From b6a63a989a4d8e05f07f14034282184f378cb8d3 Mon Sep 17 00:00:00 2001 From: Leechael Yim Date: Wed, 18 Mar 2026 22:00:00 +0800 Subject: [PATCH 01/12] refactor: replace custom HTTP client with Go SDK Replace the Terraform provider's custom HTTP client layer (client.go, client_typed.go) and oapi-codegen generated client (internal/phalaapi/) with the Phala Cloud Go SDK. This eliminates ~37k lines of duplicated API client code and ensures both projects evolve together. Key changes: - All API calls now use phala.Client methods (ProvisionCVM, GetCVMInfo, PatchCVM, DeleteCVM, etc.) instead of raw PostJSON/GetJSON/PatchJSON - cvmAPIResponse replaced with phala.CVMInfo from SDK - authMeResponse replaced with phala.CurrentUser from SDK - Data sources use typed SDK responses (AvailableNodes, CVMAttestation) - Removed oapi-codegen dependency and OpenAPI specs - Bumped Go version to 1.25.0 - Added local replace directive for Go SDK (dev only) --- go.mod | 10 +- go.sum | 13 +- internal/phalaapi/client.gen.go | 21111 ----------------- internal/phalaapi/doc.go | 4 - internal/provider/auth_me.go | 64 - internal/provider/client.go | 338 - internal/provider/client_contract_test.go | 482 - internal/provider/client_typed.go | 425 - internal/provider/cvm_helpers.go | 261 +- internal/provider/data_source_account.go | 17 +- internal/provider/data_source_attestation.go | 72 +- internal/provider/data_source_images.go | 61 +- internal/provider/data_source_nodes.go | 66 +- internal/provider/data_source_regions.go | 55 +- internal/provider/data_source_sizes.go | 26 +- internal/provider/data_source_workspace.go | 11 +- internal/provider/provider.go | 24 +- internal/provider/resource_app.go | 416 +- internal/provider/resource_app_test.go | 57 +- internal/provider/resource_cvm_power.go | 23 +- internal/provider/resource_shared.go | 107 +- internal/provider/resource_shared_test.go | 48 +- internal/provider/resource_ssh_key.go | 53 +- internal/provider/test_helpers_test.go | 17 + openapi/generate-client.sh | 20 - openapi/normalize-openapi.jq | 60 - openapi/oapi-codegen.yaml | 8 - openapi/phala-cloud-openapi.json | 1 - openapi/phala-cloud-openapi.normalized.json | 14314 ----------- 29 files changed, 744 insertions(+), 37420 deletions(-) delete mode 100644 internal/phalaapi/client.gen.go delete mode 100644 internal/phalaapi/doc.go delete mode 100644 internal/provider/auth_me.go delete mode 100644 internal/provider/client.go delete mode 100644 internal/provider/client_contract_test.go delete mode 100644 internal/provider/client_typed.go create mode 100644 internal/provider/test_helpers_test.go delete mode 100755 openapi/generate-client.sh delete mode 100644 openapi/normalize-openapi.jq delete mode 100644 openapi/oapi-codegen.yaml delete mode 100644 openapi/phala-cloud-openapi.json delete mode 100644 openapi/phala-cloud-openapi.normalized.json diff --git a/go.mod b/go.mod index fcf5908..4c86601 100644 --- a/go.mod +++ b/go.mod @@ -1,17 +1,17 @@ module github.com/Phala-Network/terraform-provider-phala -go 1.24.0 +go 1.25.0 require ( + github.com/Phala-Network/phala-cloud/sdks/go v0.0.0-00010101000000-000000000000 github.com/hashicorp/terraform-plugin-framework v1.16.1 - github.com/oapi-codegen/runtime v1.2.0 ) +replace github.com/Phala-Network/phala-cloud/sdks/go => ../go + require ( - github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect github.com/fatih/color v1.15.0 // indirect github.com/golang/protobuf v1.5.4 // indirect - github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/go-plugin v1.7.0 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect @@ -27,7 +27,7 @@ require ( github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect golang.org/x/net v0.43.0 // indirect - golang.org/x/sys v0.35.0 // indirect + golang.org/x/sys v0.42.0 // indirect golang.org/x/text v0.28.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 // indirect google.golang.org/grpc v1.75.1 // indirect diff --git a/go.sum b/go.sum index b292d9d..6311a91 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,3 @@ -github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= -github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= -github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= -github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/FBatYVw= github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -41,7 +37,6 @@ github.com/hashicorp/yamux v0.1.2 h1:XtB8kyFOyHXYVFnwT5C3+Bdo8gArse7j2AQ0DA0Uey8 github.com/hashicorp/yamux v0.1.2/go.mod h1:C+zze2n6e/7wshOZep2A70/aQU6QBRWJO/G6FT1wIns= github.com/jhump/protoreflect v1.17.0 h1:qOEr613fac2lOuTgWN4tPAtLL7fUSbuJL5X5XumQh94= github.com/jhump/protoreflect v1.17.0/go.mod h1:h9+vUUL38jiBzck8ck+6G/aeMX8Z4QUY/NiJPwPNi+8= -github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -53,16 +48,12 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= -github.com/oapi-codegen/runtime v1.2.0 h1:RvKc1CVS1QeKSNzO97FBQbSMZyQ8s6rZd+LpmzwHMP4= -github.com/oapi-codegen/runtime v1.2.0/go.mod h1:Y7ZhmmlE8ikZOmuHRRndiIm7nf3xcVv+YMweKgG1DT0= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -91,8 +82,8 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= -golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= +golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= diff --git a/internal/phalaapi/client.gen.go b/internal/phalaapi/client.gen.go deleted file mode 100644 index 04b4c47..0000000 --- a/internal/phalaapi/client.gen.go +++ /dev/null @@ -1,21111 +0,0 @@ -// Package phalaapi provides primitives to interact with the openapi HTTP API. -// -// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT. -package phalaapi - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - "net/http" - "net/url" - "strings" - "time" - - "github.com/oapi-codegen/runtime" - openapi_types "github.com/oapi-codegen/runtime/types" -) - -const ( - APIKeyHeaderScopes = "APIKeyHeader.Scopes" - OAuth2AuthorizationCodeBearerScopes = "OAuth2AuthorizationCodeBearer.Scopes" -) - -// Defines values for AttestationKeyType. -const ( - N2 AttestationKeyType = 2 - N3 AttestationKeyType = 3 -) - -// Defines values for BillingPeriod. -const ( - Hourly BillingPeriod = "hourly" - Monthly BillingPeriod = "monthly" - Skip BillingPeriod = "skip" -) - -// Defines values for BodyHandleRestartCvmApiV1CvmsCvmIdRestartPostPolling. -const ( - BodyHandleRestartCvmApiV1CvmsCvmIdRestartPostPollingV1 BodyHandleRestartCvmApiV1CvmsCvmIdRestartPostPolling = "v1" - BodyHandleRestartCvmApiV1CvmsCvmIdRestartPostPollingV2 BodyHandleRestartCvmApiV1CvmsCvmIdRestartPostPolling = "v2" -) - -// Defines values for BodyHandleShutdownCvmApiV1CvmsCvmIdShutdownPostPolling. -const ( - BodyHandleShutdownCvmApiV1CvmsCvmIdShutdownPostPollingV1 BodyHandleShutdownCvmApiV1CvmsCvmIdShutdownPostPolling = "v1" - BodyHandleShutdownCvmApiV1CvmsCvmIdShutdownPostPollingV2 BodyHandleShutdownCvmApiV1CvmsCvmIdShutdownPostPolling = "v2" -) - -// Defines values for BodyHandleStartCvmApiV1CvmsCvmIdStartPostPolling. -const ( - BodyHandleStartCvmApiV1CvmsCvmIdStartPostPollingV1 BodyHandleStartCvmApiV1CvmsCvmIdStartPostPolling = "v1" - BodyHandleStartCvmApiV1CvmsCvmIdStartPostPollingV2 BodyHandleStartCvmApiV1CvmsCvmIdStartPostPolling = "v2" -) - -// Defines values for BodyHandleStopCvmApiV1CvmsCvmIdStopPostPolling. -const ( - BodyHandleStopCvmApiV1CvmsCvmIdStopPostPollingV1 BodyHandleStopCvmApiV1CvmsCvmIdStopPostPolling = "v1" - BodyHandleStopCvmApiV1CvmsCvmIdStopPostPollingV2 BodyHandleStopCvmApiV1CvmsCvmIdStopPostPolling = "v2" -) - -// Defines values for BodyHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchPolling. -const ( - BodyHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchPollingV1 BodyHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchPolling = "v1" - BodyHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchPollingV2 BodyHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchPolling = "v2" -) - -// Defines values for GpuConfigAttachMode0. -const ( - All GpuConfigAttachMode0 = "all" - Listed GpuConfigAttachMode0 = "listed" -) - -// Defines values for InstanceIdRefreshResultSource. -const ( - Gateway InstanceIdRefreshResultSource = "gateway" - None InstanceIdRefreshResultSource = "none" - TeepodInfo InstanceIdRefreshResultSource = "teepod_info" - TeepodState InstanceIdRefreshResultSource = "teepod_state" -) - -// Defines values for InstanceIdRefreshResultStatus. -const ( - Conflict InstanceIdRefreshResultStatus = "conflict" - Error InstanceIdRefreshResultStatus = "error" - Skipped InstanceIdRefreshResultStatus = "skipped" - Unchanged InstanceIdRefreshResultStatus = "unchanged" - Updated InstanceIdRefreshResultStatus = "updated" -) - -// Defines values for KmsType. -const ( - Base KmsType = "base" - Ethereum KmsType = "ethereum" - Legacy KmsType = "legacy" - Phala KmsType = "phala" -) - -// Defines values for SessionResponseDeviceKind. -const ( - Desktop SessionResponseDeviceKind = "Desktop" - Mobile SessionResponseDeviceKind = "Mobile" - Unknown SessionResponseDeviceKind = "Unknown" -) - -// Defines values for TeamTier. -const ( - ENTERPRISE TeamTier = "ENTERPRISE" - LEVEL1 TeamTier = "LEVEL_1" - LEVEL2 TeamTier = "LEVEL_2" - PRO TeamTier = "PRO" -) - -// Defines values for TeeType. -const ( - N0 TeeType = 0 - N129 TeeType = 129 -) - -// Defines values for TeepodStatus. -const ( - MAINTENANCE TeepodStatus = "MAINTENANCE" - OFFLINE TeepodStatus = "OFFLINE" - ONLINE TeepodStatus = "ONLINE" -) - -// Defines values for HandleRemoveCvmApiV1CvmsCvmIdDeleteParamsPolling. -const ( - HandleRemoveCvmApiV1CvmsCvmIdDeleteParamsPollingV1 HandleRemoveCvmApiV1CvmsCvmIdDeleteParamsPolling = "v1" - HandleRemoveCvmApiV1CvmsCvmIdDeleteParamsPollingV2 HandleRemoveCvmApiV1CvmsCvmIdDeleteParamsPolling = "v2" -) - -// Defines values for HandleResizeCvmApiV1CvmsCvmIdResourcesPatchParamsPolling. -const ( - V1 HandleResizeCvmApiV1CvmsCvmIdResourcesPatchParamsPolling = "v1" - V2 HandleResizeCvmApiV1CvmsCvmIdResourcesPatchParamsPolling = "v2" -) - -// AcmeFetchResult Result of an ACME account fetch attempt. -type AcmeFetchResult struct { - // Error Error message if request failed - Error *string `json:"error"` - - // HttpOk True if HTTP 200 response received - HttpOk bool `json:"http_ok"` - - // StatusCode HTTP status code returned - StatusCode *int `json:"status_code"` - - // Uri Account URI from response body - Uri *string `json:"uri"` - - // Url ACME endpoint URL queried - Url string `json:"url"` -} - -// AppComposeV2 defines model for AppComposeV2. -type AppComposeV2 struct { - AllowedEnvs *[]string `json:"allowed_envs,omitempty"` - BashScript *string `json:"bash_script"` - DefaultGatewayDomain *string `json:"default_gateway_domain"` - DockerComposeFile *string `json:"docker_compose_file"` - Features *[]string `json:"features,omitempty"` - GatewayEnabled *bool `json:"gateway_enabled,omitempty"` - InitScript *string `json:"init_script"` - KmsEnabled *bool `json:"kms_enabled,omitempty"` - LocalKeyProviderEnabled *bool `json:"local_key_provider_enabled,omitempty"` - ManifestVersion *int `json:"manifest_version,omitempty"` - Name string `json:"name"` - NoInstanceId *bool `json:"no_instance_id,omitempty"` - PreLaunchScript *string `json:"pre_launch_script"` - PublicLogs *bool `json:"public_logs,omitempty"` - PublicSysinfo *bool `json:"public_sysinfo,omitempty"` - PublicTcbinfo *bool `json:"public_tcbinfo,omitempty"` - Runner *string `json:"runner,omitempty"` - Salt *string `json:"salt"` - SecureTime *bool `json:"secure_time,omitempty"` - StorageFs *AppComposeV2_StorageFs `json:"storage_fs"` - TproxyEnabled *bool `json:"tproxy_enabled,omitempty"` -} - -// AppComposeV2StorageFs0 defines model for . -type AppComposeV2StorageFs0 = string - -// AppComposeV2StorageFs1 defines model for . -type AppComposeV2StorageFs1 = string - -// AppComposeV2_StorageFs defines model for AppComposeV2.StorageFs. -type AppComposeV2_StorageFs struct { - union json.RawMessage -} - -// AppEventsResponse Instance event list response. -type AppEventsResponse struct { - // Events Event records - Events []InstanceEventResponse `json:"events"` - - // Total Number of events returned - Total int `json:"total"` -} - -// AppRevisionDetailResponse Full revision detail with configuration data. -type AppRevisionDetailResponse struct { - // AppId Hex app identifier - AppId string `json:"app_id"` - - // ComposeFile Docker compose content (dict or raw string) - ComposeFile *AppRevisionDetailResponse_ComposeFile `json:"compose_file"` - - // ComposeHash SHA-256 hash of compose file - ComposeHash string `json:"compose_hash"` - - // CreatedAt Revision timestamp (ISO 8601) - CreatedAt string `json:"created_at"` - - // Cvm Minimal CVM reference for embedding in responses. - Cvm *CvmRef `json:"cvm,omitempty"` - - // EncryptedEnv Hex-encoded encrypted environment variables - EncryptedEnv string `json:"encrypted_env"` - - // OperationType Operation: deploy, update, restart, etc. - OperationType string `json:"operation_type"` - - // RevisionId Revision record identifier (hashid of snowflake_id) - RevisionId string `json:"revision_id"` - - // TraceId Request trace ID for debugging - TraceId *string `json:"trace_id"` - - // TriggeredBy Minimal user reference for embedding in responses. - TriggeredBy *UserRef `json:"triggered_by,omitempty"` - - // UserConfig JSON user configuration string - UserConfig string `json:"user_config"` - - // VmUuid CVM UUID - VmUuid string `json:"vm_uuid"` - - // Workspace Minimal workspace reference for embedding in responses. - Workspace *WorkspaceRef `json:"workspace,omitempty"` -} - -// AppRevisionDetailResponseComposeFile0 defines model for . -type AppRevisionDetailResponseComposeFile0 map[string]interface{} - -// AppRevisionDetailResponseComposeFile1 defines model for . -type AppRevisionDetailResponseComposeFile1 = string - -// AppRevisionDetailResponse_ComposeFile Docker compose content (dict or raw string) -type AppRevisionDetailResponse_ComposeFile struct { - union json.RawMessage -} - -// AppRevisionResponse App deployment revision summary. -type AppRevisionResponse struct { - // AppId Hex app identifier - AppId string `json:"app_id"` - - // ComposeHash SHA-256 hash of compose file - ComposeHash string `json:"compose_hash"` - - // CreatedAt Revision timestamp (ISO 8601) - CreatedAt string `json:"created_at"` - - // Cvm Minimal CVM reference for embedding in responses. - Cvm *CvmRef `json:"cvm,omitempty"` - - // OperationType Operation: deploy, update, restart, etc. - OperationType string `json:"operation_type"` - - // RevisionId Revision record identifier (hashid of snowflake_id) - RevisionId string `json:"revision_id"` - - // TraceId Request trace ID for debugging - TraceId *string `json:"trace_id"` - - // TriggeredBy Minimal user reference for embedding in responses. - TriggeredBy *UserRef `json:"triggered_by,omitempty"` - - // VmUuid CVM UUID - VmUuid string `json:"vm_uuid"` - - // Workspace Minimal workspace reference for embedding in responses. - Workspace *WorkspaceRef `json:"workspace,omitempty"` -} - -// AppRevisionsResponse Paginated revision list. -type AppRevisionsResponse struct { - // Page Current page number - Page int `json:"page"` - - // PageSize Items per page - PageSize int `json:"page_size"` - - // Revisions Revision records - Revisions []AppRevisionResponse `json:"revisions"` - - // Total Total revision count - Total int `json:"total"` - - // TotalPages Total page count - TotalPages int `json:"total_pages"` -} - -// AppUsageResponse App usage response with cost summary. -type AppUsageResponse struct { - // Total Number of records returned - Total int `json:"total"` - - // TotalCost Sum of costs in USD - TotalCost float32 `json:"total_cost"` - - // Usage Usage records - Usage []MeteredUsageResponse `json:"usage"` -} - -// AttestationKeyType Attestation key type (subset used in SGX/TDX DCAP quotes). -type AttestationKeyType int - -// BatchInstanceIdRefreshRequest defines model for BatchInstanceIdRefreshRequest. -type BatchInstanceIdRefreshRequest struct { - // CvmIds Optional CVM identifiers. Admin can pass cross-workspace IDs. - CvmIds *[]string `json:"cvm_ids"` - - // DryRun Preview changes without persisting - DryRun *bool `json:"dry_run,omitempty"` - - // Limit Max CVMs to process in one request - Limit *int `json:"limit,omitempty"` - - // MissingOnly Only process CVMs with missing instance_id - MissingOnly *bool `json:"missing_only,omitempty"` - - // Overwrite Overwrite existing instance_id when different - Overwrite *bool `json:"overwrite,omitempty"` - - // RunningOnly Only process CVMs with status=running - RunningOnly *bool `json:"running_only,omitempty"` -} - -// BatchInstanceIdRefreshResponse defines model for BatchInstanceIdRefreshResponse. -type BatchInstanceIdRefreshResponse struct { - Conflicts int `json:"conflicts"` - Errors int `json:"errors"` - Items []InstanceIdRefreshResult `json:"items"` - Scanned int `json:"scanned"` - Skipped int `json:"skipped"` - Total int `json:"total"` - Unchanged int `json:"unchanged"` - Updated int `json:"updated"` -} - -// BatchStatusRequest defines model for BatchStatusRequest. -type BatchStatusRequest struct { - VmUuids []string `json:"vm_uuids"` -} - -// BatchStopErrorEntry Error detail for a single CVM in batch stop. -type BatchStopErrorEntry struct { - // CvmId Hashed CVM ID - CvmId string `json:"cvm_id"` - - // Error Error message - Error string `json:"error"` -} - -// BatchStopRequest Request to batch stop multiple CVMs. -type BatchStopRequest struct { - // CvmIds List of CVM hash IDs to stop - CvmIds []string `json:"cvm_ids"` -} - -// BatchStopResponse Summary of batch stop operation. -type BatchStopResponse struct { - // Errors CVMs that failed to stop - Errors *[]BatchStopErrorEntry `json:"errors,omitempty"` - - // Skipped CVMs skipped (in_progress, no vm_uuid, GPU rental managed) - Skipped int `json:"skipped"` - - // Stopped CVMs successfully scheduled for stop - Stopped int `json:"stopped"` - - // Total Total CVMs requested - Total int `json:"total"` -} - -// BillingPeriod defines model for BillingPeriod. -type BillingPeriod string - -// BodyApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPost defines model for Body_api_verify_email_token_api_v1_auth_verify_email_token_post. -type BodyApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPost struct { - Request EmailTokenVerificationRequest `json:"request"` - SiteKey *string `json:"site_key,omitempty"` -} - -// BodyHandleRestartCvmApiV1CvmsCvmIdRestartPost defines model for Body_handle_restart_cvm_api_v1_cvms__cvm_id__restart_post. -type BodyHandleRestartCvmApiV1CvmsCvmIdRestartPost struct { - // Force Skip graceful shutdown - Force *bool `json:"force,omitempty"` - - // Polling Polling version for task routing - Polling *BodyHandleRestartCvmApiV1CvmsCvmIdRestartPostPolling `json:"polling"` -} - -// BodyHandleRestartCvmApiV1CvmsCvmIdRestartPostPolling Polling version for task routing -type BodyHandleRestartCvmApiV1CvmsCvmIdRestartPostPolling string - -// BodyHandleShutdownCvmApiV1CvmsCvmIdShutdownPost defines model for Body_handle_shutdown_cvm_api_v1_cvms__cvm_id__shutdown_post. -type BodyHandleShutdownCvmApiV1CvmsCvmIdShutdownPost struct { - // Polling Polling version for task routing - Polling *BodyHandleShutdownCvmApiV1CvmsCvmIdShutdownPostPolling `json:"polling"` -} - -// BodyHandleShutdownCvmApiV1CvmsCvmIdShutdownPostPolling Polling version for task routing -type BodyHandleShutdownCvmApiV1CvmsCvmIdShutdownPostPolling string - -// BodyHandleStartCvmApiV1CvmsCvmIdStartPost defines model for Body_handle_start_cvm_api_v1_cvms__cvm_id__start_post. -type BodyHandleStartCvmApiV1CvmsCvmIdStartPost struct { - // Polling Polling version for task routing - Polling *BodyHandleStartCvmApiV1CvmsCvmIdStartPostPolling `json:"polling"` -} - -// BodyHandleStartCvmApiV1CvmsCvmIdStartPostPolling Polling version for task routing -type BodyHandleStartCvmApiV1CvmsCvmIdStartPostPolling string - -// BodyHandleStopCvmApiV1CvmsCvmIdStopPost defines model for Body_handle_stop_cvm_api_v1_cvms__cvm_id__stop_post. -type BodyHandleStopCvmApiV1CvmsCvmIdStopPost struct { - // Polling Polling version for task routing - Polling *BodyHandleStopCvmApiV1CvmsCvmIdStopPostPolling `json:"polling"` -} - -// BodyHandleStopCvmApiV1CvmsCvmIdStopPostPolling Polling version for task routing -type BodyHandleStopCvmApiV1CvmsCvmIdStopPostPolling string - -// BodyHandleUpdateCvmListedApiV1CvmsCvmIdListedPatch defines model for Body_handle_update_cvm_listed_api_v1_cvms__cvm_id__listed_patch. -type BodyHandleUpdateCvmListedApiV1CvmsCvmIdListedPatch struct { - Listed bool `json:"listed"` -} - -// BodyHandleUpdateCvmNameApiV1CvmsCvmIdNamePatch defines model for Body_handle_update_cvm_name_api_v1_cvms__cvm_id__name_patch. -type BodyHandleUpdateCvmNameApiV1CvmsCvmIdNamePatch struct { - Name string `json:"name"` -} - -// BodyHandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatch defines model for Body_handle_update_cvm_scheduled_delete_api_v1_cvms__cvm_id__scheduled_delete_patch. -type BodyHandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatch struct { - ScheduledDeleteAt *time.Time `json:"scheduled_delete_at"` -} - -// BodyHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatch defines model for Body_handle_update_cvm_visibility_api_v1_cvms__cvm_id__visibility_patch. -type BodyHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatch struct { - // Polling Polling version for task routing - Polling *BodyHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchPolling `json:"polling"` - - // PublicLogs Expose container logs publicly - PublicLogs bool `json:"public_logs"` - - // PublicSysinfo Expose system info publicly - PublicSysinfo bool `json:"public_sysinfo"` - - // PublicTcbinfo Expose TCB attestation info publicly - PublicTcbinfo *bool `json:"public_tcbinfo"` -} - -// BodyHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchPolling Polling version for task routing -type BodyHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchPolling string - -// BodyHandleUploadAndVerifyApiV1AttestationsVerifyPost defines model for Body_handle_upload_and_verify_api_v1_attestations_verify_post. -type BodyHandleUploadAndVerifyApiV1AttestationsVerifyPost struct { - File *openapi_types.File `json:"file"` - Hex *string `json:"hex"` -} - -// BodyLoginForAccessTokenApiV1AuthTokenPost defines model for Body_login_for_access_token_api_v1_auth_token_post. -type BodyLoginForAccessTokenApiV1AuthTokenPost struct { - ClientId *string `json:"client_id"` - ClientSecret *string `json:"client_secret"` - GrantType *string `json:"grant_type"` - Password string `json:"password"` - Scope *string `json:"scope,omitempty"` - Username string `json:"username"` -} - -// BodyLoginWithCookieApiV1AuthLoginPost defines model for Body_login_with_cookie_api_v1_auth_login_post. -type BodyLoginWithCookieApiV1AuthLoginPost struct { - ClientId *string `json:"client_id"` - ClientSecret *string `json:"client_secret"` - GrantType *string `json:"grant_type"` - Password string `json:"password"` - Scope *string `json:"scope,omitempty"` - Username string `json:"username"` -} - -// BodyTriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatch defines model for Body_trigger_cvm_compose_file_update_api_v1_cvms__cvm_id__compose_file_patch. -type BodyTriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatch struct { - // ComposeHash Hash from provision response - ComposeHash string `json:"compose_hash"` - - // EncryptedEnv New encrypted env blob (hex) - EncryptedEnv *string `json:"encrypted_env"` - - // EnvKeys Allowed env var names - EnvKeys *[]string `json:"env_keys"` - - // UpdateEnvVars Update allowed_envs list - UpdateEnvVars *bool `json:"update_env_vars"` -} - -// BodyUpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatch defines model for Body_update_cvm_docker_compose_api_v1_cvms__cvm_id__docker_compose_patch. -type BodyUpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatch struct { - // File Docker Compose YAML file to upload - File *openapi_types.File `json:"file"` -} - -// BodyUpdateCvmEnvsApiV1CvmsCvmIdEnvsPatch defines model for Body_update_cvm_envs_api_v1_cvms__cvm_id__envs_patch. -type BodyUpdateCvmEnvsApiV1CvmsCvmIdEnvsPatch struct { - // ComposeHash Hash from Phase 1 response (Phase 2 only) - ComposeHash *string `json:"compose_hash"` - - // EncryptedEnv Encrypted env blob as hex string - EncryptedEnv string `json:"encrypted_env"` - - // EnvKeys Allowed env var names. Changes trigger verification for contract-owned KMS. - EnvKeys *[]string `json:"env_keys"` - - // TransactionHash Transaction hash proving on-chain registration (Phase 2 only) - TransactionHash *string `json:"transaction_hash"` -} - -// BodyUpdateCvmOsImageApiV1CvmsCvmIdOsImagePatch defines model for Body_update_cvm_os_image_api_v1_cvms__cvm_id__os_image_patch. -type BodyUpdateCvmOsImageApiV1CvmsCvmIdOsImagePatch struct { - // OsImageName Image name or slug from available-os-images - OsImageName string `json:"os_image_name"` -} - -// BodyUpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatch defines model for Body_update_cvm_pre_launch_script_api_v1_cvms__cvm_id__pre_launch_script_patch. -type BodyUpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatch struct { - // File Shell script file to upload - File *openapi_types.File `json:"file"` -} - -// CVMGatewayInfo defines model for CVMGatewayInfo. -type CVMGatewayInfo struct { - BaseDomain *string `json:"base_domain"` - Cname *string `json:"cname"` -} - -// CVMInfo defines model for CVMInfo. -type CVMInfo struct { - AppId *string `json:"app_id"` - ComposeHash *string `json:"compose_hash"` - CreatedAt *time.Time `json:"created_at"` - - // Creator Minimal user reference for embedding in responses. - Creator *UserRef `json:"creator,omitempty"` - DeletedAt *time.Time `json:"deleted_at"` - DockerComposeHash *string `json:"docker_compose_hash"` - Endpoints *[]CvmNetworkUrls `json:"endpoints"` - Gateway CVMGatewayInfo `json:"gateway"` - GatewayEnabled *bool `json:"gateway_enabled,omitempty"` - - // Id A hashed identifier that maps to an internal database ID - Id string `json:"id"` - InstanceId *string `json:"instance_id"` - KmsInfo *CVMKmsInfo `json:"kms_info,omitempty"` - KmsType *KmsType `json:"kms_type,omitempty"` - Listed *bool `json:"listed,omitempty"` - Name string `json:"name"` - - // NodeInfo Minimal node/teepod reference for embedding in responses. - NodeInfo *NodeRef `json:"node_info,omitempty"` - Os *CVMOSInfo `json:"os,omitempty"` - PreLaunchScriptHash *string `json:"pre_launch_script_hash"` - Progress *CVMProgressInfo `json:"progress,omitempty"` - ProjectType *string `json:"project_type"` - PublicLogs *bool `json:"public_logs,omitempty"` - PublicSysinfo *bool `json:"public_sysinfo,omitempty"` - PublicTcbinfo *bool `json:"public_tcbinfo,omitempty"` - Resource CVMResourceInfo `json:"resource"` - SecureTime *bool `json:"secure_time,omitempty"` - Services *[]map[string]interface{} `json:"services,omitempty"` - Status string `json:"status"` - StorageFs *string `json:"storage_fs,omitempty"` - VmUuid *string `json:"vm_uuid"` - - // Workspace Minimal workspace reference for embedding in responses. - Workspace *WorkspaceRef `json:"workspace,omitempty"` -} - -// CVMInfoDetail defines model for CVMInfoDetail. -type CVMInfoDetail struct { - AppId *string `json:"app_id"` - ComposeFile *CVMInfoDetail_ComposeFile `json:"compose_file"` - ComposeHash *string `json:"compose_hash"` - CreatedAt *time.Time `json:"created_at"` - - // Creator Minimal user reference for embedding in responses. - Creator *UserRef `json:"creator,omitempty"` - DeletedAt *time.Time `json:"deleted_at"` - DockerComposeHash *string `json:"docker_compose_hash"` - Endpoints *[]CvmNetworkUrls `json:"endpoints"` - Gateway CVMGatewayInfo `json:"gateway"` - GatewayEnabled *bool `json:"gateway_enabled,omitempty"` - - // Id A hashed identifier that maps to an internal database ID - Id string `json:"id"` - InstanceId *string `json:"instance_id"` - KmsInfo *CVMKmsInfo `json:"kms_info,omitempty"` - KmsType *KmsType `json:"kms_type,omitempty"` - Listed *bool `json:"listed,omitempty"` - Name string `json:"name"` - - // NodeInfo Minimal node/teepod reference for embedding in responses. - NodeInfo *NodeRef `json:"node_info,omitempty"` - Os *CVMOSInfo `json:"os,omitempty"` - PreLaunchScriptHash *string `json:"pre_launch_script_hash"` - Progress *CVMProgressInfo `json:"progress,omitempty"` - ProjectType *string `json:"project_type"` - PublicLogs *bool `json:"public_logs,omitempty"` - PublicSysinfo *bool `json:"public_sysinfo,omitempty"` - PublicTcbinfo *bool `json:"public_tcbinfo,omitempty"` - Resource CVMResourceInfo `json:"resource"` - SecureTime *bool `json:"secure_time,omitempty"` - Services *[]map[string]interface{} `json:"services,omitempty"` - Status string `json:"status"` - StorageFs *string `json:"storage_fs,omitempty"` - VmUuid *string `json:"vm_uuid"` - - // Workspace Minimal workspace reference for embedding in responses. - Workspace *WorkspaceRef `json:"workspace,omitempty"` -} - -// CVMInfoDetailComposeFile0 defines model for . -type CVMInfoDetailComposeFile0 map[string]interface{} - -// CVMInfoDetailComposeFile1 defines model for . -type CVMInfoDetailComposeFile1 = string - -// CVMInfoDetail_ComposeFile defines model for CVMInfoDetail.ComposeFile. -type CVMInfoDetail_ComposeFile struct { - union json.RawMessage -} - -// CVMKmsInfo defines model for CVMKmsInfo. -type CVMKmsInfo struct { - ChainId *int `json:"chain_id"` - DeployerAddress *string `json:"deployer_address"` - DstackAppAddress *string `json:"dstack_app_address"` - DstackKmsAddress *string `json:"dstack_kms_address"` - EncryptedEnvPubkey *string `json:"encrypted_env_pubkey"` - RpcEndpoint *string `json:"rpc_endpoint"` -} - -// CVMOSInfo defines model for CVMOSInfo. -type CVMOSInfo struct { - IsDev *bool `json:"is_dev"` - Name *string `json:"name"` - OsImageHash *string `json:"os_image_hash"` - Version *string `json:"version"` -} - -// CVMProgressInfo defines model for CVMProgressInfo. -type CVMProgressInfo struct { - CorrelationId *string `json:"correlation_id"` - StartedAt *time.Time `json:"started_at"` - Target *string `json:"target"` -} - -// CVMResourceInfo defines model for CVMResourceInfo. -type CVMResourceInfo struct { - BillingPeriod *BillingPeriod `json:"billing_period,omitempty"` - - // ComputeBillingPrice A monetary value with precise decimal arithmetic - ComputeBillingPrice *string `json:"compute_billing_price"` - DiskInGb *int `json:"disk_in_gb"` - Gpus *int `json:"gpus"` - InstanceType *string `json:"instance_type"` - MemoryInGb *float32 `json:"memory_in_gb"` - Vcpu *int `json:"vcpu"` -} - -// CaaCheckResult CAA record check result (informational, not required for validation). -type CaaCheckResult struct { - // Accounturi Account URI extracted from CAA record - Accounturi *string `json:"accounturi"` - - // AcmeFetches ACME endpoint query attempts - AcmeFetches []AcmeFetchResult `json:"acme_fetches"` - - // CaaRecords Raw CAA DNS records found - CaaRecords []string `json:"caa_records"` - - // ExpectedUri Expected URI from ACME account - ExpectedUri *string `json:"expected_uri"` - - // InfoMessage Additional context or guidance - InfoMessage *string `json:"info_message"` - - // IsMatch True if CAA accounturi matches ACME account - IsMatch bool `json:"is_match"` -} - -// Certificate defines model for Certificate. -type Certificate struct { - AppId *string `json:"app_id"` - CertUsage *string `json:"cert_usage"` - Fingerprint string `json:"fingerprint"` - IsCa *bool `json:"is_ca,omitempty"` - Issuer CertificateIssuer `json:"issuer"` - NotAfter time.Time `json:"not_after"` - NotBefore time.Time `json:"not_before"` - PositionInChain *int `json:"position_in_chain"` - Quote *string `json:"quote"` - Sans *[]string `json:"sans"` - SerialNumber string `json:"serial_number"` - SignatureAlgorithm string `json:"signature_algorithm"` - Subject CertificateSubject `json:"subject"` - Version string `json:"version"` -} - -// CertificateIssuer defines model for CertificateIssuer. -type CertificateIssuer struct { - // CommonName Issuer common name - CommonName *string `json:"common_name"` - - // Country Issuer country code - Country *string `json:"country"` - - // Organization Issuer organization - Organization *string `json:"organization"` -} - -// CertificateSubject defines model for CertificateSubject. -type CertificateSubject struct { - // CommonName Certificate subject common name - CommonName *string `json:"common_name"` - - // Country Country code - Country *string `json:"country"` - - // Locality Locality name - Locality *string `json:"locality"` - - // Organization Organization name - Organization *string `json:"organization"` - - // State State or province - State *string `json:"state"` -} - -// ChangeEmailPayload Request payload for changing email address -type ChangeEmailPayload struct { - CurrentPassword *string `json:"current_password"` - Email openapi_types.Email `json:"email"` - SiteKey *string `json:"site_key"` - TotpCode *string `json:"totp_code"` -} - -// ComposeFilePatchRequest API request model for partially updating CVM compose files - matches CvmUpgradePayload structure -type ComposeFilePatchRequest struct { - // ComposeManifest Partial update for compose_manifest fields - ComposeManifest *ComposeManifestPatchRequest `json:"compose_manifest,omitempty"` - EncryptedEnv *string `json:"encrypted_env"` - EnvKeys *[]string `json:"env_keys"` -} - -// ComposeFileProvisionResponse API response model for compose file provision -type ComposeFileProvisionResponse struct { - AppId string `json:"app_id"` - ComposeHash string `json:"compose_hash"` - DeviceId *string `json:"device_id"` - - // KmsInfo KMS instance information. - KmsInfo *KMSInfo `json:"kms_info,omitempty"` -} - -// ComposeFileUpdateRequest API request model for updating CVM compose files -type ComposeFileUpdateRequest struct { - ComposeFile AppComposeV2 `json:"compose_file"` - ComposeHash string `json:"compose_hash"` - EncryptedEnv *string `json:"encrypted_env"` - EnvKeys *[]string `json:"env_keys"` -} - -// ComposeManifest @see https://github.com/Dstack-TEE/dstack/blob/master/tdxctl/src/utils.rs#L77 -// @see https://github.com/Dstack-TEE/dstack/blob/master/basefiles/app-compose.sh -type ComposeManifest struct { - BashScript *string `json:"bash_script"` - DefaultGatewayDomain *string `json:"default_gateway_domain"` - DockerComposeFile *string `json:"docker_compose_file"` - DockerConfig *DockerConfig `json:"docker_config,omitempty"` - Features *[]string `json:"features,omitempty"` - KmsEnabled *bool `json:"kms_enabled,omitempty"` - ManifestVersion *int `json:"manifest_version,omitempty"` - Name string `json:"name"` - PreLaunchScript *string `json:"pre_launch_script"` - PublicLogs *bool `json:"public_logs,omitempty"` - PublicSysinfo *bool `json:"public_sysinfo,omitempty"` - Runner *string `json:"runner,omitempty"` - Salt *string `json:"salt"` - TproxyEnabled *bool `json:"tproxy_enabled,omitempty"` - Version *string `json:"version,omitempty"` -} - -// ComposeManifestPatchRequest Partial update for compose_manifest fields -type ComposeManifestPatchRequest struct { - DockerComposeFile *string `json:"docker_compose_file"` - PreLaunchScript *string `json:"pre_launch_script"` -} - -// CreateTappRequest defines model for CreateTappRequest. -type CreateTappRequest struct { - // AppId The calculated app ID from compose file. - AppId string `json:"app_id"` - - // ComposeHash The compose hash of the app compose file. - ComposeHash string `json:"compose_hash"` - - // ContractAddress The contract address. - ContractAddress *string `json:"contract_address"` - - // DeployerAddress The deployer address. - DeployerAddress *string `json:"deployer_address"` - - // EncryptedEnv The encrypted environment variables. - EncryptedEnv *string `json:"encrypted_env"` - - // EnvKeys The environment variables to use for the app. - EnvKeys *[]string `json:"env_keys"` - - // KmsId The KMS ID. - KmsId *string `json:"kms_id"` -} - -// CreateWorkloadTappRequest defines model for CreateWorkloadTappRequest. -type CreateWorkloadTappRequest struct { - // InstanceType The instance_type of the tapp. - InstanceType string `json:"instance_type"` - - // ModelId The model_id of the tapp. - ModelId string `json:"model_id"` - - // Name The name of the tapp. - Name string `json:"name"` - - // ScheduledDeleteAt The scheduled delete time of the tapp. - ScheduledDeleteAt *time.Time `json:"scheduled_delete_at"` -} - -// Credit defines model for Credit. -type Credit struct { - Balance float32 `json:"balance"` - GrantedBalance *float32 `json:"granted_balance"` - Id int `json:"id"` -} - -// CvmAttestation Model representing CVM attestation information -type CvmAttestation struct { - AppCertificates *[]Certificate `json:"app_certificates"` - ComposeFile *string `json:"compose_file"` - Error *string `json:"error"` - IsOnline bool `json:"is_online"` - IsPublic *bool `json:"is_public,omitempty"` - Name *string `json:"name"` - TcbInfo *TcbInfo `json:"tcb_info,omitempty"` -} - -// CvmComposeFile Model representing CVM compose file information -type CvmComposeFile struct { - // ComposeFile @see https://github.com/Dstack-TEE/dstack/blob/master/tdxctl/src/utils.rs#L77 - // @see https://github.com/Dstack-TEE/dstack/blob/master/basefiles/app-compose.sh - ComposeFile ComposeManifest `json:"compose_file"` - EnvPubkey string `json:"env_pubkey"` - Salt *string `json:"salt"` -} - -// CvmComposition Model representing CVM container list information -type CvmComposition struct { - Containers *[]ExtendedContainer `json:"containers"` - DockerComposeFile *string `json:"docker_compose_file"` - Error *string `json:"error"` - Features *[]string `json:"features"` - IsOnline bool `json:"is_online"` - IsPublic *bool `json:"is_public,omitempty"` - ManifestVersion *int `json:"manifest_version"` - Runner *string `json:"runner"` - Version *string `json:"version"` -} - -// CvmNetwork Model representing CVM network information -type CvmNetwork struct { - Error *string `json:"error"` - InternalIp *string `json:"internal_ip"` - IsOnline bool `json:"is_online"` - IsPublic *bool `json:"is_public,omitempty"` - LatestHandshake *time.Time `json:"latest_handshake"` - PublicUrls *[]CvmNetworkUrls `json:"public_urls"` -} - -// CvmNetworkUrls Model representing public URLs for a CVM port -type CvmNetworkUrls struct { - App string `json:"app"` - Instance string `json:"instance"` -} - -// CvmNode defines model for CvmNode. -type CvmNode struct { - Id int `json:"id"` - Name string `json:"name"` - RegionIdentifier *string `json:"region_identifier"` -} - -// CvmOperationResponse Aggregated operation record grouped by correlation_id. -type CvmOperationResponse struct { - // CompletedAt UTC timestamp of last event - CompletedAt *time.Time `json:"completed_at"` - - // ComposeHash Hash identifying compose configuration - ComposeHash *string `json:"compose_hash"` - - // CorrelationId Unique ID linking all events in this operation - CorrelationId string `json:"correlation_id"` - - // DurationMs Total duration from start to completion - DurationMs *int `json:"duration_ms"` - - // ErrorMessage Failure reason (sanitized for non-admins) - ErrorMessage *string `json:"error_message"` - - // Events Chronological event timeline - Events []OperationEventDetail `json:"events"` - - // InstanceName CVM name at operation time - InstanceName string `json:"instance_name"` - - // OperationType Type: compose_update, power_on, resize, etc. - OperationType string `json:"operation_type"` - - // StartedAt UTC timestamp of first event - StartedAt time.Time `json:"started_at"` - - // Status Current status: completed, in_progress, or failed - Status string `json:"status"` - - // SubOperations Ordered list of sub-operation types - SubOperations []string `json:"sub_operations"` - - // TargetState Expected CVM state after completion - TargetState string `json:"target_state"` - - // TriggeredBy User ID who initiated the operation - TriggeredBy int `json:"triggered_by"` - - // TriggeredByEmail Email if available - TriggeredByEmail *string `json:"triggered_by_email"` - - // TriggeredByUsername Username if available - TriggeredByUsername *string `json:"triggered_by_username"` -} - -// CvmRef Minimal CVM reference for embedding in responses. -type CvmRef struct { - // AppId Deterministic app identifier from manifest - AppId *string `json:"app_id"` - - // Name User-assigned CVM name - Name *string `json:"name"` - - // ObjectType Fixed value 'cvm' - ObjectType *string `json:"object_type,omitempty"` - - // VmUuid CVM instance UUID - VmUuid string `json:"vm_uuid"` -} - -// CvmResizePayload defines model for CvmResizePayload. -type CvmResizePayload struct { - AllowRestart *int `json:"allow_restart"` - DiskSize *int `json:"disk_size"` - InstanceType *string `json:"instance_type"` - Memory *int `json:"memory"` - Vcpu *int `json:"vcpu"` -} - -// CvmStatus CVM status information for API response. -// -// This schema is used for both internal status determination and API responses. -// Contains current state, progress information, and async operation tracking. -type CvmStatus struct { - BootError *string `json:"boot_error"` - BootProgress *string `json:"boot_progress"` - CorrelationId *string `json:"correlation_id"` - InProgress *bool `json:"in_progress,omitempty"` - OperationStartedAt *time.Time `json:"operation_started_at"` - OperationType *string `json:"operation_type"` - Status string `json:"status"` - Uptime *string `json:"uptime"` - VmUuid string `json:"vm_uuid"` -} - -// CvmSystemInfo defines model for CvmSystemInfo. -type CvmSystemInfo struct { - BootError *string `json:"boot_error"` - BootProgress *string `json:"boot_progress"` - Error *string `json:"error"` - InProgress *bool `json:"in_progress,omitempty"` - IsOnline bool `json:"is_online"` - IsPublic *bool `json:"is_public,omitempty"` - Status *string `json:"status"` - Sysinfo *SystemInfo `json:"sysinfo,omitempty"` -} - -// CvmUpgradePayload defines model for CvmUpgradePayload. -type CvmUpgradePayload struct { - AllowRestart *int `json:"allow_restart"` - ComposeManifest AppComposeV2 `json:"compose_manifest"` - EncryptedEnv *string `json:"encrypted_env"` - EnvKeys *[]string `json:"env_keys"` - Id *string `json:"id"` - Ports *[]PortMapping `json:"ports"` - UpdatePorts *bool `json:"update_ports,omitempty"` - UserConfig *string `json:"user_config"` -} - -// CvmUserConfig defines model for CvmUserConfig. -type CvmUserConfig struct { - // DefaultGatewayDomain Default gateway domain - DefaultGatewayDomain *string `json:"default_gateway_domain"` - - // Hostname CVM hostname - Hostname *string `json:"hostname"` - - // SshAuthorizedKeys SSH public keys injected at launch - SshAuthorizedKeys *[]string `json:"ssh_authorized_keys,omitempty"` -} - -// DeviceAuthorizeRequest Request body for user approval of a device authorization. -type DeviceAuthorizeRequest struct { - // TotpCode 2FA code if user has TOTP enabled - TotpCode *string `json:"totp_code"` - - // UserCode Verification code from CLI (e.g., XXXX-XXXX) - UserCode string `json:"user_code"` - - // WorkspaceSlug Workspace to bind the token to - WorkspaceSlug *string `json:"workspace_slug"` -} - -// DeviceCodeRequest Request body for initiating device authorization flow (RFC 8628). -type DeviceCodeRequest struct { - // ClientId OAuth client identifier - ClientId *string `json:"client_id,omitempty"` - - // Scope Space-separated list of requested permissions - Scope *string `json:"scope,omitempty"` -} - -// DeviceCodeResponse Response containing codes for device authorization flow. -type DeviceCodeResponse struct { - // DeviceCode Opaque code for CLI polling - DeviceCode string `json:"device_code"` - - // ExpiresIn Seconds until codes expire - ExpiresIn int `json:"expires_in"` - - // Interval Minimum polling interval in seconds - Interval int `json:"interval"` - - // UserCode Short code user enters in browser (e.g., XXXX-XXXX) - UserCode string `json:"user_code"` - - // VerificationUri URL where user enters the code - VerificationUri string `json:"verification_uri"` - - // VerificationUriComplete URL with code pre-filled - VerificationUriComplete string `json:"verification_uri_complete"` -} - -// DeviceTokenRequest Request body for polling device authorization status. -type DeviceTokenRequest struct { - // DeviceCode Device code from /device/code response - DeviceCode string `json:"device_code"` - - // GrantType OAuth grant type (must be device_code) - GrantType *string `json:"grant_type,omitempty"` -} - -// DeviceTokenResponse Response containing the issued access token. -type DeviceTokenResponse struct { - // AccessToken API token for CLI authentication - AccessToken string `json:"access_token"` - - // ExpiresIn Token lifetime in seconds (90 days) - ExpiresIn *int `json:"expires_in,omitempty"` - - // TokenType Token type (always 'bearer') - TokenType *string `json:"token_type,omitempty"` -} - -// DiagnoseDomainsRequest Request for diagnosing custom domain DNS configuration. -type DiagnoseDomainsRequest struct { - // Domains List of domain and port pairs to check - Domains []DomainCheckRequest `json:"domains"` -} - -// DiagnosisResponse Response containing diagnosis results for all requested domains. -type DiagnosisResponse struct { - // Results Diagnosis results in request order - Results []DomainDiagnosisResult `json:"results"` -} - -// DiskInfo defines model for DiskInfo. -type DiskInfo struct { - FreeSize int `json:"free_size"` - MountPoint string `json:"mount_point"` - Name string `json:"name"` - TotalSize int `json:"total_size"` -} - -// DnsRecordResult DNS record check result. -type DnsRecordResult struct { - // ActualValue Actual value found, null if missing - ActualValue *string `json:"actual_value"` - - // ExpectedValue Expected record value - ExpectedValue string `json:"expected_value"` - - // IsDeprecated True if this record format is deprecated - IsDeprecated *bool `json:"is_deprecated,omitempty"` - - // IsValid True if actual matches expected - IsValid bool `json:"is_valid"` - - // QueryName Domain name queried - QueryName string `json:"query_name"` - - // RecordType Record type: CNAME or TXT - RecordType string `json:"record_type"` - - // WarningMessage Deprecation or migration warning - WarningMessage *string `json:"warning_message"` -} - -// DockerConfig defines model for DockerConfig. -type DockerConfig struct { - Password *string `json:"password"` - Registry *string `json:"registry"` - Username *string `json:"username"` -} - -// DomainCheckRequest Single domain check entry. -type DomainCheckRequest struct { - // Domain Domain name to diagnose (e.g., app.example.com) - Domain string `json:"domain"` - - // Port Port number the domain routes to - Port int `json:"port"` -} - -// DomainDiagnosisResult Diagnosis result for a single domain. -type DomainDiagnosisResult struct { - // CaaCheck CAA record check result (informational, not required for validation). - CaaCheck *CaaCheckResult `json:"caa_check,omitempty"` - - // Domain Domain name checked - Domain string `json:"domain"` - - // IsValid True if all required records (CNAME, TXT) are correct - IsValid bool `json:"is_valid"` - - // Port Port number checked - Port int `json:"port"` - - // Records DNS record check results - Records []DnsRecordResult `json:"records"` -} - -// DstackAppMinimalResponse defines model for DstackAppMinimalResponse. -type DstackAppMinimalResponse struct { - AppIconUrl *interface{} `json:"app_icon_url"` - AppId string `json:"app_id"` - AppProvisionType *interface{} `json:"app_provision_type"` - CreatedAt *interface{} `json:"created_at"` - CurrentCvm *interface{} `json:"current_cvm"` - CvmCount *interface{} `json:"cvm_count"` - Cvms *interface{} `json:"cvms"` - Id *interface{} `json:"id"` - KmsType *interface{} `json:"kms_type"` - Name *interface{} `json:"name"` - Profile *interface{} `json:"profile"` -} - -// EmailTokenVerificationRequest defines model for EmailTokenVerificationRequest. -type EmailTokenVerificationRequest struct { - Token string `json:"token"` -} - -// EmailVerificationPayload Request payload for email verification -type EmailVerificationPayload struct { - Email *openapi_types.Email `json:"email"` - SiteKey *string `json:"site_key"` -} - -// EventLog defines model for EventLog. -type EventLog struct { - Digest string `json:"digest"` - Event string `json:"event"` - EventPayload string `json:"event_payload"` - EventType int `json:"event_type"` - Imr int `json:"imr"` -} - -// ExtendedContainer Extended Container with the public log endpoint if any. -type ExtendedContainer struct { - Command *string `json:"command"` - Created int `json:"created"` - Id string `json:"id"` - Image string `json:"image"` - ImageId string `json:"image_id"` - LogEndpoint *string `json:"log_endpoint"` - Names []string `json:"names"` - State string `json:"state"` - Status string `json:"status"` -} - -// FilterOptionsResponse Available filter values for app list queries. -type FilterOptionsResponse struct { - // ImageVersions Distinct OS image names - ImageVersions []string `json:"image_versions"` - - // InstanceTypes Distinct instance type identifiers - InstanceTypes []string `json:"instance_types"` - - // KmsSlugs Distinct KMS slug values - KmsSlugs []string `json:"kms_slugs"` - - // KmsTypes Distinct KMS type values - KmsTypes []string `json:"kms_types"` - - // Nodes Distinct node names (union of teepod and node names) - Nodes []string `json:"nodes"` - - // Regions Distinct region identifiers - Regions []string `json:"regions"` - - // Statuses Distinct CVM status values - Statuses []string `json:"statuses"` -} - -// GpuAvailability GPU availability information for the current team -type GpuAvailability struct { - // HasPublicGpus Whether there are public GPUs available - HasPublicGpus *bool `json:"has_public_gpus,omitempty"` - - // HasReservedGpus Whether team has reserved GPU access - HasReservedGpus *bool `json:"has_reserved_gpus,omitempty"` - - // PublicGpuCount Number of public GPUs available - PublicGpuCount *int `json:"public_gpu_count,omitempty"` - - // ReservedGpuCount Number of reserved GPUs available to use - ReservedGpuCount *int `json:"reserved_gpu_count,omitempty"` -} - -// GpuConfig defines model for GpuConfig. -type GpuConfig struct { - AttachMode *GpuConfig_AttachMode `json:"attach_mode,omitempty"` - Gpus []GpuSpec `json:"gpus"` -} - -// GpuConfigAttachMode0 defines model for GpuConfig.AttachMode.0. -type GpuConfigAttachMode0 string - -// GpuConfigAttachMode1 defines model for . -type GpuConfigAttachMode1 = string - -// GpuConfig_AttachMode defines model for GpuConfig.AttachMode. -type GpuConfig_AttachMode struct { - union json.RawMessage -} - -// GpuSpec defines model for GpuSpec. -type GpuSpec struct { - ProductId *string `json:"product_id"` - Slot string `json:"slot"` -} - -// HTTPValidationError defines model for HTTPValidationError. -type HTTPValidationError struct { - Detail *[]ValidationError `json:"detail,omitempty"` -} - -// HostedCvm defines model for HostedCvm. -type HostedCvm struct { - AllowUpgrade *bool `json:"allow_upgrade,omitempty"` - BillingPeriod *string `json:"billing_period"` - ContractAddress *string `json:"contract_address"` - DappDashboardUrl *string `json:"dapp_dashboard_url"` - DeployerAddress *string `json:"deployer_address"` - DiskSize *int `json:"disk_size"` - GatewayDomain *string `json:"gateway_domain"` - - // Hosted Mapping from Teepod RPC's VmInfo. - Hosted VmInfo `json:"hosted"` - InProgress *bool `json:"in_progress,omitempty"` - - // KmsInfo KMS instance information. - KmsInfo *KMSInfo `json:"kms_info,omitempty"` - Listed *bool `json:"listed,omitempty"` - ManagedUser *ManagedUser `json:"managed_user,omitempty"` - Memory *int `json:"memory"` - Name string `json:"name"` - Node *CvmNode `json:"node,omitempty"` - - // ProjectId A hashed identifier that maps to an internal database ID - ProjectId *string `json:"project_id"` - ProjectType *string `json:"project_type"` - PublicUrls []CvmNetworkUrls `json:"public_urls"` - Status string `json:"status"` - SyslogEndpoint *string `json:"syslog_endpoint"` - Vcpu *int `json:"vcpu"` -} - -// InstanceEventResponse CVM instance lifecycle event. -type InstanceEventResponse struct { - // CorrelationId Request correlation ID - CorrelationId *string `json:"correlation_id"` - - // EventType Event type: created, started, stopped, etc. - EventType string `json:"event_type"` - - // InstanceId CVM instance UUID - InstanceId string `json:"instance_id"` - - // InstanceName CVM display name - InstanceName *string `json:"instance_name"` - - // InstanceType Instance type identifier - InstanceType *string `json:"instance_type"` - - // MessageId Unique event identifier - MessageId string `json:"message_id"` - - // OperationPayload JSON operation parameters - OperationPayload *string `json:"operation_payload"` - - // OperationType Operation that triggered the event - OperationType *string `json:"operation_type"` - - // Priority Event priority level - Priority *string `json:"priority"` - - // ProjectId Project database ID - ProjectId *int `json:"project_id"` - - // State CVM state at event time - State *string `json:"state"` - - // TargetState Intended state after operation - TargetState *string `json:"target_state"` - - // TeamId Team database ID - TeamId *int `json:"team_id"` - - // Timestamp Event timestamp (ISO 8601) - Timestamp string `json:"timestamp"` - - // TriggeredBy User ID who triggered the event - TriggeredBy *int `json:"triggered_by"` - - // UserId Owner user ID - UserId *int `json:"user_id"` -} - -// InstanceIdRefreshRequest defines model for InstanceIdRefreshRequest. -type InstanceIdRefreshRequest struct { - // DryRun Preview changes without persisting - DryRun *bool `json:"dry_run,omitempty"` - - // Overwrite Overwrite existing instance_id when different - Overwrite *bool `json:"overwrite,omitempty"` -} - -// InstanceIdRefreshResult defines model for InstanceIdRefreshResult. -type InstanceIdRefreshResult struct { - CvmId int `json:"cvm_id"` - Identifier string `json:"identifier"` - NewInstanceId *string `json:"new_instance_id"` - OldInstanceId *string `json:"old_instance_id"` - Reason *string `json:"reason"` - Source *InstanceIdRefreshResultSource `json:"source,omitempty"` - Status InstanceIdRefreshResultStatus `json:"status"` - VerifiedWithGateway *bool `json:"verified_with_gateway,omitempty"` -} - -// InstanceIdRefreshResultSource defines model for InstanceIdRefreshResult.Source. -type InstanceIdRefreshResultSource string - -// InstanceIdRefreshResultStatus defines model for InstanceIdRefreshResult.Status. -type InstanceIdRefreshResultStatus string - -// KMSInfo KMS instance information. -type KMSInfo struct { - // ChainId Blockchain chain ID if onchain - ChainId *int `json:"chain_id"` - - // GatewayAppId Gateway application ID - GatewayAppId *string `json:"gateway_app_id"` - - // Id Hashed KMS identifier (kms_xxxxx) - Id string `json:"id"` - - // KmsContractAddress Smart contract address if onchain - KmsContractAddress *string `json:"kms_contract_address"` - - // Slug Human-readable KMS name - Slug *string `json:"slug"` - - // Url KMS endpoint URL - Url string `json:"url"` - - // Version KMS software version - Version string `json:"version"` -} - -// KmsListResponse Paginated KMS list response. -type KmsListResponse struct { - Items []KMSInfo `json:"items"` - Page int `json:"page"` - PageSize int `json:"page_size"` - Pages int `json:"pages"` - Total int `json:"total"` -} - -// KmsType defines model for KmsType. -type KmsType string - -// KmsWithSupportedOSImage defines model for KmsWithSupportedOSImage. -type KmsWithSupportedOSImage struct { - // ChainId Blockchain chain ID if onchain - ChainId *int `json:"chain_id"` - - // GatewayAppId Gateway application ID - GatewayAppId *string `json:"gateway_app_id"` - - // Id Hashed KMS identifier (kms_xxxxx) - Id string `json:"id"` - - // KmsContractAddress Smart contract address if onchain - KmsContractAddress *string `json:"kms_contract_address"` - - // Slug Human-readable KMS name - Slug *string `json:"slug"` - SupportedOsImages *[]string `json:"supported_os_images,omitempty"` - - // Url KMS endpoint URL - Url string `json:"url"` - - // Version KMS software version - Version string `json:"version"` -} - -// LoginRequest defines model for LoginRequest. -type LoginRequest struct { - Password string `json:"password"` - TotpCode *string `json:"totp_code"` - Username string `json:"username"` -} - -// MachineInfo CVM hardware configuration. -type MachineInfo struct { - // DiskSize Disk size in GB - DiskSize int `json:"disk_size"` - - // GpuCount GPU count (0 if none) - GpuCount int `json:"gpu_count"` - - // Memory Memory in MB - Memory int `json:"memory"` - - // Vcpu Virtual CPU count - Vcpu int `json:"vcpu"` -} - -// ManagedUser defines model for ManagedUser. -type ManagedUser struct { - Id int `json:"id"` - Username string `json:"username"` -} - -// MeteredUsageResponse Single metered usage record. -type MeteredUsageResponse struct { - // BillingDay Billing day bucket - BillingDay string `json:"billing_day"` - - // BillingEnd Billing period end (date) - BillingEnd string `json:"billing_end"` - - // BillingHour Billing hour bucket - BillingHour string `json:"billing_hour"` - - // BillingKey Unique billing record key - BillingKey string `json:"billing_key"` - - // BillingStart Billing period start (date) - BillingStart string `json:"billing_start"` - - // Cost Cost in USD - Cost float32 `json:"cost"` - - // Details JSON usage details - Details *string `json:"details"` - - // DurationMinutes Usage duration in minutes - DurationMinutes float32 `json:"duration_minutes"` - - // EventType Usage event type - EventType string `json:"event_type"` - - // InstanceId CVM instance UUID - InstanceId string `json:"instance_id"` - - // ProjectId Project database ID - ProjectId int `json:"project_id"` - - // TeamId Team database ID - TeamId int `json:"team_id"` - - // Timestamp Record timestamp (ISO 8601) - Timestamp string `json:"timestamp"` - - // UsageType Billing category: compute, storage, etc. - UsageType string `json:"usage_type"` -} - -// NodeRef Minimal node/teepod reference for embedding in responses. -type NodeRef struct { - // DeviceId Device ID - DeviceId *string `json:"device_id"` - - // Id Teepod numeric ID - Id *int `json:"id"` - - // Name Node display name - Name *string `json:"name"` - - // ObjectType Fixed value 'node' - ObjectType *string `json:"object_type,omitempty"` - - // Ppid PPID - Ppid *string `json:"ppid"` - - // Region Region identifier - Region *string `json:"region"` - Status *TeepodStatus `json:"status,omitempty"` - - // Version Teepod version - Version *string `json:"version"` -} - -// OSImageVariant Single OS image variant (production or development build). -type OSImageVariant struct { - // IsCurrent True if this is the currently running image - IsCurrent *bool `json:"is_current,omitempty"` - - // Name Human-readable image name (e.g. dstack-0.5.5) - Name string `json:"name"` - - // OsImageHash SHA256 hash of the OS image - OsImageHash *string `json:"os_image_hash"` - - // Slug Unique identifier for API calls (e.g. dstack-0.5.5-e18f5407) - Slug string `json:"slug"` -} - -// OperationEventDetail Single atomic event within an operation. -type OperationEventDetail struct { - // EventType Event type identifier (e.g. instance.power_on.start) - EventType string `json:"event_type"` - - // State CVM state at event time (e.g. running, stopped) - State string `json:"state"` - - // Timestamp UTC timestamp when event occurred - Timestamp time.Time `json:"timestamp"` -} - -// PaginatedCvmInfos defines model for PaginatedCvmInfos. -type PaginatedCvmInfos struct { - Items []CVMInfo `json:"items"` - Page int `json:"page"` - PageSize int `json:"page_size"` - Pages int `json:"pages"` - Total int `json:"total"` -} - -// PaginatedCvmOperationsResponse Cursor-paginated list of CVM operations. -type PaginatedCvmOperationsResponse struct { - // Items Operations ordered by started_at DESC - Items []CvmOperationResponse `json:"items"` - - // NextCursor Opaque cursor for next page, null if last page - NextCursor *string `json:"next_cursor"` - - // Total Approximate total count (not exact for performance) - Total int `json:"total"` -} - -// PaginatedHostedCvms Paginated response for CVM list endpoints -type PaginatedHostedCvms struct { - Items []HostedCvm `json:"items"` - Page int `json:"page"` - PageSize int `json:"page_size"` - Pages int `json:"pages"` - Total int `json:"total"` -} - -// PasswordResetRequest defines model for PasswordResetRequest. -type PasswordResetRequest struct { - Email openapi_types.Email `json:"email"` - SiteKey *string `json:"site_key"` -} - -// PortMapping defines model for PortMapping. -type PortMapping struct { - HostAddress *string `json:"host_address"` - HostPort int `json:"host_port"` - Protocol string `json:"protocol"` - VmPort int `json:"vm_port"` -} - -// ProfileGetResponse Response model for entity profile - only public display data. -type ProfileGetResponse struct { - AvatarUrl *string `json:"avatar_url"` - CustomDomain *string `json:"custom_domain"` - Description *string `json:"description"` - DisplayName *string `json:"display_name"` -} - -// ProvisionComposeFileUpdateRequest Request model for provisioning compose file updates. -type ProvisionComposeFileUpdateRequest struct { - AllowedEnvs *[]string `json:"allowed_envs,omitempty"` - BashScript *string `json:"bash_script"` - DefaultGatewayDomain *string `json:"default_gateway_domain"` - DockerComposeFile *string `json:"docker_compose_file"` - Features *[]string `json:"features,omitempty"` - GatewayEnabled *bool `json:"gateway_enabled,omitempty"` - InitScript *string `json:"init_script"` - KmsEnabled *bool `json:"kms_enabled,omitempty"` - LocalKeyProviderEnabled *bool `json:"local_key_provider_enabled,omitempty"` - ManifestVersion *int `json:"manifest_version,omitempty"` - Name string `json:"name"` - NoInstanceId *bool `json:"no_instance_id,omitempty"` - PreLaunchScript *string `json:"pre_launch_script"` - PublicLogs *bool `json:"public_logs,omitempty"` - PublicSysinfo *bool `json:"public_sysinfo,omitempty"` - PublicTcbinfo *bool `json:"public_tcbinfo,omitempty"` - Runner *string `json:"runner,omitempty"` - Salt *string `json:"salt"` - SecureTime *bool `json:"secure_time,omitempty"` - StorageFs *ProvisionComposeFileUpdateRequest_StorageFs `json:"storage_fs"` - TproxyEnabled *bool `json:"tproxy_enabled,omitempty"` - - // UpdateEnvVars Whether to also update allowed_envs - UpdateEnvVars *bool `json:"update_env_vars"` -} - -// ProvisionComposeFileUpdateRequestStorageFs0 defines model for . -type ProvisionComposeFileUpdateRequestStorageFs0 = string - -// ProvisionComposeFileUpdateRequestStorageFs1 defines model for . -type ProvisionComposeFileUpdateRequestStorageFs1 = string - -// ProvisionComposeFileUpdateRequest_StorageFs defines model for ProvisionComposeFileUpdateRequest.StorageFs. -type ProvisionComposeFileUpdateRequest_StorageFs struct { - union json.RawMessage -} - -// ProvisionDstackAppRequestV2 Request for provisioning a DStack app with automatic resource matching. -// -// Most fields are optional and will be automatically determined by the resource -// matching logic in preflight_dstack_app. Only compose_file and name are required. -type ProvisionDstackAppRequestV2 struct { - // AppId Optional app_id for manual specification. Required when nonce is provided. Only works with PHALA KMS. - AppId *string `json:"app_id"` - ComposeFile AppComposeV2 `json:"compose_file"` - DiskSize *int `json:"disk_size"` - EncryptedEnv *string `json:"encrypted_env"` - EnvKeys *[]string `json:"env_keys,omitempty"` - ExperimentalVpcServerAppId *string `json:"experimental_vpc_server_app_id"` - GatewayUrls *[]string `json:"gateway_urls,omitempty"` - Gpus *GpuConfig `json:"gpus,omitempty"` - Hugepages *bool `json:"hugepages,omitempty"` - Image *string `json:"image"` - InstanceType *string `json:"instance_type"` - Kms *KmsType `json:"kms,omitempty"` - KmsId *string `json:"kms_id"` - KmsUrls *[]string `json:"kms_urls,omitempty"` - Listed *bool `json:"listed,omitempty"` - Memory *int `json:"memory"` - - // Name CVM name (used as hostname): 5-63 chars, must start with letter, can contain letters/numbers/hyphens - Name string `json:"name"` - - // Nonce Optional nonce for deterministic app_id generation. When provided, app_id must also be provided. System will verify: app_id == get_create_address(team_wallet, nonce) - Nonce *int `json:"nonce"` - PinNuma *bool `json:"pin_numa,omitempty"` - Ports *[]PortMapping `json:"ports"` - - // PreferDev Prefer dev OS image (True) or non-dev OS image (False). When None, auto-selects based on image name or defaults to dev. - PreferDev *bool `json:"prefer_dev"` - Region *string `json:"region"` - TeepodId *int `json:"teepod_id"` - UserConfig *string `json:"user_config"` - Vcpu *int `json:"vcpu"` -} - -// ProvisionElizaRequest defines model for ProvisionElizaRequest. -type ProvisionElizaRequest struct { - // Characterfile The characterfile to use for the a16z/eliza. - Characterfile string `json:"characterfile"` - - // EnvKeys The environment variables to use for the a16z/eliza. - EnvKeys []string `json:"env_keys"` - - // Image The image to use for the a16z/eliza. If not provided, it will use the latest image. - Image *string `json:"image"` - - // Name The name of the tapp. - Name string `json:"name"` - - // TeepodId The Teepod ID to use for the a16z/eliza. If not provided, it will auto select an available one. - TeepodId *int `json:"teepod_id"` -} - -// PublicCVM defines model for PublicCVM. -type PublicCVM struct { - AppId string `json:"app_id"` - BaseImage *string `json:"base_image"` - InstanceId *string `json:"instance_id"` - Name string `json:"name"` - Status string `json:"status"` - VmUuid *string `json:"vm_uuid"` -} - -// Quote defines model for Quote. -type Quote struct { - Body QuoteBody `json:"body"` - CertData *string `json:"cert_data"` - Header QuoteHeader `json:"header"` - Verified *bool `json:"verified"` -} - -// QuoteBody defines model for QuoteBody. -type QuoteBody struct { - Mrconfig openapi_types.File `json:"mrconfig"` - Mrowner openapi_types.File `json:"mrowner"` - Mrownerconfig openapi_types.File `json:"mrownerconfig"` - Mrseam openapi_types.File `json:"mrseam"` - Mrsignerseam openapi_types.File `json:"mrsignerseam"` - Mrtd openapi_types.File `json:"mrtd"` - Reportdata openapi_types.File `json:"reportdata"` - Rtmr0 openapi_types.File `json:"rtmr0"` - Rtmr1 openapi_types.File `json:"rtmr1"` - Rtmr2 openapi_types.File `json:"rtmr2"` - Rtmr3 openapi_types.File `json:"rtmr3"` - Seamattributes openapi_types.File `json:"seamattributes"` - Tdattributes openapi_types.File `json:"tdattributes"` - TeeTcbSvn string `json:"tee_tcb_svn"` - Xfam openapi_types.File `json:"xfam"` -} - -// QuoteCollateralV3 defines model for QuoteCollateralV3. -type QuoteCollateralV3 struct { - PckCrl string `json:"pck_crl"` - PckCrlIssuerChain string `json:"pck_crl_issuer_chain"` - QeIdentity string `json:"qe_identity"` - QeIdentityIssuerChain string `json:"qe_identity_issuer_chain"` - QeIdentitySignature string `json:"qe_identity_signature"` - RootCaCrl *string `json:"root_ca_crl"` - TcbInfo string `json:"tcb_info"` - TcbInfoIssuerChain string `json:"tcb_info_issuer_chain"` - TcbInfoSignature string `json:"tcb_info_signature"` -} - -// QuoteHeader defines model for QuoteHeader. -type QuoteHeader struct { - // AkType Attestation key type (subset used in SGX/TDX DCAP quotes). - AkType AttestationKeyType `json:"ak_type"` - QeVendor openapi_types.File `json:"qe_vendor"` - - // TeeType TEE type values used by Intel DCAP quote header. - TeeType TeeType `json:"tee_type"` - UserData openapi_types.File `json:"user_data"` - Version int `json:"version"` -} - -// RedeployRevisionRequest defines model for RedeployRevisionRequest. -type RedeployRevisionRequest struct { - VmUuids *[]string `json:"vm_uuids"` -} - -// RedpillApiKeyCreate Request body for creating a Redpill API key. -type RedpillApiKeyCreate struct { - // Name Display name for the API key - Name *string `json:"name"` -} - -// RegisterPayload defines model for RegisterPayload. -type RegisterPayload struct { - Email openapi_types.Email `json:"email"` - InviteCode *string `json:"invite_code"` - Password string `json:"password"` - SiteKey *string `json:"site_key"` - Username string `json:"username"` -} - -// ResetPasswordWithToken Request model for resetting password with token. -type ResetPasswordWithToken struct { - Password string `json:"password"` - SiteKey *string `json:"site_key"` - Token string `json:"token"` -} - -// ResourceThreshold Resource threshold for VM creation. -type ResourceThreshold struct { - MaxDisk *int `json:"max_disk"` - MaxDiskEach *int `json:"max_disk_each"` - MaxInstances *int `json:"max_instances"` - MaxMemory *int `json:"max_memory"` - MaxMemoryEach *int `json:"max_memory_each"` - MaxVcpu *int `json:"max_vcpu"` -} - -// SessionResponse API response model for user sessions with sanitized device info. -type SessionResponse struct { - CreatedAt time.Time `json:"created_at"` - DeviceInfo *string `json:"device_info"` - - // DeviceKind Get device kind (Mobile/Desktop) based on user agent. - DeviceKind *SessionResponseDeviceKind `json:"device_kind,omitempty"` - - // DeviceLabel Generate a user-friendly device label, including OS. - DeviceLabel *string `json:"device_label,omitempty"` - - // DeviceOs Expose detected operating system as a computed field. - DeviceOs *string `json:"device_os,omitempty"` - Id string `json:"id"` - IsCurrent bool `json:"is_current"` - Jti string `json:"jti"` - LastSeenAt time.Time `json:"last_seen_at"` - Revoked bool `json:"revoked"` - RevokedAt *time.Time `json:"revoked_at"` - UserAgent *string `json:"user_agent"` -} - -// SessionResponseDeviceKind Get device kind (Mobile/Desktop) based on user agent. -type SessionResponseDeviceKind string - -// SessionsListResponse Response for listing user sessions. -type SessionsListResponse struct { - Sessions []SessionResponse `json:"sessions"` - Total int `json:"total"` -} - -// StepUpVerifyRequest Generic step-up verification request. -// -// Accepts either current_password (for users without 2FA) or totp_code (for users with 2FA). -// On success, server will issue a short-lived cookie used by sensitive endpoints. -type StepUpVerifyRequest struct { - CurrentPassword *string `json:"current_password"` - TotpCode *string `json:"totp_code"` -} - -// SystemInfo defines model for SystemInfo. -type SystemInfo struct { - AvailableMemory int `json:"available_memory"` - CpuModel string `json:"cpu_model"` - Disks []DiskInfo `json:"disks"` - FreeMemory int `json:"free_memory"` - FreeSwap int `json:"free_swap"` - KernelVersion string `json:"kernel_version"` - LoadavgFifteen int `json:"loadavg_fifteen"` - LoadavgFive int `json:"loadavg_five"` - LoadavgOne int `json:"loadavg_one"` - NumCpus int `json:"num_cpus"` - OsName string `json:"os_name"` - OsVersion string `json:"os_version"` - TotalMemory int `json:"total_memory"` - TotalSwap int `json:"total_swap"` - Uptime int `json:"uptime"` - UsedMemory int `json:"used_memory"` - UsedSwap int `json:"used_swap"` -} - -// TcbInfo defines model for TcbInfo. -type TcbInfo struct { - AppCompose string `json:"app_compose"` - EventLog []EventLog `json:"event_log"` - Mrtd string `json:"mrtd"` - RootfsHash *string `json:"rootfs_hash"` - Rtmr0 string `json:"rtmr0"` - Rtmr1 string `json:"rtmr1"` - Rtmr2 string `json:"rtmr2"` - Rtmr3 string `json:"rtmr3"` -} - -// TeamTier defines model for TeamTier. -type TeamTier string - -// TeeType TEE type values used by Intel DCAP quote header. -type TeeType int - -// Teepod defines model for Teepod. -type Teepod struct { - CreatedAt time.Time `json:"created_at"` - Enabled bool `json:"enabled"` - Endpoint string `json:"endpoint"` - Id int `json:"id"` - KmsUrl string `json:"kms_url"` - KmsVersion *string `json:"kms_version"` - LastPingAt *time.Time `json:"last_ping_at"` - Name string `json:"name"` - RegionIdentifier *string `json:"region_identifier"` - Status TeepodStatus `json:"status"` - TeepodVersion *string `json:"teepod_version"` - TproxyBaseDomain *string `json:"tproxy_base_domain"` - TproxyPort *int `json:"tproxy_port"` - TproxyTappdPort *int `json:"tproxy_tappd_port"` - TproxyUrl string `json:"tproxy_url"` -} - -// TeepodCapacity Represents a teepod (remain) capacity -type TeepodCapacity struct { - DedicatedForTeamId *int `json:"dedicated_for_team_id"` - DefaultKms *string `json:"default_kms"` - DeviceId *string `json:"device_id"` - Fmspc *string `json:"fmspc"` - Images []TeehouseApiRoutesCvmsPreflightAvailableOSImage `json:"images"` - KmsList *[]string `json:"kms_list,omitempty"` - Listed bool `json:"listed"` - Name string `json:"name"` - RegionIdentifier *string `json:"region_identifier"` - RemainingCvmSlots int `json:"remaining_cvm_slots"` - RemainingDisk *float32 `json:"remaining_disk"` - RemainingMemory float32 `json:"remaining_memory"` - RemainingVcpu float32 `json:"remaining_vcpu"` - ResourceScore float32 `json:"resource_score"` - SupportOnchainKms *bool `json:"support_onchain_kms,omitempty"` - TeepodId int `json:"teepod_id"` -} - -// TeepodMeta defines model for TeepodMeta. -type TeepodMeta struct { - Id int `json:"id"` - Name string `json:"name"` -} - -// TeepodStatus defines model for TeepodStatus. -type TeepodStatus string - -// TierCapacity defines model for TierCapacity. -type TierCapacity struct { - // Capacity Resource threshold for VM creation. - Capacity ResourceThreshold `json:"capacity"` - - // GpuAvailability GPU availability information for the current team - GpuAvailability *GpuAvailability `json:"gpu_availability,omitempty"` - KmsList []KmsWithSupportedOSImage `json:"kms_list"` - Nodes []TeepodCapacity `json:"nodes"` - Tier TeamTier `json:"tier"` -} - -// TwoFactorDisableRequest defines model for TwoFactorDisableRequest. -type TwoFactorDisableRequest struct { - VerificationCode string `json:"verification_code"` -} - -// TwoFactorPageVerifyRequest defines model for TwoFactorPageVerifyRequest. -type TwoFactorPageVerifyRequest struct { - Code string `json:"code"` -} - -// TwoFactorRegenerateRequest defines model for TwoFactorRegenerateRequest. -type TwoFactorRegenerateRequest struct { - VerificationCode string `json:"verification_code"` -} - -// TwoFactorSetupRequest defines model for TwoFactorSetupRequest. -type TwoFactorSetupRequest struct { - TotpCode string `json:"totp_code"` -} - -// TwoFactorVerificationRequest defines model for TwoFactorVerificationRequest. -type TwoFactorVerificationRequest struct { - Code string `json:"code"` -} - -// UpdatePasswordRequest defines model for UpdatePasswordRequest. -type UpdatePasswordRequest struct { - CurrentPassword *string `json:"current_password"` - Password string `json:"password"` - SiteKey *string `json:"site_key"` - TotpCode *string `json:"totp_code"` -} - -// UpdateUsernameRequest defines model for UpdateUsernameRequest. -type UpdateUsernameRequest struct { - CurrentPassword *string `json:"current_password"` - TotpCode *string `json:"totp_code"` - Username string `json:"username"` -} - -// User defines model for User. -type User struct { - CreatedAt time.Time `json:"created_at"` - Credit *Credit `json:"credit,omitempty"` - Id int `json:"id"` - Role string `json:"role"` - Username string `json:"username"` -} - -// UserRef Minimal user reference for embedding in responses. -type UserRef struct { - // AvatarUrl Gravatar or OAuth provider avatar URL - AvatarUrl *string `json:"avatar_url"` - - // Id A hashed identifier that maps to an internal database ID - Id *string `json:"id"` - - // ObjectType Fixed value 'user' - ObjectType *string `json:"object_type,omitempty"` - - // Username Display username - Username *string `json:"username"` -} - -// VM defines model for VM. -type VM struct { - AppId string `json:"app_id"` - AppUrl *string `json:"app_url"` - BaseImage *string `json:"base_image"` - CreatedAt time.Time `json:"created_at"` - DiskSize int `json:"disk_size"` - DockerComposeFile *string `json:"docker_compose_file"` - EncryptedEnvPubkey *string `json:"encrypted_env_pubkey"` - Features *[]string `json:"features"` - Id int `json:"id"` - InstanceId *string `json:"instance_id"` - ManifestVersion *int `json:"manifest_version"` - Memory int `json:"memory"` - Name string `json:"name"` - Runner *string `json:"runner"` - Status string `json:"status"` - Teepod *TeepodMeta `json:"teepod,omitempty"` - TeepodId int `json:"teepod_id"` - UserId *int `json:"user_id"` - Vcpu int `json:"vcpu"` - Version *string `json:"version"` - VmUuid *string `json:"vm_uuid"` -} - -// VMCreateWithTeepod defines model for VMCreateWithTeepod. -type VMCreateWithTeepod struct { - AppIdSalt *string `json:"app_id_salt"` - - // ComposeManifest @see https://github.com/Dstack-TEE/dstack/blob/master/tdxctl/src/utils.rs#L77 - // @see https://github.com/Dstack-TEE/dstack/blob/master/basefiles/app-compose.sh - ComposeManifest ComposeManifest `json:"compose_manifest"` - DiskSize int `json:"disk_size"` - EncryptedEnv *string `json:"encrypted_env"` - EnvKeys *[]string `json:"env_keys"` - Image string `json:"image"` - InstanceType *string `json:"instance_type"` - Listed *bool `json:"listed,omitempty"` - Memory int `json:"memory"` - Name string `json:"name"` - Ports *[]PortMapping `json:"ports"` - TeepodId int `json:"teepod_id"` - UserId *int `json:"user_id"` - Vcpu int `json:"vcpu"` -} - -// ValidationError defines model for ValidationError. -type ValidationError struct { - Loc []ValidationError_Loc_Item `json:"loc"` - Msg string `json:"msg"` - Type string `json:"type"` -} - -// ValidationErrorLoc0 defines model for . -type ValidationErrorLoc0 = string - -// ValidationErrorLoc1 defines model for . -type ValidationErrorLoc1 = int - -// ValidationError_Loc_Item defines model for ValidationError.loc.Item. -type ValidationError_Loc_Item struct { - union json.RawMessage -} - -// VerificationResponse Quote verification result. -type VerificationResponse struct { - // CanDownload Raw quote downloadable - CanDownload *bool `json:"can_download"` - - // Checksum SHA256 of quote bytes - Checksum *string `json:"checksum"` - - // Id Quote checksum identifier - Id string `json:"id"` - - // ProofOfCloud Quote from Phala Cloud TEE - ProofOfCloud bool `json:"proof_of_cloud"` - Quote *Quote `json:"quote,omitempty"` - QuoteCollateral *QuoteCollateralV3 `json:"quote_collateral,omitempty"` - - // Success Verification passed - Success bool `json:"success"` - - // UploadedAt ISO8601 upload timestamp - UploadedAt *string `json:"uploaded_at"` -} - -// VerifyAndLinkOAuthRequest Request to verify password/2FA and link OAuth account during Link-on-Login flow. -type VerifyAndLinkOAuthRequest struct { - LinkToken string `json:"link_token"` - Password *string `json:"password"` - TotpCode *string `json:"totp_code"` -} - -// VmConfiguration Mapping from Teepod RPC's VmConfiguration. -type VmConfiguration struct { - AppId *string `json:"app_id"` - ComposeFile *AppComposeV2 `json:"compose_file,omitempty"` - DiskSize int `json:"disk_size"` - EncryptedEnv *string `json:"encrypted_env"` - GatewayUrls *[]string `json:"gateway_urls,omitempty"` - Gpus *GpuConfig `json:"gpus,omitempty"` - Hugepages *bool `json:"hugepages,omitempty"` - Image string `json:"image"` - KmsUrls *[]string `json:"kms_urls,omitempty"` - Memory int `json:"memory"` - Name string `json:"name"` - PinNuma *bool `json:"pin_numa,omitempty"` - Ports *[]PortMapping `json:"ports"` - UserConfig *string `json:"user_config"` - Vcpu int `json:"vcpu"` -} - -// VmInfo Mapping from Teepod RPC's VmInfo. -type VmInfo struct { - AppId string `json:"app_id"` - AppUrl *string `json:"app_url"` - BootError *string `json:"boot_error"` - BootProgress *string `json:"boot_progress"` - - // Configuration Mapping from Teepod RPC's VmConfiguration. - Configuration *VmConfiguration `json:"configuration,omitempty"` - ExitedAt *string `json:"exited_at"` - Id string `json:"id"` - ImageVersion *string `json:"image_version"` - InstanceId *string `json:"instance_id"` - Name string `json:"name"` - ShutdownProgress *string `json:"shutdown_progress"` - Status string `json:"status"` - Uptime string `json:"uptime"` -} - -// WorkspaceRef Minimal workspace reference for embedding in responses. -type WorkspaceRef struct { - // AvatarUrl Workspace avatar URL from profile - AvatarUrl *string `json:"avatar_url"` - - // Id Hashed workspace ID - Id string `json:"id"` - - // Name Workspace display name - Name string `json:"name"` - - // ObjectType Fixed value 'workspace' - ObjectType *string `json:"object_type,omitempty"` - - // Slug URL-safe workspace identifier - Slug *string `json:"slug"` -} - -// WrappedChangeEmailRequest Wrapped request format from frontend API route -type WrappedChangeEmailRequest struct { - // Request Request payload for changing email address - Request ChangeEmailPayload `json:"request"` - SiteKey *string `json:"site_key"` -} - -// WrappedEmailVerificationRequest Wrapped request format from frontend API route -type WrappedEmailVerificationRequest struct { - // Request Request payload for email verification - Request EmailVerificationPayload `json:"request"` - SiteKey *string `json:"site_key"` -} - -// TeehouseApiRoutesAppsSchemasReplicateRequest CVM replication request parameters. -type TeehouseApiRoutesAppsSchemasReplicateRequest struct { - // EncryptedEnv Hex-encoded encrypted environment - EncryptedEnv *string `json:"encrypted_env"` - - // NodeId Target node ID for replica - NodeId *int `json:"node_id"` - - // TeepodId Target node ID (deprecated, use node_id) - TeepodId *int `json:"teepod_id"` -} - -// TeehouseApiRoutesAppsV20251028SchemasCvmBasicInfo defines model for teehouse__api__routes__apps__v20251028__schemas__CvmBasicInfo. -type TeehouseApiRoutesAppsV20251028SchemasCvmBasicInfo struct { - AppId string `json:"app_id"` - BaseImage *string `json:"base_image"` - DiskSize int `json:"disk_size"` - InstanceId *string `json:"instance_id"` - InstanceType *string `json:"instance_type"` - KmsId *string `json:"kms_id"` - KmsSlug *string `json:"kms_slug"` - KmsType *string `json:"kms_type"` - Listed *bool `json:"listed"` - - // MachineInfo CVM hardware configuration. - MachineInfo *MachineInfo `json:"machine_info,omitempty"` - Memory int `json:"memory"` - Name *string `json:"name,omitempty"` - RegionIdentifier *string `json:"region_identifier"` - Status string `json:"status"` - TeepodId int `json:"teepod_id"` - TeepodName string `json:"teepod_name"` - UpdatedAt *time.Time `json:"updated_at"` - Vcpu int `json:"vcpu"` - VmUuid *string `json:"vm_uuid"` -} - -// TeehouseApiRoutesAppsV20251028SchemasDstackAppFullResponse defines model for teehouse__api__routes__apps__v20251028__schemas__DstackAppFullResponse. -type TeehouseApiRoutesAppsV20251028SchemasDstackAppFullResponse struct { - AppIconUrl *string `json:"app_icon_url"` - AppId string `json:"app_id"` - AppProvisionType *string `json:"app_provision_type"` - CreatedAt string `json:"created_at"` - CurrentCvm *TeehouseApiRoutesAppsV20251028SchemasCvmBasicInfo `json:"current_cvm,omitempty"` - CvmCount *int `json:"cvm_count,omitempty"` - Cvms *[]TeehouseApiRoutesAppsV20251028SchemasCvmBasicInfo `json:"cvms,omitempty"` - - // Id A hashed identifier that maps to an internal database ID - Id string `json:"id"` - KmsType string `json:"kms_type"` - Name string `json:"name"` - - // Profile Response model for entity profile - only public display data. - Profile *ProfileGetResponse `json:"profile,omitempty"` - TeamName *string `json:"team_name"` - TeamSlug *string `json:"team_slug"` -} - -// TeehouseApiRoutesAppsV20251028SchemasDstackAppListResponse defines model for teehouse__api__routes__apps__v20251028__schemas__DstackAppListResponse. -type TeehouseApiRoutesAppsV20251028SchemasDstackAppListResponse struct { - DstackApps []TeehouseApiRoutesAppsV20251028SchemasDstackAppListResponse_DstackApps_Item `json:"dstack_apps"` - Page int `json:"page"` - PageSize int `json:"page_size"` - Total int `json:"total"` - TotalPages int `json:"total_pages"` -} - -// TeehouseApiRoutesAppsV20251028SchemasDstackAppListResponse_DstackApps_Item defines model for teehouse__api__routes__apps__v20251028__schemas__DstackAppListResponse.dstack_apps.Item. -type TeehouseApiRoutesAppsV20251028SchemasDstackAppListResponse_DstackApps_Item struct { - union json.RawMessage -} - -// TeehouseApiRoutesAppsV20260121SchemasDstackAppFullResponse defines model for teehouse__api__routes__apps__v20260121__schemas__DstackAppFullResponse. -type TeehouseApiRoutesAppsV20260121SchemasDstackAppFullResponse struct { - AppIconUrl *string `json:"app_icon_url"` - AppId string `json:"app_id"` - AppProvisionType *string `json:"app_provision_type"` - CreatedAt string `json:"created_at"` - CurrentCvm *CVMInfo `json:"current_cvm,omitempty"` - CvmCount *int `json:"cvm_count,omitempty"` - Cvms *[]CVMInfo `json:"cvms,omitempty"` - - // Id A hashed identifier that maps to an internal database ID - Id string `json:"id"` - KmsType string `json:"kms_type"` - Name string `json:"name"` - - // Profile Response model for entity profile - only public display data. - Profile *ProfileGetResponse `json:"profile,omitempty"` -} - -// TeehouseApiRoutesAppsV20260121SchemasDstackAppListResponse defines model for teehouse__api__routes__apps__v20260121__schemas__DstackAppListResponse. -type TeehouseApiRoutesAppsV20260121SchemasDstackAppListResponse struct { - DstackApps []TeehouseApiRoutesAppsV20260121SchemasDstackAppListResponse_DstackApps_Item `json:"dstack_apps"` - Page int `json:"page"` - PageSize int `json:"page_size"` - Total int `json:"total"` - TotalPages int `json:"total_pages"` -} - -// TeehouseApiRoutesAppsV20260121SchemasDstackAppListResponse_DstackApps_Item defines model for teehouse__api__routes__apps__v20260121__schemas__DstackAppListResponse.dstack_apps.Item. -type TeehouseApiRoutesAppsV20260121SchemasDstackAppListResponse_DstackApps_Item struct { - union json.RawMessage -} - -// TeehouseApiRoutesCvmsDeploymentReplicateRequest Request model for CVM replication (currently disabled). -type TeehouseApiRoutesCvmsDeploymentReplicateRequest struct { - // EncryptedEnv New encrypted env blob (hex) - EncryptedEnv *string `json:"encrypted_env"` - - // NodeId Target node ID for the replica - NodeId *int `json:"node_id"` - - // TeepodId Target node ID (deprecated, use node_id) - TeepodId *int `json:"teepod_id"` -} - -// TeehouseApiRoutesCvmsManagementCvmBasicInfo Detailed CVM information returned by GET /cvms/{cvm_id}. -type TeehouseApiRoutesCvmsManagementCvmBasicInfo struct { - // AppId Unique application identifier - AppId string `json:"app_id"` - - // BaseImage OS image name - BaseImage *string `json:"base_image"` - - // ContractAddress On-chain contract address - ContractAddress *string `json:"contract_address"` - - // DappDashboardUrl DApp dashboard URL if applicable - DappDashboardUrl *string `json:"dapp_dashboard_url"` - - // DeployerAddress Deployer wallet address - DeployerAddress *string `json:"deployer_address"` - - // DiskSize Allocated disk size in GB - DiskSize int `json:"disk_size"` - - // EncryptedEnvPubkey Public key for encrypting env vars - EncryptedEnvPubkey *string `json:"encrypted_env_pubkey"` - - // GatewayDomain Gateway base domain - GatewayDomain *string `json:"gateway_domain"` - - // Id Internal CVM database ID - Id int `json:"id"` - - // InProgress True if an operation is currently executing - InProgress *bool `json:"in_progress,omitempty"` - - // InstanceId Public instance identifier - InstanceId *string `json:"instance_id"` - - // InstanceType Instance type identifier - InstanceType *string `json:"instance_type"` - - // KmsInfo KMS instance information. - KmsInfo *KMSInfo `json:"kms_info,omitempty"` - - // Listed True if publicly listed - Listed *bool `json:"listed,omitempty"` - - // Memory Allocated memory in MB - Memory int `json:"memory"` - - // Name RFC 1123 compliant CVM name - Name string `json:"name"` - - // ProjectId A hashed identifier that maps to an internal database ID - ProjectId *string `json:"project_id"` - - // ProjectType Project provision type - ProjectType *string `json:"project_type"` - - // PublicLogs Expose logs publicly - PublicLogs *bool `json:"public_logs"` - - // PublicSysinfo Expose system info publicly - PublicSysinfo *bool `json:"public_sysinfo"` - - // PublicUrls Exposed service URLs - PublicUrls *[]CvmNetworkUrls `json:"public_urls"` - - // ScheduledDeleteAt Auto-delete timestamp (UTC) - ScheduledDeleteAt *time.Time `json:"scheduled_delete_at"` - - // Status Current status: running, stopped, starting, etc. - Status string `json:"status"` - - // SyslogEndpoint Syslog streaming endpoint - SyslogEndpoint *string `json:"syslog_endpoint"` - Teepod *CvmNode `json:"teepod,omitempty"` - - // TeepodId Node ID (admin only) - TeepodId *int `json:"teepod_id"` - - // Vcpu Allocated vCPU count - Vcpu int `json:"vcpu"` - - // VmUuid VM instance UUID on the node - VmUuid *string `json:"vm_uuid"` -} - -// TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImage OS image version with production and development variants. -type TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImage struct { - // Dev Single OS image variant (production or development build). - Dev *OSImageVariant `json:"dev,omitempty"` - - // Prod Single OS image variant (production or development build). - Prod *OSImageVariant `json:"prod,omitempty"` - - // Version Semantic version as tuple (major, minor, patch[, build]) - Version TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImage_Version `json:"version"` -} - -// TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion0 defines model for . -type TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion0 = []interface{} - -// TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion1 defines model for . -type TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion1 = []interface{} - -// TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImage_Version Semantic version as tuple (major, minor, patch[, build]) -type TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImage_Version struct { - union json.RawMessage -} - -// TeehouseApiRoutesCvmsPreflightAvailableOSImage defines model for teehouse__api__routes__cvms__preflight__AvailableOSImage. -type TeehouseApiRoutesCvmsPreflightAvailableOSImage struct { - IsDev bool `json:"is_dev"` - Name string `json:"name"` - OsImageHash *string `json:"os_image_hash"` - RequiresGpu *bool `json:"requires_gpu,omitempty"` - Slug string `json:"slug"` - Version TeehouseApiRoutesCvmsPreflightAvailableOSImage_Version `json:"version"` -} - -// TeehouseApiRoutesCvmsPreflightAvailableOSImageVersion0 defines model for . -type TeehouseApiRoutesCvmsPreflightAvailableOSImageVersion0 = []interface{} - -// TeehouseApiRoutesCvmsPreflightAvailableOSImageVersion1 defines model for . -type TeehouseApiRoutesCvmsPreflightAvailableOSImageVersion1 = []interface{} - -// TeehouseApiRoutesCvmsPreflightAvailableOSImage_Version defines model for TeehouseApiRoutesCvmsPreflightAvailableOSImage.Version. -type TeehouseApiRoutesCvmsPreflightAvailableOSImage_Version struct { - union json.RawMessage -} - -// ListDstackAppsApiV1AppsGetParams defines parameters for ListDstackAppsApiV1AppsGet. -type ListDstackAppsApiV1AppsGetParams struct { - // Page Page number (1-indexed) - Page *int `form:"page,omitempty" json:"page,omitempty"` - - // PageSize Items per page - PageSize *int `form:"page_size,omitempty" json:"page_size,omitempty"` - - // Search Search name, app_id, vm_uuid, instance_id - Search *string `form:"search,omitempty" json:"search,omitempty"` - - // Status CVM status filter - Status *[]string `form:"status,omitempty" json:"status,omitempty"` - - // Listed Listed status filter - Listed *bool `form:"listed,omitempty" json:"listed,omitempty"` - - // BaseImage OS image name filter - BaseImage *string `form:"base_image,omitempty" json:"base_image,omitempty"` - - // InstanceType Instance type filter - InstanceType *string `form:"instance_type,omitempty" json:"instance_type,omitempty"` - - // KmsSlug KMS slug filter - KmsSlug *string `form:"kms_slug,omitempty" json:"kms_slug,omitempty"` - - // KmsType KMS type filter - KmsType *string `form:"kms_type,omitempty" json:"kms_type,omitempty"` - - // Node Node name filter (matches teepod or node name) - Node *string `form:"node,omitempty" json:"node,omitempty"` - - // Region Region identifier filter - Region *string `form:"region,omitempty" json:"region,omitempty"` -} - -// GetAppEventsApiV1AppsAppIdEventsGetParams defines parameters for GetAppEventsApiV1AppsAppIdEventsGet. -type GetAppEventsApiV1AppsAppIdEventsGetParams struct { - // Limit Max events to return - Limit *int `form:"limit,omitempty" json:"limit,omitempty"` - - // EventType Filter by event type - EventType *string `form:"event_type,omitempty" json:"event_type,omitempty"` - - // InstanceId Filter by instance UUID - InstanceId *string `form:"instance_id,omitempty" json:"instance_id,omitempty"` - - // OperationType Filter by operation type - OperationType *string `form:"operation_type,omitempty" json:"operation_type,omitempty"` - - // StartDate Start date (ISO 8601) - StartDate *string `form:"start_date,omitempty" json:"start_date,omitempty"` - - // EndDate End date (ISO 8601) - EndDate *string `form:"end_date,omitempty" json:"end_date,omitempty"` -} - -// GetAppRevisionsApiV1AppsAppIdRevisionsGetParams defines parameters for GetAppRevisionsApiV1AppsAppIdRevisionsGet. -type GetAppRevisionsApiV1AppsAppIdRevisionsGetParams struct { - // Page Page number (1-indexed) - Page *int `form:"page,omitempty" json:"page,omitempty"` - - // PageSize Items per page - PageSize *int `form:"page_size,omitempty" json:"page_size,omitempty"` -} - -// GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetParams defines parameters for GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGet. -type GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetParams struct { - // RawComposeFile Return compose_file as string instead of dict - RawComposeFile *bool `form:"raw_compose_file,omitempty" json:"raw_compose_file,omitempty"` -} - -// RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostParams defines parameters for RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPost. -type RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostParams struct { - // TransactionHash Optional transaction hash proving on-chain compose hash registration - TransactionHash *string `form:"transaction_hash,omitempty" json:"transaction_hash,omitempty"` -} - -// GetAppUsageApiV1AppsAppIdUsageGetParams defines parameters for GetAppUsageApiV1AppsAppIdUsageGet. -type GetAppUsageApiV1AppsAppIdUsageGetParams struct { - // StartDate Start date (ISO 8601) - StartDate *time.Time `form:"start_date,omitempty" json:"start_date,omitempty"` - - // EndDate End date (ISO 8601) - EndDate *time.Time `form:"end_date,omitempty" json:"end_date,omitempty"` - - // Limit Max records to return - Limit *int `form:"limit,omitempty" json:"limit,omitempty"` - - // Offset Records to skip - Offset *int `form:"offset,omitempty" json:"offset,omitempty"` -} - -// HandleListRecentApiV1AttestationsRecentGetParams defines parameters for HandleListRecentApiV1AttestationsRecentGet. -type HandleListRecentApiV1AttestationsRecentGetParams struct { - // Skip Offset for pagination - Skip *int `form:"skip,omitempty" json:"skip,omitempty"` - - // Limit Max results - Limit *int `form:"limit,omitempty" json:"limit,omitempty"` -} - -// DecodeLinkTokenApiV1AuthDecodeLinkTokenGetParams defines parameters for DecodeLinkTokenApiV1AuthDecodeLinkTokenGet. -type DecodeLinkTokenApiV1AuthDecodeLinkTokenGetParams struct { - Token string `form:"token" json:"token"` -} - -// GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetParams defines parameters for GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGet. -type GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetParams struct { - ReturnUrl *string `form:"returnUrl,omitempty" json:"returnUrl,omitempty"` - Invite *string `form:"invite,omitempty" json:"invite,omitempty"` - Mode *string `form:"mode,omitempty" json:"mode,omitempty"` -} - -// GithubOauthCallbackApiV1AuthOauthGithubCallbackGetParams defines parameters for GithubOauthCallbackApiV1AuthOauthGithubCallbackGet. -type GithubOauthCallbackApiV1AuthOauthGithubCallbackGetParams struct { - Code *string `form:"code,omitempty" json:"code,omitempty"` - State *string `form:"state,omitempty" json:"state,omitempty"` - Error *string `form:"error,omitempty" json:"error,omitempty"` - ErrorDescription *string `form:"error_description,omitempty" json:"error_description,omitempty"` -} - -// GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetParams defines parameters for GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGet. -type GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetParams struct { - ReturnUrl *string `form:"returnUrl,omitempty" json:"returnUrl,omitempty"` - Invite *string `form:"invite,omitempty" json:"invite,omitempty"` - Mode *string `form:"mode,omitempty" json:"mode,omitempty"` -} - -// GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetParams defines parameters for GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGet. -type GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetParams struct { - Code string `form:"code" json:"code"` - State *string `form:"state,omitempty" json:"state,omitempty"` -} - -// RevokeAllSessionsApiV1AuthSessionsDeleteParams defines parameters for RevokeAllSessionsApiV1AuthSessionsDelete. -type RevokeAllSessionsApiV1AuthSessionsDeleteParams struct { - RevokeCurrent *bool `form:"revoke_current,omitempty" json:"revoke_current,omitempty"` -} - -// ValidateResetTokenApiV1AuthValidateResetTokenGetParams defines parameters for ValidateResetTokenApiV1AuthValidateResetTokenGet. -type ValidateResetTokenApiV1AuthValidateResetTokenGetParams struct { - Token string `form:"token" json:"token"` -} - -// HandleListCvmsApiV1CvmsGetParams defines parameters for HandleListCvmsApiV1CvmsGet. -type HandleListCvmsApiV1CvmsGetParams struct { - // UserId Filter by owner (admin only). Use '0' for unassigned. - UserId *struct { - union json.RawMessage - } `form:"user_id,omitempty" json:"user_id,omitempty"` - - // TeepodId Filter by node ID (admin only) - TeepodId *int `form:"teepod_id,omitempty" json:"teepod_id,omitempty"` -} - -// HandleListCvmsApiV1CvmsGetParamsUserId0 defines parameters for HandleListCvmsApiV1CvmsGet. -type HandleListCvmsApiV1CvmsGetParamsUserId0 = string - -// HandleListCvmsApiV1CvmsGetParamsUserId1 defines parameters for HandleListCvmsApiV1CvmsGet. -type HandleListCvmsApiV1CvmsGetParamsUserId1 = string - -// HandleListCvmsPaginatedApiV1CvmsPaginatedGetParams defines parameters for HandleListCvmsPaginatedApiV1CvmsPaginatedGet. -type HandleListCvmsPaginatedApiV1CvmsPaginatedGetParams struct { - // UserId Filter by owner (admin only). Use '0' for unassigned. - UserId *struct { - union json.RawMessage - } `form:"user_id,omitempty" json:"user_id,omitempty"` - - // TeepodId Filter by node ID (admin only) - TeepodId *int `form:"teepod_id,omitempty" json:"teepod_id,omitempty"` - - // Page Page number (1-indexed) - Page *int `form:"page,omitempty" json:"page,omitempty"` - - // PageSize Items per page (max 100) - PageSize *int `form:"page_size,omitempty" json:"page_size,omitempty"` -} - -// HandleListCvmsPaginatedApiV1CvmsPaginatedGetParamsUserId0 defines parameters for HandleListCvmsPaginatedApiV1CvmsPaginatedGet. -type HandleListCvmsPaginatedApiV1CvmsPaginatedGetParamsUserId0 = string - -// HandleListCvmsPaginatedApiV1CvmsPaginatedGetParamsUserId1 defines parameters for HandleListCvmsPaginatedApiV1CvmsPaginatedGet. -type HandleListCvmsPaginatedApiV1CvmsPaginatedGetParamsUserId1 = string - -// HandleRemoveCvmApiV1CvmsCvmIdDeleteParams defines parameters for HandleRemoveCvmApiV1CvmsCvmIdDelete. -type HandleRemoveCvmApiV1CvmsCvmIdDeleteParams struct { - // Polling Polling version for task routing - Polling *HandleRemoveCvmApiV1CvmsCvmIdDeleteParamsPolling `form:"polling,omitempty" json:"polling,omitempty"` -} - -// HandleRemoveCvmApiV1CvmsCvmIdDeleteParamsPolling defines parameters for HandleRemoveCvmApiV1CvmsCvmIdDelete. -type HandleRemoveCvmApiV1CvmsCvmIdDeleteParamsPolling string - -// GetCvmComposeFileApiV1CvmsCvmIdComposeFileGetParams defines parameters for GetCvmComposeFileApiV1CvmsCvmIdComposeFileGet. -type GetCvmComposeFileApiV1CvmsCvmIdComposeFileGetParams struct { - Raw *string `form:"raw,omitempty" json:"raw,omitempty"` -} - -// UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchParams defines parameters for UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatch. -type UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchParams struct { - // XComposeHash Compose hash from Phase 1 response - XComposeHash *string `json:"X-Compose-Hash,omitempty"` - - // XTransactionHash Transaction hash proving on-chain registration - XTransactionHash *string `json:"X-Transaction-Hash,omitempty"` -} - -// GetCvmOperationsApiV1CvmsCvmIdOperationsGetParams defines parameters for GetCvmOperationsApiV1CvmsCvmIdOperationsGet. -type GetCvmOperationsApiV1CvmsCvmIdOperationsGetParams struct { - // Cursor Opaque cursor from previous response - Cursor *string `form:"cursor,omitempty" json:"cursor,omitempty"` - - // Limit Page size - Limit *int `form:"limit,omitempty" json:"limit,omitempty"` - - // StartTime Include operations started after this UTC time - StartTime *time.Time `form:"start_time,omitempty" json:"start_time,omitempty"` - - // EndTime Include operations started before this UTC time - EndTime *time.Time `form:"end_time,omitempty" json:"end_time,omitempty"` - - // OperationTypes Filter by operation types (e.g. compose_update, power_on) - OperationTypes *[]string `form:"operation_types,omitempty" json:"operation_types,omitempty"` -} - -// UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchParams defines parameters for UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatch. -type UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchParams struct { - // XComposeHash Compose hash from Phase 1 response - XComposeHash *string `json:"X-Compose-Hash,omitempty"` - - // XTransactionHash Transaction hash proving on-chain registration - XTransactionHash *string `json:"X-Transaction-Hash,omitempty"` -} - -// HandleResizeCvmApiV1CvmsCvmIdResourcesPatchParams defines parameters for HandleResizeCvmApiV1CvmsCvmIdResourcesPatch. -type HandleResizeCvmApiV1CvmsCvmIdResourcesPatchParams struct { - // Polling Polling version for task routing - Polling *HandleResizeCvmApiV1CvmsCvmIdResourcesPatchParamsPolling `form:"polling,omitempty" json:"polling,omitempty"` -} - -// HandleResizeCvmApiV1CvmsCvmIdResourcesPatchParamsPolling defines parameters for HandleResizeCvmApiV1CvmsCvmIdResourcesPatch. -type HandleResizeCvmApiV1CvmsCvmIdResourcesPatchParamsPolling string - -// RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostParams defines parameters for RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPost. -type RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostParams struct { - // TransactionHash Optional transaction hash proving on-chain compose hash registration - TransactionHash *string `form:"transaction_hash,omitempty" json:"transaction_hash,omitempty"` -} - -// HandleGetCvmStateApiV1CvmsCvmIdStateGetParams defines parameters for HandleGetCvmStateApiV1CvmsCvmIdStateGet. -type HandleGetCvmStateApiV1CvmsCvmIdStateGetParams struct { - // Target Target status to wait for. If specified, returns SSE stream. - Target *string `form:"target,omitempty" json:"target,omitempty"` - - // Interval Polling interval in seconds (5-30) - Interval *int `form:"interval,omitempty" json:"interval,omitempty"` - - // Timeout Maximum wait time in seconds (10-600) - Timeout *int `form:"timeout,omitempty" json:"timeout,omitempty"` -} - -// ListKmsApiV1KmsGetParams defines parameters for ListKmsApiV1KmsGet. -type ListKmsApiV1KmsGetParams struct { - // Page Page number (1-indexed) - Page *int `form:"page,omitempty" json:"page,omitempty"` - - // PageSize Items per page (1-100) - PageSize *int `form:"page_size,omitempty" json:"page_size,omitempty"` - - // IsOnchain Filter: true=onchain only, false=offchain only, omit=all - IsOnchain *bool `form:"is_onchain,omitempty" json:"is_onchain,omitempty"` -} - -// GetNextAppIdApiV1KmsPhalaNextAppIdGetParams defines parameters for GetNextAppIdApiV1KmsPhalaNextAppIdGet. -type GetNextAppIdApiV1KmsPhalaNextAppIdGetParams struct { - // Counts Number of app IDs to predict (1-20) - Counts *int `form:"counts,omitempty" json:"counts,omitempty"` -} - -// UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchParams defines parameters for UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatch. -type UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchParams struct { - // Active True to enable, false to disable - Active bool `form:"active" json:"active"` -} - -// GetDailyUsageApiV1RedpillUsageDailyGetParams defines parameters for GetDailyUsageApiV1RedpillUsageDailyGet. -type GetDailyUsageApiV1RedpillUsageDailyGetParams struct { - // KeyId Filter by API key ID - KeyId *int `form:"key_id,omitempty" json:"key_id,omitempty"` - - // StartDate Start date (ISO 8601) - StartDate *string `form:"start_date,omitempty" json:"start_date,omitempty"` - - // EndDate End date (ISO 8601) - EndDate *string `form:"end_date,omitempty" json:"end_date,omitempty"` -} - -// GetUsageLogsApiV1RedpillUsageLogsGetParams defines parameters for GetUsageLogsApiV1RedpillUsageLogsGet. -type GetUsageLogsApiV1RedpillUsageLogsGetParams struct { - // KeyId Filter by API key ID - KeyId *int `form:"key_id,omitempty" json:"key_id,omitempty"` - - // StartDate Start date (ISO 8601) - StartDate *string `form:"start_date,omitempty" json:"start_date,omitempty"` - - // EndDate End date (ISO 8601) - EndDate *string `form:"end_date,omitempty" json:"end_date,omitempty"` - - // Page Page number - Page *int `form:"page,omitempty" json:"page,omitempty"` - - // PageSize Items per page - PageSize *int `form:"page_size,omitempty" json:"page_size,omitempty"` -} - -// ListTeepodsApiV1TeepodsGetParams defines parameters for ListTeepodsApiV1TeepodsGet. -type ListTeepodsApiV1TeepodsGetParams struct { - // Enabled Filter by enabled status (admin only) - Enabled *bool `form:"enabled,omitempty" json:"enabled,omitempty"` -} - -// HandleGetAvailableTeepodsApiV1TeepodsAvailableGetParams defines parameters for HandleGetAvailableTeepodsApiV1TeepodsAvailableGet. -type HandleGetAvailableTeepodsApiV1TeepodsAvailableGetParams struct { - // V03xOnly Only return dstack v0.3.x nodes - V03xOnly *string `form:"v03x_only,omitempty" json:"v03x_only,omitempty"` -} - -// HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostJSONRequestBody defines body for HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPost for application/json ContentType. -type HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostJSONRequestBody = TeehouseApiRoutesAppsSchemasReplicateRequest - -// RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostJSONRequestBody defines body for RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPost for application/json ContentType. -type RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostJSONRequestBody = RedeployRevisionRequest - -// HandleUploadAndVerifyApiV1AttestationsVerifyPostMultipartRequestBody defines body for HandleUploadAndVerifyApiV1AttestationsVerifyPost for multipart/form-data ContentType. -type HandleUploadAndVerifyApiV1AttestationsVerifyPostMultipartRequestBody = BodyHandleUploadAndVerifyApiV1AttestationsVerifyPost - -// Confirm2faSetupEndpointApiV1Auth2faConfirmPostJSONRequestBody defines body for Confirm2faSetupEndpointApiV1Auth2faConfirmPost for application/json ContentType. -type Confirm2faSetupEndpointApiV1Auth2faConfirmPostJSONRequestBody = TwoFactorSetupRequest - -// Disable2faEndpointApiV1Auth2faDisablePostJSONRequestBody defines body for Disable2faEndpointApiV1Auth2faDisablePost for application/json ContentType. -type Disable2faEndpointApiV1Auth2faDisablePostJSONRequestBody = TwoFactorDisableRequest - -// RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostJSONRequestBody defines body for RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPost for application/json ContentType. -type RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostJSONRequestBody = TwoFactorRegenerateRequest - -// Verify2faEndpointApiV1Auth2faVerifyPostJSONRequestBody defines body for Verify2faEndpointApiV1Auth2faVerifyPost for application/json ContentType. -type Verify2faEndpointApiV1Auth2faVerifyPostJSONRequestBody = TwoFactorVerificationRequest - -// Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostJSONRequestBody defines body for Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePost for application/json ContentType. -type Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostJSONRequestBody = TwoFactorPageVerifyRequest - -// ApiChangeEmailApiV1AuthChangeEmailPostJSONRequestBody defines body for ApiChangeEmailApiV1AuthChangeEmailPost for application/json ContentType. -type ApiChangeEmailApiV1AuthChangeEmailPostJSONRequestBody = WrappedChangeEmailRequest - -// AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostJSONRequestBody defines body for AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePost for application/json ContentType. -type AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostJSONRequestBody = DeviceAuthorizeRequest - -// RequestDeviceCodeApiV1AuthDeviceCodePostJSONRequestBody defines body for RequestDeviceCodeApiV1AuthDeviceCodePost for application/json ContentType. -type RequestDeviceCodeApiV1AuthDeviceCodePostJSONRequestBody = DeviceCodeRequest - -// PollDeviceTokenApiV1AuthDeviceTokenPostJSONRequestBody defines body for PollDeviceTokenApiV1AuthDeviceTokenPost for application/json ContentType. -type PollDeviceTokenApiV1AuthDeviceTokenPostJSONRequestBody = DeviceTokenRequest - -// ForgotPasswordApiV1AuthForgotPasswordPostJSONRequestBody defines body for ForgotPasswordApiV1AuthForgotPasswordPost for application/json ContentType. -type ForgotPasswordApiV1AuthForgotPasswordPostJSONRequestBody = PasswordResetRequest - -// LoginWithCookieApiV1AuthLoginPostFormdataRequestBody defines body for LoginWithCookieApiV1AuthLoginPost for application/x-www-form-urlencoded ContentType. -type LoginWithCookieApiV1AuthLoginPostFormdataRequestBody = BodyLoginWithCookieApiV1AuthLoginPost - -// LoginWith2faApiV1AuthLoginWith2faPostJSONRequestBody defines body for LoginWith2faApiV1AuthLoginWith2faPost for application/json ContentType. -type LoginWith2faApiV1AuthLoginWith2faPostJSONRequestBody = LoginRequest - -// HandleUpdatePasswordApiV1AuthPasswordPostJSONRequestBody defines body for HandleUpdatePasswordApiV1AuthPasswordPost for application/json ContentType. -type HandleUpdatePasswordApiV1AuthPasswordPostJSONRequestBody = UpdatePasswordRequest - -// RegisterUserApiV1AuthRegisterPostJSONRequestBody defines body for RegisterUserApiV1AuthRegisterPost for application/json ContentType. -type RegisterUserApiV1AuthRegisterPostJSONRequestBody = RegisterPayload - -// ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostJSONRequestBody defines body for ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPost for application/json ContentType. -type ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostJSONRequestBody = WrappedEmailVerificationRequest - -// HandleResetPasswordWithTokenApiV1AuthResetPasswordPutJSONRequestBody defines body for HandleResetPasswordWithTokenApiV1AuthResetPasswordPut for application/json ContentType. -type HandleResetPasswordWithTokenApiV1AuthResetPasswordPutJSONRequestBody = ResetPasswordWithToken - -// VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostJSONRequestBody defines body for VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPost for application/json ContentType. -type VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostJSONRequestBody = StepUpVerifyRequest - -// LoginForAccessTokenApiV1AuthTokenPostFormdataRequestBody defines body for LoginForAccessTokenApiV1AuthTokenPost for application/x-www-form-urlencoded ContentType. -type LoginForAccessTokenApiV1AuthTokenPostFormdataRequestBody = BodyLoginForAccessTokenApiV1AuthTokenPost - -// HandleUpdateUsernameApiV1AuthUsernamePutJSONRequestBody defines body for HandleUpdateUsernameApiV1AuthUsernamePut for application/json ContentType. -type HandleUpdateUsernameApiV1AuthUsernamePutJSONRequestBody = UpdateUsernameRequest - -// VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostJSONRequestBody defines body for VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPost for application/json ContentType. -type VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostJSONRequestBody = VerifyAndLinkOAuthRequest - -// ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostJSONRequestBody defines body for ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPost for application/json ContentType. -type ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostJSONRequestBody = BodyApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPost - -// HandleCreateCvmFromPovisionApiV1CvmsPostJSONRequestBody defines body for HandleCreateCvmFromPovisionApiV1CvmsPost for application/json ContentType. -type HandleCreateCvmFromPovisionApiV1CvmsPostJSONRequestBody = CreateTappRequest - -// HandleBatchStopCvmsApiV1CvmsBatchStopPostJSONRequestBody defines body for HandleBatchStopCvmsApiV1CvmsBatchStopPost for application/json ContentType. -type HandleBatchStopCvmsApiV1CvmsBatchStopPostJSONRequestBody = BatchStopRequest - -// HandleCreateElizaFromProvisionApiV1CvmsElizaPostJSONRequestBody defines body for HandleCreateElizaFromProvisionApiV1CvmsElizaPost for application/json ContentType. -type HandleCreateElizaFromProvisionApiV1CvmsElizaPostJSONRequestBody = CreateTappRequest - -// HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostJSONRequestBody defines body for HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPost for application/json ContentType. -type HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostJSONRequestBody = VMCreateWithTeepod - -// HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchJSONRequestBody defines body for HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatch for application/json ContentType. -type HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchJSONRequestBody = BatchInstanceIdRefreshRequest - -// HandleProvisionCvmApiV1CvmsProvisionPostJSONRequestBody defines body for HandleProvisionCvmApiV1CvmsProvisionPost for application/json ContentType. -type HandleProvisionCvmApiV1CvmsProvisionPostJSONRequestBody = ProvisionDstackAppRequestV2 - -// HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostJSONRequestBody defines body for HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPost for application/json ContentType. -type HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostJSONRequestBody = ProvisionElizaRequest - -// HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostJSONRequestBody defines body for HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPost for application/json ContentType. -type HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostJSONRequestBody = VMCreateWithTeepod - -// HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostJSONRequestBody defines body for HandleCreateCvmForWorkloadApiV1CvmsWorkloadPost for application/json ContentType. -type HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostJSONRequestBody = CreateWorkloadTappRequest - -// HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchJSONRequestBody defines body for HandlePatchCvmComposeApiV1CvmsCvmIdComposePatch for application/json ContentType. -type HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchJSONRequestBody = ComposeFilePatchRequest - -// HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutJSONRequestBody defines body for HandleUpdateCvmComposeApiV1CvmsCvmIdComposePut for application/json ContentType. -type HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutJSONRequestBody = CvmUpgradePayload - -// TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchJSONRequestBody defines body for TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatch for application/json ContentType. -type TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchJSONRequestBody = BodyTriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatch - -// SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostJSONRequestBody defines body for SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePost for application/json ContentType. -type SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostJSONRequestBody = ComposeFileUpdateRequest - -// ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostJSONRequestBody defines body for ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPost for application/json ContentType. -type ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostJSONRequestBody = ProvisionComposeFileUpdateRequest - -// DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostJSONRequestBody defines body for DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePost for application/json ContentType. -type DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostJSONRequestBody = DiagnoseDomainsRequest - -// UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchMultipartRequestBody defines body for UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatch for multipart/form-data ContentType. -type UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchMultipartRequestBody = BodyUpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatch - -// UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchJSONRequestBody defines body for UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatch for application/json ContentType. -type UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchJSONRequestBody = BodyUpdateCvmEnvsApiV1CvmsCvmIdEnvsPatch - -// HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchJSONRequestBody defines body for HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatch for application/json ContentType. -type HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchJSONRequestBody = InstanceIdRefreshRequest - -// HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchJSONRequestBody defines body for HandleUpdateCvmListedApiV1CvmsCvmIdListedPatch for application/json ContentType. -type HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchJSONRequestBody = BodyHandleUpdateCvmListedApiV1CvmsCvmIdListedPatch - -// HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchJSONRequestBody defines body for HandleUpdateCvmNameApiV1CvmsCvmIdNamePatch for application/json ContentType. -type HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchJSONRequestBody = BodyHandleUpdateCvmNameApiV1CvmsCvmIdNamePatch - -// UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchJSONRequestBody defines body for UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatch for application/json ContentType. -type UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchJSONRequestBody = BodyUpdateCvmOsImageApiV1CvmsCvmIdOsImagePatch - -// UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchMultipartRequestBody defines body for UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatch for multipart/form-data ContentType. -type UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchMultipartRequestBody = BodyUpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatch - -// HandleReplicateCvmApiV1CvmsCvmIdReplicasPostJSONRequestBody defines body for HandleReplicateCvmApiV1CvmsCvmIdReplicasPost for application/json ContentType. -type HandleReplicateCvmApiV1CvmsCvmIdReplicasPostJSONRequestBody = TeehouseApiRoutesCvmsDeploymentReplicateRequest - -// HandleResizeCvmApiV1CvmsCvmIdResourcesPatchJSONRequestBody defines body for HandleResizeCvmApiV1CvmsCvmIdResourcesPatch for application/json ContentType. -type HandleResizeCvmApiV1CvmsCvmIdResourcesPatchJSONRequestBody = CvmResizePayload - -// HandleRestartCvmApiV1CvmsCvmIdRestartPostJSONRequestBody defines body for HandleRestartCvmApiV1CvmsCvmIdRestartPost for application/json ContentType. -type HandleRestartCvmApiV1CvmsCvmIdRestartPostJSONRequestBody = BodyHandleRestartCvmApiV1CvmsCvmIdRestartPost - -// HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchJSONRequestBody defines body for HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatch for application/json ContentType. -type HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchJSONRequestBody = BodyHandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatch - -// HandleShutdownCvmApiV1CvmsCvmIdShutdownPostJSONRequestBody defines body for HandleShutdownCvmApiV1CvmsCvmIdShutdownPost for application/json ContentType. -type HandleShutdownCvmApiV1CvmsCvmIdShutdownPostJSONRequestBody = BodyHandleShutdownCvmApiV1CvmsCvmIdShutdownPost - -// HandleStartCvmApiV1CvmsCvmIdStartPostJSONRequestBody defines body for HandleStartCvmApiV1CvmsCvmIdStartPost for application/json ContentType. -type HandleStartCvmApiV1CvmsCvmIdStartPostJSONRequestBody = BodyHandleStartCvmApiV1CvmsCvmIdStartPost - -// HandleStopCvmApiV1CvmsCvmIdStopPostJSONRequestBody defines body for HandleStopCvmApiV1CvmsCvmIdStopPost for application/json ContentType. -type HandleStopCvmApiV1CvmsCvmIdStopPostJSONRequestBody = BodyHandleStopCvmApiV1CvmsCvmIdStopPost - -// HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchJSONRequestBody defines body for HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatch for application/json ContentType. -type HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchJSONRequestBody = BodyHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatch - -// CreateRedpillApiKeyApiV1RedpillApiKeysPostJSONRequestBody defines body for CreateRedpillApiKeyApiV1RedpillApiKeysPost for application/json ContentType. -type CreateRedpillApiKeyApiV1RedpillApiKeysPostJSONRequestBody = RedpillApiKeyCreate - -// HandleBatchCvmStatusApiV1StatusBatchPostJSONRequestBody defines body for HandleBatchCvmStatusApiV1StatusBatchPost for application/json ContentType. -type HandleBatchCvmStatusApiV1StatusBatchPostJSONRequestBody = BatchStatusRequest - -// AsAppComposeV2StorageFs0 returns the union data inside the AppComposeV2_StorageFs as a AppComposeV2StorageFs0 -func (t AppComposeV2_StorageFs) AsAppComposeV2StorageFs0() (AppComposeV2StorageFs0, error) { - var body AppComposeV2StorageFs0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAppComposeV2StorageFs0 overwrites any union data inside the AppComposeV2_StorageFs as the provided AppComposeV2StorageFs0 -func (t *AppComposeV2_StorageFs) FromAppComposeV2StorageFs0(v AppComposeV2StorageFs0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAppComposeV2StorageFs0 performs a merge with any union data inside the AppComposeV2_StorageFs, using the provided AppComposeV2StorageFs0 -func (t *AppComposeV2_StorageFs) MergeAppComposeV2StorageFs0(v AppComposeV2StorageFs0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAppComposeV2StorageFs1 returns the union data inside the AppComposeV2_StorageFs as a AppComposeV2StorageFs1 -func (t AppComposeV2_StorageFs) AsAppComposeV2StorageFs1() (AppComposeV2StorageFs1, error) { - var body AppComposeV2StorageFs1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAppComposeV2StorageFs1 overwrites any union data inside the AppComposeV2_StorageFs as the provided AppComposeV2StorageFs1 -func (t *AppComposeV2_StorageFs) FromAppComposeV2StorageFs1(v AppComposeV2StorageFs1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAppComposeV2StorageFs1 performs a merge with any union data inside the AppComposeV2_StorageFs, using the provided AppComposeV2StorageFs1 -func (t *AppComposeV2_StorageFs) MergeAppComposeV2StorageFs1(v AppComposeV2StorageFs1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t AppComposeV2_StorageFs) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *AppComposeV2_StorageFs) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsAppRevisionDetailResponseComposeFile0 returns the union data inside the AppRevisionDetailResponse_ComposeFile as a AppRevisionDetailResponseComposeFile0 -func (t AppRevisionDetailResponse_ComposeFile) AsAppRevisionDetailResponseComposeFile0() (AppRevisionDetailResponseComposeFile0, error) { - var body AppRevisionDetailResponseComposeFile0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAppRevisionDetailResponseComposeFile0 overwrites any union data inside the AppRevisionDetailResponse_ComposeFile as the provided AppRevisionDetailResponseComposeFile0 -func (t *AppRevisionDetailResponse_ComposeFile) FromAppRevisionDetailResponseComposeFile0(v AppRevisionDetailResponseComposeFile0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAppRevisionDetailResponseComposeFile0 performs a merge with any union data inside the AppRevisionDetailResponse_ComposeFile, using the provided AppRevisionDetailResponseComposeFile0 -func (t *AppRevisionDetailResponse_ComposeFile) MergeAppRevisionDetailResponseComposeFile0(v AppRevisionDetailResponseComposeFile0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAppRevisionDetailResponseComposeFile1 returns the union data inside the AppRevisionDetailResponse_ComposeFile as a AppRevisionDetailResponseComposeFile1 -func (t AppRevisionDetailResponse_ComposeFile) AsAppRevisionDetailResponseComposeFile1() (AppRevisionDetailResponseComposeFile1, error) { - var body AppRevisionDetailResponseComposeFile1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAppRevisionDetailResponseComposeFile1 overwrites any union data inside the AppRevisionDetailResponse_ComposeFile as the provided AppRevisionDetailResponseComposeFile1 -func (t *AppRevisionDetailResponse_ComposeFile) FromAppRevisionDetailResponseComposeFile1(v AppRevisionDetailResponseComposeFile1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAppRevisionDetailResponseComposeFile1 performs a merge with any union data inside the AppRevisionDetailResponse_ComposeFile, using the provided AppRevisionDetailResponseComposeFile1 -func (t *AppRevisionDetailResponse_ComposeFile) MergeAppRevisionDetailResponseComposeFile1(v AppRevisionDetailResponseComposeFile1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t AppRevisionDetailResponse_ComposeFile) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *AppRevisionDetailResponse_ComposeFile) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsCVMInfoDetailComposeFile0 returns the union data inside the CVMInfoDetail_ComposeFile as a CVMInfoDetailComposeFile0 -func (t CVMInfoDetail_ComposeFile) AsCVMInfoDetailComposeFile0() (CVMInfoDetailComposeFile0, error) { - var body CVMInfoDetailComposeFile0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromCVMInfoDetailComposeFile0 overwrites any union data inside the CVMInfoDetail_ComposeFile as the provided CVMInfoDetailComposeFile0 -func (t *CVMInfoDetail_ComposeFile) FromCVMInfoDetailComposeFile0(v CVMInfoDetailComposeFile0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeCVMInfoDetailComposeFile0 performs a merge with any union data inside the CVMInfoDetail_ComposeFile, using the provided CVMInfoDetailComposeFile0 -func (t *CVMInfoDetail_ComposeFile) MergeCVMInfoDetailComposeFile0(v CVMInfoDetailComposeFile0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsCVMInfoDetailComposeFile1 returns the union data inside the CVMInfoDetail_ComposeFile as a CVMInfoDetailComposeFile1 -func (t CVMInfoDetail_ComposeFile) AsCVMInfoDetailComposeFile1() (CVMInfoDetailComposeFile1, error) { - var body CVMInfoDetailComposeFile1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromCVMInfoDetailComposeFile1 overwrites any union data inside the CVMInfoDetail_ComposeFile as the provided CVMInfoDetailComposeFile1 -func (t *CVMInfoDetail_ComposeFile) FromCVMInfoDetailComposeFile1(v CVMInfoDetailComposeFile1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeCVMInfoDetailComposeFile1 performs a merge with any union data inside the CVMInfoDetail_ComposeFile, using the provided CVMInfoDetailComposeFile1 -func (t *CVMInfoDetail_ComposeFile) MergeCVMInfoDetailComposeFile1(v CVMInfoDetailComposeFile1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t CVMInfoDetail_ComposeFile) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *CVMInfoDetail_ComposeFile) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsGpuConfigAttachMode0 returns the union data inside the GpuConfig_AttachMode as a GpuConfigAttachMode0 -func (t GpuConfig_AttachMode) AsGpuConfigAttachMode0() (GpuConfigAttachMode0, error) { - var body GpuConfigAttachMode0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromGpuConfigAttachMode0 overwrites any union data inside the GpuConfig_AttachMode as the provided GpuConfigAttachMode0 -func (t *GpuConfig_AttachMode) FromGpuConfigAttachMode0(v GpuConfigAttachMode0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeGpuConfigAttachMode0 performs a merge with any union data inside the GpuConfig_AttachMode, using the provided GpuConfigAttachMode0 -func (t *GpuConfig_AttachMode) MergeGpuConfigAttachMode0(v GpuConfigAttachMode0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsGpuConfigAttachMode1 returns the union data inside the GpuConfig_AttachMode as a GpuConfigAttachMode1 -func (t GpuConfig_AttachMode) AsGpuConfigAttachMode1() (GpuConfigAttachMode1, error) { - var body GpuConfigAttachMode1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromGpuConfigAttachMode1 overwrites any union data inside the GpuConfig_AttachMode as the provided GpuConfigAttachMode1 -func (t *GpuConfig_AttachMode) FromGpuConfigAttachMode1(v GpuConfigAttachMode1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeGpuConfigAttachMode1 performs a merge with any union data inside the GpuConfig_AttachMode, using the provided GpuConfigAttachMode1 -func (t *GpuConfig_AttachMode) MergeGpuConfigAttachMode1(v GpuConfigAttachMode1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t GpuConfig_AttachMode) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *GpuConfig_AttachMode) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsProvisionComposeFileUpdateRequestStorageFs0 returns the union data inside the ProvisionComposeFileUpdateRequest_StorageFs as a ProvisionComposeFileUpdateRequestStorageFs0 -func (t ProvisionComposeFileUpdateRequest_StorageFs) AsProvisionComposeFileUpdateRequestStorageFs0() (ProvisionComposeFileUpdateRequestStorageFs0, error) { - var body ProvisionComposeFileUpdateRequestStorageFs0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromProvisionComposeFileUpdateRequestStorageFs0 overwrites any union data inside the ProvisionComposeFileUpdateRequest_StorageFs as the provided ProvisionComposeFileUpdateRequestStorageFs0 -func (t *ProvisionComposeFileUpdateRequest_StorageFs) FromProvisionComposeFileUpdateRequestStorageFs0(v ProvisionComposeFileUpdateRequestStorageFs0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeProvisionComposeFileUpdateRequestStorageFs0 performs a merge with any union data inside the ProvisionComposeFileUpdateRequest_StorageFs, using the provided ProvisionComposeFileUpdateRequestStorageFs0 -func (t *ProvisionComposeFileUpdateRequest_StorageFs) MergeProvisionComposeFileUpdateRequestStorageFs0(v ProvisionComposeFileUpdateRequestStorageFs0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsProvisionComposeFileUpdateRequestStorageFs1 returns the union data inside the ProvisionComposeFileUpdateRequest_StorageFs as a ProvisionComposeFileUpdateRequestStorageFs1 -func (t ProvisionComposeFileUpdateRequest_StorageFs) AsProvisionComposeFileUpdateRequestStorageFs1() (ProvisionComposeFileUpdateRequestStorageFs1, error) { - var body ProvisionComposeFileUpdateRequestStorageFs1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromProvisionComposeFileUpdateRequestStorageFs1 overwrites any union data inside the ProvisionComposeFileUpdateRequest_StorageFs as the provided ProvisionComposeFileUpdateRequestStorageFs1 -func (t *ProvisionComposeFileUpdateRequest_StorageFs) FromProvisionComposeFileUpdateRequestStorageFs1(v ProvisionComposeFileUpdateRequestStorageFs1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeProvisionComposeFileUpdateRequestStorageFs1 performs a merge with any union data inside the ProvisionComposeFileUpdateRequest_StorageFs, using the provided ProvisionComposeFileUpdateRequestStorageFs1 -func (t *ProvisionComposeFileUpdateRequest_StorageFs) MergeProvisionComposeFileUpdateRequestStorageFs1(v ProvisionComposeFileUpdateRequestStorageFs1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t ProvisionComposeFileUpdateRequest_StorageFs) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *ProvisionComposeFileUpdateRequest_StorageFs) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsValidationErrorLoc0 returns the union data inside the ValidationError_Loc_Item as a ValidationErrorLoc0 -func (t ValidationError_Loc_Item) AsValidationErrorLoc0() (ValidationErrorLoc0, error) { - var body ValidationErrorLoc0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromValidationErrorLoc0 overwrites any union data inside the ValidationError_Loc_Item as the provided ValidationErrorLoc0 -func (t *ValidationError_Loc_Item) FromValidationErrorLoc0(v ValidationErrorLoc0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeValidationErrorLoc0 performs a merge with any union data inside the ValidationError_Loc_Item, using the provided ValidationErrorLoc0 -func (t *ValidationError_Loc_Item) MergeValidationErrorLoc0(v ValidationErrorLoc0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsValidationErrorLoc1 returns the union data inside the ValidationError_Loc_Item as a ValidationErrorLoc1 -func (t ValidationError_Loc_Item) AsValidationErrorLoc1() (ValidationErrorLoc1, error) { - var body ValidationErrorLoc1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromValidationErrorLoc1 overwrites any union data inside the ValidationError_Loc_Item as the provided ValidationErrorLoc1 -func (t *ValidationError_Loc_Item) FromValidationErrorLoc1(v ValidationErrorLoc1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeValidationErrorLoc1 performs a merge with any union data inside the ValidationError_Loc_Item, using the provided ValidationErrorLoc1 -func (t *ValidationError_Loc_Item) MergeValidationErrorLoc1(v ValidationErrorLoc1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t ValidationError_Loc_Item) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *ValidationError_Loc_Item) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsTeehouseApiRoutesAppsV20251028SchemasDstackAppFullResponse returns the union data inside the TeehouseApiRoutesAppsV20251028SchemasDstackAppListResponse_DstackApps_Item as a TeehouseApiRoutesAppsV20251028SchemasDstackAppFullResponse -func (t TeehouseApiRoutesAppsV20251028SchemasDstackAppListResponse_DstackApps_Item) AsTeehouseApiRoutesAppsV20251028SchemasDstackAppFullResponse() (TeehouseApiRoutesAppsV20251028SchemasDstackAppFullResponse, error) { - var body TeehouseApiRoutesAppsV20251028SchemasDstackAppFullResponse - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromTeehouseApiRoutesAppsV20251028SchemasDstackAppFullResponse overwrites any union data inside the TeehouseApiRoutesAppsV20251028SchemasDstackAppListResponse_DstackApps_Item as the provided TeehouseApiRoutesAppsV20251028SchemasDstackAppFullResponse -func (t *TeehouseApiRoutesAppsV20251028SchemasDstackAppListResponse_DstackApps_Item) FromTeehouseApiRoutesAppsV20251028SchemasDstackAppFullResponse(v TeehouseApiRoutesAppsV20251028SchemasDstackAppFullResponse) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeTeehouseApiRoutesAppsV20251028SchemasDstackAppFullResponse performs a merge with any union data inside the TeehouseApiRoutesAppsV20251028SchemasDstackAppListResponse_DstackApps_Item, using the provided TeehouseApiRoutesAppsV20251028SchemasDstackAppFullResponse -func (t *TeehouseApiRoutesAppsV20251028SchemasDstackAppListResponse_DstackApps_Item) MergeTeehouseApiRoutesAppsV20251028SchemasDstackAppFullResponse(v TeehouseApiRoutesAppsV20251028SchemasDstackAppFullResponse) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsDstackAppMinimalResponse returns the union data inside the TeehouseApiRoutesAppsV20251028SchemasDstackAppListResponse_DstackApps_Item as a DstackAppMinimalResponse -func (t TeehouseApiRoutesAppsV20251028SchemasDstackAppListResponse_DstackApps_Item) AsDstackAppMinimalResponse() (DstackAppMinimalResponse, error) { - var body DstackAppMinimalResponse - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromDstackAppMinimalResponse overwrites any union data inside the TeehouseApiRoutesAppsV20251028SchemasDstackAppListResponse_DstackApps_Item as the provided DstackAppMinimalResponse -func (t *TeehouseApiRoutesAppsV20251028SchemasDstackAppListResponse_DstackApps_Item) FromDstackAppMinimalResponse(v DstackAppMinimalResponse) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeDstackAppMinimalResponse performs a merge with any union data inside the TeehouseApiRoutesAppsV20251028SchemasDstackAppListResponse_DstackApps_Item, using the provided DstackAppMinimalResponse -func (t *TeehouseApiRoutesAppsV20251028SchemasDstackAppListResponse_DstackApps_Item) MergeDstackAppMinimalResponse(v DstackAppMinimalResponse) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t TeehouseApiRoutesAppsV20251028SchemasDstackAppListResponse_DstackApps_Item) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *TeehouseApiRoutesAppsV20251028SchemasDstackAppListResponse_DstackApps_Item) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsTeehouseApiRoutesAppsV20260121SchemasDstackAppFullResponse returns the union data inside the TeehouseApiRoutesAppsV20260121SchemasDstackAppListResponse_DstackApps_Item as a TeehouseApiRoutesAppsV20260121SchemasDstackAppFullResponse -func (t TeehouseApiRoutesAppsV20260121SchemasDstackAppListResponse_DstackApps_Item) AsTeehouseApiRoutesAppsV20260121SchemasDstackAppFullResponse() (TeehouseApiRoutesAppsV20260121SchemasDstackAppFullResponse, error) { - var body TeehouseApiRoutesAppsV20260121SchemasDstackAppFullResponse - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromTeehouseApiRoutesAppsV20260121SchemasDstackAppFullResponse overwrites any union data inside the TeehouseApiRoutesAppsV20260121SchemasDstackAppListResponse_DstackApps_Item as the provided TeehouseApiRoutesAppsV20260121SchemasDstackAppFullResponse -func (t *TeehouseApiRoutesAppsV20260121SchemasDstackAppListResponse_DstackApps_Item) FromTeehouseApiRoutesAppsV20260121SchemasDstackAppFullResponse(v TeehouseApiRoutesAppsV20260121SchemasDstackAppFullResponse) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeTeehouseApiRoutesAppsV20260121SchemasDstackAppFullResponse performs a merge with any union data inside the TeehouseApiRoutesAppsV20260121SchemasDstackAppListResponse_DstackApps_Item, using the provided TeehouseApiRoutesAppsV20260121SchemasDstackAppFullResponse -func (t *TeehouseApiRoutesAppsV20260121SchemasDstackAppListResponse_DstackApps_Item) MergeTeehouseApiRoutesAppsV20260121SchemasDstackAppFullResponse(v TeehouseApiRoutesAppsV20260121SchemasDstackAppFullResponse) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsDstackAppMinimalResponse returns the union data inside the TeehouseApiRoutesAppsV20260121SchemasDstackAppListResponse_DstackApps_Item as a DstackAppMinimalResponse -func (t TeehouseApiRoutesAppsV20260121SchemasDstackAppListResponse_DstackApps_Item) AsDstackAppMinimalResponse() (DstackAppMinimalResponse, error) { - var body DstackAppMinimalResponse - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromDstackAppMinimalResponse overwrites any union data inside the TeehouseApiRoutesAppsV20260121SchemasDstackAppListResponse_DstackApps_Item as the provided DstackAppMinimalResponse -func (t *TeehouseApiRoutesAppsV20260121SchemasDstackAppListResponse_DstackApps_Item) FromDstackAppMinimalResponse(v DstackAppMinimalResponse) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeDstackAppMinimalResponse performs a merge with any union data inside the TeehouseApiRoutesAppsV20260121SchemasDstackAppListResponse_DstackApps_Item, using the provided DstackAppMinimalResponse -func (t *TeehouseApiRoutesAppsV20260121SchemasDstackAppListResponse_DstackApps_Item) MergeDstackAppMinimalResponse(v DstackAppMinimalResponse) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t TeehouseApiRoutesAppsV20260121SchemasDstackAppListResponse_DstackApps_Item) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *TeehouseApiRoutesAppsV20260121SchemasDstackAppListResponse_DstackApps_Item) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsTeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion0 returns the union data inside the TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImage_Version as a TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion0 -func (t TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImage_Version) AsTeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion0() (TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion0, error) { - var body TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromTeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion0 overwrites any union data inside the TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImage_Version as the provided TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion0 -func (t *TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImage_Version) FromTeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion0(v TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeTeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion0 performs a merge with any union data inside the TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImage_Version, using the provided TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion0 -func (t *TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImage_Version) MergeTeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion0(v TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsTeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion1 returns the union data inside the TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImage_Version as a TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion1 -func (t TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImage_Version) AsTeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion1() (TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion1, error) { - var body TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromTeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion1 overwrites any union data inside the TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImage_Version as the provided TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion1 -func (t *TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImage_Version) FromTeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion1(v TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeTeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion1 performs a merge with any union data inside the TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImage_Version, using the provided TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion1 -func (t *TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImage_Version) MergeTeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion1(v TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImageVersion1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImage_Version) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImage_Version) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsTeehouseApiRoutesCvmsPreflightAvailableOSImageVersion0 returns the union data inside the TeehouseApiRoutesCvmsPreflightAvailableOSImage_Version as a TeehouseApiRoutesCvmsPreflightAvailableOSImageVersion0 -func (t TeehouseApiRoutesCvmsPreflightAvailableOSImage_Version) AsTeehouseApiRoutesCvmsPreflightAvailableOSImageVersion0() (TeehouseApiRoutesCvmsPreflightAvailableOSImageVersion0, error) { - var body TeehouseApiRoutesCvmsPreflightAvailableOSImageVersion0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromTeehouseApiRoutesCvmsPreflightAvailableOSImageVersion0 overwrites any union data inside the TeehouseApiRoutesCvmsPreflightAvailableOSImage_Version as the provided TeehouseApiRoutesCvmsPreflightAvailableOSImageVersion0 -func (t *TeehouseApiRoutesCvmsPreflightAvailableOSImage_Version) FromTeehouseApiRoutesCvmsPreflightAvailableOSImageVersion0(v TeehouseApiRoutesCvmsPreflightAvailableOSImageVersion0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeTeehouseApiRoutesCvmsPreflightAvailableOSImageVersion0 performs a merge with any union data inside the TeehouseApiRoutesCvmsPreflightAvailableOSImage_Version, using the provided TeehouseApiRoutesCvmsPreflightAvailableOSImageVersion0 -func (t *TeehouseApiRoutesCvmsPreflightAvailableOSImage_Version) MergeTeehouseApiRoutesCvmsPreflightAvailableOSImageVersion0(v TeehouseApiRoutesCvmsPreflightAvailableOSImageVersion0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsTeehouseApiRoutesCvmsPreflightAvailableOSImageVersion1 returns the union data inside the TeehouseApiRoutesCvmsPreflightAvailableOSImage_Version as a TeehouseApiRoutesCvmsPreflightAvailableOSImageVersion1 -func (t TeehouseApiRoutesCvmsPreflightAvailableOSImage_Version) AsTeehouseApiRoutesCvmsPreflightAvailableOSImageVersion1() (TeehouseApiRoutesCvmsPreflightAvailableOSImageVersion1, error) { - var body TeehouseApiRoutesCvmsPreflightAvailableOSImageVersion1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromTeehouseApiRoutesCvmsPreflightAvailableOSImageVersion1 overwrites any union data inside the TeehouseApiRoutesCvmsPreflightAvailableOSImage_Version as the provided TeehouseApiRoutesCvmsPreflightAvailableOSImageVersion1 -func (t *TeehouseApiRoutesCvmsPreflightAvailableOSImage_Version) FromTeehouseApiRoutesCvmsPreflightAvailableOSImageVersion1(v TeehouseApiRoutesCvmsPreflightAvailableOSImageVersion1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeTeehouseApiRoutesCvmsPreflightAvailableOSImageVersion1 performs a merge with any union data inside the TeehouseApiRoutesCvmsPreflightAvailableOSImage_Version, using the provided TeehouseApiRoutesCvmsPreflightAvailableOSImageVersion1 -func (t *TeehouseApiRoutesCvmsPreflightAvailableOSImage_Version) MergeTeehouseApiRoutesCvmsPreflightAvailableOSImageVersion1(v TeehouseApiRoutesCvmsPreflightAvailableOSImageVersion1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t TeehouseApiRoutesCvmsPreflightAvailableOSImage_Version) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *TeehouseApiRoutesCvmsPreflightAvailableOSImage_Version) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// RequestEditorFn is the function signature for the RequestEditor callback function -type RequestEditorFn func(ctx context.Context, req *http.Request) error - -// Doer performs HTTP requests. -// -// The standard http.Client implements this interface. -type HttpRequestDoer interface { - Do(req *http.Request) (*http.Response, error) -} - -// Client which conforms to the OpenAPI3 specification for this service. -type Client struct { - // The endpoint of the server conforming to this interface, with scheme, - // https://api.deepmap.com for example. This can contain a path relative - // to the server, such as https://api.deepmap.com/dev-test, and all the - // paths in the swagger spec will be appended to the server. - Server string - - // Doer for performing requests, typically a *http.Client with any - // customized settings, such as certificate chains. - Client HttpRequestDoer - - // A list of callbacks for modifying requests which are generated before sending over - // the network. - RequestEditors []RequestEditorFn -} - -// ClientOption allows setting custom parameters during construction -type ClientOption func(*Client) error - -// Creates a new Client, with reasonable defaults -func NewClient(server string, opts ...ClientOption) (*Client, error) { - // create a client with sane default values - client := Client{ - Server: server, - } - // mutate client and add all optional params - for _, o := range opts { - if err := o(&client); err != nil { - return nil, err - } - } - // ensure the server URL always has a trailing slash - if !strings.HasSuffix(client.Server, "/") { - client.Server += "/" - } - // create httpClient, if not already present - if client.Client == nil { - client.Client = &http.Client{} - } - return &client, nil -} - -// WithHTTPClient allows overriding the default Doer, which is -// automatically created using http.Client. This is useful for tests. -func WithHTTPClient(doer HttpRequestDoer) ClientOption { - return func(c *Client) error { - c.Client = doer - return nil - } -} - -// WithRequestEditorFn allows setting up a callback function, which will be -// called right before sending the request. This can be used to mutate the request. -func WithRequestEditorFn(fn RequestEditorFn) ClientOption { - return func(c *Client) error { - c.RequestEditors = append(c.RequestEditors, fn) - return nil - } -} - -// The interface specification for the client above. -type ClientInterface interface { - // ListDstackAppsApiV1AppsGet request - ListDstackAppsApiV1AppsGet(ctx context.Context, params *ListDstackAppsApiV1AppsGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetFilterOptionsApiV1AppsFilterOptionsGet request - GetFilterOptionsApiV1AppsFilterOptionsGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetDstackAppApiV1AppsAppIdGet request - GetDstackAppApiV1AppsAppIdGet(ctx context.Context, appId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleGetAppAttestationApiV1AppsAppIdAttestationsGet request - HandleGetAppAttestationApiV1AppsAppIdAttestationsGet(ctx context.Context, appId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleGetAppCvmsApiV1AppsAppIdCvmsGet request - HandleGetAppCvmsApiV1AppsAppIdCvmsGet(ctx context.Context, appId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostWithBody request with any body - HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostWithBody(ctx context.Context, appId string, vmUuid string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPost(ctx context.Context, appId string, vmUuid string, body HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetAppEventsApiV1AppsAppIdEventsGet request - GetAppEventsApiV1AppsAppIdEventsGet(ctx context.Context, appId string, params *GetAppEventsApiV1AppsAppIdEventsGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetAppRevisionsApiV1AppsAppIdRevisionsGet request - GetAppRevisionsApiV1AppsAppIdRevisionsGet(ctx context.Context, appId string, params *GetAppRevisionsApiV1AppsAppIdRevisionsGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGet request - GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGet(ctx context.Context, appId string, revisionId string, params *GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostWithBody request with any body - RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostWithBody(ctx context.Context, appId string, revisionId string, params *RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPost(ctx context.Context, appId string, revisionId string, params *RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostParams, body RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetAppUsageApiV1AppsAppIdUsageGet request - GetAppUsageApiV1AppsAppIdUsageGet(ctx context.Context, appId string, params *GetAppUsageApiV1AppsAppIdUsageGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetCollateralApiV1AttestationsCollateralChecksumGet request - GetCollateralApiV1AttestationsCollateralChecksumGet(ctx context.Context, checksum string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleListDeviceIdsApiV1AttestationsDeviceIdsGet request - HandleListDeviceIdsApiV1AttestationsDeviceIdsGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleListNodesApiV1AttestationsNodesGet request - HandleListNodesApiV1AttestationsNodesGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleListPpidsApiV1AttestationsPpidsGet request - HandleListPpidsApiV1AttestationsPpidsGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleGetRawApiV1AttestationsRawChecksumGet request - HandleGetRawApiV1AttestationsRawChecksumGet(ctx context.Context, checksum string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleCheckRawFileApiV1AttestationsRawChecksumHead request - HandleCheckRawFileApiV1AttestationsRawChecksumHead(ctx context.Context, checksum string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleListRecentApiV1AttestationsRecentGet request - HandleListRecentApiV1AttestationsRecentGet(ctx context.Context, params *HandleListRecentApiV1AttestationsRecentGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleUploadAndVerifyApiV1AttestationsVerifyPostWithBody request with any body - HandleUploadAndVerifyApiV1AttestationsVerifyPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleViewApiV1AttestationsViewChecksumGet request - HandleViewApiV1AttestationsViewChecksumGet(ctx context.Context, checksum string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // Confirm2faSetupEndpointApiV1Auth2faConfirmPostWithBody request with any body - Confirm2faSetupEndpointApiV1Auth2faConfirmPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - Confirm2faSetupEndpointApiV1Auth2faConfirmPost(ctx context.Context, body Confirm2faSetupEndpointApiV1Auth2faConfirmPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // Disable2faEndpointApiV1Auth2faDisablePostWithBody request with any body - Disable2faEndpointApiV1Auth2faDisablePostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - Disable2faEndpointApiV1Auth2faDisablePost(ctx context.Context, body Disable2faEndpointApiV1Auth2faDisablePostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostWithBody request with any body - RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPost(ctx context.Context, body RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // Setup2faEndpointApiV1Auth2faSetupPost request - Setup2faEndpointApiV1Auth2faSetupPost(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // Get2faStatusEndpointApiV1Auth2faStatusGet request - Get2faStatusEndpointApiV1Auth2faStatusGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // Verify2faEndpointApiV1Auth2faVerifyPostWithBody request with any body - Verify2faEndpointApiV1Auth2faVerifyPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - Verify2faEndpointApiV1Auth2faVerifyPost(ctx context.Context, body Verify2faEndpointApiV1Auth2faVerifyPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostWithBody request with any body - Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePost(ctx context.Context, body Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // AuthenticatedApiV1AuthAuthenticatedGet request - AuthenticatedApiV1AuthAuthenticatedGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // ApiChangeEmailApiV1AuthChangeEmailPostWithBody request with any body - ApiChangeEmailApiV1AuthChangeEmailPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - ApiChangeEmailApiV1AuthChangeEmailPost(ctx context.Context, body ApiChangeEmailApiV1AuthChangeEmailPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DecodeLinkTokenApiV1AuthDecodeLinkTokenGet request - DecodeLinkTokenApiV1AuthDecodeLinkTokenGet(ctx context.Context, params *DecodeLinkTokenApiV1AuthDecodeLinkTokenGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostWithBody request with any body - AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePost(ctx context.Context, body AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // RequestDeviceCodeApiV1AuthDeviceCodePostWithBody request with any body - RequestDeviceCodeApiV1AuthDeviceCodePostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - RequestDeviceCodeApiV1AuthDeviceCodePost(ctx context.Context, body RequestDeviceCodeApiV1AuthDeviceCodePostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // CheckDeviceStatusApiV1AuthDeviceStatusUserCodeGet request - CheckDeviceStatusApiV1AuthDeviceStatusUserCodeGet(ctx context.Context, userCode string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PollDeviceTokenApiV1AuthDeviceTokenPostWithBody request with any body - PollDeviceTokenApiV1AuthDeviceTokenPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PollDeviceTokenApiV1AuthDeviceTokenPost(ctx context.Context, body PollDeviceTokenApiV1AuthDeviceTokenPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // ForgotPasswordApiV1AuthForgotPasswordPostWithBody request with any body - ForgotPasswordApiV1AuthForgotPasswordPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - ForgotPasswordApiV1AuthForgotPasswordPost(ctx context.Context, body ForgotPasswordApiV1AuthForgotPasswordPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // LoginWithCookieApiV1AuthLoginPostWithBody request with any body - LoginWithCookieApiV1AuthLoginPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - LoginWithCookieApiV1AuthLoginPostWithFormdataBody(ctx context.Context, body LoginWithCookieApiV1AuthLoginPostFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // LoginWith2faApiV1AuthLoginWith2faPostWithBody request with any body - LoginWith2faApiV1AuthLoginWith2faPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - LoginWith2faApiV1AuthLoginWith2faPost(ctx context.Context, body LoginWith2faApiV1AuthLoginWith2faPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // LogoutApiV1AuthLogoutPost request - LogoutApiV1AuthLogoutPost(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // ReadUsersMeApiV1AuthMeGet request - ReadUsersMeApiV1AuthMeGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGet request - GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGet(ctx context.Context, params *GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GithubOauthCallbackApiV1AuthOauthGithubCallbackGet request - GithubOauthCallbackApiV1AuthOauthGithubCallbackGet(ctx context.Context, params *GithubOauthCallbackApiV1AuthOauthGithubCallbackGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGet request - GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGet(ctx context.Context, params *GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGet request - GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGet(ctx context.Context, params *GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleUpdatePasswordApiV1AuthPasswordPostWithBody request with any body - HandleUpdatePasswordApiV1AuthPasswordPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleUpdatePasswordApiV1AuthPasswordPost(ctx context.Context, body HandleUpdatePasswordApiV1AuthPasswordPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // RegisterUserApiV1AuthRegisterPostWithBody request with any body - RegisterUserApiV1AuthRegisterPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - RegisterUserApiV1AuthRegisterPost(ctx context.Context, body RegisterUserApiV1AuthRegisterPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostWithBody request with any body - ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPost(ctx context.Context, body ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleResetPasswordWithTokenApiV1AuthResetPasswordPutWithBody request with any body - HandleResetPasswordWithTokenApiV1AuthResetPasswordPutWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleResetPasswordWithTokenApiV1AuthResetPasswordPut(ctx context.Context, body HandleResetPasswordWithTokenApiV1AuthResetPasswordPutJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // RevokeAllSessionsApiV1AuthSessionsDelete request - RevokeAllSessionsApiV1AuthSessionsDelete(ctx context.Context, params *RevokeAllSessionsApiV1AuthSessionsDeleteParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetActiveSessionsApiV1AuthSessionsGet request - GetActiveSessionsApiV1AuthSessionsGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // RevokeSessionEndpointApiV1AuthSessionsJtiDelete request - RevokeSessionEndpointApiV1AuthSessionsJtiDelete(ctx context.Context, jti string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostWithBody request with any body - VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPost(ctx context.Context, body VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // LoginForAccessTokenApiV1AuthTokenPostWithBody request with any body - LoginForAccessTokenApiV1AuthTokenPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - LoginForAccessTokenApiV1AuthTokenPostWithFormdataBody(ctx context.Context, body LoginForAccessTokenApiV1AuthTokenPostFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleUpdateUsernameApiV1AuthUsernamePutWithBody request with any body - HandleUpdateUsernameApiV1AuthUsernamePutWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleUpdateUsernameApiV1AuthUsernamePut(ctx context.Context, body HandleUpdateUsernameApiV1AuthUsernamePutJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // ValidateResetTokenApiV1AuthValidateResetTokenGet request - ValidateResetTokenApiV1AuthValidateResetTokenGet(ctx context.Context, params *ValidateResetTokenApiV1AuthValidateResetTokenGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostWithBody request with any body - VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPost(ctx context.Context, body VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostWithBody request with any body - ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPost(ctx context.Context, body ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleListCvmsApiV1CvmsGet request - HandleListCvmsApiV1CvmsGet(ctx context.Context, params *HandleListCvmsApiV1CvmsGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleCreateCvmFromPovisionApiV1CvmsPostWithBody request with any body - HandleCreateCvmFromPovisionApiV1CvmsPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleCreateCvmFromPovisionApiV1CvmsPost(ctx context.Context, body HandleCreateCvmFromPovisionApiV1CvmsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleBatchStopCvmsApiV1CvmsBatchStopPostWithBody request with any body - HandleBatchStopCvmsApiV1CvmsBatchStopPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleBatchStopCvmsApiV1CvmsBatchStopPost(ctx context.Context, body HandleBatchStopCvmsApiV1CvmsBatchStopPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleCreateElizaFromProvisionApiV1CvmsElizaPostWithBody request with any body - HandleCreateElizaFromProvisionApiV1CvmsElizaPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleCreateElizaFromProvisionApiV1CvmsElizaPost(ctx context.Context, body HandleCreateElizaFromProvisionApiV1CvmsElizaPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostWithBody request with any body - HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPost(ctx context.Context, body HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchWithBody request with any body - HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatch(ctx context.Context, body HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleListCvmsPaginatedApiV1CvmsPaginatedGet request - HandleListCvmsPaginatedApiV1CvmsPaginatedGet(ctx context.Context, params *HandleListCvmsPaginatedApiV1CvmsPaginatedGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleProvisionCvmApiV1CvmsProvisionPostWithBody request with any body - HandleProvisionCvmApiV1CvmsProvisionPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleProvisionCvmApiV1CvmsProvisionPost(ctx context.Context, body HandleProvisionCvmApiV1CvmsProvisionPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostWithBody request with any body - HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPost(ctx context.Context, body HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostWithBody request with any body - HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPost(ctx context.Context, body HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostWithBody request with any body - HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleCreateCvmForWorkloadApiV1CvmsWorkloadPost(ctx context.Context, body HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleRemoveCvmApiV1CvmsCvmIdDelete request - HandleRemoveCvmApiV1CvmsCvmIdDelete(ctx context.Context, cvmId string, params *HandleRemoveCvmApiV1CvmsCvmIdDeleteParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleGetCvmApiV1CvmsCvmIdGet request - HandleGetCvmApiV1CvmsCvmIdGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleGetCvmAttestationApiV1CvmsCvmIdAttestationGet request - HandleGetCvmAttestationApiV1CvmsCvmIdAttestationGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGet request - GetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleGetCvmComposeApiV1CvmsCvmIdComposeGet request - HandleGetCvmComposeApiV1CvmsCvmIdComposeGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchWithBody request with any body - HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandlePatchCvmComposeApiV1CvmsCvmIdComposePatch(ctx context.Context, cvmId string, body HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutWithBody request with any body - HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleUpdateCvmComposeApiV1CvmsCvmIdComposePut(ctx context.Context, cvmId string, body HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetCvmComposeFileApiV1CvmsCvmIdComposeFileGet request - GetCvmComposeFileApiV1CvmsCvmIdComposeFileGet(ctx context.Context, cvmId string, params *GetCvmComposeFileApiV1CvmsCvmIdComposeFileGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchWithBody request with any body - TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatch(ctx context.Context, cvmId string, body TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostWithBody request with any body - SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePost(ctx context.Context, cvmId string, body SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostWithBody request with any body - ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPost(ctx context.Context, cvmId string, body ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleGetCvmCompositionApiV1CvmsCvmIdCompositionGet request - HandleGetCvmCompositionApiV1CvmsCvmIdCompositionGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostWithBody request with any body - DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePost(ctx context.Context, cvmId string, body DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchWithBody request with any body - UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchWithBody(ctx context.Context, cvmId string, params *UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGet request - HandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchWithBody request with any body - UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatch(ctx context.Context, cvmId string, body UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchWithBody request with any body - HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatch(ctx context.Context, cvmId string, body HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchWithBody request with any body - HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleUpdateCvmListedApiV1CvmsCvmIdListedPatch(ctx context.Context, cvmId string, body HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchWithBody request with any body - HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleUpdateCvmNameApiV1CvmsCvmIdNamePatch(ctx context.Context, cvmId string, body HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGet request - HandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetOperationStatusApiV1CvmsCvmIdOperationStatusGet request - GetOperationStatusApiV1CvmsCvmIdOperationStatusGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetCvmOperationsApiV1CvmsCvmIdOperationsGet request - GetCvmOperationsApiV1CvmsCvmIdOperationsGet(ctx context.Context, cvmId string, params *GetCvmOperationsApiV1CvmsCvmIdOperationsGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchWithBody request with any body - UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatch(ctx context.Context, cvmId string, body UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGet request - HandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchWithBody request with any body - UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchWithBody(ctx context.Context, cvmId string, params *UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleReplicateCvmApiV1CvmsCvmIdReplicasPostWithBody request with any body - HandleReplicateCvmApiV1CvmsCvmIdReplicasPostWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleReplicateCvmApiV1CvmsCvmIdReplicasPost(ctx context.Context, cvmId string, body HandleReplicateCvmApiV1CvmsCvmIdReplicasPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleResizeCvmApiV1CvmsCvmIdResourcesPatchWithBody request with any body - HandleResizeCvmApiV1CvmsCvmIdResourcesPatchWithBody(ctx context.Context, cvmId string, params *HandleResizeCvmApiV1CvmsCvmIdResourcesPatchParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleResizeCvmApiV1CvmsCvmIdResourcesPatch(ctx context.Context, cvmId string, params *HandleResizeCvmApiV1CvmsCvmIdResourcesPatchParams, body HandleResizeCvmApiV1CvmsCvmIdResourcesPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleRestartCvmApiV1CvmsCvmIdRestartPostWithBody request with any body - HandleRestartCvmApiV1CvmsCvmIdRestartPostWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleRestartCvmApiV1CvmsCvmIdRestartPost(ctx context.Context, cvmId string, body HandleRestartCvmApiV1CvmsCvmIdRestartPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPost request - RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPost(ctx context.Context, cvmId string, revisionId string, params *RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchWithBody request with any body - HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatch(ctx context.Context, cvmId string, body HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleShutdownCvmApiV1CvmsCvmIdShutdownPostWithBody request with any body - HandleShutdownCvmApiV1CvmsCvmIdShutdownPostWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleShutdownCvmApiV1CvmsCvmIdShutdownPost(ctx context.Context, cvmId string, body HandleShutdownCvmApiV1CvmsCvmIdShutdownPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleStartCvmApiV1CvmsCvmIdStartPostWithBody request with any body - HandleStartCvmApiV1CvmsCvmIdStartPostWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleStartCvmApiV1CvmsCvmIdStartPost(ctx context.Context, cvmId string, body HandleStartCvmApiV1CvmsCvmIdStartPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleGetCvmStateApiV1CvmsCvmIdStateGet request - HandleGetCvmStateApiV1CvmsCvmIdStateGet(ctx context.Context, cvmId string, params *HandleGetCvmStateApiV1CvmsCvmIdStateGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleGetCvmStatsApiV1CvmsCvmIdStatsGet request - HandleGetCvmStatsApiV1CvmsCvmIdStatsGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleStopCvmApiV1CvmsCvmIdStopPostWithBody request with any body - HandleStopCvmApiV1CvmsCvmIdStopPostWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleStopCvmApiV1CvmsCvmIdStopPost(ctx context.Context, cvmId string, body HandleStopCvmApiV1CvmsCvmIdStopPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetCvmUserConfigApiV1CvmsCvmIdUserConfigGet request - GetCvmUserConfigApiV1CvmsCvmIdUserConfigGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchWithBody request with any body - HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatch(ctx context.Context, cvmId string, body HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // ListKmsApiV1KmsGet request - ListKmsApiV1KmsGet(ctx context.Context, params *ListKmsApiV1KmsGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetNextAppIdApiV1KmsPhalaNextAppIdGet request - GetNextAppIdApiV1KmsPhalaNextAppIdGet(ctx context.Context, params *GetNextAppIdApiV1KmsPhalaNextAppIdGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetKmsInfoApiV1KmsKmsIdGet request - GetKmsInfoApiV1KmsKmsIdGet(ctx context.Context, kmsId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGet request - GetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGet(ctx context.Context, kmsId string, appId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // ListRedpillApiKeysApiV1RedpillApiKeysGet request - ListRedpillApiKeysApiV1RedpillApiKeysGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // CreateRedpillApiKeyApiV1RedpillApiKeysPostWithBody request with any body - CreateRedpillApiKeyApiV1RedpillApiKeysPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - CreateRedpillApiKeyApiV1RedpillApiKeysPost(ctx context.Context, body CreateRedpillApiKeyApiV1RedpillApiKeysPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatch request - UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatch(ctx context.Context, apiKeyId int, params *UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // ConnectRedpillUserApiV1RedpillConnectPost request - ConnectRedpillUserApiV1RedpillConnectPost(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // ListApiKeyLogsApiV1RedpillLogsApiKeyIdGet request - ListApiKeyLogsApiV1RedpillLogsApiKeyIdGet(ctx context.Context, apiKeyId int, reqEditors ...RequestEditorFn) (*http.Response, error) - - // ListModelsApiV1RedpillModelsGet request - ListModelsApiV1RedpillModelsGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetDailyUsageApiV1RedpillUsageDailyGet request - GetDailyUsageApiV1RedpillUsageDailyGet(ctx context.Context, params *GetDailyUsageApiV1RedpillUsageDailyGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetUsageLogsApiV1RedpillUsageLogsGet request - GetUsageLogsApiV1RedpillUsageLogsGet(ctx context.Context, params *GetUsageLogsApiV1RedpillUsageLogsGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleBatchCvmStatusApiV1StatusBatchPostWithBody request with any body - HandleBatchCvmStatusApiV1StatusBatchPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleBatchCvmStatusApiV1StatusBatchPost(ctx context.Context, body HandleBatchCvmStatusApiV1StatusBatchPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // ListTeepodsApiV1TeepodsGet request - ListTeepodsApiV1TeepodsGet(ctx context.Context, params *ListTeepodsApiV1TeepodsGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleGetAvailableTeepodsApiV1TeepodsAvailableGet request - HandleGetAvailableTeepodsApiV1TeepodsAvailableGet(ctx context.Context, params *HandleGetAvailableTeepodsApiV1TeepodsAvailableGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGet request - HandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGet(ctx context.Context, teepodId int, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPost request - HandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPost(ctx context.Context, teepodId int, appId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // ListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGet request - ListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGet(ctx context.Context, teepodId int, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleListPublicCvmsApiV1VerifiedAppsGet request - HandleListPublicCvmsApiV1VerifiedAppsGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGet request - HandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HealthCheckHealthGet request - HealthCheckHealthGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) -} - -func (c *Client) ListDstackAppsApiV1AppsGet(ctx context.Context, params *ListDstackAppsApiV1AppsGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListDstackAppsApiV1AppsGetRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetFilterOptionsApiV1AppsFilterOptionsGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetFilterOptionsApiV1AppsFilterOptionsGetRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetDstackAppApiV1AppsAppIdGet(ctx context.Context, appId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetDstackAppApiV1AppsAppIdGetRequest(c.Server, appId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleGetAppAttestationApiV1AppsAppIdAttestationsGet(ctx context.Context, appId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleGetAppAttestationApiV1AppsAppIdAttestationsGetRequest(c.Server, appId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleGetAppCvmsApiV1AppsAppIdCvmsGet(ctx context.Context, appId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleGetAppCvmsApiV1AppsAppIdCvmsGetRequest(c.Server, appId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostWithBody(ctx context.Context, appId string, vmUuid string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostRequestWithBody(c.Server, appId, vmUuid, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPost(ctx context.Context, appId string, vmUuid string, body HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostRequest(c.Server, appId, vmUuid, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetAppEventsApiV1AppsAppIdEventsGet(ctx context.Context, appId string, params *GetAppEventsApiV1AppsAppIdEventsGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetAppEventsApiV1AppsAppIdEventsGetRequest(c.Server, appId, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetAppRevisionsApiV1AppsAppIdRevisionsGet(ctx context.Context, appId string, params *GetAppRevisionsApiV1AppsAppIdRevisionsGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetAppRevisionsApiV1AppsAppIdRevisionsGetRequest(c.Server, appId, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGet(ctx context.Context, appId string, revisionId string, params *GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetRequest(c.Server, appId, revisionId, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostWithBody(ctx context.Context, appId string, revisionId string, params *RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostRequestWithBody(c.Server, appId, revisionId, params, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPost(ctx context.Context, appId string, revisionId string, params *RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostParams, body RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostRequest(c.Server, appId, revisionId, params, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetAppUsageApiV1AppsAppIdUsageGet(ctx context.Context, appId string, params *GetAppUsageApiV1AppsAppIdUsageGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetAppUsageApiV1AppsAppIdUsageGetRequest(c.Server, appId, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetCollateralApiV1AttestationsCollateralChecksumGet(ctx context.Context, checksum string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetCollateralApiV1AttestationsCollateralChecksumGetRequest(c.Server, checksum) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleListDeviceIdsApiV1AttestationsDeviceIdsGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleListDeviceIdsApiV1AttestationsDeviceIdsGetRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleListNodesApiV1AttestationsNodesGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleListNodesApiV1AttestationsNodesGetRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleListPpidsApiV1AttestationsPpidsGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleListPpidsApiV1AttestationsPpidsGetRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleGetRawApiV1AttestationsRawChecksumGet(ctx context.Context, checksum string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleGetRawApiV1AttestationsRawChecksumGetRequest(c.Server, checksum) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleCheckRawFileApiV1AttestationsRawChecksumHead(ctx context.Context, checksum string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleCheckRawFileApiV1AttestationsRawChecksumHeadRequest(c.Server, checksum) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleListRecentApiV1AttestationsRecentGet(ctx context.Context, params *HandleListRecentApiV1AttestationsRecentGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleListRecentApiV1AttestationsRecentGetRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleUploadAndVerifyApiV1AttestationsVerifyPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleUploadAndVerifyApiV1AttestationsVerifyPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleViewApiV1AttestationsViewChecksumGet(ctx context.Context, checksum string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleViewApiV1AttestationsViewChecksumGetRequest(c.Server, checksum) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) Confirm2faSetupEndpointApiV1Auth2faConfirmPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewConfirm2faSetupEndpointApiV1Auth2faConfirmPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) Confirm2faSetupEndpointApiV1Auth2faConfirmPost(ctx context.Context, body Confirm2faSetupEndpointApiV1Auth2faConfirmPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewConfirm2faSetupEndpointApiV1Auth2faConfirmPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) Disable2faEndpointApiV1Auth2faDisablePostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDisable2faEndpointApiV1Auth2faDisablePostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) Disable2faEndpointApiV1Auth2faDisablePost(ctx context.Context, body Disable2faEndpointApiV1Auth2faDisablePostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDisable2faEndpointApiV1Auth2faDisablePostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPost(ctx context.Context, body RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) Setup2faEndpointApiV1Auth2faSetupPost(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSetup2faEndpointApiV1Auth2faSetupPostRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) Get2faStatusEndpointApiV1Auth2faStatusGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGet2faStatusEndpointApiV1Auth2faStatusGetRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) Verify2faEndpointApiV1Auth2faVerifyPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewVerify2faEndpointApiV1Auth2faVerifyPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) Verify2faEndpointApiV1Auth2faVerifyPost(ctx context.Context, body Verify2faEndpointApiV1Auth2faVerifyPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewVerify2faEndpointApiV1Auth2faVerifyPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewVerify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePost(ctx context.Context, body Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewVerify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) AuthenticatedApiV1AuthAuthenticatedGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewAuthenticatedApiV1AuthAuthenticatedGetRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ApiChangeEmailApiV1AuthChangeEmailPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiChangeEmailApiV1AuthChangeEmailPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ApiChangeEmailApiV1AuthChangeEmailPost(ctx context.Context, body ApiChangeEmailApiV1AuthChangeEmailPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiChangeEmailApiV1AuthChangeEmailPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) DecodeLinkTokenApiV1AuthDecodeLinkTokenGet(ctx context.Context, params *DecodeLinkTokenApiV1AuthDecodeLinkTokenGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDecodeLinkTokenApiV1AuthDecodeLinkTokenGetRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewAuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePost(ctx context.Context, body AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewAuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) RequestDeviceCodeApiV1AuthDeviceCodePostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRequestDeviceCodeApiV1AuthDeviceCodePostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) RequestDeviceCodeApiV1AuthDeviceCodePost(ctx context.Context, body RequestDeviceCodeApiV1AuthDeviceCodePostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRequestDeviceCodeApiV1AuthDeviceCodePostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CheckDeviceStatusApiV1AuthDeviceStatusUserCodeGet(ctx context.Context, userCode string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCheckDeviceStatusApiV1AuthDeviceStatusUserCodeGetRequest(c.Server, userCode) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PollDeviceTokenApiV1AuthDeviceTokenPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPollDeviceTokenApiV1AuthDeviceTokenPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PollDeviceTokenApiV1AuthDeviceTokenPost(ctx context.Context, body PollDeviceTokenApiV1AuthDeviceTokenPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPollDeviceTokenApiV1AuthDeviceTokenPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ForgotPasswordApiV1AuthForgotPasswordPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewForgotPasswordApiV1AuthForgotPasswordPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ForgotPasswordApiV1AuthForgotPasswordPost(ctx context.Context, body ForgotPasswordApiV1AuthForgotPasswordPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewForgotPasswordApiV1AuthForgotPasswordPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) LoginWithCookieApiV1AuthLoginPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewLoginWithCookieApiV1AuthLoginPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) LoginWithCookieApiV1AuthLoginPostWithFormdataBody(ctx context.Context, body LoginWithCookieApiV1AuthLoginPostFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewLoginWithCookieApiV1AuthLoginPostRequestWithFormdataBody(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) LoginWith2faApiV1AuthLoginWith2faPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewLoginWith2faApiV1AuthLoginWith2faPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) LoginWith2faApiV1AuthLoginWith2faPost(ctx context.Context, body LoginWith2faApiV1AuthLoginWith2faPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewLoginWith2faApiV1AuthLoginWith2faPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) LogoutApiV1AuthLogoutPost(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewLogoutApiV1AuthLogoutPostRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ReadUsersMeApiV1AuthMeGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewReadUsersMeApiV1AuthMeGetRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGet(ctx context.Context, params *GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GithubOauthCallbackApiV1AuthOauthGithubCallbackGet(ctx context.Context, params *GithubOauthCallbackApiV1AuthOauthGithubCallbackGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGithubOauthCallbackApiV1AuthOauthGithubCallbackGetRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGet(ctx context.Context, params *GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGet(ctx context.Context, params *GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleUpdatePasswordApiV1AuthPasswordPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleUpdatePasswordApiV1AuthPasswordPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleUpdatePasswordApiV1AuthPasswordPost(ctx context.Context, body HandleUpdatePasswordApiV1AuthPasswordPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleUpdatePasswordApiV1AuthPasswordPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) RegisterUserApiV1AuthRegisterPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRegisterUserApiV1AuthRegisterPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) RegisterUserApiV1AuthRegisterPost(ctx context.Context, body RegisterUserApiV1AuthRegisterPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRegisterUserApiV1AuthRegisterPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPost(ctx context.Context, body ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleResetPasswordWithTokenApiV1AuthResetPasswordPutWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleResetPasswordWithTokenApiV1AuthResetPasswordPutRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleResetPasswordWithTokenApiV1AuthResetPasswordPut(ctx context.Context, body HandleResetPasswordWithTokenApiV1AuthResetPasswordPutJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleResetPasswordWithTokenApiV1AuthResetPasswordPutRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) RevokeAllSessionsApiV1AuthSessionsDelete(ctx context.Context, params *RevokeAllSessionsApiV1AuthSessionsDeleteParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRevokeAllSessionsApiV1AuthSessionsDeleteRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetActiveSessionsApiV1AuthSessionsGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetActiveSessionsApiV1AuthSessionsGetRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) RevokeSessionEndpointApiV1AuthSessionsJtiDelete(ctx context.Context, jti string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRevokeSessionEndpointApiV1AuthSessionsJtiDeleteRequest(c.Server, jti) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewVerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPost(ctx context.Context, body VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewVerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) LoginForAccessTokenApiV1AuthTokenPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewLoginForAccessTokenApiV1AuthTokenPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) LoginForAccessTokenApiV1AuthTokenPostWithFormdataBody(ctx context.Context, body LoginForAccessTokenApiV1AuthTokenPostFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewLoginForAccessTokenApiV1AuthTokenPostRequestWithFormdataBody(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleUpdateUsernameApiV1AuthUsernamePutWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleUpdateUsernameApiV1AuthUsernamePutRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleUpdateUsernameApiV1AuthUsernamePut(ctx context.Context, body HandleUpdateUsernameApiV1AuthUsernamePutJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleUpdateUsernameApiV1AuthUsernamePutRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ValidateResetTokenApiV1AuthValidateResetTokenGet(ctx context.Context, params *ValidateResetTokenApiV1AuthValidateResetTokenGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewValidateResetTokenApiV1AuthValidateResetTokenGetRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewVerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPost(ctx context.Context, body VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewVerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPost(ctx context.Context, body ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleListCvmsApiV1CvmsGet(ctx context.Context, params *HandleListCvmsApiV1CvmsGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleListCvmsApiV1CvmsGetRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleCreateCvmFromPovisionApiV1CvmsPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleCreateCvmFromPovisionApiV1CvmsPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleCreateCvmFromPovisionApiV1CvmsPost(ctx context.Context, body HandleCreateCvmFromPovisionApiV1CvmsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleCreateCvmFromPovisionApiV1CvmsPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleBatchStopCvmsApiV1CvmsBatchStopPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleBatchStopCvmsApiV1CvmsBatchStopPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleBatchStopCvmsApiV1CvmsBatchStopPost(ctx context.Context, body HandleBatchStopCvmsApiV1CvmsBatchStopPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleBatchStopCvmsApiV1CvmsBatchStopPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleCreateElizaFromProvisionApiV1CvmsElizaPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleCreateElizaFromProvisionApiV1CvmsElizaPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleCreateElizaFromProvisionApiV1CvmsElizaPost(ctx context.Context, body HandleCreateElizaFromProvisionApiV1CvmsElizaPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleCreateElizaFromProvisionApiV1CvmsElizaPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPost(ctx context.Context, body HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatch(ctx context.Context, body HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleListCvmsPaginatedApiV1CvmsPaginatedGet(ctx context.Context, params *HandleListCvmsPaginatedApiV1CvmsPaginatedGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleListCvmsPaginatedApiV1CvmsPaginatedGetRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleProvisionCvmApiV1CvmsProvisionPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleProvisionCvmApiV1CvmsProvisionPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleProvisionCvmApiV1CvmsProvisionPost(ctx context.Context, body HandleProvisionCvmApiV1CvmsProvisionPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleProvisionCvmApiV1CvmsProvisionPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPost(ctx context.Context, body HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPost(ctx context.Context, body HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleCreateCvmForWorkloadApiV1CvmsWorkloadPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleCreateCvmForWorkloadApiV1CvmsWorkloadPost(ctx context.Context, body HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleCreateCvmForWorkloadApiV1CvmsWorkloadPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleRemoveCvmApiV1CvmsCvmIdDelete(ctx context.Context, cvmId string, params *HandleRemoveCvmApiV1CvmsCvmIdDeleteParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleRemoveCvmApiV1CvmsCvmIdDeleteRequest(c.Server, cvmId, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleGetCvmApiV1CvmsCvmIdGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleGetCvmApiV1CvmsCvmIdGetRequest(c.Server, cvmId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleGetCvmAttestationApiV1CvmsCvmIdAttestationGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleGetCvmAttestationApiV1CvmsCvmIdAttestationGetRequest(c.Server, cvmId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGetRequest(c.Server, cvmId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleGetCvmComposeApiV1CvmsCvmIdComposeGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleGetCvmComposeApiV1CvmsCvmIdComposeGetRequest(c.Server, cvmId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandlePatchCvmComposeApiV1CvmsCvmIdComposePatchRequestWithBody(c.Server, cvmId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandlePatchCvmComposeApiV1CvmsCvmIdComposePatch(ctx context.Context, cvmId string, body HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandlePatchCvmComposeApiV1CvmsCvmIdComposePatchRequest(c.Server, cvmId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleUpdateCvmComposeApiV1CvmsCvmIdComposePutRequestWithBody(c.Server, cvmId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleUpdateCvmComposeApiV1CvmsCvmIdComposePut(ctx context.Context, cvmId string, body HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleUpdateCvmComposeApiV1CvmsCvmIdComposePutRequest(c.Server, cvmId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetCvmComposeFileApiV1CvmsCvmIdComposeFileGet(ctx context.Context, cvmId string, params *GetCvmComposeFileApiV1CvmsCvmIdComposeFileGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetCvmComposeFileApiV1CvmsCvmIdComposeFileGetRequest(c.Server, cvmId, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewTriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchRequestWithBody(c.Server, cvmId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatch(ctx context.Context, cvmId string, body TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewTriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchRequest(c.Server, cvmId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostRequestWithBody(c.Server, cvmId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePost(ctx context.Context, cvmId string, body SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostRequest(c.Server, cvmId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostRequestWithBody(c.Server, cvmId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPost(ctx context.Context, cvmId string, body ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostRequest(c.Server, cvmId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleGetCvmCompositionApiV1CvmsCvmIdCompositionGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleGetCvmCompositionApiV1CvmsCvmIdCompositionGetRequest(c.Server, cvmId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostRequestWithBody(c.Server, cvmId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePost(ctx context.Context, cvmId string, body DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostRequest(c.Server, cvmId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchWithBody(ctx context.Context, cvmId string, params *UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchRequestWithBody(c.Server, cvmId, params, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGetRequest(c.Server, cvmId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchRequestWithBody(c.Server, cvmId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatch(ctx context.Context, cvmId string, body UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchRequest(c.Server, cvmId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchRequestWithBody(c.Server, cvmId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatch(ctx context.Context, cvmId string, body HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchRequest(c.Server, cvmId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleUpdateCvmListedApiV1CvmsCvmIdListedPatchRequestWithBody(c.Server, cvmId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleUpdateCvmListedApiV1CvmsCvmIdListedPatch(ctx context.Context, cvmId string, body HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleUpdateCvmListedApiV1CvmsCvmIdListedPatchRequest(c.Server, cvmId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleUpdateCvmNameApiV1CvmsCvmIdNamePatchRequestWithBody(c.Server, cvmId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleUpdateCvmNameApiV1CvmsCvmIdNamePatch(ctx context.Context, cvmId string, body HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleUpdateCvmNameApiV1CvmsCvmIdNamePatchRequest(c.Server, cvmId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGetRequest(c.Server, cvmId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetOperationStatusApiV1CvmsCvmIdOperationStatusGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetOperationStatusApiV1CvmsCvmIdOperationStatusGetRequest(c.Server, cvmId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetCvmOperationsApiV1CvmsCvmIdOperationsGet(ctx context.Context, cvmId string, params *GetCvmOperationsApiV1CvmsCvmIdOperationsGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetCvmOperationsApiV1CvmsCvmIdOperationsGetRequest(c.Server, cvmId, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchRequestWithBody(c.Server, cvmId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatch(ctx context.Context, cvmId string, body UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchRequest(c.Server, cvmId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGetRequest(c.Server, cvmId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchWithBody(ctx context.Context, cvmId string, params *UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchRequestWithBody(c.Server, cvmId, params, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleReplicateCvmApiV1CvmsCvmIdReplicasPostWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleReplicateCvmApiV1CvmsCvmIdReplicasPostRequestWithBody(c.Server, cvmId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleReplicateCvmApiV1CvmsCvmIdReplicasPost(ctx context.Context, cvmId string, body HandleReplicateCvmApiV1CvmsCvmIdReplicasPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleReplicateCvmApiV1CvmsCvmIdReplicasPostRequest(c.Server, cvmId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleResizeCvmApiV1CvmsCvmIdResourcesPatchWithBody(ctx context.Context, cvmId string, params *HandleResizeCvmApiV1CvmsCvmIdResourcesPatchParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleResizeCvmApiV1CvmsCvmIdResourcesPatchRequestWithBody(c.Server, cvmId, params, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleResizeCvmApiV1CvmsCvmIdResourcesPatch(ctx context.Context, cvmId string, params *HandleResizeCvmApiV1CvmsCvmIdResourcesPatchParams, body HandleResizeCvmApiV1CvmsCvmIdResourcesPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleResizeCvmApiV1CvmsCvmIdResourcesPatchRequest(c.Server, cvmId, params, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleRestartCvmApiV1CvmsCvmIdRestartPostWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleRestartCvmApiV1CvmsCvmIdRestartPostRequestWithBody(c.Server, cvmId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleRestartCvmApiV1CvmsCvmIdRestartPost(ctx context.Context, cvmId string, body HandleRestartCvmApiV1CvmsCvmIdRestartPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleRestartCvmApiV1CvmsCvmIdRestartPostRequest(c.Server, cvmId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPost(ctx context.Context, cvmId string, revisionId string, params *RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostRequest(c.Server, cvmId, revisionId, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchRequestWithBody(c.Server, cvmId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatch(ctx context.Context, cvmId string, body HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchRequest(c.Server, cvmId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleShutdownCvmApiV1CvmsCvmIdShutdownPostWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleShutdownCvmApiV1CvmsCvmIdShutdownPostRequestWithBody(c.Server, cvmId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleShutdownCvmApiV1CvmsCvmIdShutdownPost(ctx context.Context, cvmId string, body HandleShutdownCvmApiV1CvmsCvmIdShutdownPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleShutdownCvmApiV1CvmsCvmIdShutdownPostRequest(c.Server, cvmId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleStartCvmApiV1CvmsCvmIdStartPostWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleStartCvmApiV1CvmsCvmIdStartPostRequestWithBody(c.Server, cvmId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleStartCvmApiV1CvmsCvmIdStartPost(ctx context.Context, cvmId string, body HandleStartCvmApiV1CvmsCvmIdStartPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleStartCvmApiV1CvmsCvmIdStartPostRequest(c.Server, cvmId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleGetCvmStateApiV1CvmsCvmIdStateGet(ctx context.Context, cvmId string, params *HandleGetCvmStateApiV1CvmsCvmIdStateGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleGetCvmStateApiV1CvmsCvmIdStateGetRequest(c.Server, cvmId, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleGetCvmStatsApiV1CvmsCvmIdStatsGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleGetCvmStatsApiV1CvmsCvmIdStatsGetRequest(c.Server, cvmId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleStopCvmApiV1CvmsCvmIdStopPostWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleStopCvmApiV1CvmsCvmIdStopPostRequestWithBody(c.Server, cvmId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleStopCvmApiV1CvmsCvmIdStopPost(ctx context.Context, cvmId string, body HandleStopCvmApiV1CvmsCvmIdStopPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleStopCvmApiV1CvmsCvmIdStopPostRequest(c.Server, cvmId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetCvmUserConfigApiV1CvmsCvmIdUserConfigGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetCvmUserConfigApiV1CvmsCvmIdUserConfigGetRequest(c.Server, cvmId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchWithBody(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchRequestWithBody(c.Server, cvmId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatch(ctx context.Context, cvmId string, body HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchRequest(c.Server, cvmId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ListKmsApiV1KmsGet(ctx context.Context, params *ListKmsApiV1KmsGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListKmsApiV1KmsGetRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetNextAppIdApiV1KmsPhalaNextAppIdGet(ctx context.Context, params *GetNextAppIdApiV1KmsPhalaNextAppIdGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetNextAppIdApiV1KmsPhalaNextAppIdGetRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetKmsInfoApiV1KmsKmsIdGet(ctx context.Context, kmsId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetKmsInfoApiV1KmsKmsIdGetRequest(c.Server, kmsId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGet(ctx context.Context, kmsId string, appId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGetRequest(c.Server, kmsId, appId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ListRedpillApiKeysApiV1RedpillApiKeysGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListRedpillApiKeysApiV1RedpillApiKeysGetRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CreateRedpillApiKeyApiV1RedpillApiKeysPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateRedpillApiKeyApiV1RedpillApiKeysPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CreateRedpillApiKeyApiV1RedpillApiKeysPost(ctx context.Context, body CreateRedpillApiKeyApiV1RedpillApiKeysPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateRedpillApiKeyApiV1RedpillApiKeysPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatch(ctx context.Context, apiKeyId int, params *UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchRequest(c.Server, apiKeyId, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ConnectRedpillUserApiV1RedpillConnectPost(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewConnectRedpillUserApiV1RedpillConnectPostRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ListApiKeyLogsApiV1RedpillLogsApiKeyIdGet(ctx context.Context, apiKeyId int, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListApiKeyLogsApiV1RedpillLogsApiKeyIdGetRequest(c.Server, apiKeyId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ListModelsApiV1RedpillModelsGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListModelsApiV1RedpillModelsGetRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetDailyUsageApiV1RedpillUsageDailyGet(ctx context.Context, params *GetDailyUsageApiV1RedpillUsageDailyGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetDailyUsageApiV1RedpillUsageDailyGetRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetUsageLogsApiV1RedpillUsageLogsGet(ctx context.Context, params *GetUsageLogsApiV1RedpillUsageLogsGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetUsageLogsApiV1RedpillUsageLogsGetRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleBatchCvmStatusApiV1StatusBatchPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleBatchCvmStatusApiV1StatusBatchPostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleBatchCvmStatusApiV1StatusBatchPost(ctx context.Context, body HandleBatchCvmStatusApiV1StatusBatchPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleBatchCvmStatusApiV1StatusBatchPostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ListTeepodsApiV1TeepodsGet(ctx context.Context, params *ListTeepodsApiV1TeepodsGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListTeepodsApiV1TeepodsGetRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleGetAvailableTeepodsApiV1TeepodsAvailableGet(ctx context.Context, params *HandleGetAvailableTeepodsApiV1TeepodsAvailableGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleGetAvailableTeepodsApiV1TeepodsAvailableGetRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGet(ctx context.Context, teepodId int, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGetRequest(c.Server, teepodId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPost(ctx context.Context, teepodId int, appId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPostRequest(c.Server, teepodId, appId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGet(ctx context.Context, teepodId int, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGetRequest(c.Server, teepodId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleListPublicCvmsApiV1VerifiedAppsGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleListPublicCvmsApiV1VerifiedAppsGetRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGet(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGetRequest(c.Server, cvmId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) HealthCheckHealthGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHealthCheckHealthGetRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -// NewListDstackAppsApiV1AppsGetRequest generates requests for ListDstackAppsApiV1AppsGet -func NewListDstackAppsApiV1AppsGetRequest(server string, params *ListDstackAppsApiV1AppsGetParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/apps") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Page != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.PageSize != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page_size", runtime.ParamLocationQuery, *params.PageSize); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Search != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "search", runtime.ParamLocationQuery, *params.Search); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Status != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "status", runtime.ParamLocationQuery, *params.Status); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Listed != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "listed", runtime.ParamLocationQuery, *params.Listed); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.BaseImage != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "base_image", runtime.ParamLocationQuery, *params.BaseImage); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.InstanceType != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "instance_type", runtime.ParamLocationQuery, *params.InstanceType); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.KmsSlug != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "kms_slug", runtime.ParamLocationQuery, *params.KmsSlug); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.KmsType != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "kms_type", runtime.ParamLocationQuery, *params.KmsType); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Node != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "node", runtime.ParamLocationQuery, *params.Node); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Region != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "region", runtime.ParamLocationQuery, *params.Region); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetFilterOptionsApiV1AppsFilterOptionsGetRequest generates requests for GetFilterOptionsApiV1AppsFilterOptionsGet -func NewGetFilterOptionsApiV1AppsFilterOptionsGetRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/apps/filter-options") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetDstackAppApiV1AppsAppIdGetRequest generates requests for GetDstackAppApiV1AppsAppIdGet -func NewGetDstackAppApiV1AppsAppIdGetRequest(server string, appId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "app_id", runtime.ParamLocationPath, appId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/apps/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleGetAppAttestationApiV1AppsAppIdAttestationsGetRequest generates requests for HandleGetAppAttestationApiV1AppsAppIdAttestationsGet -func NewHandleGetAppAttestationApiV1AppsAppIdAttestationsGetRequest(server string, appId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "app_id", runtime.ParamLocationPath, appId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/apps/%s/attestations", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleGetAppCvmsApiV1AppsAppIdCvmsGetRequest generates requests for HandleGetAppCvmsApiV1AppsAppIdCvmsGet -func NewHandleGetAppCvmsApiV1AppsAppIdCvmsGetRequest(server string, appId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "app_id", runtime.ParamLocationPath, appId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/apps/%s/cvms", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostRequest calls the generic HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPost builder with application/json body -func NewHandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostRequest(server string, appId string, vmUuid string, body HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostRequestWithBody(server, appId, vmUuid, "application/json", bodyReader) -} - -// NewHandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostRequestWithBody generates requests for HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPost with any type of body -func NewHandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostRequestWithBody(server string, appId string, vmUuid string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "app_id", runtime.ParamLocationPath, appId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "vm_uuid", runtime.ParamLocationPath, vmUuid) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/apps/%s/cvms/%s/replicas", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewGetAppEventsApiV1AppsAppIdEventsGetRequest generates requests for GetAppEventsApiV1AppsAppIdEventsGet -func NewGetAppEventsApiV1AppsAppIdEventsGetRequest(server string, appId string, params *GetAppEventsApiV1AppsAppIdEventsGetParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "app_id", runtime.ParamLocationPath, appId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/apps/%s/events", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Limit != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.EventType != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "event_type", runtime.ParamLocationQuery, *params.EventType); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.InstanceId != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "instance_id", runtime.ParamLocationQuery, *params.InstanceId); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.OperationType != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "operation_type", runtime.ParamLocationQuery, *params.OperationType); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.StartDate != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "start_date", runtime.ParamLocationQuery, *params.StartDate); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.EndDate != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "end_date", runtime.ParamLocationQuery, *params.EndDate); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetAppRevisionsApiV1AppsAppIdRevisionsGetRequest generates requests for GetAppRevisionsApiV1AppsAppIdRevisionsGet -func NewGetAppRevisionsApiV1AppsAppIdRevisionsGetRequest(server string, appId string, params *GetAppRevisionsApiV1AppsAppIdRevisionsGetParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "app_id", runtime.ParamLocationPath, appId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/apps/%s/revisions", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Page != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.PageSize != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page_size", runtime.ParamLocationQuery, *params.PageSize); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetRequest generates requests for GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGet -func NewGetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetRequest(server string, appId string, revisionId string, params *GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "app_id", runtime.ParamLocationPath, appId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "revision_id", runtime.ParamLocationPath, revisionId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/apps/%s/revisions/%s", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.RawComposeFile != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "raw_compose_file", runtime.ParamLocationQuery, *params.RawComposeFile); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewRedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostRequest calls the generic RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPost builder with application/json body -func NewRedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostRequest(server string, appId string, revisionId string, params *RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostParams, body RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewRedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostRequestWithBody(server, appId, revisionId, params, "application/json", bodyReader) -} - -// NewRedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostRequestWithBody generates requests for RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPost with any type of body -func NewRedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostRequestWithBody(server string, appId string, revisionId string, params *RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostParams, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "app_id", runtime.ParamLocationPath, appId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "revision_id", runtime.ParamLocationPath, revisionId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/apps/%s/revisions/%s/redeploy", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.TransactionHash != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "transaction_hash", runtime.ParamLocationQuery, *params.TransactionHash); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewGetAppUsageApiV1AppsAppIdUsageGetRequest generates requests for GetAppUsageApiV1AppsAppIdUsageGet -func NewGetAppUsageApiV1AppsAppIdUsageGetRequest(server string, appId string, params *GetAppUsageApiV1AppsAppIdUsageGetParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "app_id", runtime.ParamLocationPath, appId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/apps/%s/usage", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.StartDate != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "start_date", runtime.ParamLocationQuery, *params.StartDate); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.EndDate != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "end_date", runtime.ParamLocationQuery, *params.EndDate); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Limit != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Offset != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetCollateralApiV1AttestationsCollateralChecksumGetRequest generates requests for GetCollateralApiV1AttestationsCollateralChecksumGet -func NewGetCollateralApiV1AttestationsCollateralChecksumGetRequest(server string, checksum string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "checksum", runtime.ParamLocationPath, checksum) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/attestations/collateral/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleListDeviceIdsApiV1AttestationsDeviceIdsGetRequest generates requests for HandleListDeviceIdsApiV1AttestationsDeviceIdsGet -func NewHandleListDeviceIdsApiV1AttestationsDeviceIdsGetRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/attestations/device_ids") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleListNodesApiV1AttestationsNodesGetRequest generates requests for HandleListNodesApiV1AttestationsNodesGet -func NewHandleListNodesApiV1AttestationsNodesGetRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/attestations/nodes") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleListPpidsApiV1AttestationsPpidsGetRequest generates requests for HandleListPpidsApiV1AttestationsPpidsGet -func NewHandleListPpidsApiV1AttestationsPpidsGetRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/attestations/ppids") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleGetRawApiV1AttestationsRawChecksumGetRequest generates requests for HandleGetRawApiV1AttestationsRawChecksumGet -func NewHandleGetRawApiV1AttestationsRawChecksumGetRequest(server string, checksum string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "checksum", runtime.ParamLocationPath, checksum) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/attestations/raw/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleCheckRawFileApiV1AttestationsRawChecksumHeadRequest generates requests for HandleCheckRawFileApiV1AttestationsRawChecksumHead -func NewHandleCheckRawFileApiV1AttestationsRawChecksumHeadRequest(server string, checksum string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "checksum", runtime.ParamLocationPath, checksum) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/attestations/raw/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("HEAD", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleListRecentApiV1AttestationsRecentGetRequest generates requests for HandleListRecentApiV1AttestationsRecentGet -func NewHandleListRecentApiV1AttestationsRecentGetRequest(server string, params *HandleListRecentApiV1AttestationsRecentGetParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/attestations/recent") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Skip != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "skip", runtime.ParamLocationQuery, *params.Skip); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Limit != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleUploadAndVerifyApiV1AttestationsVerifyPostRequestWithBody generates requests for HandleUploadAndVerifyApiV1AttestationsVerifyPost with any type of body -func NewHandleUploadAndVerifyApiV1AttestationsVerifyPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/attestations/verify") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleViewApiV1AttestationsViewChecksumGetRequest generates requests for HandleViewApiV1AttestationsViewChecksumGet -func NewHandleViewApiV1AttestationsViewChecksumGetRequest(server string, checksum string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "checksum", runtime.ParamLocationPath, checksum) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/attestations/view/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewConfirm2faSetupEndpointApiV1Auth2faConfirmPostRequest calls the generic Confirm2faSetupEndpointApiV1Auth2faConfirmPost builder with application/json body -func NewConfirm2faSetupEndpointApiV1Auth2faConfirmPostRequest(server string, body Confirm2faSetupEndpointApiV1Auth2faConfirmPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewConfirm2faSetupEndpointApiV1Auth2faConfirmPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewConfirm2faSetupEndpointApiV1Auth2faConfirmPostRequestWithBody generates requests for Confirm2faSetupEndpointApiV1Auth2faConfirmPost with any type of body -func NewConfirm2faSetupEndpointApiV1Auth2faConfirmPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/2fa/confirm") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewDisable2faEndpointApiV1Auth2faDisablePostRequest calls the generic Disable2faEndpointApiV1Auth2faDisablePost builder with application/json body -func NewDisable2faEndpointApiV1Auth2faDisablePostRequest(server string, body Disable2faEndpointApiV1Auth2faDisablePostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewDisable2faEndpointApiV1Auth2faDisablePostRequestWithBody(server, "application/json", bodyReader) -} - -// NewDisable2faEndpointApiV1Auth2faDisablePostRequestWithBody generates requests for Disable2faEndpointApiV1Auth2faDisablePost with any type of body -func NewDisable2faEndpointApiV1Auth2faDisablePostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/2fa/disable") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewRegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostRequest calls the generic RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPost builder with application/json body -func NewRegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostRequest(server string, body RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewRegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewRegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostRequestWithBody generates requests for RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPost with any type of body -func NewRegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/2fa/regenerate-backup-codes") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewSetup2faEndpointApiV1Auth2faSetupPostRequest generates requests for Setup2faEndpointApiV1Auth2faSetupPost -func NewSetup2faEndpointApiV1Auth2faSetupPostRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/2fa/setup") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGet2faStatusEndpointApiV1Auth2faStatusGetRequest generates requests for Get2faStatusEndpointApiV1Auth2faStatusGet -func NewGet2faStatusEndpointApiV1Auth2faStatusGetRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/2fa/status") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewVerify2faEndpointApiV1Auth2faVerifyPostRequest calls the generic Verify2faEndpointApiV1Auth2faVerifyPost builder with application/json body -func NewVerify2faEndpointApiV1Auth2faVerifyPostRequest(server string, body Verify2faEndpointApiV1Auth2faVerifyPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewVerify2faEndpointApiV1Auth2faVerifyPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewVerify2faEndpointApiV1Auth2faVerifyPostRequestWithBody generates requests for Verify2faEndpointApiV1Auth2faVerifyPost with any type of body -func NewVerify2faEndpointApiV1Auth2faVerifyPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/2fa/verify") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewVerify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostRequest calls the generic Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePost builder with application/json body -func NewVerify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostRequest(server string, body Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewVerify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostRequestWithBody(server, "application/json", bodyReader) -} - -// NewVerify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostRequestWithBody generates requests for Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePost with any type of body -func NewVerify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/2fa/verify-and-set-cookie") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewAuthenticatedApiV1AuthAuthenticatedGetRequest generates requests for AuthenticatedApiV1AuthAuthenticatedGet -func NewAuthenticatedApiV1AuthAuthenticatedGetRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/authenticated") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewApiChangeEmailApiV1AuthChangeEmailPostRequest calls the generic ApiChangeEmailApiV1AuthChangeEmailPost builder with application/json body -func NewApiChangeEmailApiV1AuthChangeEmailPostRequest(server string, body ApiChangeEmailApiV1AuthChangeEmailPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewApiChangeEmailApiV1AuthChangeEmailPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewApiChangeEmailApiV1AuthChangeEmailPostRequestWithBody generates requests for ApiChangeEmailApiV1AuthChangeEmailPost with any type of body -func NewApiChangeEmailApiV1AuthChangeEmailPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/change-email") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewDecodeLinkTokenApiV1AuthDecodeLinkTokenGetRequest generates requests for DecodeLinkTokenApiV1AuthDecodeLinkTokenGet -func NewDecodeLinkTokenApiV1AuthDecodeLinkTokenGetRequest(server string, params *DecodeLinkTokenApiV1AuthDecodeLinkTokenGetParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/decode-link-token") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "token", runtime.ParamLocationQuery, params.Token); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewAuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostRequest calls the generic AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePost builder with application/json body -func NewAuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostRequest(server string, body AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewAuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostRequestWithBody(server, "application/json", bodyReader) -} - -// NewAuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostRequestWithBody generates requests for AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePost with any type of body -func NewAuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/device/authorize") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewRequestDeviceCodeApiV1AuthDeviceCodePostRequest calls the generic RequestDeviceCodeApiV1AuthDeviceCodePost builder with application/json body -func NewRequestDeviceCodeApiV1AuthDeviceCodePostRequest(server string, body RequestDeviceCodeApiV1AuthDeviceCodePostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewRequestDeviceCodeApiV1AuthDeviceCodePostRequestWithBody(server, "application/json", bodyReader) -} - -// NewRequestDeviceCodeApiV1AuthDeviceCodePostRequestWithBody generates requests for RequestDeviceCodeApiV1AuthDeviceCodePost with any type of body -func NewRequestDeviceCodeApiV1AuthDeviceCodePostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/device/code") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewCheckDeviceStatusApiV1AuthDeviceStatusUserCodeGetRequest generates requests for CheckDeviceStatusApiV1AuthDeviceStatusUserCodeGet -func NewCheckDeviceStatusApiV1AuthDeviceStatusUserCodeGetRequest(server string, userCode string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "user_code", runtime.ParamLocationPath, userCode) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/device/status/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewPollDeviceTokenApiV1AuthDeviceTokenPostRequest calls the generic PollDeviceTokenApiV1AuthDeviceTokenPost builder with application/json body -func NewPollDeviceTokenApiV1AuthDeviceTokenPostRequest(server string, body PollDeviceTokenApiV1AuthDeviceTokenPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPollDeviceTokenApiV1AuthDeviceTokenPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewPollDeviceTokenApiV1AuthDeviceTokenPostRequestWithBody generates requests for PollDeviceTokenApiV1AuthDeviceTokenPost with any type of body -func NewPollDeviceTokenApiV1AuthDeviceTokenPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/device/token") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewForgotPasswordApiV1AuthForgotPasswordPostRequest calls the generic ForgotPasswordApiV1AuthForgotPasswordPost builder with application/json body -func NewForgotPasswordApiV1AuthForgotPasswordPostRequest(server string, body ForgotPasswordApiV1AuthForgotPasswordPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewForgotPasswordApiV1AuthForgotPasswordPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewForgotPasswordApiV1AuthForgotPasswordPostRequestWithBody generates requests for ForgotPasswordApiV1AuthForgotPasswordPost with any type of body -func NewForgotPasswordApiV1AuthForgotPasswordPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/forgot-password") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewLoginWithCookieApiV1AuthLoginPostRequestWithFormdataBody calls the generic LoginWithCookieApiV1AuthLoginPost builder with application/x-www-form-urlencoded body -func NewLoginWithCookieApiV1AuthLoginPostRequestWithFormdataBody(server string, body LoginWithCookieApiV1AuthLoginPostFormdataRequestBody) (*http.Request, error) { - var bodyReader io.Reader - bodyStr, err := runtime.MarshalForm(body, nil) - if err != nil { - return nil, err - } - bodyReader = strings.NewReader(bodyStr.Encode()) - return NewLoginWithCookieApiV1AuthLoginPostRequestWithBody(server, "application/x-www-form-urlencoded", bodyReader) -} - -// NewLoginWithCookieApiV1AuthLoginPostRequestWithBody generates requests for LoginWithCookieApiV1AuthLoginPost with any type of body -func NewLoginWithCookieApiV1AuthLoginPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/login") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewLoginWith2faApiV1AuthLoginWith2faPostRequest calls the generic LoginWith2faApiV1AuthLoginWith2faPost builder with application/json body -func NewLoginWith2faApiV1AuthLoginWith2faPostRequest(server string, body LoginWith2faApiV1AuthLoginWith2faPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewLoginWith2faApiV1AuthLoginWith2faPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewLoginWith2faApiV1AuthLoginWith2faPostRequestWithBody generates requests for LoginWith2faApiV1AuthLoginWith2faPost with any type of body -func NewLoginWith2faApiV1AuthLoginWith2faPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/login-with-2fa") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewLogoutApiV1AuthLogoutPostRequest generates requests for LogoutApiV1AuthLogoutPost -func NewLogoutApiV1AuthLogoutPostRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/logout") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewReadUsersMeApiV1AuthMeGetRequest generates requests for ReadUsersMeApiV1AuthMeGet -func NewReadUsersMeApiV1AuthMeGetRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/me") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetRequest generates requests for GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGet -func NewGithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetRequest(server string, params *GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/oauth/github/authorize") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.ReturnUrl != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "returnUrl", runtime.ParamLocationQuery, *params.ReturnUrl); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Invite != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "invite", runtime.ParamLocationQuery, *params.Invite); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Mode != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "mode", runtime.ParamLocationQuery, *params.Mode); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGithubOauthCallbackApiV1AuthOauthGithubCallbackGetRequest generates requests for GithubOauthCallbackApiV1AuthOauthGithubCallbackGet -func NewGithubOauthCallbackApiV1AuthOauthGithubCallbackGetRequest(server string, params *GithubOauthCallbackApiV1AuthOauthGithubCallbackGetParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/oauth/github/callback") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Code != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "code", runtime.ParamLocationQuery, *params.Code); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.State != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "state", runtime.ParamLocationQuery, *params.State); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Error != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "error", runtime.ParamLocationQuery, *params.Error); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.ErrorDescription != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "error_description", runtime.ParamLocationQuery, *params.ErrorDescription); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetRequest generates requests for GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGet -func NewGoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetRequest(server string, params *GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/oauth/google/authorize") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.ReturnUrl != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "returnUrl", runtime.ParamLocationQuery, *params.ReturnUrl); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Invite != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "invite", runtime.ParamLocationQuery, *params.Invite); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Mode != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "mode", runtime.ParamLocationQuery, *params.Mode); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetRequest generates requests for GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGet -func NewGoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetRequest(server string, params *GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/oauth/google/callback") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "code", runtime.ParamLocationQuery, params.Code); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - if params.State != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "state", runtime.ParamLocationQuery, *params.State); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleUpdatePasswordApiV1AuthPasswordPostRequest calls the generic HandleUpdatePasswordApiV1AuthPasswordPost builder with application/json body -func NewHandleUpdatePasswordApiV1AuthPasswordPostRequest(server string, body HandleUpdatePasswordApiV1AuthPasswordPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleUpdatePasswordApiV1AuthPasswordPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewHandleUpdatePasswordApiV1AuthPasswordPostRequestWithBody generates requests for HandleUpdatePasswordApiV1AuthPasswordPost with any type of body -func NewHandleUpdatePasswordApiV1AuthPasswordPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/password") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewRegisterUserApiV1AuthRegisterPostRequest calls the generic RegisterUserApiV1AuthRegisterPost builder with application/json body -func NewRegisterUserApiV1AuthRegisterPostRequest(server string, body RegisterUserApiV1AuthRegisterPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewRegisterUserApiV1AuthRegisterPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewRegisterUserApiV1AuthRegisterPostRequestWithBody generates requests for RegisterUserApiV1AuthRegisterPost with any type of body -func NewRegisterUserApiV1AuthRegisterPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/register") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostRequest calls the generic ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPost builder with application/json body -func NewApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostRequest(server string, body ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostRequestWithBody generates requests for ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPost with any type of body -func NewApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/request-email-verification") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleResetPasswordWithTokenApiV1AuthResetPasswordPutRequest calls the generic HandleResetPasswordWithTokenApiV1AuthResetPasswordPut builder with application/json body -func NewHandleResetPasswordWithTokenApiV1AuthResetPasswordPutRequest(server string, body HandleResetPasswordWithTokenApiV1AuthResetPasswordPutJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleResetPasswordWithTokenApiV1AuthResetPasswordPutRequestWithBody(server, "application/json", bodyReader) -} - -// NewHandleResetPasswordWithTokenApiV1AuthResetPasswordPutRequestWithBody generates requests for HandleResetPasswordWithTokenApiV1AuthResetPasswordPut with any type of body -func NewHandleResetPasswordWithTokenApiV1AuthResetPasswordPutRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/reset-password") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PUT", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewRevokeAllSessionsApiV1AuthSessionsDeleteRequest generates requests for RevokeAllSessionsApiV1AuthSessionsDelete -func NewRevokeAllSessionsApiV1AuthSessionsDeleteRequest(server string, params *RevokeAllSessionsApiV1AuthSessionsDeleteParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/sessions") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.RevokeCurrent != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "revoke_current", runtime.ParamLocationQuery, *params.RevokeCurrent); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("DELETE", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetActiveSessionsApiV1AuthSessionsGetRequest generates requests for GetActiveSessionsApiV1AuthSessionsGet -func NewGetActiveSessionsApiV1AuthSessionsGetRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/sessions") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewRevokeSessionEndpointApiV1AuthSessionsJtiDeleteRequest generates requests for RevokeSessionEndpointApiV1AuthSessionsJtiDelete -func NewRevokeSessionEndpointApiV1AuthSessionsJtiDeleteRequest(server string, jti string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "jti", runtime.ParamLocationPath, jti) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/sessions/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("DELETE", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewVerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostRequest calls the generic VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPost builder with application/json body -func NewVerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostRequest(server string, body VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewVerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewVerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostRequestWithBody generates requests for VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPost with any type of body -func NewVerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/step-up/verify") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewLoginForAccessTokenApiV1AuthTokenPostRequestWithFormdataBody calls the generic LoginForAccessTokenApiV1AuthTokenPost builder with application/x-www-form-urlencoded body -func NewLoginForAccessTokenApiV1AuthTokenPostRequestWithFormdataBody(server string, body LoginForAccessTokenApiV1AuthTokenPostFormdataRequestBody) (*http.Request, error) { - var bodyReader io.Reader - bodyStr, err := runtime.MarshalForm(body, nil) - if err != nil { - return nil, err - } - bodyReader = strings.NewReader(bodyStr.Encode()) - return NewLoginForAccessTokenApiV1AuthTokenPostRequestWithBody(server, "application/x-www-form-urlencoded", bodyReader) -} - -// NewLoginForAccessTokenApiV1AuthTokenPostRequestWithBody generates requests for LoginForAccessTokenApiV1AuthTokenPost with any type of body -func NewLoginForAccessTokenApiV1AuthTokenPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/token") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleUpdateUsernameApiV1AuthUsernamePutRequest calls the generic HandleUpdateUsernameApiV1AuthUsernamePut builder with application/json body -func NewHandleUpdateUsernameApiV1AuthUsernamePutRequest(server string, body HandleUpdateUsernameApiV1AuthUsernamePutJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleUpdateUsernameApiV1AuthUsernamePutRequestWithBody(server, "application/json", bodyReader) -} - -// NewHandleUpdateUsernameApiV1AuthUsernamePutRequestWithBody generates requests for HandleUpdateUsernameApiV1AuthUsernamePut with any type of body -func NewHandleUpdateUsernameApiV1AuthUsernamePutRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/username") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PUT", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewValidateResetTokenApiV1AuthValidateResetTokenGetRequest generates requests for ValidateResetTokenApiV1AuthValidateResetTokenGet -func NewValidateResetTokenApiV1AuthValidateResetTokenGetRequest(server string, params *ValidateResetTokenApiV1AuthValidateResetTokenGetParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/validate-reset-token") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "token", runtime.ParamLocationQuery, params.Token); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewVerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostRequest calls the generic VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPost builder with application/json body -func NewVerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostRequest(server string, body VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewVerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewVerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostRequestWithBody generates requests for VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPost with any type of body -func NewVerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/verify-and-link-oauth") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostRequest calls the generic ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPost builder with application/json body -func NewApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostRequest(server string, body ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostRequestWithBody generates requests for ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPost with any type of body -func NewApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/auth/verify-email-token") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleListCvmsApiV1CvmsGetRequest generates requests for HandleListCvmsApiV1CvmsGet -func NewHandleListCvmsApiV1CvmsGetRequest(server string, params *HandleListCvmsApiV1CvmsGetParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.UserId != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "user_id", runtime.ParamLocationQuery, *params.UserId); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.TeepodId != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "teepod_id", runtime.ParamLocationQuery, *params.TeepodId); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleCreateCvmFromPovisionApiV1CvmsPostRequest calls the generic HandleCreateCvmFromPovisionApiV1CvmsPost builder with application/json body -func NewHandleCreateCvmFromPovisionApiV1CvmsPostRequest(server string, body HandleCreateCvmFromPovisionApiV1CvmsPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleCreateCvmFromPovisionApiV1CvmsPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewHandleCreateCvmFromPovisionApiV1CvmsPostRequestWithBody generates requests for HandleCreateCvmFromPovisionApiV1CvmsPost with any type of body -func NewHandleCreateCvmFromPovisionApiV1CvmsPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleBatchStopCvmsApiV1CvmsBatchStopPostRequest calls the generic HandleBatchStopCvmsApiV1CvmsBatchStopPost builder with application/json body -func NewHandleBatchStopCvmsApiV1CvmsBatchStopPostRequest(server string, body HandleBatchStopCvmsApiV1CvmsBatchStopPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleBatchStopCvmsApiV1CvmsBatchStopPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewHandleBatchStopCvmsApiV1CvmsBatchStopPostRequestWithBody generates requests for HandleBatchStopCvmsApiV1CvmsBatchStopPost with any type of body -func NewHandleBatchStopCvmsApiV1CvmsBatchStopPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/batch-stop") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleCreateElizaFromProvisionApiV1CvmsElizaPostRequest calls the generic HandleCreateElizaFromProvisionApiV1CvmsElizaPost builder with application/json body -func NewHandleCreateElizaFromProvisionApiV1CvmsElizaPostRequest(server string, body HandleCreateElizaFromProvisionApiV1CvmsElizaPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleCreateElizaFromProvisionApiV1CvmsElizaPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewHandleCreateElizaFromProvisionApiV1CvmsElizaPostRequestWithBody generates requests for HandleCreateElizaFromProvisionApiV1CvmsElizaPost with any type of body -func NewHandleCreateElizaFromProvisionApiV1CvmsElizaPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/eliza") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostRequest calls the generic HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPost builder with application/json body -func NewHandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostRequest(server string, body HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewHandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostRequestWithBody generates requests for HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPost with any type of body -func NewHandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/from_cvm_configuration") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchRequest calls the generic HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatch builder with application/json body -func NewHandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchRequest(server string, body HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchRequestWithBody(server, "application/json", bodyReader) -} - -// NewHandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchRequestWithBody generates requests for HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatch with any type of body -func NewHandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/instance-ids") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PATCH", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleListCvmsPaginatedApiV1CvmsPaginatedGetRequest generates requests for HandleListCvmsPaginatedApiV1CvmsPaginatedGet -func NewHandleListCvmsPaginatedApiV1CvmsPaginatedGetRequest(server string, params *HandleListCvmsPaginatedApiV1CvmsPaginatedGetParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/paginated") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.UserId != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "user_id", runtime.ParamLocationQuery, *params.UserId); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.TeepodId != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "teepod_id", runtime.ParamLocationQuery, *params.TeepodId); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Page != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.PageSize != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page_size", runtime.ParamLocationQuery, *params.PageSize); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleProvisionCvmApiV1CvmsProvisionPostRequest calls the generic HandleProvisionCvmApiV1CvmsProvisionPost builder with application/json body -func NewHandleProvisionCvmApiV1CvmsProvisionPostRequest(server string, body HandleProvisionCvmApiV1CvmsProvisionPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleProvisionCvmApiV1CvmsProvisionPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewHandleProvisionCvmApiV1CvmsProvisionPostRequestWithBody generates requests for HandleProvisionCvmApiV1CvmsProvisionPost with any type of body -func NewHandleProvisionCvmApiV1CvmsProvisionPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/provision") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostRequest calls the generic HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPost builder with application/json body -func NewHandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostRequest(server string, body HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewHandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostRequestWithBody generates requests for HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPost with any type of body -func NewHandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/provision/eliza") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostRequest calls the generic HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPost builder with application/json body -func NewHandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostRequest(server string, body HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewHandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostRequestWithBody generates requests for HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPost with any type of body -func NewHandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/pubkey/from_cvm_configuration") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleCreateCvmForWorkloadApiV1CvmsWorkloadPostRequest calls the generic HandleCreateCvmForWorkloadApiV1CvmsWorkloadPost builder with application/json body -func NewHandleCreateCvmForWorkloadApiV1CvmsWorkloadPostRequest(server string, body HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleCreateCvmForWorkloadApiV1CvmsWorkloadPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewHandleCreateCvmForWorkloadApiV1CvmsWorkloadPostRequestWithBody generates requests for HandleCreateCvmForWorkloadApiV1CvmsWorkloadPost with any type of body -func NewHandleCreateCvmForWorkloadApiV1CvmsWorkloadPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/workload") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleRemoveCvmApiV1CvmsCvmIdDeleteRequest generates requests for HandleRemoveCvmApiV1CvmsCvmIdDelete -func NewHandleRemoveCvmApiV1CvmsCvmIdDeleteRequest(server string, cvmId string, params *HandleRemoveCvmApiV1CvmsCvmIdDeleteParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Polling != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "polling", runtime.ParamLocationQuery, *params.Polling); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("DELETE", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleGetCvmApiV1CvmsCvmIdGetRequest generates requests for HandleGetCvmApiV1CvmsCvmIdGet -func NewHandleGetCvmApiV1CvmsCvmIdGetRequest(server string, cvmId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleGetCvmAttestationApiV1CvmsCvmIdAttestationGetRequest generates requests for HandleGetCvmAttestationApiV1CvmsCvmIdAttestationGet -func NewHandleGetCvmAttestationApiV1CvmsCvmIdAttestationGetRequest(server string, cvmId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/attestation", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGetRequest generates requests for GetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGet -func NewGetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGetRequest(server string, cvmId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/available-os-images", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleGetCvmComposeApiV1CvmsCvmIdComposeGetRequest generates requests for HandleGetCvmComposeApiV1CvmsCvmIdComposeGet -func NewHandleGetCvmComposeApiV1CvmsCvmIdComposeGetRequest(server string, cvmId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/compose", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandlePatchCvmComposeApiV1CvmsCvmIdComposePatchRequest calls the generic HandlePatchCvmComposeApiV1CvmsCvmIdComposePatch builder with application/json body -func NewHandlePatchCvmComposeApiV1CvmsCvmIdComposePatchRequest(server string, cvmId string, body HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandlePatchCvmComposeApiV1CvmsCvmIdComposePatchRequestWithBody(server, cvmId, "application/json", bodyReader) -} - -// NewHandlePatchCvmComposeApiV1CvmsCvmIdComposePatchRequestWithBody generates requests for HandlePatchCvmComposeApiV1CvmsCvmIdComposePatch with any type of body -func NewHandlePatchCvmComposeApiV1CvmsCvmIdComposePatchRequestWithBody(server string, cvmId string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/compose", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PATCH", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleUpdateCvmComposeApiV1CvmsCvmIdComposePutRequest calls the generic HandleUpdateCvmComposeApiV1CvmsCvmIdComposePut builder with application/json body -func NewHandleUpdateCvmComposeApiV1CvmsCvmIdComposePutRequest(server string, cvmId string, body HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleUpdateCvmComposeApiV1CvmsCvmIdComposePutRequestWithBody(server, cvmId, "application/json", bodyReader) -} - -// NewHandleUpdateCvmComposeApiV1CvmsCvmIdComposePutRequestWithBody generates requests for HandleUpdateCvmComposeApiV1CvmsCvmIdComposePut with any type of body -func NewHandleUpdateCvmComposeApiV1CvmsCvmIdComposePutRequestWithBody(server string, cvmId string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/compose", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PUT", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewGetCvmComposeFileApiV1CvmsCvmIdComposeFileGetRequest generates requests for GetCvmComposeFileApiV1CvmsCvmIdComposeFileGet -func NewGetCvmComposeFileApiV1CvmsCvmIdComposeFileGetRequest(server string, cvmId string, params *GetCvmComposeFileApiV1CvmsCvmIdComposeFileGetParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/compose_file", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Raw != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "raw", runtime.ParamLocationQuery, *params.Raw); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewTriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchRequest calls the generic TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatch builder with application/json body -func NewTriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchRequest(server string, cvmId string, body TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewTriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchRequestWithBody(server, cvmId, "application/json", bodyReader) -} - -// NewTriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchRequestWithBody generates requests for TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatch with any type of body -func NewTriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchRequestWithBody(server string, cvmId string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/compose_file", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PATCH", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewSubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostRequest calls the generic SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePost builder with application/json body -func NewSubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostRequest(server string, cvmId string, body SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewSubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostRequestWithBody(server, cvmId, "application/json", bodyReader) -} - -// NewSubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostRequestWithBody generates requests for SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePost with any type of body -func NewSubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostRequestWithBody(server string, cvmId string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/compose_file", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostRequest calls the generic ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPost builder with application/json body -func NewProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostRequest(server string, cvmId string, body ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostRequestWithBody(server, cvmId, "application/json", bodyReader) -} - -// NewProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostRequestWithBody generates requests for ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPost with any type of body -func NewProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostRequestWithBody(server string, cvmId string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/compose_file/provision", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleGetCvmCompositionApiV1CvmsCvmIdCompositionGetRequest generates requests for HandleGetCvmCompositionApiV1CvmsCvmIdCompositionGet -func NewHandleGetCvmCompositionApiV1CvmsCvmIdCompositionGetRequest(server string, cvmId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/composition", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewDiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostRequest calls the generic DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePost builder with application/json body -func NewDiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostRequest(server string, cvmId string, body DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewDiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostRequestWithBody(server, cvmId, "application/json", bodyReader) -} - -// NewDiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostRequestWithBody generates requests for DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePost with any type of body -func NewDiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostRequestWithBody(server string, cvmId string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/customize-domain-diagnose", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewUpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchRequestWithBody generates requests for UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatch with any type of body -func NewUpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchRequestWithBody(server string, cvmId string, params *UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchParams, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/docker-compose", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PATCH", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - if params != nil { - - if params.XComposeHash != nil { - var headerParam0 string - - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Compose-Hash", runtime.ParamLocationHeader, *params.XComposeHash) - if err != nil { - return nil, err - } - - req.Header.Set("X-Compose-Hash", headerParam0) - } - - if params.XTransactionHash != nil { - var headerParam1 string - - headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Transaction-Hash", runtime.ParamLocationHeader, *params.XTransactionHash) - if err != nil { - return nil, err - } - - req.Header.Set("X-Transaction-Hash", headerParam1) - } - - } - - return req, nil -} - -// NewHandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGetRequest generates requests for HandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGet -func NewHandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGetRequest(server string, cvmId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/docker-compose.yml", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewUpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchRequest calls the generic UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatch builder with application/json body -func NewUpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchRequest(server string, cvmId string, body UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewUpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchRequestWithBody(server, cvmId, "application/json", bodyReader) -} - -// NewUpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchRequestWithBody generates requests for UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatch with any type of body -func NewUpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchRequestWithBody(server string, cvmId string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/envs", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PATCH", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchRequest calls the generic HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatch builder with application/json body -func NewHandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchRequest(server string, cvmId string, body HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchRequestWithBody(server, cvmId, "application/json", bodyReader) -} - -// NewHandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchRequestWithBody generates requests for HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatch with any type of body -func NewHandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchRequestWithBody(server string, cvmId string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/instance-id", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PATCH", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleUpdateCvmListedApiV1CvmsCvmIdListedPatchRequest calls the generic HandleUpdateCvmListedApiV1CvmsCvmIdListedPatch builder with application/json body -func NewHandleUpdateCvmListedApiV1CvmsCvmIdListedPatchRequest(server string, cvmId string, body HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleUpdateCvmListedApiV1CvmsCvmIdListedPatchRequestWithBody(server, cvmId, "application/json", bodyReader) -} - -// NewHandleUpdateCvmListedApiV1CvmsCvmIdListedPatchRequestWithBody generates requests for HandleUpdateCvmListedApiV1CvmsCvmIdListedPatch with any type of body -func NewHandleUpdateCvmListedApiV1CvmsCvmIdListedPatchRequestWithBody(server string, cvmId string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/listed", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PATCH", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleUpdateCvmNameApiV1CvmsCvmIdNamePatchRequest calls the generic HandleUpdateCvmNameApiV1CvmsCvmIdNamePatch builder with application/json body -func NewHandleUpdateCvmNameApiV1CvmsCvmIdNamePatchRequest(server string, cvmId string, body HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleUpdateCvmNameApiV1CvmsCvmIdNamePatchRequestWithBody(server, cvmId, "application/json", bodyReader) -} - -// NewHandleUpdateCvmNameApiV1CvmsCvmIdNamePatchRequestWithBody generates requests for HandleUpdateCvmNameApiV1CvmsCvmIdNamePatch with any type of body -func NewHandleUpdateCvmNameApiV1CvmsCvmIdNamePatchRequestWithBody(server string, cvmId string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/name", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PATCH", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGetRequest generates requests for HandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGet -func NewHandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGetRequest(server string, cvmId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/network", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetOperationStatusApiV1CvmsCvmIdOperationStatusGetRequest generates requests for GetOperationStatusApiV1CvmsCvmIdOperationStatusGet -func NewGetOperationStatusApiV1CvmsCvmIdOperationStatusGetRequest(server string, cvmId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/operation-status", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetCvmOperationsApiV1CvmsCvmIdOperationsGetRequest generates requests for GetCvmOperationsApiV1CvmsCvmIdOperationsGet -func NewGetCvmOperationsApiV1CvmsCvmIdOperationsGetRequest(server string, cvmId string, params *GetCvmOperationsApiV1CvmsCvmIdOperationsGetParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/operations", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Cursor != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cursor", runtime.ParamLocationQuery, *params.Cursor); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Limit != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.StartTime != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "start_time", runtime.ParamLocationQuery, *params.StartTime); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.EndTime != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "end_time", runtime.ParamLocationQuery, *params.EndTime); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.OperationTypes != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "operation_types", runtime.ParamLocationQuery, *params.OperationTypes); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewUpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchRequest calls the generic UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatch builder with application/json body -func NewUpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchRequest(server string, cvmId string, body UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewUpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchRequestWithBody(server, cvmId, "application/json", bodyReader) -} - -// NewUpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchRequestWithBody generates requests for UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatch with any type of body -func NewUpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchRequestWithBody(server string, cvmId string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/os-image", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PATCH", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGetRequest generates requests for HandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGet -func NewHandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGetRequest(server string, cvmId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/pre-launch-script", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewUpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchRequestWithBody generates requests for UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatch with any type of body -func NewUpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchRequestWithBody(server string, cvmId string, params *UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchParams, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/pre-launch-script", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PATCH", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - if params != nil { - - if params.XComposeHash != nil { - var headerParam0 string - - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Compose-Hash", runtime.ParamLocationHeader, *params.XComposeHash) - if err != nil { - return nil, err - } - - req.Header.Set("X-Compose-Hash", headerParam0) - } - - if params.XTransactionHash != nil { - var headerParam1 string - - headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Transaction-Hash", runtime.ParamLocationHeader, *params.XTransactionHash) - if err != nil { - return nil, err - } - - req.Header.Set("X-Transaction-Hash", headerParam1) - } - - } - - return req, nil -} - -// NewHandleReplicateCvmApiV1CvmsCvmIdReplicasPostRequest calls the generic HandleReplicateCvmApiV1CvmsCvmIdReplicasPost builder with application/json body -func NewHandleReplicateCvmApiV1CvmsCvmIdReplicasPostRequest(server string, cvmId string, body HandleReplicateCvmApiV1CvmsCvmIdReplicasPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleReplicateCvmApiV1CvmsCvmIdReplicasPostRequestWithBody(server, cvmId, "application/json", bodyReader) -} - -// NewHandleReplicateCvmApiV1CvmsCvmIdReplicasPostRequestWithBody generates requests for HandleReplicateCvmApiV1CvmsCvmIdReplicasPost with any type of body -func NewHandleReplicateCvmApiV1CvmsCvmIdReplicasPostRequestWithBody(server string, cvmId string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/replicas", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleResizeCvmApiV1CvmsCvmIdResourcesPatchRequest calls the generic HandleResizeCvmApiV1CvmsCvmIdResourcesPatch builder with application/json body -func NewHandleResizeCvmApiV1CvmsCvmIdResourcesPatchRequest(server string, cvmId string, params *HandleResizeCvmApiV1CvmsCvmIdResourcesPatchParams, body HandleResizeCvmApiV1CvmsCvmIdResourcesPatchJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleResizeCvmApiV1CvmsCvmIdResourcesPatchRequestWithBody(server, cvmId, params, "application/json", bodyReader) -} - -// NewHandleResizeCvmApiV1CvmsCvmIdResourcesPatchRequestWithBody generates requests for HandleResizeCvmApiV1CvmsCvmIdResourcesPatch with any type of body -func NewHandleResizeCvmApiV1CvmsCvmIdResourcesPatchRequestWithBody(server string, cvmId string, params *HandleResizeCvmApiV1CvmsCvmIdResourcesPatchParams, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/resources", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Polling != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "polling", runtime.ParamLocationQuery, *params.Polling); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("PATCH", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleRestartCvmApiV1CvmsCvmIdRestartPostRequest calls the generic HandleRestartCvmApiV1CvmsCvmIdRestartPost builder with application/json body -func NewHandleRestartCvmApiV1CvmsCvmIdRestartPostRequest(server string, cvmId string, body HandleRestartCvmApiV1CvmsCvmIdRestartPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleRestartCvmApiV1CvmsCvmIdRestartPostRequestWithBody(server, cvmId, "application/json", bodyReader) -} - -// NewHandleRestartCvmApiV1CvmsCvmIdRestartPostRequestWithBody generates requests for HandleRestartCvmApiV1CvmsCvmIdRestartPost with any type of body -func NewHandleRestartCvmApiV1CvmsCvmIdRestartPostRequestWithBody(server string, cvmId string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/restart", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewRedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostRequest generates requests for RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPost -func NewRedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostRequest(server string, cvmId string, revisionId string, params *RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "revision_id", runtime.ParamLocationPath, revisionId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/revisions/%s/redeploy", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.TransactionHash != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "transaction_hash", runtime.ParamLocationQuery, *params.TransactionHash); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("POST", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchRequest calls the generic HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatch builder with application/json body -func NewHandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchRequest(server string, cvmId string, body HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchRequestWithBody(server, cvmId, "application/json", bodyReader) -} - -// NewHandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchRequestWithBody generates requests for HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatch with any type of body -func NewHandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchRequestWithBody(server string, cvmId string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/scheduled-delete", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PATCH", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleShutdownCvmApiV1CvmsCvmIdShutdownPostRequest calls the generic HandleShutdownCvmApiV1CvmsCvmIdShutdownPost builder with application/json body -func NewHandleShutdownCvmApiV1CvmsCvmIdShutdownPostRequest(server string, cvmId string, body HandleShutdownCvmApiV1CvmsCvmIdShutdownPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleShutdownCvmApiV1CvmsCvmIdShutdownPostRequestWithBody(server, cvmId, "application/json", bodyReader) -} - -// NewHandleShutdownCvmApiV1CvmsCvmIdShutdownPostRequestWithBody generates requests for HandleShutdownCvmApiV1CvmsCvmIdShutdownPost with any type of body -func NewHandleShutdownCvmApiV1CvmsCvmIdShutdownPostRequestWithBody(server string, cvmId string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/shutdown", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleStartCvmApiV1CvmsCvmIdStartPostRequest calls the generic HandleStartCvmApiV1CvmsCvmIdStartPost builder with application/json body -func NewHandleStartCvmApiV1CvmsCvmIdStartPostRequest(server string, cvmId string, body HandleStartCvmApiV1CvmsCvmIdStartPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleStartCvmApiV1CvmsCvmIdStartPostRequestWithBody(server, cvmId, "application/json", bodyReader) -} - -// NewHandleStartCvmApiV1CvmsCvmIdStartPostRequestWithBody generates requests for HandleStartCvmApiV1CvmsCvmIdStartPost with any type of body -func NewHandleStartCvmApiV1CvmsCvmIdStartPostRequestWithBody(server string, cvmId string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/start", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewHandleGetCvmStateApiV1CvmsCvmIdStateGetRequest generates requests for HandleGetCvmStateApiV1CvmsCvmIdStateGet -func NewHandleGetCvmStateApiV1CvmsCvmIdStateGetRequest(server string, cvmId string, params *HandleGetCvmStateApiV1CvmsCvmIdStateGetParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/state", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Target != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "target", runtime.ParamLocationQuery, *params.Target); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Interval != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "interval", runtime.ParamLocationQuery, *params.Interval); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Timeout != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "timeout", runtime.ParamLocationQuery, *params.Timeout); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleGetCvmStatsApiV1CvmsCvmIdStatsGetRequest generates requests for HandleGetCvmStatsApiV1CvmsCvmIdStatsGet -func NewHandleGetCvmStatsApiV1CvmsCvmIdStatsGetRequest(server string, cvmId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/stats", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleStopCvmApiV1CvmsCvmIdStopPostRequest calls the generic HandleStopCvmApiV1CvmsCvmIdStopPost builder with application/json body -func NewHandleStopCvmApiV1CvmsCvmIdStopPostRequest(server string, cvmId string, body HandleStopCvmApiV1CvmsCvmIdStopPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleStopCvmApiV1CvmsCvmIdStopPostRequestWithBody(server, cvmId, "application/json", bodyReader) -} - -// NewHandleStopCvmApiV1CvmsCvmIdStopPostRequestWithBody generates requests for HandleStopCvmApiV1CvmsCvmIdStopPost with any type of body -func NewHandleStopCvmApiV1CvmsCvmIdStopPostRequestWithBody(server string, cvmId string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/stop", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewGetCvmUserConfigApiV1CvmsCvmIdUserConfigGetRequest generates requests for GetCvmUserConfigApiV1CvmsCvmIdUserConfigGet -func NewGetCvmUserConfigApiV1CvmsCvmIdUserConfigGetRequest(server string, cvmId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/user_config", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchRequest calls the generic HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatch builder with application/json body -func NewHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchRequest(server string, cvmId string, body HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchRequestWithBody(server, cvmId, "application/json", bodyReader) -} - -// NewHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchRequestWithBody generates requests for HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatch with any type of body -func NewHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchRequestWithBody(server string, cvmId string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/cvms/%s/visibility", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PATCH", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewListKmsApiV1KmsGetRequest generates requests for ListKmsApiV1KmsGet -func NewListKmsApiV1KmsGetRequest(server string, params *ListKmsApiV1KmsGetParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/kms") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Page != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.PageSize != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page_size", runtime.ParamLocationQuery, *params.PageSize); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.IsOnchain != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "is_onchain", runtime.ParamLocationQuery, *params.IsOnchain); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetNextAppIdApiV1KmsPhalaNextAppIdGetRequest generates requests for GetNextAppIdApiV1KmsPhalaNextAppIdGet -func NewGetNextAppIdApiV1KmsPhalaNextAppIdGetRequest(server string, params *GetNextAppIdApiV1KmsPhalaNextAppIdGetParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/kms/phala/next_app_id") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Counts != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "counts", runtime.ParamLocationQuery, *params.Counts); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetKmsInfoApiV1KmsKmsIdGetRequest generates requests for GetKmsInfoApiV1KmsKmsIdGet -func NewGetKmsInfoApiV1KmsKmsIdGetRequest(server string, kmsId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "kms_id", runtime.ParamLocationPath, kmsId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/kms/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGetRequest generates requests for GetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGet -func NewGetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGetRequest(server string, kmsId string, appId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "kms_id", runtime.ParamLocationPath, kmsId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "app_id", runtime.ParamLocationPath, appId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/kms/%s/pubkey/%s", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewListRedpillApiKeysApiV1RedpillApiKeysGetRequest generates requests for ListRedpillApiKeysApiV1RedpillApiKeysGet -func NewListRedpillApiKeysApiV1RedpillApiKeysGetRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/redpill/api-keys") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewCreateRedpillApiKeyApiV1RedpillApiKeysPostRequest calls the generic CreateRedpillApiKeyApiV1RedpillApiKeysPost builder with application/json body -func NewCreateRedpillApiKeyApiV1RedpillApiKeysPostRequest(server string, body CreateRedpillApiKeyApiV1RedpillApiKeysPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreateRedpillApiKeyApiV1RedpillApiKeysPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewCreateRedpillApiKeyApiV1RedpillApiKeysPostRequestWithBody generates requests for CreateRedpillApiKeyApiV1RedpillApiKeysPost with any type of body -func NewCreateRedpillApiKeyApiV1RedpillApiKeysPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/redpill/api-keys") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewUpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchRequest generates requests for UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatch -func NewUpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchRequest(server string, apiKeyId int, params *UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "api_key_id", runtime.ParamLocationPath, apiKeyId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/redpill/api-keys/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "active", runtime.ParamLocationQuery, params.Active); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("PATCH", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewConnectRedpillUserApiV1RedpillConnectPostRequest generates requests for ConnectRedpillUserApiV1RedpillConnectPost -func NewConnectRedpillUserApiV1RedpillConnectPostRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/redpill/connect") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewListApiKeyLogsApiV1RedpillLogsApiKeyIdGetRequest generates requests for ListApiKeyLogsApiV1RedpillLogsApiKeyIdGet -func NewListApiKeyLogsApiV1RedpillLogsApiKeyIdGetRequest(server string, apiKeyId int) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "api_key_id", runtime.ParamLocationPath, apiKeyId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/redpill/logs/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewListModelsApiV1RedpillModelsGetRequest generates requests for ListModelsApiV1RedpillModelsGet -func NewListModelsApiV1RedpillModelsGetRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/redpill/models") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetDailyUsageApiV1RedpillUsageDailyGetRequest generates requests for GetDailyUsageApiV1RedpillUsageDailyGet -func NewGetDailyUsageApiV1RedpillUsageDailyGetRequest(server string, params *GetDailyUsageApiV1RedpillUsageDailyGetParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/redpill/usage/daily") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.KeyId != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "key_id", runtime.ParamLocationQuery, *params.KeyId); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.StartDate != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "start_date", runtime.ParamLocationQuery, *params.StartDate); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.EndDate != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "end_date", runtime.ParamLocationQuery, *params.EndDate); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetUsageLogsApiV1RedpillUsageLogsGetRequest generates requests for GetUsageLogsApiV1RedpillUsageLogsGet -func NewGetUsageLogsApiV1RedpillUsageLogsGetRequest(server string, params *GetUsageLogsApiV1RedpillUsageLogsGetParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/redpill/usage/logs") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.KeyId != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "key_id", runtime.ParamLocationQuery, *params.KeyId); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.StartDate != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "start_date", runtime.ParamLocationQuery, *params.StartDate); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.EndDate != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "end_date", runtime.ParamLocationQuery, *params.EndDate); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Page != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.PageSize != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page_size", runtime.ParamLocationQuery, *params.PageSize); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleBatchCvmStatusApiV1StatusBatchPostRequest calls the generic HandleBatchCvmStatusApiV1StatusBatchPost builder with application/json body -func NewHandleBatchCvmStatusApiV1StatusBatchPostRequest(server string, body HandleBatchCvmStatusApiV1StatusBatchPostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewHandleBatchCvmStatusApiV1StatusBatchPostRequestWithBody(server, "application/json", bodyReader) -} - -// NewHandleBatchCvmStatusApiV1StatusBatchPostRequestWithBody generates requests for HandleBatchCvmStatusApiV1StatusBatchPost with any type of body -func NewHandleBatchCvmStatusApiV1StatusBatchPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/status/batch") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewListTeepodsApiV1TeepodsGetRequest generates requests for ListTeepodsApiV1TeepodsGet -func NewListTeepodsApiV1TeepodsGetRequest(server string, params *ListTeepodsApiV1TeepodsGetParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/teepods") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Enabled != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "enabled", runtime.ParamLocationQuery, *params.Enabled); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleGetAvailableTeepodsApiV1TeepodsAvailableGetRequest generates requests for HandleGetAvailableTeepodsApiV1TeepodsAvailableGet -func NewHandleGetAvailableTeepodsApiV1TeepodsAvailableGetRequest(server string, params *HandleGetAvailableTeepodsApiV1TeepodsAvailableGetParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/teepods/available") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.V03xOnly != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "v03x_only", runtime.ParamLocationQuery, *params.V03xOnly); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGetRequest generates requests for HandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGet -func NewHandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGetRequest(server string, teepodId int) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "teepod_id", runtime.ParamLocationPath, teepodId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/teepods/%s/cvms", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPostRequest generates requests for HandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPost -func NewHandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPostRequest(server string, teepodId int, appId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "teepod_id", runtime.ParamLocationPath, teepodId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "app_id", runtime.ParamLocationPath, appId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/teepods/%s/cvms/%s/list", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGetRequest generates requests for ListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGet -func NewListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGetRequest(server string, teepodId int) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "teepod_id", runtime.ParamLocationPath, teepodId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/teepods/%s/images", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleListPublicCvmsApiV1VerifiedAppsGetRequest generates requests for HandleListPublicCvmsApiV1VerifiedAppsGet -func NewHandleListPublicCvmsApiV1VerifiedAppsGetRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/verified_apps") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGetRequest generates requests for HandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGet -func NewHandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGetRequest(server string, cvmId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cvm_id", runtime.ParamLocationPath, cvmId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/v1/verified_apps/%s/attestation", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHealthCheckHealthGetRequest generates requests for HealthCheckHealthGet -func NewHealthCheckHealthGetRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/health") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { - for _, r := range c.RequestEditors { - if err := r(ctx, req); err != nil { - return err - } - } - for _, r := range additionalEditors { - if err := r(ctx, req); err != nil { - return err - } - } - return nil -} - -// ClientWithResponses builds on ClientInterface to offer response payloads -type ClientWithResponses struct { - ClientInterface -} - -// NewClientWithResponses creates a new ClientWithResponses, which wraps -// Client with return type handling -func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { - client, err := NewClient(server, opts...) - if err != nil { - return nil, err - } - return &ClientWithResponses{client}, nil -} - -// WithBaseURL overrides the baseURL. -func WithBaseURL(baseURL string) ClientOption { - return func(c *Client) error { - newBaseURL, err := url.Parse(baseURL) - if err != nil { - return err - } - c.Server = newBaseURL.String() - return nil - } -} - -// ClientWithResponsesInterface is the interface specification for the client with responses above. -type ClientWithResponsesInterface interface { - // ListDstackAppsApiV1AppsGetWithResponse request - ListDstackAppsApiV1AppsGetWithResponse(ctx context.Context, params *ListDstackAppsApiV1AppsGetParams, reqEditors ...RequestEditorFn) (*ListDstackAppsApiV1AppsGetResponse, error) - - // GetFilterOptionsApiV1AppsFilterOptionsGetWithResponse request - GetFilterOptionsApiV1AppsFilterOptionsGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetFilterOptionsApiV1AppsFilterOptionsGetResponse, error) - - // GetDstackAppApiV1AppsAppIdGetWithResponse request - GetDstackAppApiV1AppsAppIdGetWithResponse(ctx context.Context, appId string, reqEditors ...RequestEditorFn) (*GetDstackAppApiV1AppsAppIdGetResponse, error) - - // HandleGetAppAttestationApiV1AppsAppIdAttestationsGetWithResponse request - HandleGetAppAttestationApiV1AppsAppIdAttestationsGetWithResponse(ctx context.Context, appId string, reqEditors ...RequestEditorFn) (*HandleGetAppAttestationApiV1AppsAppIdAttestationsGetResponse, error) - - // HandleGetAppCvmsApiV1AppsAppIdCvmsGetWithResponse request - HandleGetAppCvmsApiV1AppsAppIdCvmsGetWithResponse(ctx context.Context, appId string, reqEditors ...RequestEditorFn) (*HandleGetAppCvmsApiV1AppsAppIdCvmsGetResponse, error) - - // HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostWithBodyWithResponse request with any body - HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostWithBodyWithResponse(ctx context.Context, appId string, vmUuid string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostResponse, error) - - HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostWithResponse(ctx context.Context, appId string, vmUuid string, body HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostResponse, error) - - // GetAppEventsApiV1AppsAppIdEventsGetWithResponse request - GetAppEventsApiV1AppsAppIdEventsGetWithResponse(ctx context.Context, appId string, params *GetAppEventsApiV1AppsAppIdEventsGetParams, reqEditors ...RequestEditorFn) (*GetAppEventsApiV1AppsAppIdEventsGetResponse, error) - - // GetAppRevisionsApiV1AppsAppIdRevisionsGetWithResponse request - GetAppRevisionsApiV1AppsAppIdRevisionsGetWithResponse(ctx context.Context, appId string, params *GetAppRevisionsApiV1AppsAppIdRevisionsGetParams, reqEditors ...RequestEditorFn) (*GetAppRevisionsApiV1AppsAppIdRevisionsGetResponse, error) - - // GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetWithResponse request - GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetWithResponse(ctx context.Context, appId string, revisionId string, params *GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetParams, reqEditors ...RequestEditorFn) (*GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetResponse, error) - - // RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostWithBodyWithResponse request with any body - RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostWithBodyWithResponse(ctx context.Context, appId string, revisionId string, params *RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostResponse, error) - - RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostWithResponse(ctx context.Context, appId string, revisionId string, params *RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostParams, body RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostJSONRequestBody, reqEditors ...RequestEditorFn) (*RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostResponse, error) - - // GetAppUsageApiV1AppsAppIdUsageGetWithResponse request - GetAppUsageApiV1AppsAppIdUsageGetWithResponse(ctx context.Context, appId string, params *GetAppUsageApiV1AppsAppIdUsageGetParams, reqEditors ...RequestEditorFn) (*GetAppUsageApiV1AppsAppIdUsageGetResponse, error) - - // GetCollateralApiV1AttestationsCollateralChecksumGetWithResponse request - GetCollateralApiV1AttestationsCollateralChecksumGetWithResponse(ctx context.Context, checksum string, reqEditors ...RequestEditorFn) (*GetCollateralApiV1AttestationsCollateralChecksumGetResponse, error) - - // HandleListDeviceIdsApiV1AttestationsDeviceIdsGetWithResponse request - HandleListDeviceIdsApiV1AttestationsDeviceIdsGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HandleListDeviceIdsApiV1AttestationsDeviceIdsGetResponse, error) - - // HandleListNodesApiV1AttestationsNodesGetWithResponse request - HandleListNodesApiV1AttestationsNodesGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HandleListNodesApiV1AttestationsNodesGetResponse, error) - - // HandleListPpidsApiV1AttestationsPpidsGetWithResponse request - HandleListPpidsApiV1AttestationsPpidsGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HandleListPpidsApiV1AttestationsPpidsGetResponse, error) - - // HandleGetRawApiV1AttestationsRawChecksumGetWithResponse request - HandleGetRawApiV1AttestationsRawChecksumGetWithResponse(ctx context.Context, checksum string, reqEditors ...RequestEditorFn) (*HandleGetRawApiV1AttestationsRawChecksumGetResponse, error) - - // HandleCheckRawFileApiV1AttestationsRawChecksumHeadWithResponse request - HandleCheckRawFileApiV1AttestationsRawChecksumHeadWithResponse(ctx context.Context, checksum string, reqEditors ...RequestEditorFn) (*HandleCheckRawFileApiV1AttestationsRawChecksumHeadResponse, error) - - // HandleListRecentApiV1AttestationsRecentGetWithResponse request - HandleListRecentApiV1AttestationsRecentGetWithResponse(ctx context.Context, params *HandleListRecentApiV1AttestationsRecentGetParams, reqEditors ...RequestEditorFn) (*HandleListRecentApiV1AttestationsRecentGetResponse, error) - - // HandleUploadAndVerifyApiV1AttestationsVerifyPostWithBodyWithResponse request with any body - HandleUploadAndVerifyApiV1AttestationsVerifyPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleUploadAndVerifyApiV1AttestationsVerifyPostResponse, error) - - // HandleViewApiV1AttestationsViewChecksumGetWithResponse request - HandleViewApiV1AttestationsViewChecksumGetWithResponse(ctx context.Context, checksum string, reqEditors ...RequestEditorFn) (*HandleViewApiV1AttestationsViewChecksumGetResponse, error) - - // Confirm2faSetupEndpointApiV1Auth2faConfirmPostWithBodyWithResponse request with any body - Confirm2faSetupEndpointApiV1Auth2faConfirmPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*Confirm2faSetupEndpointApiV1Auth2faConfirmPostResponse, error) - - Confirm2faSetupEndpointApiV1Auth2faConfirmPostWithResponse(ctx context.Context, body Confirm2faSetupEndpointApiV1Auth2faConfirmPostJSONRequestBody, reqEditors ...RequestEditorFn) (*Confirm2faSetupEndpointApiV1Auth2faConfirmPostResponse, error) - - // Disable2faEndpointApiV1Auth2faDisablePostWithBodyWithResponse request with any body - Disable2faEndpointApiV1Auth2faDisablePostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*Disable2faEndpointApiV1Auth2faDisablePostResponse, error) - - Disable2faEndpointApiV1Auth2faDisablePostWithResponse(ctx context.Context, body Disable2faEndpointApiV1Auth2faDisablePostJSONRequestBody, reqEditors ...RequestEditorFn) (*Disable2faEndpointApiV1Auth2faDisablePostResponse, error) - - // RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostWithBodyWithResponse request with any body - RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostResponse, error) - - RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostWithResponse(ctx context.Context, body RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostJSONRequestBody, reqEditors ...RequestEditorFn) (*RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostResponse, error) - - // Setup2faEndpointApiV1Auth2faSetupPostWithResponse request - Setup2faEndpointApiV1Auth2faSetupPostWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*Setup2faEndpointApiV1Auth2faSetupPostResponse, error) - - // Get2faStatusEndpointApiV1Auth2faStatusGetWithResponse request - Get2faStatusEndpointApiV1Auth2faStatusGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*Get2faStatusEndpointApiV1Auth2faStatusGetResponse, error) - - // Verify2faEndpointApiV1Auth2faVerifyPostWithBodyWithResponse request with any body - Verify2faEndpointApiV1Auth2faVerifyPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*Verify2faEndpointApiV1Auth2faVerifyPostResponse, error) - - Verify2faEndpointApiV1Auth2faVerifyPostWithResponse(ctx context.Context, body Verify2faEndpointApiV1Auth2faVerifyPostJSONRequestBody, reqEditors ...RequestEditorFn) (*Verify2faEndpointApiV1Auth2faVerifyPostResponse, error) - - // Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostWithBodyWithResponse request with any body - Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostResponse, error) - - Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostWithResponse(ctx context.Context, body Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostJSONRequestBody, reqEditors ...RequestEditorFn) (*Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostResponse, error) - - // AuthenticatedApiV1AuthAuthenticatedGetWithResponse request - AuthenticatedApiV1AuthAuthenticatedGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*AuthenticatedApiV1AuthAuthenticatedGetResponse, error) - - // ApiChangeEmailApiV1AuthChangeEmailPostWithBodyWithResponse request with any body - ApiChangeEmailApiV1AuthChangeEmailPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiChangeEmailApiV1AuthChangeEmailPostResponse, error) - - ApiChangeEmailApiV1AuthChangeEmailPostWithResponse(ctx context.Context, body ApiChangeEmailApiV1AuthChangeEmailPostJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiChangeEmailApiV1AuthChangeEmailPostResponse, error) - - // DecodeLinkTokenApiV1AuthDecodeLinkTokenGetWithResponse request - DecodeLinkTokenApiV1AuthDecodeLinkTokenGetWithResponse(ctx context.Context, params *DecodeLinkTokenApiV1AuthDecodeLinkTokenGetParams, reqEditors ...RequestEditorFn) (*DecodeLinkTokenApiV1AuthDecodeLinkTokenGetResponse, error) - - // AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostWithBodyWithResponse request with any body - AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostResponse, error) - - AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostWithResponse(ctx context.Context, body AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostJSONRequestBody, reqEditors ...RequestEditorFn) (*AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostResponse, error) - - // RequestDeviceCodeApiV1AuthDeviceCodePostWithBodyWithResponse request with any body - RequestDeviceCodeApiV1AuthDeviceCodePostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestDeviceCodeApiV1AuthDeviceCodePostResponse, error) - - RequestDeviceCodeApiV1AuthDeviceCodePostWithResponse(ctx context.Context, body RequestDeviceCodeApiV1AuthDeviceCodePostJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestDeviceCodeApiV1AuthDeviceCodePostResponse, error) - - // CheckDeviceStatusApiV1AuthDeviceStatusUserCodeGetWithResponse request - CheckDeviceStatusApiV1AuthDeviceStatusUserCodeGetWithResponse(ctx context.Context, userCode string, reqEditors ...RequestEditorFn) (*CheckDeviceStatusApiV1AuthDeviceStatusUserCodeGetResponse, error) - - // PollDeviceTokenApiV1AuthDeviceTokenPostWithBodyWithResponse request with any body - PollDeviceTokenApiV1AuthDeviceTokenPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PollDeviceTokenApiV1AuthDeviceTokenPostResponse, error) - - PollDeviceTokenApiV1AuthDeviceTokenPostWithResponse(ctx context.Context, body PollDeviceTokenApiV1AuthDeviceTokenPostJSONRequestBody, reqEditors ...RequestEditorFn) (*PollDeviceTokenApiV1AuthDeviceTokenPostResponse, error) - - // ForgotPasswordApiV1AuthForgotPasswordPostWithBodyWithResponse request with any body - ForgotPasswordApiV1AuthForgotPasswordPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ForgotPasswordApiV1AuthForgotPasswordPostResponse, error) - - ForgotPasswordApiV1AuthForgotPasswordPostWithResponse(ctx context.Context, body ForgotPasswordApiV1AuthForgotPasswordPostJSONRequestBody, reqEditors ...RequestEditorFn) (*ForgotPasswordApiV1AuthForgotPasswordPostResponse, error) - - // LoginWithCookieApiV1AuthLoginPostWithBodyWithResponse request with any body - LoginWithCookieApiV1AuthLoginPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LoginWithCookieApiV1AuthLoginPostResponse, error) - - LoginWithCookieApiV1AuthLoginPostWithFormdataBodyWithResponse(ctx context.Context, body LoginWithCookieApiV1AuthLoginPostFormdataRequestBody, reqEditors ...RequestEditorFn) (*LoginWithCookieApiV1AuthLoginPostResponse, error) - - // LoginWith2faApiV1AuthLoginWith2faPostWithBodyWithResponse request with any body - LoginWith2faApiV1AuthLoginWith2faPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LoginWith2faApiV1AuthLoginWith2faPostResponse, error) - - LoginWith2faApiV1AuthLoginWith2faPostWithResponse(ctx context.Context, body LoginWith2faApiV1AuthLoginWith2faPostJSONRequestBody, reqEditors ...RequestEditorFn) (*LoginWith2faApiV1AuthLoginWith2faPostResponse, error) - - // LogoutApiV1AuthLogoutPostWithResponse request - LogoutApiV1AuthLogoutPostWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*LogoutApiV1AuthLogoutPostResponse, error) - - // ReadUsersMeApiV1AuthMeGetWithResponse request - ReadUsersMeApiV1AuthMeGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ReadUsersMeApiV1AuthMeGetResponse, error) - - // GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetWithResponse request - GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetWithResponse(ctx context.Context, params *GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetParams, reqEditors ...RequestEditorFn) (*GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetResponse, error) - - // GithubOauthCallbackApiV1AuthOauthGithubCallbackGetWithResponse request - GithubOauthCallbackApiV1AuthOauthGithubCallbackGetWithResponse(ctx context.Context, params *GithubOauthCallbackApiV1AuthOauthGithubCallbackGetParams, reqEditors ...RequestEditorFn) (*GithubOauthCallbackApiV1AuthOauthGithubCallbackGetResponse, error) - - // GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetWithResponse request - GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetWithResponse(ctx context.Context, params *GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetParams, reqEditors ...RequestEditorFn) (*GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetResponse, error) - - // GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetWithResponse request - GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetWithResponse(ctx context.Context, params *GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetParams, reqEditors ...RequestEditorFn) (*GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetResponse, error) - - // HandleUpdatePasswordApiV1AuthPasswordPostWithBodyWithResponse request with any body - HandleUpdatePasswordApiV1AuthPasswordPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleUpdatePasswordApiV1AuthPasswordPostResponse, error) - - HandleUpdatePasswordApiV1AuthPasswordPostWithResponse(ctx context.Context, body HandleUpdatePasswordApiV1AuthPasswordPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleUpdatePasswordApiV1AuthPasswordPostResponse, error) - - // RegisterUserApiV1AuthRegisterPostWithBodyWithResponse request with any body - RegisterUserApiV1AuthRegisterPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RegisterUserApiV1AuthRegisterPostResponse, error) - - RegisterUserApiV1AuthRegisterPostWithResponse(ctx context.Context, body RegisterUserApiV1AuthRegisterPostJSONRequestBody, reqEditors ...RequestEditorFn) (*RegisterUserApiV1AuthRegisterPostResponse, error) - - // ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostWithBodyWithResponse request with any body - ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostResponse, error) - - ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostWithResponse(ctx context.Context, body ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostResponse, error) - - // HandleResetPasswordWithTokenApiV1AuthResetPasswordPutWithBodyWithResponse request with any body - HandleResetPasswordWithTokenApiV1AuthResetPasswordPutWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleResetPasswordWithTokenApiV1AuthResetPasswordPutResponse, error) - - HandleResetPasswordWithTokenApiV1AuthResetPasswordPutWithResponse(ctx context.Context, body HandleResetPasswordWithTokenApiV1AuthResetPasswordPutJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleResetPasswordWithTokenApiV1AuthResetPasswordPutResponse, error) - - // RevokeAllSessionsApiV1AuthSessionsDeleteWithResponse request - RevokeAllSessionsApiV1AuthSessionsDeleteWithResponse(ctx context.Context, params *RevokeAllSessionsApiV1AuthSessionsDeleteParams, reqEditors ...RequestEditorFn) (*RevokeAllSessionsApiV1AuthSessionsDeleteResponse, error) - - // GetActiveSessionsApiV1AuthSessionsGetWithResponse request - GetActiveSessionsApiV1AuthSessionsGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetActiveSessionsApiV1AuthSessionsGetResponse, error) - - // RevokeSessionEndpointApiV1AuthSessionsJtiDeleteWithResponse request - RevokeSessionEndpointApiV1AuthSessionsJtiDeleteWithResponse(ctx context.Context, jti string, reqEditors ...RequestEditorFn) (*RevokeSessionEndpointApiV1AuthSessionsJtiDeleteResponse, error) - - // VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostWithBodyWithResponse request with any body - VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostResponse, error) - - VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostWithResponse(ctx context.Context, body VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostJSONRequestBody, reqEditors ...RequestEditorFn) (*VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostResponse, error) - - // LoginForAccessTokenApiV1AuthTokenPostWithBodyWithResponse request with any body - LoginForAccessTokenApiV1AuthTokenPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LoginForAccessTokenApiV1AuthTokenPostResponse, error) - - LoginForAccessTokenApiV1AuthTokenPostWithFormdataBodyWithResponse(ctx context.Context, body LoginForAccessTokenApiV1AuthTokenPostFormdataRequestBody, reqEditors ...RequestEditorFn) (*LoginForAccessTokenApiV1AuthTokenPostResponse, error) - - // HandleUpdateUsernameApiV1AuthUsernamePutWithBodyWithResponse request with any body - HandleUpdateUsernameApiV1AuthUsernamePutWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleUpdateUsernameApiV1AuthUsernamePutResponse, error) - - HandleUpdateUsernameApiV1AuthUsernamePutWithResponse(ctx context.Context, body HandleUpdateUsernameApiV1AuthUsernamePutJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleUpdateUsernameApiV1AuthUsernamePutResponse, error) - - // ValidateResetTokenApiV1AuthValidateResetTokenGetWithResponse request - ValidateResetTokenApiV1AuthValidateResetTokenGetWithResponse(ctx context.Context, params *ValidateResetTokenApiV1AuthValidateResetTokenGetParams, reqEditors ...RequestEditorFn) (*ValidateResetTokenApiV1AuthValidateResetTokenGetResponse, error) - - // VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostWithBodyWithResponse request with any body - VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostResponse, error) - - VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostWithResponse(ctx context.Context, body VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostJSONRequestBody, reqEditors ...RequestEditorFn) (*VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostResponse, error) - - // ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostWithBodyWithResponse request with any body - ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostResponse, error) - - ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostWithResponse(ctx context.Context, body ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostResponse, error) - - // HandleListCvmsApiV1CvmsGetWithResponse request - HandleListCvmsApiV1CvmsGetWithResponse(ctx context.Context, params *HandleListCvmsApiV1CvmsGetParams, reqEditors ...RequestEditorFn) (*HandleListCvmsApiV1CvmsGetResponse, error) - - // HandleCreateCvmFromPovisionApiV1CvmsPostWithBodyWithResponse request with any body - HandleCreateCvmFromPovisionApiV1CvmsPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleCreateCvmFromPovisionApiV1CvmsPostResponse, error) - - HandleCreateCvmFromPovisionApiV1CvmsPostWithResponse(ctx context.Context, body HandleCreateCvmFromPovisionApiV1CvmsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleCreateCvmFromPovisionApiV1CvmsPostResponse, error) - - // HandleBatchStopCvmsApiV1CvmsBatchStopPostWithBodyWithResponse request with any body - HandleBatchStopCvmsApiV1CvmsBatchStopPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleBatchStopCvmsApiV1CvmsBatchStopPostResponse, error) - - HandleBatchStopCvmsApiV1CvmsBatchStopPostWithResponse(ctx context.Context, body HandleBatchStopCvmsApiV1CvmsBatchStopPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleBatchStopCvmsApiV1CvmsBatchStopPostResponse, error) - - // HandleCreateElizaFromProvisionApiV1CvmsElizaPostWithBodyWithResponse request with any body - HandleCreateElizaFromProvisionApiV1CvmsElizaPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleCreateElizaFromProvisionApiV1CvmsElizaPostResponse, error) - - HandleCreateElizaFromProvisionApiV1CvmsElizaPostWithResponse(ctx context.Context, body HandleCreateElizaFromProvisionApiV1CvmsElizaPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleCreateElizaFromProvisionApiV1CvmsElizaPostResponse, error) - - // HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostWithBodyWithResponse request with any body - HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostResponse, error) - - HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostWithResponse(ctx context.Context, body HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostResponse, error) - - // HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchWithBodyWithResponse request with any body - HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchResponse, error) - - HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchWithResponse(ctx context.Context, body HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchResponse, error) - - // HandleListCvmsPaginatedApiV1CvmsPaginatedGetWithResponse request - HandleListCvmsPaginatedApiV1CvmsPaginatedGetWithResponse(ctx context.Context, params *HandleListCvmsPaginatedApiV1CvmsPaginatedGetParams, reqEditors ...RequestEditorFn) (*HandleListCvmsPaginatedApiV1CvmsPaginatedGetResponse, error) - - // HandleProvisionCvmApiV1CvmsProvisionPostWithBodyWithResponse request with any body - HandleProvisionCvmApiV1CvmsProvisionPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleProvisionCvmApiV1CvmsProvisionPostResponse, error) - - HandleProvisionCvmApiV1CvmsProvisionPostWithResponse(ctx context.Context, body HandleProvisionCvmApiV1CvmsProvisionPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleProvisionCvmApiV1CvmsProvisionPostResponse, error) - - // HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostWithBodyWithResponse request with any body - HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostResponse, error) - - HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostWithResponse(ctx context.Context, body HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostResponse, error) - - // HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostWithBodyWithResponse request with any body - HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostResponse, error) - - HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostWithResponse(ctx context.Context, body HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostResponse, error) - - // HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostWithBodyWithResponse request with any body - HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostResponse, error) - - HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostWithResponse(ctx context.Context, body HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostResponse, error) - - // HandleRemoveCvmApiV1CvmsCvmIdDeleteWithResponse request - HandleRemoveCvmApiV1CvmsCvmIdDeleteWithResponse(ctx context.Context, cvmId string, params *HandleRemoveCvmApiV1CvmsCvmIdDeleteParams, reqEditors ...RequestEditorFn) (*HandleRemoveCvmApiV1CvmsCvmIdDeleteResponse, error) - - // HandleGetCvmApiV1CvmsCvmIdGetWithResponse request - HandleGetCvmApiV1CvmsCvmIdGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*HandleGetCvmApiV1CvmsCvmIdGetResponse, error) - - // HandleGetCvmAttestationApiV1CvmsCvmIdAttestationGetWithResponse request - HandleGetCvmAttestationApiV1CvmsCvmIdAttestationGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*HandleGetCvmAttestationApiV1CvmsCvmIdAttestationGetResponse, error) - - // GetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGetWithResponse request - GetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*GetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGetResponse, error) - - // HandleGetCvmComposeApiV1CvmsCvmIdComposeGetWithResponse request - HandleGetCvmComposeApiV1CvmsCvmIdComposeGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*HandleGetCvmComposeApiV1CvmsCvmIdComposeGetResponse, error) - - // HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchWithBodyWithResponse request with any body - HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchResponse, error) - - HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchWithResponse(ctx context.Context, cvmId string, body HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchResponse, error) - - // HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutWithBodyWithResponse request with any body - HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutResponse, error) - - HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutWithResponse(ctx context.Context, cvmId string, body HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutResponse, error) - - // GetCvmComposeFileApiV1CvmsCvmIdComposeFileGetWithResponse request - GetCvmComposeFileApiV1CvmsCvmIdComposeFileGetWithResponse(ctx context.Context, cvmId string, params *GetCvmComposeFileApiV1CvmsCvmIdComposeFileGetParams, reqEditors ...RequestEditorFn) (*GetCvmComposeFileApiV1CvmsCvmIdComposeFileGetResponse, error) - - // TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchWithBodyWithResponse request with any body - TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchResponse, error) - - TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchWithResponse(ctx context.Context, cvmId string, body TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchResponse, error) - - // SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostWithBodyWithResponse request with any body - SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostResponse, error) - - SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostWithResponse(ctx context.Context, cvmId string, body SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostJSONRequestBody, reqEditors ...RequestEditorFn) (*SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostResponse, error) - - // ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostWithBodyWithResponse request with any body - ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostResponse, error) - - ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostWithResponse(ctx context.Context, cvmId string, body ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostJSONRequestBody, reqEditors ...RequestEditorFn) (*ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostResponse, error) - - // HandleGetCvmCompositionApiV1CvmsCvmIdCompositionGetWithResponse request - HandleGetCvmCompositionApiV1CvmsCvmIdCompositionGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*HandleGetCvmCompositionApiV1CvmsCvmIdCompositionGetResponse, error) - - // DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostWithBodyWithResponse request with any body - DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostResponse, error) - - DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostWithResponse(ctx context.Context, cvmId string, body DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostJSONRequestBody, reqEditors ...RequestEditorFn) (*DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostResponse, error) - - // UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchWithBodyWithResponse request with any body - UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchWithBodyWithResponse(ctx context.Context, cvmId string, params *UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchResponse, error) - - // HandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGetWithResponse request - HandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*HandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGetResponse, error) - - // UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchWithBodyWithResponse request with any body - UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchResponse, error) - - UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchWithResponse(ctx context.Context, cvmId string, body UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchResponse, error) - - // HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchWithBodyWithResponse request with any body - HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchResponse, error) - - HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchWithResponse(ctx context.Context, cvmId string, body HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchResponse, error) - - // HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchWithBodyWithResponse request with any body - HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchResponse, error) - - HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchWithResponse(ctx context.Context, cvmId string, body HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchResponse, error) - - // HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchWithBodyWithResponse request with any body - HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchResponse, error) - - HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchWithResponse(ctx context.Context, cvmId string, body HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchResponse, error) - - // HandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGetWithResponse request - HandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*HandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGetResponse, error) - - // GetOperationStatusApiV1CvmsCvmIdOperationStatusGetWithResponse request - GetOperationStatusApiV1CvmsCvmIdOperationStatusGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*GetOperationStatusApiV1CvmsCvmIdOperationStatusGetResponse, error) - - // GetCvmOperationsApiV1CvmsCvmIdOperationsGetWithResponse request - GetCvmOperationsApiV1CvmsCvmIdOperationsGetWithResponse(ctx context.Context, cvmId string, params *GetCvmOperationsApiV1CvmsCvmIdOperationsGetParams, reqEditors ...RequestEditorFn) (*GetCvmOperationsApiV1CvmsCvmIdOperationsGetResponse, error) - - // UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchWithBodyWithResponse request with any body - UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchResponse, error) - - UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchWithResponse(ctx context.Context, cvmId string, body UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchResponse, error) - - // HandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGetWithResponse request - HandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*HandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGetResponse, error) - - // UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchWithBodyWithResponse request with any body - UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchWithBodyWithResponse(ctx context.Context, cvmId string, params *UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchResponse, error) - - // HandleReplicateCvmApiV1CvmsCvmIdReplicasPostWithBodyWithResponse request with any body - HandleReplicateCvmApiV1CvmsCvmIdReplicasPostWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleReplicateCvmApiV1CvmsCvmIdReplicasPostResponse, error) - - HandleReplicateCvmApiV1CvmsCvmIdReplicasPostWithResponse(ctx context.Context, cvmId string, body HandleReplicateCvmApiV1CvmsCvmIdReplicasPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleReplicateCvmApiV1CvmsCvmIdReplicasPostResponse, error) - - // HandleResizeCvmApiV1CvmsCvmIdResourcesPatchWithBodyWithResponse request with any body - HandleResizeCvmApiV1CvmsCvmIdResourcesPatchWithBodyWithResponse(ctx context.Context, cvmId string, params *HandleResizeCvmApiV1CvmsCvmIdResourcesPatchParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleResizeCvmApiV1CvmsCvmIdResourcesPatchResponse, error) - - HandleResizeCvmApiV1CvmsCvmIdResourcesPatchWithResponse(ctx context.Context, cvmId string, params *HandleResizeCvmApiV1CvmsCvmIdResourcesPatchParams, body HandleResizeCvmApiV1CvmsCvmIdResourcesPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleResizeCvmApiV1CvmsCvmIdResourcesPatchResponse, error) - - // HandleRestartCvmApiV1CvmsCvmIdRestartPostWithBodyWithResponse request with any body - HandleRestartCvmApiV1CvmsCvmIdRestartPostWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleRestartCvmApiV1CvmsCvmIdRestartPostResponse, error) - - HandleRestartCvmApiV1CvmsCvmIdRestartPostWithResponse(ctx context.Context, cvmId string, body HandleRestartCvmApiV1CvmsCvmIdRestartPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleRestartCvmApiV1CvmsCvmIdRestartPostResponse, error) - - // RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostWithResponse request - RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostWithResponse(ctx context.Context, cvmId string, revisionId string, params *RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostParams, reqEditors ...RequestEditorFn) (*RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostResponse, error) - - // HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchWithBodyWithResponse request with any body - HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchResponse, error) - - HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchWithResponse(ctx context.Context, cvmId string, body HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchResponse, error) - - // HandleShutdownCvmApiV1CvmsCvmIdShutdownPostWithBodyWithResponse request with any body - HandleShutdownCvmApiV1CvmsCvmIdShutdownPostWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleShutdownCvmApiV1CvmsCvmIdShutdownPostResponse, error) - - HandleShutdownCvmApiV1CvmsCvmIdShutdownPostWithResponse(ctx context.Context, cvmId string, body HandleShutdownCvmApiV1CvmsCvmIdShutdownPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleShutdownCvmApiV1CvmsCvmIdShutdownPostResponse, error) - - // HandleStartCvmApiV1CvmsCvmIdStartPostWithBodyWithResponse request with any body - HandleStartCvmApiV1CvmsCvmIdStartPostWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleStartCvmApiV1CvmsCvmIdStartPostResponse, error) - - HandleStartCvmApiV1CvmsCvmIdStartPostWithResponse(ctx context.Context, cvmId string, body HandleStartCvmApiV1CvmsCvmIdStartPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleStartCvmApiV1CvmsCvmIdStartPostResponse, error) - - // HandleGetCvmStateApiV1CvmsCvmIdStateGetWithResponse request - HandleGetCvmStateApiV1CvmsCvmIdStateGetWithResponse(ctx context.Context, cvmId string, params *HandleGetCvmStateApiV1CvmsCvmIdStateGetParams, reqEditors ...RequestEditorFn) (*HandleGetCvmStateApiV1CvmsCvmIdStateGetResponse, error) - - // HandleGetCvmStatsApiV1CvmsCvmIdStatsGetWithResponse request - HandleGetCvmStatsApiV1CvmsCvmIdStatsGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*HandleGetCvmStatsApiV1CvmsCvmIdStatsGetResponse, error) - - // HandleStopCvmApiV1CvmsCvmIdStopPostWithBodyWithResponse request with any body - HandleStopCvmApiV1CvmsCvmIdStopPostWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleStopCvmApiV1CvmsCvmIdStopPostResponse, error) - - HandleStopCvmApiV1CvmsCvmIdStopPostWithResponse(ctx context.Context, cvmId string, body HandleStopCvmApiV1CvmsCvmIdStopPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleStopCvmApiV1CvmsCvmIdStopPostResponse, error) - - // GetCvmUserConfigApiV1CvmsCvmIdUserConfigGetWithResponse request - GetCvmUserConfigApiV1CvmsCvmIdUserConfigGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*GetCvmUserConfigApiV1CvmsCvmIdUserConfigGetResponse, error) - - // HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchWithBodyWithResponse request with any body - HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchResponse, error) - - HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchWithResponse(ctx context.Context, cvmId string, body HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchResponse, error) - - // ListKmsApiV1KmsGetWithResponse request - ListKmsApiV1KmsGetWithResponse(ctx context.Context, params *ListKmsApiV1KmsGetParams, reqEditors ...RequestEditorFn) (*ListKmsApiV1KmsGetResponse, error) - - // GetNextAppIdApiV1KmsPhalaNextAppIdGetWithResponse request - GetNextAppIdApiV1KmsPhalaNextAppIdGetWithResponse(ctx context.Context, params *GetNextAppIdApiV1KmsPhalaNextAppIdGetParams, reqEditors ...RequestEditorFn) (*GetNextAppIdApiV1KmsPhalaNextAppIdGetResponse, error) - - // GetKmsInfoApiV1KmsKmsIdGetWithResponse request - GetKmsInfoApiV1KmsKmsIdGetWithResponse(ctx context.Context, kmsId string, reqEditors ...RequestEditorFn) (*GetKmsInfoApiV1KmsKmsIdGetResponse, error) - - // GetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGetWithResponse request - GetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGetWithResponse(ctx context.Context, kmsId string, appId string, reqEditors ...RequestEditorFn) (*GetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGetResponse, error) - - // ListRedpillApiKeysApiV1RedpillApiKeysGetWithResponse request - ListRedpillApiKeysApiV1RedpillApiKeysGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListRedpillApiKeysApiV1RedpillApiKeysGetResponse, error) - - // CreateRedpillApiKeyApiV1RedpillApiKeysPostWithBodyWithResponse request with any body - CreateRedpillApiKeyApiV1RedpillApiKeysPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateRedpillApiKeyApiV1RedpillApiKeysPostResponse, error) - - CreateRedpillApiKeyApiV1RedpillApiKeysPostWithResponse(ctx context.Context, body CreateRedpillApiKeyApiV1RedpillApiKeysPostJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateRedpillApiKeyApiV1RedpillApiKeysPostResponse, error) - - // UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchWithResponse request - UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchWithResponse(ctx context.Context, apiKeyId int, params *UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchParams, reqEditors ...RequestEditorFn) (*UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchResponse, error) - - // ConnectRedpillUserApiV1RedpillConnectPostWithResponse request - ConnectRedpillUserApiV1RedpillConnectPostWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ConnectRedpillUserApiV1RedpillConnectPostResponse, error) - - // ListApiKeyLogsApiV1RedpillLogsApiKeyIdGetWithResponse request - ListApiKeyLogsApiV1RedpillLogsApiKeyIdGetWithResponse(ctx context.Context, apiKeyId int, reqEditors ...RequestEditorFn) (*ListApiKeyLogsApiV1RedpillLogsApiKeyIdGetResponse, error) - - // ListModelsApiV1RedpillModelsGetWithResponse request - ListModelsApiV1RedpillModelsGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListModelsApiV1RedpillModelsGetResponse, error) - - // GetDailyUsageApiV1RedpillUsageDailyGetWithResponse request - GetDailyUsageApiV1RedpillUsageDailyGetWithResponse(ctx context.Context, params *GetDailyUsageApiV1RedpillUsageDailyGetParams, reqEditors ...RequestEditorFn) (*GetDailyUsageApiV1RedpillUsageDailyGetResponse, error) - - // GetUsageLogsApiV1RedpillUsageLogsGetWithResponse request - GetUsageLogsApiV1RedpillUsageLogsGetWithResponse(ctx context.Context, params *GetUsageLogsApiV1RedpillUsageLogsGetParams, reqEditors ...RequestEditorFn) (*GetUsageLogsApiV1RedpillUsageLogsGetResponse, error) - - // HandleBatchCvmStatusApiV1StatusBatchPostWithBodyWithResponse request with any body - HandleBatchCvmStatusApiV1StatusBatchPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleBatchCvmStatusApiV1StatusBatchPostResponse, error) - - HandleBatchCvmStatusApiV1StatusBatchPostWithResponse(ctx context.Context, body HandleBatchCvmStatusApiV1StatusBatchPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleBatchCvmStatusApiV1StatusBatchPostResponse, error) - - // ListTeepodsApiV1TeepodsGetWithResponse request - ListTeepodsApiV1TeepodsGetWithResponse(ctx context.Context, params *ListTeepodsApiV1TeepodsGetParams, reqEditors ...RequestEditorFn) (*ListTeepodsApiV1TeepodsGetResponse, error) - - // HandleGetAvailableTeepodsApiV1TeepodsAvailableGetWithResponse request - HandleGetAvailableTeepodsApiV1TeepodsAvailableGetWithResponse(ctx context.Context, params *HandleGetAvailableTeepodsApiV1TeepodsAvailableGetParams, reqEditors ...RequestEditorFn) (*HandleGetAvailableTeepodsApiV1TeepodsAvailableGetResponse, error) - - // HandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGetWithResponse request - HandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGetWithResponse(ctx context.Context, teepodId int, reqEditors ...RequestEditorFn) (*HandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGetResponse, error) - - // HandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPostWithResponse request - HandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPostWithResponse(ctx context.Context, teepodId int, appId string, reqEditors ...RequestEditorFn) (*HandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPostResponse, error) - - // ListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGetWithResponse request - ListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGetWithResponse(ctx context.Context, teepodId int, reqEditors ...RequestEditorFn) (*ListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGetResponse, error) - - // HandleListPublicCvmsApiV1VerifiedAppsGetWithResponse request - HandleListPublicCvmsApiV1VerifiedAppsGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HandleListPublicCvmsApiV1VerifiedAppsGetResponse, error) - - // HandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGetWithResponse request - HandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*HandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGetResponse, error) - - // HealthCheckHealthGetWithResponse request - HealthCheckHealthGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthCheckHealthGetResponse, error) -} - -type ListDstackAppsApiV1AppsGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - union json.RawMessage - } - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r ListDstackAppsApiV1AppsGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r ListDstackAppsApiV1AppsGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetFilterOptionsApiV1AppsFilterOptionsGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *FilterOptionsResponse -} - -// Status returns HTTPResponse.Status -func (r GetFilterOptionsApiV1AppsFilterOptionsGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetFilterOptionsApiV1AppsFilterOptionsGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetDstackAppApiV1AppsAppIdGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - union json.RawMessage - } - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r GetDstackAppApiV1AppsAppIdGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetDstackAppApiV1AppsAppIdGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleGetAppAttestationApiV1AppsAppIdAttestationsGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleGetAppAttestationApiV1AppsAppIdAttestationsGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleGetAppAttestationApiV1AppsAppIdAttestationsGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleGetAppCvmsApiV1AppsAppIdCvmsGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - union json.RawMessage - } - JSON422 *HTTPValidationError -} -type HandleGetAppCvmsApiV1AppsAppIdCvmsGet2000 = []HostedCvm -type HandleGetAppCvmsApiV1AppsAppIdCvmsGet2001 = []CVMInfo - -// Status returns HTTPResponse.Status -func (r HandleGetAppCvmsApiV1AppsAppIdCvmsGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleGetAppCvmsApiV1AppsAppIdCvmsGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *VM - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetAppEventsApiV1AppsAppIdEventsGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *AppEventsResponse - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r GetAppEventsApiV1AppsAppIdEventsGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetAppEventsApiV1AppsAppIdEventsGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetAppRevisionsApiV1AppsAppIdRevisionsGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *AppRevisionsResponse - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r GetAppRevisionsApiV1AppsAppIdRevisionsGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetAppRevisionsApiV1AppsAppIdRevisionsGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *AppRevisionDetailResponse - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON202 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetAppUsageApiV1AppsAppIdUsageGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *AppUsageResponse - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r GetAppUsageApiV1AppsAppIdUsageGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetAppUsageApiV1AppsAppIdUsageGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetCollateralApiV1AttestationsCollateralChecksumGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r GetCollateralApiV1AttestationsCollateralChecksumGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetCollateralApiV1AttestationsCollateralChecksumGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleListDeviceIdsApiV1AttestationsDeviceIdsGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} -} - -// Status returns HTTPResponse.Status -func (r HandleListDeviceIdsApiV1AttestationsDeviceIdsGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleListDeviceIdsApiV1AttestationsDeviceIdsGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleListNodesApiV1AttestationsNodesGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]NodeRef -} - -// Status returns HTTPResponse.Status -func (r HandleListNodesApiV1AttestationsNodesGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleListNodesApiV1AttestationsNodesGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleListPpidsApiV1AttestationsPpidsGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} -} - -// Status returns HTTPResponse.Status -func (r HandleListPpidsApiV1AttestationsPpidsGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleListPpidsApiV1AttestationsPpidsGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleGetRawApiV1AttestationsRawChecksumGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleGetRawApiV1AttestationsRawChecksumGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleGetRawApiV1AttestationsRawChecksumGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleCheckRawFileApiV1AttestationsRawChecksumHeadResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleCheckRawFileApiV1AttestationsRawChecksumHeadResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleCheckRawFileApiV1AttestationsRawChecksumHeadResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleListRecentApiV1AttestationsRecentGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleListRecentApiV1AttestationsRecentGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleListRecentApiV1AttestationsRecentGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleUploadAndVerifyApiV1AttestationsVerifyPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *VerificationResponse - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleUploadAndVerifyApiV1AttestationsVerifyPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleUploadAndVerifyApiV1AttestationsVerifyPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleViewApiV1AttestationsViewChecksumGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleViewApiV1AttestationsViewChecksumGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleViewApiV1AttestationsViewChecksumGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type Confirm2faSetupEndpointApiV1Auth2faConfirmPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r Confirm2faSetupEndpointApiV1Auth2faConfirmPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r Confirm2faSetupEndpointApiV1Auth2faConfirmPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type Disable2faEndpointApiV1Auth2faDisablePostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r Disable2faEndpointApiV1Auth2faDisablePostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r Disable2faEndpointApiV1Auth2faDisablePostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type Setup2faEndpointApiV1Auth2faSetupPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} -} - -// Status returns HTTPResponse.Status -func (r Setup2faEndpointApiV1Auth2faSetupPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r Setup2faEndpointApiV1Auth2faSetupPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type Get2faStatusEndpointApiV1Auth2faStatusGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} -} - -// Status returns HTTPResponse.Status -func (r Get2faStatusEndpointApiV1Auth2faStatusGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r Get2faStatusEndpointApiV1Auth2faStatusGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type Verify2faEndpointApiV1Auth2faVerifyPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r Verify2faEndpointApiV1Auth2faVerifyPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r Verify2faEndpointApiV1Auth2faVerifyPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type AuthenticatedApiV1AuthAuthenticatedGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} -} - -// Status returns HTTPResponse.Status -func (r AuthenticatedApiV1AuthAuthenticatedGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r AuthenticatedApiV1AuthAuthenticatedGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type ApiChangeEmailApiV1AuthChangeEmailPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r ApiChangeEmailApiV1AuthChangeEmailPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r ApiChangeEmailApiV1AuthChangeEmailPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type DecodeLinkTokenApiV1AuthDecodeLinkTokenGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r DecodeLinkTokenApiV1AuthDecodeLinkTokenGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r DecodeLinkTokenApiV1AuthDecodeLinkTokenGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type RequestDeviceCodeApiV1AuthDeviceCodePostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *DeviceCodeResponse - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r RequestDeviceCodeApiV1AuthDeviceCodePostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r RequestDeviceCodeApiV1AuthDeviceCodePostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type CheckDeviceStatusApiV1AuthDeviceStatusUserCodeGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r CheckDeviceStatusApiV1AuthDeviceStatusUserCodeGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r CheckDeviceStatusApiV1AuthDeviceStatusUserCodeGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PollDeviceTokenApiV1AuthDeviceTokenPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *DeviceTokenResponse - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r PollDeviceTokenApiV1AuthDeviceTokenPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PollDeviceTokenApiV1AuthDeviceTokenPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type ForgotPasswordApiV1AuthForgotPasswordPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r ForgotPasswordApiV1AuthForgotPasswordPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r ForgotPasswordApiV1AuthForgotPasswordPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type LoginWithCookieApiV1AuthLoginPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r LoginWithCookieApiV1AuthLoginPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r LoginWithCookieApiV1AuthLoginPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type LoginWith2faApiV1AuthLoginWith2faPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r LoginWith2faApiV1AuthLoginWith2faPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r LoginWith2faApiV1AuthLoginWith2faPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type LogoutApiV1AuthLogoutPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} -} - -// Status returns HTTPResponse.Status -func (r LogoutApiV1AuthLogoutPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r LogoutApiV1AuthLogoutPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type ReadUsersMeApiV1AuthMeGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} -} - -// Status returns HTTPResponse.Status -func (r ReadUsersMeApiV1AuthMeGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r ReadUsersMeApiV1AuthMeGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GithubOauthCallbackApiV1AuthOauthGithubCallbackGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r GithubOauthCallbackApiV1AuthOauthGithubCallbackGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GithubOauthCallbackApiV1AuthOauthGithubCallbackGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleUpdatePasswordApiV1AuthPasswordPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *User - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleUpdatePasswordApiV1AuthPasswordPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleUpdatePasswordApiV1AuthPasswordPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type RegisterUserApiV1AuthRegisterPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r RegisterUserApiV1AuthRegisterPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r RegisterUserApiV1AuthRegisterPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleResetPasswordWithTokenApiV1AuthResetPasswordPutResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *map[string]interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleResetPasswordWithTokenApiV1AuthResetPasswordPutResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleResetPasswordWithTokenApiV1AuthResetPasswordPutResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type RevokeAllSessionsApiV1AuthSessionsDeleteResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r RevokeAllSessionsApiV1AuthSessionsDeleteResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r RevokeAllSessionsApiV1AuthSessionsDeleteResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetActiveSessionsApiV1AuthSessionsGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *SessionsListResponse -} - -// Status returns HTTPResponse.Status -func (r GetActiveSessionsApiV1AuthSessionsGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetActiveSessionsApiV1AuthSessionsGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type RevokeSessionEndpointApiV1AuthSessionsJtiDeleteResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r RevokeSessionEndpointApiV1AuthSessionsJtiDeleteResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r RevokeSessionEndpointApiV1AuthSessionsJtiDeleteResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type LoginForAccessTokenApiV1AuthTokenPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r LoginForAccessTokenApiV1AuthTokenPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r LoginForAccessTokenApiV1AuthTokenPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleUpdateUsernameApiV1AuthUsernamePutResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleUpdateUsernameApiV1AuthUsernamePutResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleUpdateUsernameApiV1AuthUsernamePutResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type ValidateResetTokenApiV1AuthValidateResetTokenGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *map[string]interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r ValidateResetTokenApiV1AuthValidateResetTokenGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r ValidateResetTokenApiV1AuthValidateResetTokenGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *map[string]string - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleListCvmsApiV1CvmsGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - union json.RawMessage - } - JSON422 *HTTPValidationError -} -type HandleListCvmsApiV1CvmsGet2000 = []HostedCvm -type HandleListCvmsApiV1CvmsGet2001 = []CVMInfo - -// Status returns HTTPResponse.Status -func (r HandleListCvmsApiV1CvmsGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleListCvmsApiV1CvmsGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleCreateCvmFromPovisionApiV1CvmsPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *VM -} - -// Status returns HTTPResponse.Status -func (r HandleCreateCvmFromPovisionApiV1CvmsPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleCreateCvmFromPovisionApiV1CvmsPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleBatchStopCvmsApiV1CvmsBatchStopPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *BatchStopResponse - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleBatchStopCvmsApiV1CvmsBatchStopPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleBatchStopCvmsApiV1CvmsBatchStopPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleCreateElizaFromProvisionApiV1CvmsElizaPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *VM -} - -// Status returns HTTPResponse.Status -func (r HandleCreateElizaFromProvisionApiV1CvmsElizaPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleCreateElizaFromProvisionApiV1CvmsElizaPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *VM - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *BatchInstanceIdRefreshResponse - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleListCvmsPaginatedApiV1CvmsPaginatedGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - union json.RawMessage - } - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleListCvmsPaginatedApiV1CvmsPaginatedGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleListCvmsPaginatedApiV1CvmsPaginatedGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleProvisionCvmApiV1CvmsProvisionPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} -} - -// Status returns HTTPResponse.Status -func (r HandleProvisionCvmApiV1CvmsProvisionPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleProvisionCvmApiV1CvmsProvisionPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *VM - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleRemoveCvmApiV1CvmsCvmIdDeleteResponse struct { - Body []byte - HTTPResponse *http.Response - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleRemoveCvmApiV1CvmsCvmIdDeleteResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleRemoveCvmApiV1CvmsCvmIdDeleteResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleGetCvmApiV1CvmsCvmIdGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - union json.RawMessage - } - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleGetCvmApiV1CvmsCvmIdGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleGetCvmApiV1CvmsCvmIdGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleGetCvmAttestationApiV1CvmsCvmIdAttestationGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *CvmAttestation - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleGetCvmAttestationApiV1CvmsCvmIdAttestationGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleGetCvmAttestationApiV1CvmsCvmIdAttestationGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImage - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r GetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleGetCvmComposeApiV1CvmsCvmIdComposeGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *CvmComposeFile - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleGetCvmComposeApiV1CvmsCvmIdComposeGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleGetCvmComposeApiV1CvmsCvmIdComposeGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchResponse struct { - Body []byte - HTTPResponse *http.Response - JSON202 *interface{} -} - -// Status returns HTTPResponse.Status -func (r HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} -} - -// Status returns HTTPResponse.Status -func (r HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetCvmComposeFileApiV1CvmsCvmIdComposeFileGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r GetCvmComposeFileApiV1CvmsCvmIdComposeFileGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetCvmComposeFileApiV1CvmsCvmIdComposeFileGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchResponse struct { - Body []byte - HTTPResponse *http.Response - JSON202 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON202 *interface{} -} - -// Status returns HTTPResponse.Status -func (r SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *ComposeFileProvisionResponse -} - -// Status returns HTTPResponse.Status -func (r ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleGetCvmCompositionApiV1CvmsCvmIdCompositionGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *CvmComposition - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleGetCvmCompositionApiV1CvmsCvmIdCompositionGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleGetCvmCompositionApiV1CvmsCvmIdCompositionGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *DiagnosisResponse - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchResponse struct { - Body []byte - HTTPResponse *http.Response - JSON202 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *string - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchResponse struct { - Body []byte - HTTPResponse *http.Response - JSON202 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *InstanceIdRefreshResult - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *VM - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchResponse struct { - Body []byte - HTTPResponse *http.Response - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *CvmNetwork - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetOperationStatusApiV1CvmsCvmIdOperationStatusGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r GetOperationStatusApiV1CvmsCvmIdOperationStatusGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetOperationStatusApiV1CvmsCvmIdOperationStatusGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetCvmOperationsApiV1CvmsCvmIdOperationsGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *PaginatedCvmOperationsResponse - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r GetCvmOperationsApiV1CvmsCvmIdOperationsGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetCvmOperationsApiV1CvmsCvmIdOperationsGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchResponse struct { - Body []byte - HTTPResponse *http.Response - JSON202 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *string - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchResponse struct { - Body []byte - HTTPResponse *http.Response - JSON202 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleReplicateCvmApiV1CvmsCvmIdReplicasPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleReplicateCvmApiV1CvmsCvmIdReplicasPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleReplicateCvmApiV1CvmsCvmIdReplicasPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleResizeCvmApiV1CvmsCvmIdResourcesPatchResponse struct { - Body []byte - HTTPResponse *http.Response - JSON202 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleResizeCvmApiV1CvmsCvmIdResourcesPatchResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleResizeCvmApiV1CvmsCvmIdResourcesPatchResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleRestartCvmApiV1CvmsCvmIdRestartPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *VM - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleRestartCvmApiV1CvmsCvmIdRestartPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleRestartCvmApiV1CvmsCvmIdRestartPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON202 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *VM - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleShutdownCvmApiV1CvmsCvmIdShutdownPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *VM - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleShutdownCvmApiV1CvmsCvmIdShutdownPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleShutdownCvmApiV1CvmsCvmIdShutdownPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleStartCvmApiV1CvmsCvmIdStartPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *VM - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleStartCvmApiV1CvmsCvmIdStartPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleStartCvmApiV1CvmsCvmIdStartPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleGetCvmStateApiV1CvmsCvmIdStateGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleGetCvmStateApiV1CvmsCvmIdStateGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleGetCvmStateApiV1CvmsCvmIdStateGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleGetCvmStatsApiV1CvmsCvmIdStatsGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *CvmSystemInfo - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleGetCvmStatsApiV1CvmsCvmIdStatsGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleGetCvmStatsApiV1CvmsCvmIdStatsGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleStopCvmApiV1CvmsCvmIdStopPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *VM - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleStopCvmApiV1CvmsCvmIdStopPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleStopCvmApiV1CvmsCvmIdStopPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetCvmUserConfigApiV1CvmsCvmIdUserConfigGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *CvmUserConfig - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r GetCvmUserConfigApiV1CvmsCvmIdUserConfigGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetCvmUserConfigApiV1CvmsCvmIdUserConfigGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *VM - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type ListKmsApiV1KmsGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *KmsListResponse - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r ListKmsApiV1KmsGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r ListKmsApiV1KmsGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetNextAppIdApiV1KmsPhalaNextAppIdGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r GetNextAppIdApiV1KmsPhalaNextAppIdGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetNextAppIdApiV1KmsPhalaNextAppIdGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetKmsInfoApiV1KmsKmsIdGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *KMSInfo - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r GetKmsInfoApiV1KmsKmsIdGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetKmsInfoApiV1KmsKmsIdGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r GetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type ListRedpillApiKeysApiV1RedpillApiKeysGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} -} - -// Status returns HTTPResponse.Status -func (r ListRedpillApiKeysApiV1RedpillApiKeysGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r ListRedpillApiKeysApiV1RedpillApiKeysGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type CreateRedpillApiKeyApiV1RedpillApiKeysPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r CreateRedpillApiKeyApiV1RedpillApiKeysPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r CreateRedpillApiKeyApiV1RedpillApiKeysPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type ConnectRedpillUserApiV1RedpillConnectPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} -} - -// Status returns HTTPResponse.Status -func (r ConnectRedpillUserApiV1RedpillConnectPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r ConnectRedpillUserApiV1RedpillConnectPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type ListApiKeyLogsApiV1RedpillLogsApiKeyIdGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r ListApiKeyLogsApiV1RedpillLogsApiKeyIdGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r ListApiKeyLogsApiV1RedpillLogsApiKeyIdGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type ListModelsApiV1RedpillModelsGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} -} - -// Status returns HTTPResponse.Status -func (r ListModelsApiV1RedpillModelsGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r ListModelsApiV1RedpillModelsGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetDailyUsageApiV1RedpillUsageDailyGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r GetDailyUsageApiV1RedpillUsageDailyGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetDailyUsageApiV1RedpillUsageDailyGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetUsageLogsApiV1RedpillUsageLogsGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r GetUsageLogsApiV1RedpillUsageLogsGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetUsageLogsApiV1RedpillUsageLogsGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleBatchCvmStatusApiV1StatusBatchPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *map[string]CvmStatus - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleBatchCvmStatusApiV1StatusBatchPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleBatchCvmStatusApiV1StatusBatchPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type ListTeepodsApiV1TeepodsGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]Teepod - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r ListTeepodsApiV1TeepodsGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r ListTeepodsApiV1TeepodsGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleGetAvailableTeepodsApiV1TeepodsAvailableGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *TierCapacity - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleGetAvailableTeepodsApiV1TeepodsAvailableGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleGetAvailableTeepodsApiV1TeepodsAvailableGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]HostedCvm - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type ListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r ListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r ListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleListPublicCvmsApiV1VerifiedAppsGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]PublicCVM -} - -// Status returns HTTPResponse.Status -func (r HandleListPublicCvmsApiV1VerifiedAppsGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleListPublicCvmsApiV1VerifiedAppsGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *CvmAttestation - JSON422 *HTTPValidationError -} - -// Status returns HTTPResponse.Status -func (r HandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HealthCheckHealthGetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} -} - -// Status returns HTTPResponse.Status -func (r HealthCheckHealthGetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HealthCheckHealthGetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -// ListDstackAppsApiV1AppsGetWithResponse request returning *ListDstackAppsApiV1AppsGetResponse -func (c *ClientWithResponses) ListDstackAppsApiV1AppsGetWithResponse(ctx context.Context, params *ListDstackAppsApiV1AppsGetParams, reqEditors ...RequestEditorFn) (*ListDstackAppsApiV1AppsGetResponse, error) { - rsp, err := c.ListDstackAppsApiV1AppsGet(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseListDstackAppsApiV1AppsGetResponse(rsp) -} - -// GetFilterOptionsApiV1AppsFilterOptionsGetWithResponse request returning *GetFilterOptionsApiV1AppsFilterOptionsGetResponse -func (c *ClientWithResponses) GetFilterOptionsApiV1AppsFilterOptionsGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetFilterOptionsApiV1AppsFilterOptionsGetResponse, error) { - rsp, err := c.GetFilterOptionsApiV1AppsFilterOptionsGet(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetFilterOptionsApiV1AppsFilterOptionsGetResponse(rsp) -} - -// GetDstackAppApiV1AppsAppIdGetWithResponse request returning *GetDstackAppApiV1AppsAppIdGetResponse -func (c *ClientWithResponses) GetDstackAppApiV1AppsAppIdGetWithResponse(ctx context.Context, appId string, reqEditors ...RequestEditorFn) (*GetDstackAppApiV1AppsAppIdGetResponse, error) { - rsp, err := c.GetDstackAppApiV1AppsAppIdGet(ctx, appId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetDstackAppApiV1AppsAppIdGetResponse(rsp) -} - -// HandleGetAppAttestationApiV1AppsAppIdAttestationsGetWithResponse request returning *HandleGetAppAttestationApiV1AppsAppIdAttestationsGetResponse -func (c *ClientWithResponses) HandleGetAppAttestationApiV1AppsAppIdAttestationsGetWithResponse(ctx context.Context, appId string, reqEditors ...RequestEditorFn) (*HandleGetAppAttestationApiV1AppsAppIdAttestationsGetResponse, error) { - rsp, err := c.HandleGetAppAttestationApiV1AppsAppIdAttestationsGet(ctx, appId, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleGetAppAttestationApiV1AppsAppIdAttestationsGetResponse(rsp) -} - -// HandleGetAppCvmsApiV1AppsAppIdCvmsGetWithResponse request returning *HandleGetAppCvmsApiV1AppsAppIdCvmsGetResponse -func (c *ClientWithResponses) HandleGetAppCvmsApiV1AppsAppIdCvmsGetWithResponse(ctx context.Context, appId string, reqEditors ...RequestEditorFn) (*HandleGetAppCvmsApiV1AppsAppIdCvmsGetResponse, error) { - rsp, err := c.HandleGetAppCvmsApiV1AppsAppIdCvmsGet(ctx, appId, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleGetAppCvmsApiV1AppsAppIdCvmsGetResponse(rsp) -} - -// HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostWithBodyWithResponse request with arbitrary body returning *HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostResponse -func (c *ClientWithResponses) HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostWithBodyWithResponse(ctx context.Context, appId string, vmUuid string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostResponse, error) { - rsp, err := c.HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostWithBody(ctx, appId, vmUuid, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostResponse(rsp) -} - -func (c *ClientWithResponses) HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostWithResponse(ctx context.Context, appId string, vmUuid string, body HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostResponse, error) { - rsp, err := c.HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPost(ctx, appId, vmUuid, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostResponse(rsp) -} - -// GetAppEventsApiV1AppsAppIdEventsGetWithResponse request returning *GetAppEventsApiV1AppsAppIdEventsGetResponse -func (c *ClientWithResponses) GetAppEventsApiV1AppsAppIdEventsGetWithResponse(ctx context.Context, appId string, params *GetAppEventsApiV1AppsAppIdEventsGetParams, reqEditors ...RequestEditorFn) (*GetAppEventsApiV1AppsAppIdEventsGetResponse, error) { - rsp, err := c.GetAppEventsApiV1AppsAppIdEventsGet(ctx, appId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetAppEventsApiV1AppsAppIdEventsGetResponse(rsp) -} - -// GetAppRevisionsApiV1AppsAppIdRevisionsGetWithResponse request returning *GetAppRevisionsApiV1AppsAppIdRevisionsGetResponse -func (c *ClientWithResponses) GetAppRevisionsApiV1AppsAppIdRevisionsGetWithResponse(ctx context.Context, appId string, params *GetAppRevisionsApiV1AppsAppIdRevisionsGetParams, reqEditors ...RequestEditorFn) (*GetAppRevisionsApiV1AppsAppIdRevisionsGetResponse, error) { - rsp, err := c.GetAppRevisionsApiV1AppsAppIdRevisionsGet(ctx, appId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetAppRevisionsApiV1AppsAppIdRevisionsGetResponse(rsp) -} - -// GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetWithResponse request returning *GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetResponse -func (c *ClientWithResponses) GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetWithResponse(ctx context.Context, appId string, revisionId string, params *GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetParams, reqEditors ...RequestEditorFn) (*GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetResponse, error) { - rsp, err := c.GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGet(ctx, appId, revisionId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetResponse(rsp) -} - -// RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostWithBodyWithResponse request with arbitrary body returning *RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostResponse -func (c *ClientWithResponses) RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostWithBodyWithResponse(ctx context.Context, appId string, revisionId string, params *RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostResponse, error) { - rsp, err := c.RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostWithBody(ctx, appId, revisionId, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseRedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostResponse(rsp) -} - -func (c *ClientWithResponses) RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostWithResponse(ctx context.Context, appId string, revisionId string, params *RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostParams, body RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostJSONRequestBody, reqEditors ...RequestEditorFn) (*RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostResponse, error) { - rsp, err := c.RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPost(ctx, appId, revisionId, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseRedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostResponse(rsp) -} - -// GetAppUsageApiV1AppsAppIdUsageGetWithResponse request returning *GetAppUsageApiV1AppsAppIdUsageGetResponse -func (c *ClientWithResponses) GetAppUsageApiV1AppsAppIdUsageGetWithResponse(ctx context.Context, appId string, params *GetAppUsageApiV1AppsAppIdUsageGetParams, reqEditors ...RequestEditorFn) (*GetAppUsageApiV1AppsAppIdUsageGetResponse, error) { - rsp, err := c.GetAppUsageApiV1AppsAppIdUsageGet(ctx, appId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetAppUsageApiV1AppsAppIdUsageGetResponse(rsp) -} - -// GetCollateralApiV1AttestationsCollateralChecksumGetWithResponse request returning *GetCollateralApiV1AttestationsCollateralChecksumGetResponse -func (c *ClientWithResponses) GetCollateralApiV1AttestationsCollateralChecksumGetWithResponse(ctx context.Context, checksum string, reqEditors ...RequestEditorFn) (*GetCollateralApiV1AttestationsCollateralChecksumGetResponse, error) { - rsp, err := c.GetCollateralApiV1AttestationsCollateralChecksumGet(ctx, checksum, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetCollateralApiV1AttestationsCollateralChecksumGetResponse(rsp) -} - -// HandleListDeviceIdsApiV1AttestationsDeviceIdsGetWithResponse request returning *HandleListDeviceIdsApiV1AttestationsDeviceIdsGetResponse -func (c *ClientWithResponses) HandleListDeviceIdsApiV1AttestationsDeviceIdsGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HandleListDeviceIdsApiV1AttestationsDeviceIdsGetResponse, error) { - rsp, err := c.HandleListDeviceIdsApiV1AttestationsDeviceIdsGet(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleListDeviceIdsApiV1AttestationsDeviceIdsGetResponse(rsp) -} - -// HandleListNodesApiV1AttestationsNodesGetWithResponse request returning *HandleListNodesApiV1AttestationsNodesGetResponse -func (c *ClientWithResponses) HandleListNodesApiV1AttestationsNodesGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HandleListNodesApiV1AttestationsNodesGetResponse, error) { - rsp, err := c.HandleListNodesApiV1AttestationsNodesGet(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleListNodesApiV1AttestationsNodesGetResponse(rsp) -} - -// HandleListPpidsApiV1AttestationsPpidsGetWithResponse request returning *HandleListPpidsApiV1AttestationsPpidsGetResponse -func (c *ClientWithResponses) HandleListPpidsApiV1AttestationsPpidsGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HandleListPpidsApiV1AttestationsPpidsGetResponse, error) { - rsp, err := c.HandleListPpidsApiV1AttestationsPpidsGet(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleListPpidsApiV1AttestationsPpidsGetResponse(rsp) -} - -// HandleGetRawApiV1AttestationsRawChecksumGetWithResponse request returning *HandleGetRawApiV1AttestationsRawChecksumGetResponse -func (c *ClientWithResponses) HandleGetRawApiV1AttestationsRawChecksumGetWithResponse(ctx context.Context, checksum string, reqEditors ...RequestEditorFn) (*HandleGetRawApiV1AttestationsRawChecksumGetResponse, error) { - rsp, err := c.HandleGetRawApiV1AttestationsRawChecksumGet(ctx, checksum, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleGetRawApiV1AttestationsRawChecksumGetResponse(rsp) -} - -// HandleCheckRawFileApiV1AttestationsRawChecksumHeadWithResponse request returning *HandleCheckRawFileApiV1AttestationsRawChecksumHeadResponse -func (c *ClientWithResponses) HandleCheckRawFileApiV1AttestationsRawChecksumHeadWithResponse(ctx context.Context, checksum string, reqEditors ...RequestEditorFn) (*HandleCheckRawFileApiV1AttestationsRawChecksumHeadResponse, error) { - rsp, err := c.HandleCheckRawFileApiV1AttestationsRawChecksumHead(ctx, checksum, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleCheckRawFileApiV1AttestationsRawChecksumHeadResponse(rsp) -} - -// HandleListRecentApiV1AttestationsRecentGetWithResponse request returning *HandleListRecentApiV1AttestationsRecentGetResponse -func (c *ClientWithResponses) HandleListRecentApiV1AttestationsRecentGetWithResponse(ctx context.Context, params *HandleListRecentApiV1AttestationsRecentGetParams, reqEditors ...RequestEditorFn) (*HandleListRecentApiV1AttestationsRecentGetResponse, error) { - rsp, err := c.HandleListRecentApiV1AttestationsRecentGet(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleListRecentApiV1AttestationsRecentGetResponse(rsp) -} - -// HandleUploadAndVerifyApiV1AttestationsVerifyPostWithBodyWithResponse request with arbitrary body returning *HandleUploadAndVerifyApiV1AttestationsVerifyPostResponse -func (c *ClientWithResponses) HandleUploadAndVerifyApiV1AttestationsVerifyPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleUploadAndVerifyApiV1AttestationsVerifyPostResponse, error) { - rsp, err := c.HandleUploadAndVerifyApiV1AttestationsVerifyPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleUploadAndVerifyApiV1AttestationsVerifyPostResponse(rsp) -} - -// HandleViewApiV1AttestationsViewChecksumGetWithResponse request returning *HandleViewApiV1AttestationsViewChecksumGetResponse -func (c *ClientWithResponses) HandleViewApiV1AttestationsViewChecksumGetWithResponse(ctx context.Context, checksum string, reqEditors ...RequestEditorFn) (*HandleViewApiV1AttestationsViewChecksumGetResponse, error) { - rsp, err := c.HandleViewApiV1AttestationsViewChecksumGet(ctx, checksum, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleViewApiV1AttestationsViewChecksumGetResponse(rsp) -} - -// Confirm2faSetupEndpointApiV1Auth2faConfirmPostWithBodyWithResponse request with arbitrary body returning *Confirm2faSetupEndpointApiV1Auth2faConfirmPostResponse -func (c *ClientWithResponses) Confirm2faSetupEndpointApiV1Auth2faConfirmPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*Confirm2faSetupEndpointApiV1Auth2faConfirmPostResponse, error) { - rsp, err := c.Confirm2faSetupEndpointApiV1Auth2faConfirmPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseConfirm2faSetupEndpointApiV1Auth2faConfirmPostResponse(rsp) -} - -func (c *ClientWithResponses) Confirm2faSetupEndpointApiV1Auth2faConfirmPostWithResponse(ctx context.Context, body Confirm2faSetupEndpointApiV1Auth2faConfirmPostJSONRequestBody, reqEditors ...RequestEditorFn) (*Confirm2faSetupEndpointApiV1Auth2faConfirmPostResponse, error) { - rsp, err := c.Confirm2faSetupEndpointApiV1Auth2faConfirmPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseConfirm2faSetupEndpointApiV1Auth2faConfirmPostResponse(rsp) -} - -// Disable2faEndpointApiV1Auth2faDisablePostWithBodyWithResponse request with arbitrary body returning *Disable2faEndpointApiV1Auth2faDisablePostResponse -func (c *ClientWithResponses) Disable2faEndpointApiV1Auth2faDisablePostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*Disable2faEndpointApiV1Auth2faDisablePostResponse, error) { - rsp, err := c.Disable2faEndpointApiV1Auth2faDisablePostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseDisable2faEndpointApiV1Auth2faDisablePostResponse(rsp) -} - -func (c *ClientWithResponses) Disable2faEndpointApiV1Auth2faDisablePostWithResponse(ctx context.Context, body Disable2faEndpointApiV1Auth2faDisablePostJSONRequestBody, reqEditors ...RequestEditorFn) (*Disable2faEndpointApiV1Auth2faDisablePostResponse, error) { - rsp, err := c.Disable2faEndpointApiV1Auth2faDisablePost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseDisable2faEndpointApiV1Auth2faDisablePostResponse(rsp) -} - -// RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostWithBodyWithResponse request with arbitrary body returning *RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostResponse -func (c *ClientWithResponses) RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostResponse, error) { - rsp, err := c.RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseRegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostResponse(rsp) -} - -func (c *ClientWithResponses) RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostWithResponse(ctx context.Context, body RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostJSONRequestBody, reqEditors ...RequestEditorFn) (*RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostResponse, error) { - rsp, err := c.RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseRegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostResponse(rsp) -} - -// Setup2faEndpointApiV1Auth2faSetupPostWithResponse request returning *Setup2faEndpointApiV1Auth2faSetupPostResponse -func (c *ClientWithResponses) Setup2faEndpointApiV1Auth2faSetupPostWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*Setup2faEndpointApiV1Auth2faSetupPostResponse, error) { - rsp, err := c.Setup2faEndpointApiV1Auth2faSetupPost(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseSetup2faEndpointApiV1Auth2faSetupPostResponse(rsp) -} - -// Get2faStatusEndpointApiV1Auth2faStatusGetWithResponse request returning *Get2faStatusEndpointApiV1Auth2faStatusGetResponse -func (c *ClientWithResponses) Get2faStatusEndpointApiV1Auth2faStatusGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*Get2faStatusEndpointApiV1Auth2faStatusGetResponse, error) { - rsp, err := c.Get2faStatusEndpointApiV1Auth2faStatusGet(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseGet2faStatusEndpointApiV1Auth2faStatusGetResponse(rsp) -} - -// Verify2faEndpointApiV1Auth2faVerifyPostWithBodyWithResponse request with arbitrary body returning *Verify2faEndpointApiV1Auth2faVerifyPostResponse -func (c *ClientWithResponses) Verify2faEndpointApiV1Auth2faVerifyPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*Verify2faEndpointApiV1Auth2faVerifyPostResponse, error) { - rsp, err := c.Verify2faEndpointApiV1Auth2faVerifyPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseVerify2faEndpointApiV1Auth2faVerifyPostResponse(rsp) -} - -func (c *ClientWithResponses) Verify2faEndpointApiV1Auth2faVerifyPostWithResponse(ctx context.Context, body Verify2faEndpointApiV1Auth2faVerifyPostJSONRequestBody, reqEditors ...RequestEditorFn) (*Verify2faEndpointApiV1Auth2faVerifyPostResponse, error) { - rsp, err := c.Verify2faEndpointApiV1Auth2faVerifyPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseVerify2faEndpointApiV1Auth2faVerifyPostResponse(rsp) -} - -// Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostWithBodyWithResponse request with arbitrary body returning *Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostResponse -func (c *ClientWithResponses) Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostResponse, error) { - rsp, err := c.Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseVerify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostResponse(rsp) -} - -func (c *ClientWithResponses) Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostWithResponse(ctx context.Context, body Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostJSONRequestBody, reqEditors ...RequestEditorFn) (*Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostResponse, error) { - rsp, err := c.Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseVerify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostResponse(rsp) -} - -// AuthenticatedApiV1AuthAuthenticatedGetWithResponse request returning *AuthenticatedApiV1AuthAuthenticatedGetResponse -func (c *ClientWithResponses) AuthenticatedApiV1AuthAuthenticatedGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*AuthenticatedApiV1AuthAuthenticatedGetResponse, error) { - rsp, err := c.AuthenticatedApiV1AuthAuthenticatedGet(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseAuthenticatedApiV1AuthAuthenticatedGetResponse(rsp) -} - -// ApiChangeEmailApiV1AuthChangeEmailPostWithBodyWithResponse request with arbitrary body returning *ApiChangeEmailApiV1AuthChangeEmailPostResponse -func (c *ClientWithResponses) ApiChangeEmailApiV1AuthChangeEmailPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiChangeEmailApiV1AuthChangeEmailPostResponse, error) { - rsp, err := c.ApiChangeEmailApiV1AuthChangeEmailPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseApiChangeEmailApiV1AuthChangeEmailPostResponse(rsp) -} - -func (c *ClientWithResponses) ApiChangeEmailApiV1AuthChangeEmailPostWithResponse(ctx context.Context, body ApiChangeEmailApiV1AuthChangeEmailPostJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiChangeEmailApiV1AuthChangeEmailPostResponse, error) { - rsp, err := c.ApiChangeEmailApiV1AuthChangeEmailPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseApiChangeEmailApiV1AuthChangeEmailPostResponse(rsp) -} - -// DecodeLinkTokenApiV1AuthDecodeLinkTokenGetWithResponse request returning *DecodeLinkTokenApiV1AuthDecodeLinkTokenGetResponse -func (c *ClientWithResponses) DecodeLinkTokenApiV1AuthDecodeLinkTokenGetWithResponse(ctx context.Context, params *DecodeLinkTokenApiV1AuthDecodeLinkTokenGetParams, reqEditors ...RequestEditorFn) (*DecodeLinkTokenApiV1AuthDecodeLinkTokenGetResponse, error) { - rsp, err := c.DecodeLinkTokenApiV1AuthDecodeLinkTokenGet(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseDecodeLinkTokenApiV1AuthDecodeLinkTokenGetResponse(rsp) -} - -// AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostWithBodyWithResponse request with arbitrary body returning *AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostResponse -func (c *ClientWithResponses) AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostResponse, error) { - rsp, err := c.AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseAuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostResponse(rsp) -} - -func (c *ClientWithResponses) AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostWithResponse(ctx context.Context, body AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostJSONRequestBody, reqEditors ...RequestEditorFn) (*AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostResponse, error) { - rsp, err := c.AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseAuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostResponse(rsp) -} - -// RequestDeviceCodeApiV1AuthDeviceCodePostWithBodyWithResponse request with arbitrary body returning *RequestDeviceCodeApiV1AuthDeviceCodePostResponse -func (c *ClientWithResponses) RequestDeviceCodeApiV1AuthDeviceCodePostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestDeviceCodeApiV1AuthDeviceCodePostResponse, error) { - rsp, err := c.RequestDeviceCodeApiV1AuthDeviceCodePostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseRequestDeviceCodeApiV1AuthDeviceCodePostResponse(rsp) -} - -func (c *ClientWithResponses) RequestDeviceCodeApiV1AuthDeviceCodePostWithResponse(ctx context.Context, body RequestDeviceCodeApiV1AuthDeviceCodePostJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestDeviceCodeApiV1AuthDeviceCodePostResponse, error) { - rsp, err := c.RequestDeviceCodeApiV1AuthDeviceCodePost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseRequestDeviceCodeApiV1AuthDeviceCodePostResponse(rsp) -} - -// CheckDeviceStatusApiV1AuthDeviceStatusUserCodeGetWithResponse request returning *CheckDeviceStatusApiV1AuthDeviceStatusUserCodeGetResponse -func (c *ClientWithResponses) CheckDeviceStatusApiV1AuthDeviceStatusUserCodeGetWithResponse(ctx context.Context, userCode string, reqEditors ...RequestEditorFn) (*CheckDeviceStatusApiV1AuthDeviceStatusUserCodeGetResponse, error) { - rsp, err := c.CheckDeviceStatusApiV1AuthDeviceStatusUserCodeGet(ctx, userCode, reqEditors...) - if err != nil { - return nil, err - } - return ParseCheckDeviceStatusApiV1AuthDeviceStatusUserCodeGetResponse(rsp) -} - -// PollDeviceTokenApiV1AuthDeviceTokenPostWithBodyWithResponse request with arbitrary body returning *PollDeviceTokenApiV1AuthDeviceTokenPostResponse -func (c *ClientWithResponses) PollDeviceTokenApiV1AuthDeviceTokenPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PollDeviceTokenApiV1AuthDeviceTokenPostResponse, error) { - rsp, err := c.PollDeviceTokenApiV1AuthDeviceTokenPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePollDeviceTokenApiV1AuthDeviceTokenPostResponse(rsp) -} - -func (c *ClientWithResponses) PollDeviceTokenApiV1AuthDeviceTokenPostWithResponse(ctx context.Context, body PollDeviceTokenApiV1AuthDeviceTokenPostJSONRequestBody, reqEditors ...RequestEditorFn) (*PollDeviceTokenApiV1AuthDeviceTokenPostResponse, error) { - rsp, err := c.PollDeviceTokenApiV1AuthDeviceTokenPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePollDeviceTokenApiV1AuthDeviceTokenPostResponse(rsp) -} - -// ForgotPasswordApiV1AuthForgotPasswordPostWithBodyWithResponse request with arbitrary body returning *ForgotPasswordApiV1AuthForgotPasswordPostResponse -func (c *ClientWithResponses) ForgotPasswordApiV1AuthForgotPasswordPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ForgotPasswordApiV1AuthForgotPasswordPostResponse, error) { - rsp, err := c.ForgotPasswordApiV1AuthForgotPasswordPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseForgotPasswordApiV1AuthForgotPasswordPostResponse(rsp) -} - -func (c *ClientWithResponses) ForgotPasswordApiV1AuthForgotPasswordPostWithResponse(ctx context.Context, body ForgotPasswordApiV1AuthForgotPasswordPostJSONRequestBody, reqEditors ...RequestEditorFn) (*ForgotPasswordApiV1AuthForgotPasswordPostResponse, error) { - rsp, err := c.ForgotPasswordApiV1AuthForgotPasswordPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseForgotPasswordApiV1AuthForgotPasswordPostResponse(rsp) -} - -// LoginWithCookieApiV1AuthLoginPostWithBodyWithResponse request with arbitrary body returning *LoginWithCookieApiV1AuthLoginPostResponse -func (c *ClientWithResponses) LoginWithCookieApiV1AuthLoginPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LoginWithCookieApiV1AuthLoginPostResponse, error) { - rsp, err := c.LoginWithCookieApiV1AuthLoginPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseLoginWithCookieApiV1AuthLoginPostResponse(rsp) -} - -func (c *ClientWithResponses) LoginWithCookieApiV1AuthLoginPostWithFormdataBodyWithResponse(ctx context.Context, body LoginWithCookieApiV1AuthLoginPostFormdataRequestBody, reqEditors ...RequestEditorFn) (*LoginWithCookieApiV1AuthLoginPostResponse, error) { - rsp, err := c.LoginWithCookieApiV1AuthLoginPostWithFormdataBody(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseLoginWithCookieApiV1AuthLoginPostResponse(rsp) -} - -// LoginWith2faApiV1AuthLoginWith2faPostWithBodyWithResponse request with arbitrary body returning *LoginWith2faApiV1AuthLoginWith2faPostResponse -func (c *ClientWithResponses) LoginWith2faApiV1AuthLoginWith2faPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LoginWith2faApiV1AuthLoginWith2faPostResponse, error) { - rsp, err := c.LoginWith2faApiV1AuthLoginWith2faPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseLoginWith2faApiV1AuthLoginWith2faPostResponse(rsp) -} - -func (c *ClientWithResponses) LoginWith2faApiV1AuthLoginWith2faPostWithResponse(ctx context.Context, body LoginWith2faApiV1AuthLoginWith2faPostJSONRequestBody, reqEditors ...RequestEditorFn) (*LoginWith2faApiV1AuthLoginWith2faPostResponse, error) { - rsp, err := c.LoginWith2faApiV1AuthLoginWith2faPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseLoginWith2faApiV1AuthLoginWith2faPostResponse(rsp) -} - -// LogoutApiV1AuthLogoutPostWithResponse request returning *LogoutApiV1AuthLogoutPostResponse -func (c *ClientWithResponses) LogoutApiV1AuthLogoutPostWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*LogoutApiV1AuthLogoutPostResponse, error) { - rsp, err := c.LogoutApiV1AuthLogoutPost(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseLogoutApiV1AuthLogoutPostResponse(rsp) -} - -// ReadUsersMeApiV1AuthMeGetWithResponse request returning *ReadUsersMeApiV1AuthMeGetResponse -func (c *ClientWithResponses) ReadUsersMeApiV1AuthMeGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ReadUsersMeApiV1AuthMeGetResponse, error) { - rsp, err := c.ReadUsersMeApiV1AuthMeGet(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseReadUsersMeApiV1AuthMeGetResponse(rsp) -} - -// GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetWithResponse request returning *GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetResponse -func (c *ClientWithResponses) GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetWithResponse(ctx context.Context, params *GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetParams, reqEditors ...RequestEditorFn) (*GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetResponse, error) { - rsp, err := c.GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGet(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetResponse(rsp) -} - -// GithubOauthCallbackApiV1AuthOauthGithubCallbackGetWithResponse request returning *GithubOauthCallbackApiV1AuthOauthGithubCallbackGetResponse -func (c *ClientWithResponses) GithubOauthCallbackApiV1AuthOauthGithubCallbackGetWithResponse(ctx context.Context, params *GithubOauthCallbackApiV1AuthOauthGithubCallbackGetParams, reqEditors ...RequestEditorFn) (*GithubOauthCallbackApiV1AuthOauthGithubCallbackGetResponse, error) { - rsp, err := c.GithubOauthCallbackApiV1AuthOauthGithubCallbackGet(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGithubOauthCallbackApiV1AuthOauthGithubCallbackGetResponse(rsp) -} - -// GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetWithResponse request returning *GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetResponse -func (c *ClientWithResponses) GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetWithResponse(ctx context.Context, params *GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetParams, reqEditors ...RequestEditorFn) (*GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetResponse, error) { - rsp, err := c.GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGet(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetResponse(rsp) -} - -// GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetWithResponse request returning *GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetResponse -func (c *ClientWithResponses) GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetWithResponse(ctx context.Context, params *GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetParams, reqEditors ...RequestEditorFn) (*GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetResponse, error) { - rsp, err := c.GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGet(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetResponse(rsp) -} - -// HandleUpdatePasswordApiV1AuthPasswordPostWithBodyWithResponse request with arbitrary body returning *HandleUpdatePasswordApiV1AuthPasswordPostResponse -func (c *ClientWithResponses) HandleUpdatePasswordApiV1AuthPasswordPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleUpdatePasswordApiV1AuthPasswordPostResponse, error) { - rsp, err := c.HandleUpdatePasswordApiV1AuthPasswordPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleUpdatePasswordApiV1AuthPasswordPostResponse(rsp) -} - -func (c *ClientWithResponses) HandleUpdatePasswordApiV1AuthPasswordPostWithResponse(ctx context.Context, body HandleUpdatePasswordApiV1AuthPasswordPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleUpdatePasswordApiV1AuthPasswordPostResponse, error) { - rsp, err := c.HandleUpdatePasswordApiV1AuthPasswordPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleUpdatePasswordApiV1AuthPasswordPostResponse(rsp) -} - -// RegisterUserApiV1AuthRegisterPostWithBodyWithResponse request with arbitrary body returning *RegisterUserApiV1AuthRegisterPostResponse -func (c *ClientWithResponses) RegisterUserApiV1AuthRegisterPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RegisterUserApiV1AuthRegisterPostResponse, error) { - rsp, err := c.RegisterUserApiV1AuthRegisterPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseRegisterUserApiV1AuthRegisterPostResponse(rsp) -} - -func (c *ClientWithResponses) RegisterUserApiV1AuthRegisterPostWithResponse(ctx context.Context, body RegisterUserApiV1AuthRegisterPostJSONRequestBody, reqEditors ...RequestEditorFn) (*RegisterUserApiV1AuthRegisterPostResponse, error) { - rsp, err := c.RegisterUserApiV1AuthRegisterPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseRegisterUserApiV1AuthRegisterPostResponse(rsp) -} - -// ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostWithBodyWithResponse request with arbitrary body returning *ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostResponse -func (c *ClientWithResponses) ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostResponse, error) { - rsp, err := c.ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostResponse(rsp) -} - -func (c *ClientWithResponses) ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostWithResponse(ctx context.Context, body ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostResponse, error) { - rsp, err := c.ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostResponse(rsp) -} - -// HandleResetPasswordWithTokenApiV1AuthResetPasswordPutWithBodyWithResponse request with arbitrary body returning *HandleResetPasswordWithTokenApiV1AuthResetPasswordPutResponse -func (c *ClientWithResponses) HandleResetPasswordWithTokenApiV1AuthResetPasswordPutWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleResetPasswordWithTokenApiV1AuthResetPasswordPutResponse, error) { - rsp, err := c.HandleResetPasswordWithTokenApiV1AuthResetPasswordPutWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleResetPasswordWithTokenApiV1AuthResetPasswordPutResponse(rsp) -} - -func (c *ClientWithResponses) HandleResetPasswordWithTokenApiV1AuthResetPasswordPutWithResponse(ctx context.Context, body HandleResetPasswordWithTokenApiV1AuthResetPasswordPutJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleResetPasswordWithTokenApiV1AuthResetPasswordPutResponse, error) { - rsp, err := c.HandleResetPasswordWithTokenApiV1AuthResetPasswordPut(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleResetPasswordWithTokenApiV1AuthResetPasswordPutResponse(rsp) -} - -// RevokeAllSessionsApiV1AuthSessionsDeleteWithResponse request returning *RevokeAllSessionsApiV1AuthSessionsDeleteResponse -func (c *ClientWithResponses) RevokeAllSessionsApiV1AuthSessionsDeleteWithResponse(ctx context.Context, params *RevokeAllSessionsApiV1AuthSessionsDeleteParams, reqEditors ...RequestEditorFn) (*RevokeAllSessionsApiV1AuthSessionsDeleteResponse, error) { - rsp, err := c.RevokeAllSessionsApiV1AuthSessionsDelete(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseRevokeAllSessionsApiV1AuthSessionsDeleteResponse(rsp) -} - -// GetActiveSessionsApiV1AuthSessionsGetWithResponse request returning *GetActiveSessionsApiV1AuthSessionsGetResponse -func (c *ClientWithResponses) GetActiveSessionsApiV1AuthSessionsGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetActiveSessionsApiV1AuthSessionsGetResponse, error) { - rsp, err := c.GetActiveSessionsApiV1AuthSessionsGet(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetActiveSessionsApiV1AuthSessionsGetResponse(rsp) -} - -// RevokeSessionEndpointApiV1AuthSessionsJtiDeleteWithResponse request returning *RevokeSessionEndpointApiV1AuthSessionsJtiDeleteResponse -func (c *ClientWithResponses) RevokeSessionEndpointApiV1AuthSessionsJtiDeleteWithResponse(ctx context.Context, jti string, reqEditors ...RequestEditorFn) (*RevokeSessionEndpointApiV1AuthSessionsJtiDeleteResponse, error) { - rsp, err := c.RevokeSessionEndpointApiV1AuthSessionsJtiDelete(ctx, jti, reqEditors...) - if err != nil { - return nil, err - } - return ParseRevokeSessionEndpointApiV1AuthSessionsJtiDeleteResponse(rsp) -} - -// VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostWithBodyWithResponse request with arbitrary body returning *VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostResponse -func (c *ClientWithResponses) VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostResponse, error) { - rsp, err := c.VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseVerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostResponse(rsp) -} - -func (c *ClientWithResponses) VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostWithResponse(ctx context.Context, body VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostJSONRequestBody, reqEditors ...RequestEditorFn) (*VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostResponse, error) { - rsp, err := c.VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseVerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostResponse(rsp) -} - -// LoginForAccessTokenApiV1AuthTokenPostWithBodyWithResponse request with arbitrary body returning *LoginForAccessTokenApiV1AuthTokenPostResponse -func (c *ClientWithResponses) LoginForAccessTokenApiV1AuthTokenPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LoginForAccessTokenApiV1AuthTokenPostResponse, error) { - rsp, err := c.LoginForAccessTokenApiV1AuthTokenPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseLoginForAccessTokenApiV1AuthTokenPostResponse(rsp) -} - -func (c *ClientWithResponses) LoginForAccessTokenApiV1AuthTokenPostWithFormdataBodyWithResponse(ctx context.Context, body LoginForAccessTokenApiV1AuthTokenPostFormdataRequestBody, reqEditors ...RequestEditorFn) (*LoginForAccessTokenApiV1AuthTokenPostResponse, error) { - rsp, err := c.LoginForAccessTokenApiV1AuthTokenPostWithFormdataBody(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseLoginForAccessTokenApiV1AuthTokenPostResponse(rsp) -} - -// HandleUpdateUsernameApiV1AuthUsernamePutWithBodyWithResponse request with arbitrary body returning *HandleUpdateUsernameApiV1AuthUsernamePutResponse -func (c *ClientWithResponses) HandleUpdateUsernameApiV1AuthUsernamePutWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleUpdateUsernameApiV1AuthUsernamePutResponse, error) { - rsp, err := c.HandleUpdateUsernameApiV1AuthUsernamePutWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleUpdateUsernameApiV1AuthUsernamePutResponse(rsp) -} - -func (c *ClientWithResponses) HandleUpdateUsernameApiV1AuthUsernamePutWithResponse(ctx context.Context, body HandleUpdateUsernameApiV1AuthUsernamePutJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleUpdateUsernameApiV1AuthUsernamePutResponse, error) { - rsp, err := c.HandleUpdateUsernameApiV1AuthUsernamePut(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleUpdateUsernameApiV1AuthUsernamePutResponse(rsp) -} - -// ValidateResetTokenApiV1AuthValidateResetTokenGetWithResponse request returning *ValidateResetTokenApiV1AuthValidateResetTokenGetResponse -func (c *ClientWithResponses) ValidateResetTokenApiV1AuthValidateResetTokenGetWithResponse(ctx context.Context, params *ValidateResetTokenApiV1AuthValidateResetTokenGetParams, reqEditors ...RequestEditorFn) (*ValidateResetTokenApiV1AuthValidateResetTokenGetResponse, error) { - rsp, err := c.ValidateResetTokenApiV1AuthValidateResetTokenGet(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseValidateResetTokenApiV1AuthValidateResetTokenGetResponse(rsp) -} - -// VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostWithBodyWithResponse request with arbitrary body returning *VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostResponse -func (c *ClientWithResponses) VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostResponse, error) { - rsp, err := c.VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseVerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostResponse(rsp) -} - -func (c *ClientWithResponses) VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostWithResponse(ctx context.Context, body VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostJSONRequestBody, reqEditors ...RequestEditorFn) (*VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostResponse, error) { - rsp, err := c.VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseVerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostResponse(rsp) -} - -// ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostWithBodyWithResponse request with arbitrary body returning *ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostResponse -func (c *ClientWithResponses) ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostResponse, error) { - rsp, err := c.ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostResponse(rsp) -} - -func (c *ClientWithResponses) ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostWithResponse(ctx context.Context, body ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostResponse, error) { - rsp, err := c.ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostResponse(rsp) -} - -// HandleListCvmsApiV1CvmsGetWithResponse request returning *HandleListCvmsApiV1CvmsGetResponse -func (c *ClientWithResponses) HandleListCvmsApiV1CvmsGetWithResponse(ctx context.Context, params *HandleListCvmsApiV1CvmsGetParams, reqEditors ...RequestEditorFn) (*HandleListCvmsApiV1CvmsGetResponse, error) { - rsp, err := c.HandleListCvmsApiV1CvmsGet(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleListCvmsApiV1CvmsGetResponse(rsp) -} - -// HandleCreateCvmFromPovisionApiV1CvmsPostWithBodyWithResponse request with arbitrary body returning *HandleCreateCvmFromPovisionApiV1CvmsPostResponse -func (c *ClientWithResponses) HandleCreateCvmFromPovisionApiV1CvmsPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleCreateCvmFromPovisionApiV1CvmsPostResponse, error) { - rsp, err := c.HandleCreateCvmFromPovisionApiV1CvmsPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleCreateCvmFromPovisionApiV1CvmsPostResponse(rsp) -} - -func (c *ClientWithResponses) HandleCreateCvmFromPovisionApiV1CvmsPostWithResponse(ctx context.Context, body HandleCreateCvmFromPovisionApiV1CvmsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleCreateCvmFromPovisionApiV1CvmsPostResponse, error) { - rsp, err := c.HandleCreateCvmFromPovisionApiV1CvmsPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleCreateCvmFromPovisionApiV1CvmsPostResponse(rsp) -} - -// HandleBatchStopCvmsApiV1CvmsBatchStopPostWithBodyWithResponse request with arbitrary body returning *HandleBatchStopCvmsApiV1CvmsBatchStopPostResponse -func (c *ClientWithResponses) HandleBatchStopCvmsApiV1CvmsBatchStopPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleBatchStopCvmsApiV1CvmsBatchStopPostResponse, error) { - rsp, err := c.HandleBatchStopCvmsApiV1CvmsBatchStopPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleBatchStopCvmsApiV1CvmsBatchStopPostResponse(rsp) -} - -func (c *ClientWithResponses) HandleBatchStopCvmsApiV1CvmsBatchStopPostWithResponse(ctx context.Context, body HandleBatchStopCvmsApiV1CvmsBatchStopPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleBatchStopCvmsApiV1CvmsBatchStopPostResponse, error) { - rsp, err := c.HandleBatchStopCvmsApiV1CvmsBatchStopPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleBatchStopCvmsApiV1CvmsBatchStopPostResponse(rsp) -} - -// HandleCreateElizaFromProvisionApiV1CvmsElizaPostWithBodyWithResponse request with arbitrary body returning *HandleCreateElizaFromProvisionApiV1CvmsElizaPostResponse -func (c *ClientWithResponses) HandleCreateElizaFromProvisionApiV1CvmsElizaPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleCreateElizaFromProvisionApiV1CvmsElizaPostResponse, error) { - rsp, err := c.HandleCreateElizaFromProvisionApiV1CvmsElizaPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleCreateElizaFromProvisionApiV1CvmsElizaPostResponse(rsp) -} - -func (c *ClientWithResponses) HandleCreateElizaFromProvisionApiV1CvmsElizaPostWithResponse(ctx context.Context, body HandleCreateElizaFromProvisionApiV1CvmsElizaPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleCreateElizaFromProvisionApiV1CvmsElizaPostResponse, error) { - rsp, err := c.HandleCreateElizaFromProvisionApiV1CvmsElizaPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleCreateElizaFromProvisionApiV1CvmsElizaPostResponse(rsp) -} - -// HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostWithBodyWithResponse request with arbitrary body returning *HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostResponse -func (c *ClientWithResponses) HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostResponse, error) { - rsp, err := c.HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostResponse(rsp) -} - -func (c *ClientWithResponses) HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostWithResponse(ctx context.Context, body HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostResponse, error) { - rsp, err := c.HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostResponse(rsp) -} - -// HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchWithBodyWithResponse request with arbitrary body returning *HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchResponse -func (c *ClientWithResponses) HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchResponse, error) { - rsp, err := c.HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchResponse(rsp) -} - -func (c *ClientWithResponses) HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchWithResponse(ctx context.Context, body HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchResponse, error) { - rsp, err := c.HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatch(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchResponse(rsp) -} - -// HandleListCvmsPaginatedApiV1CvmsPaginatedGetWithResponse request returning *HandleListCvmsPaginatedApiV1CvmsPaginatedGetResponse -func (c *ClientWithResponses) HandleListCvmsPaginatedApiV1CvmsPaginatedGetWithResponse(ctx context.Context, params *HandleListCvmsPaginatedApiV1CvmsPaginatedGetParams, reqEditors ...RequestEditorFn) (*HandleListCvmsPaginatedApiV1CvmsPaginatedGetResponse, error) { - rsp, err := c.HandleListCvmsPaginatedApiV1CvmsPaginatedGet(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleListCvmsPaginatedApiV1CvmsPaginatedGetResponse(rsp) -} - -// HandleProvisionCvmApiV1CvmsProvisionPostWithBodyWithResponse request with arbitrary body returning *HandleProvisionCvmApiV1CvmsProvisionPostResponse -func (c *ClientWithResponses) HandleProvisionCvmApiV1CvmsProvisionPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleProvisionCvmApiV1CvmsProvisionPostResponse, error) { - rsp, err := c.HandleProvisionCvmApiV1CvmsProvisionPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleProvisionCvmApiV1CvmsProvisionPostResponse(rsp) -} - -func (c *ClientWithResponses) HandleProvisionCvmApiV1CvmsProvisionPostWithResponse(ctx context.Context, body HandleProvisionCvmApiV1CvmsProvisionPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleProvisionCvmApiV1CvmsProvisionPostResponse, error) { - rsp, err := c.HandleProvisionCvmApiV1CvmsProvisionPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleProvisionCvmApiV1CvmsProvisionPostResponse(rsp) -} - -// HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostWithBodyWithResponse request with arbitrary body returning *HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostResponse -func (c *ClientWithResponses) HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostResponse, error) { - rsp, err := c.HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostResponse(rsp) -} - -func (c *ClientWithResponses) HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostWithResponse(ctx context.Context, body HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostResponse, error) { - rsp, err := c.HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostResponse(rsp) -} - -// HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostWithBodyWithResponse request with arbitrary body returning *HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostResponse -func (c *ClientWithResponses) HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostResponse, error) { - rsp, err := c.HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostResponse(rsp) -} - -func (c *ClientWithResponses) HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostWithResponse(ctx context.Context, body HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostResponse, error) { - rsp, err := c.HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostResponse(rsp) -} - -// HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostWithBodyWithResponse request with arbitrary body returning *HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostResponse -func (c *ClientWithResponses) HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostResponse, error) { - rsp, err := c.HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleCreateCvmForWorkloadApiV1CvmsWorkloadPostResponse(rsp) -} - -func (c *ClientWithResponses) HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostWithResponse(ctx context.Context, body HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostResponse, error) { - rsp, err := c.HandleCreateCvmForWorkloadApiV1CvmsWorkloadPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleCreateCvmForWorkloadApiV1CvmsWorkloadPostResponse(rsp) -} - -// HandleRemoveCvmApiV1CvmsCvmIdDeleteWithResponse request returning *HandleRemoveCvmApiV1CvmsCvmIdDeleteResponse -func (c *ClientWithResponses) HandleRemoveCvmApiV1CvmsCvmIdDeleteWithResponse(ctx context.Context, cvmId string, params *HandleRemoveCvmApiV1CvmsCvmIdDeleteParams, reqEditors ...RequestEditorFn) (*HandleRemoveCvmApiV1CvmsCvmIdDeleteResponse, error) { - rsp, err := c.HandleRemoveCvmApiV1CvmsCvmIdDelete(ctx, cvmId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleRemoveCvmApiV1CvmsCvmIdDeleteResponse(rsp) -} - -// HandleGetCvmApiV1CvmsCvmIdGetWithResponse request returning *HandleGetCvmApiV1CvmsCvmIdGetResponse -func (c *ClientWithResponses) HandleGetCvmApiV1CvmsCvmIdGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*HandleGetCvmApiV1CvmsCvmIdGetResponse, error) { - rsp, err := c.HandleGetCvmApiV1CvmsCvmIdGet(ctx, cvmId, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleGetCvmApiV1CvmsCvmIdGetResponse(rsp) -} - -// HandleGetCvmAttestationApiV1CvmsCvmIdAttestationGetWithResponse request returning *HandleGetCvmAttestationApiV1CvmsCvmIdAttestationGetResponse -func (c *ClientWithResponses) HandleGetCvmAttestationApiV1CvmsCvmIdAttestationGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*HandleGetCvmAttestationApiV1CvmsCvmIdAttestationGetResponse, error) { - rsp, err := c.HandleGetCvmAttestationApiV1CvmsCvmIdAttestationGet(ctx, cvmId, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleGetCvmAttestationApiV1CvmsCvmIdAttestationGetResponse(rsp) -} - -// GetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGetWithResponse request returning *GetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGetResponse -func (c *ClientWithResponses) GetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*GetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGetResponse, error) { - rsp, err := c.GetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGet(ctx, cvmId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGetResponse(rsp) -} - -// HandleGetCvmComposeApiV1CvmsCvmIdComposeGetWithResponse request returning *HandleGetCvmComposeApiV1CvmsCvmIdComposeGetResponse -func (c *ClientWithResponses) HandleGetCvmComposeApiV1CvmsCvmIdComposeGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*HandleGetCvmComposeApiV1CvmsCvmIdComposeGetResponse, error) { - rsp, err := c.HandleGetCvmComposeApiV1CvmsCvmIdComposeGet(ctx, cvmId, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleGetCvmComposeApiV1CvmsCvmIdComposeGetResponse(rsp) -} - -// HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchWithBodyWithResponse request with arbitrary body returning *HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchResponse -func (c *ClientWithResponses) HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchResponse, error) { - rsp, err := c.HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchWithBody(ctx, cvmId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandlePatchCvmComposeApiV1CvmsCvmIdComposePatchResponse(rsp) -} - -func (c *ClientWithResponses) HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchWithResponse(ctx context.Context, cvmId string, body HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchResponse, error) { - rsp, err := c.HandlePatchCvmComposeApiV1CvmsCvmIdComposePatch(ctx, cvmId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandlePatchCvmComposeApiV1CvmsCvmIdComposePatchResponse(rsp) -} - -// HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutWithBodyWithResponse request with arbitrary body returning *HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutResponse -func (c *ClientWithResponses) HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutResponse, error) { - rsp, err := c.HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutWithBody(ctx, cvmId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleUpdateCvmComposeApiV1CvmsCvmIdComposePutResponse(rsp) -} - -func (c *ClientWithResponses) HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutWithResponse(ctx context.Context, cvmId string, body HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutResponse, error) { - rsp, err := c.HandleUpdateCvmComposeApiV1CvmsCvmIdComposePut(ctx, cvmId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleUpdateCvmComposeApiV1CvmsCvmIdComposePutResponse(rsp) -} - -// GetCvmComposeFileApiV1CvmsCvmIdComposeFileGetWithResponse request returning *GetCvmComposeFileApiV1CvmsCvmIdComposeFileGetResponse -func (c *ClientWithResponses) GetCvmComposeFileApiV1CvmsCvmIdComposeFileGetWithResponse(ctx context.Context, cvmId string, params *GetCvmComposeFileApiV1CvmsCvmIdComposeFileGetParams, reqEditors ...RequestEditorFn) (*GetCvmComposeFileApiV1CvmsCvmIdComposeFileGetResponse, error) { - rsp, err := c.GetCvmComposeFileApiV1CvmsCvmIdComposeFileGet(ctx, cvmId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetCvmComposeFileApiV1CvmsCvmIdComposeFileGetResponse(rsp) -} - -// TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchWithBodyWithResponse request with arbitrary body returning *TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchResponse -func (c *ClientWithResponses) TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchResponse, error) { - rsp, err := c.TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchWithBody(ctx, cvmId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseTriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchResponse(rsp) -} - -func (c *ClientWithResponses) TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchWithResponse(ctx context.Context, cvmId string, body TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchResponse, error) { - rsp, err := c.TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatch(ctx, cvmId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseTriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchResponse(rsp) -} - -// SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostWithBodyWithResponse request with arbitrary body returning *SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostResponse -func (c *ClientWithResponses) SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostResponse, error) { - rsp, err := c.SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostWithBody(ctx, cvmId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseSubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostResponse(rsp) -} - -func (c *ClientWithResponses) SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostWithResponse(ctx context.Context, cvmId string, body SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostJSONRequestBody, reqEditors ...RequestEditorFn) (*SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostResponse, error) { - rsp, err := c.SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePost(ctx, cvmId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseSubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostResponse(rsp) -} - -// ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostWithBodyWithResponse request with arbitrary body returning *ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostResponse -func (c *ClientWithResponses) ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostResponse, error) { - rsp, err := c.ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostWithBody(ctx, cvmId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostResponse(rsp) -} - -func (c *ClientWithResponses) ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostWithResponse(ctx context.Context, cvmId string, body ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostJSONRequestBody, reqEditors ...RequestEditorFn) (*ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostResponse, error) { - rsp, err := c.ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPost(ctx, cvmId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostResponse(rsp) -} - -// HandleGetCvmCompositionApiV1CvmsCvmIdCompositionGetWithResponse request returning *HandleGetCvmCompositionApiV1CvmsCvmIdCompositionGetResponse -func (c *ClientWithResponses) HandleGetCvmCompositionApiV1CvmsCvmIdCompositionGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*HandleGetCvmCompositionApiV1CvmsCvmIdCompositionGetResponse, error) { - rsp, err := c.HandleGetCvmCompositionApiV1CvmsCvmIdCompositionGet(ctx, cvmId, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleGetCvmCompositionApiV1CvmsCvmIdCompositionGetResponse(rsp) -} - -// DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostWithBodyWithResponse request with arbitrary body returning *DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostResponse -func (c *ClientWithResponses) DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostResponse, error) { - rsp, err := c.DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostWithBody(ctx, cvmId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseDiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostResponse(rsp) -} - -func (c *ClientWithResponses) DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostWithResponse(ctx context.Context, cvmId string, body DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostJSONRequestBody, reqEditors ...RequestEditorFn) (*DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostResponse, error) { - rsp, err := c.DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePost(ctx, cvmId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseDiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostResponse(rsp) -} - -// UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchWithBodyWithResponse request with arbitrary body returning *UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchResponse -func (c *ClientWithResponses) UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchWithBodyWithResponse(ctx context.Context, cvmId string, params *UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchResponse, error) { - rsp, err := c.UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchWithBody(ctx, cvmId, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchResponse(rsp) -} - -// HandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGetWithResponse request returning *HandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGetResponse -func (c *ClientWithResponses) HandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*HandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGetResponse, error) { - rsp, err := c.HandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGet(ctx, cvmId, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGetResponse(rsp) -} - -// UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchWithBodyWithResponse request with arbitrary body returning *UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchResponse -func (c *ClientWithResponses) UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchResponse, error) { - rsp, err := c.UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchWithBody(ctx, cvmId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchResponse(rsp) -} - -func (c *ClientWithResponses) UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchWithResponse(ctx context.Context, cvmId string, body UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchResponse, error) { - rsp, err := c.UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatch(ctx, cvmId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchResponse(rsp) -} - -// HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchWithBodyWithResponse request with arbitrary body returning *HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchResponse -func (c *ClientWithResponses) HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchResponse, error) { - rsp, err := c.HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchWithBody(ctx, cvmId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchResponse(rsp) -} - -func (c *ClientWithResponses) HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchWithResponse(ctx context.Context, cvmId string, body HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchResponse, error) { - rsp, err := c.HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatch(ctx, cvmId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchResponse(rsp) -} - -// HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchWithBodyWithResponse request with arbitrary body returning *HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchResponse -func (c *ClientWithResponses) HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchResponse, error) { - rsp, err := c.HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchWithBody(ctx, cvmId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleUpdateCvmListedApiV1CvmsCvmIdListedPatchResponse(rsp) -} - -func (c *ClientWithResponses) HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchWithResponse(ctx context.Context, cvmId string, body HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchResponse, error) { - rsp, err := c.HandleUpdateCvmListedApiV1CvmsCvmIdListedPatch(ctx, cvmId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleUpdateCvmListedApiV1CvmsCvmIdListedPatchResponse(rsp) -} - -// HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchWithBodyWithResponse request with arbitrary body returning *HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchResponse -func (c *ClientWithResponses) HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchResponse, error) { - rsp, err := c.HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchWithBody(ctx, cvmId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleUpdateCvmNameApiV1CvmsCvmIdNamePatchResponse(rsp) -} - -func (c *ClientWithResponses) HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchWithResponse(ctx context.Context, cvmId string, body HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchResponse, error) { - rsp, err := c.HandleUpdateCvmNameApiV1CvmsCvmIdNamePatch(ctx, cvmId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleUpdateCvmNameApiV1CvmsCvmIdNamePatchResponse(rsp) -} - -// HandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGetWithResponse request returning *HandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGetResponse -func (c *ClientWithResponses) HandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*HandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGetResponse, error) { - rsp, err := c.HandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGet(ctx, cvmId, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGetResponse(rsp) -} - -// GetOperationStatusApiV1CvmsCvmIdOperationStatusGetWithResponse request returning *GetOperationStatusApiV1CvmsCvmIdOperationStatusGetResponse -func (c *ClientWithResponses) GetOperationStatusApiV1CvmsCvmIdOperationStatusGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*GetOperationStatusApiV1CvmsCvmIdOperationStatusGetResponse, error) { - rsp, err := c.GetOperationStatusApiV1CvmsCvmIdOperationStatusGet(ctx, cvmId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetOperationStatusApiV1CvmsCvmIdOperationStatusGetResponse(rsp) -} - -// GetCvmOperationsApiV1CvmsCvmIdOperationsGetWithResponse request returning *GetCvmOperationsApiV1CvmsCvmIdOperationsGetResponse -func (c *ClientWithResponses) GetCvmOperationsApiV1CvmsCvmIdOperationsGetWithResponse(ctx context.Context, cvmId string, params *GetCvmOperationsApiV1CvmsCvmIdOperationsGetParams, reqEditors ...RequestEditorFn) (*GetCvmOperationsApiV1CvmsCvmIdOperationsGetResponse, error) { - rsp, err := c.GetCvmOperationsApiV1CvmsCvmIdOperationsGet(ctx, cvmId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetCvmOperationsApiV1CvmsCvmIdOperationsGetResponse(rsp) -} - -// UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchWithBodyWithResponse request with arbitrary body returning *UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchResponse -func (c *ClientWithResponses) UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchResponse, error) { - rsp, err := c.UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchWithBody(ctx, cvmId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchResponse(rsp) -} - -func (c *ClientWithResponses) UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchWithResponse(ctx context.Context, cvmId string, body UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchResponse, error) { - rsp, err := c.UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatch(ctx, cvmId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchResponse(rsp) -} - -// HandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGetWithResponse request returning *HandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGetResponse -func (c *ClientWithResponses) HandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*HandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGetResponse, error) { - rsp, err := c.HandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGet(ctx, cvmId, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGetResponse(rsp) -} - -// UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchWithBodyWithResponse request with arbitrary body returning *UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchResponse -func (c *ClientWithResponses) UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchWithBodyWithResponse(ctx context.Context, cvmId string, params *UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchResponse, error) { - rsp, err := c.UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchWithBody(ctx, cvmId, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchResponse(rsp) -} - -// HandleReplicateCvmApiV1CvmsCvmIdReplicasPostWithBodyWithResponse request with arbitrary body returning *HandleReplicateCvmApiV1CvmsCvmIdReplicasPostResponse -func (c *ClientWithResponses) HandleReplicateCvmApiV1CvmsCvmIdReplicasPostWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleReplicateCvmApiV1CvmsCvmIdReplicasPostResponse, error) { - rsp, err := c.HandleReplicateCvmApiV1CvmsCvmIdReplicasPostWithBody(ctx, cvmId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleReplicateCvmApiV1CvmsCvmIdReplicasPostResponse(rsp) -} - -func (c *ClientWithResponses) HandleReplicateCvmApiV1CvmsCvmIdReplicasPostWithResponse(ctx context.Context, cvmId string, body HandleReplicateCvmApiV1CvmsCvmIdReplicasPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleReplicateCvmApiV1CvmsCvmIdReplicasPostResponse, error) { - rsp, err := c.HandleReplicateCvmApiV1CvmsCvmIdReplicasPost(ctx, cvmId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleReplicateCvmApiV1CvmsCvmIdReplicasPostResponse(rsp) -} - -// HandleResizeCvmApiV1CvmsCvmIdResourcesPatchWithBodyWithResponse request with arbitrary body returning *HandleResizeCvmApiV1CvmsCvmIdResourcesPatchResponse -func (c *ClientWithResponses) HandleResizeCvmApiV1CvmsCvmIdResourcesPatchWithBodyWithResponse(ctx context.Context, cvmId string, params *HandleResizeCvmApiV1CvmsCvmIdResourcesPatchParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleResizeCvmApiV1CvmsCvmIdResourcesPatchResponse, error) { - rsp, err := c.HandleResizeCvmApiV1CvmsCvmIdResourcesPatchWithBody(ctx, cvmId, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleResizeCvmApiV1CvmsCvmIdResourcesPatchResponse(rsp) -} - -func (c *ClientWithResponses) HandleResizeCvmApiV1CvmsCvmIdResourcesPatchWithResponse(ctx context.Context, cvmId string, params *HandleResizeCvmApiV1CvmsCvmIdResourcesPatchParams, body HandleResizeCvmApiV1CvmsCvmIdResourcesPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleResizeCvmApiV1CvmsCvmIdResourcesPatchResponse, error) { - rsp, err := c.HandleResizeCvmApiV1CvmsCvmIdResourcesPatch(ctx, cvmId, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleResizeCvmApiV1CvmsCvmIdResourcesPatchResponse(rsp) -} - -// HandleRestartCvmApiV1CvmsCvmIdRestartPostWithBodyWithResponse request with arbitrary body returning *HandleRestartCvmApiV1CvmsCvmIdRestartPostResponse -func (c *ClientWithResponses) HandleRestartCvmApiV1CvmsCvmIdRestartPostWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleRestartCvmApiV1CvmsCvmIdRestartPostResponse, error) { - rsp, err := c.HandleRestartCvmApiV1CvmsCvmIdRestartPostWithBody(ctx, cvmId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleRestartCvmApiV1CvmsCvmIdRestartPostResponse(rsp) -} - -func (c *ClientWithResponses) HandleRestartCvmApiV1CvmsCvmIdRestartPostWithResponse(ctx context.Context, cvmId string, body HandleRestartCvmApiV1CvmsCvmIdRestartPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleRestartCvmApiV1CvmsCvmIdRestartPostResponse, error) { - rsp, err := c.HandleRestartCvmApiV1CvmsCvmIdRestartPost(ctx, cvmId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleRestartCvmApiV1CvmsCvmIdRestartPostResponse(rsp) -} - -// RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostWithResponse request returning *RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostResponse -func (c *ClientWithResponses) RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostWithResponse(ctx context.Context, cvmId string, revisionId string, params *RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostParams, reqEditors ...RequestEditorFn) (*RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostResponse, error) { - rsp, err := c.RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPost(ctx, cvmId, revisionId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseRedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostResponse(rsp) -} - -// HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchWithBodyWithResponse request with arbitrary body returning *HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchResponse -func (c *ClientWithResponses) HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchResponse, error) { - rsp, err := c.HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchWithBody(ctx, cvmId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchResponse(rsp) -} - -func (c *ClientWithResponses) HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchWithResponse(ctx context.Context, cvmId string, body HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchResponse, error) { - rsp, err := c.HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatch(ctx, cvmId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchResponse(rsp) -} - -// HandleShutdownCvmApiV1CvmsCvmIdShutdownPostWithBodyWithResponse request with arbitrary body returning *HandleShutdownCvmApiV1CvmsCvmIdShutdownPostResponse -func (c *ClientWithResponses) HandleShutdownCvmApiV1CvmsCvmIdShutdownPostWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleShutdownCvmApiV1CvmsCvmIdShutdownPostResponse, error) { - rsp, err := c.HandleShutdownCvmApiV1CvmsCvmIdShutdownPostWithBody(ctx, cvmId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleShutdownCvmApiV1CvmsCvmIdShutdownPostResponse(rsp) -} - -func (c *ClientWithResponses) HandleShutdownCvmApiV1CvmsCvmIdShutdownPostWithResponse(ctx context.Context, cvmId string, body HandleShutdownCvmApiV1CvmsCvmIdShutdownPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleShutdownCvmApiV1CvmsCvmIdShutdownPostResponse, error) { - rsp, err := c.HandleShutdownCvmApiV1CvmsCvmIdShutdownPost(ctx, cvmId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleShutdownCvmApiV1CvmsCvmIdShutdownPostResponse(rsp) -} - -// HandleStartCvmApiV1CvmsCvmIdStartPostWithBodyWithResponse request with arbitrary body returning *HandleStartCvmApiV1CvmsCvmIdStartPostResponse -func (c *ClientWithResponses) HandleStartCvmApiV1CvmsCvmIdStartPostWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleStartCvmApiV1CvmsCvmIdStartPostResponse, error) { - rsp, err := c.HandleStartCvmApiV1CvmsCvmIdStartPostWithBody(ctx, cvmId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleStartCvmApiV1CvmsCvmIdStartPostResponse(rsp) -} - -func (c *ClientWithResponses) HandleStartCvmApiV1CvmsCvmIdStartPostWithResponse(ctx context.Context, cvmId string, body HandleStartCvmApiV1CvmsCvmIdStartPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleStartCvmApiV1CvmsCvmIdStartPostResponse, error) { - rsp, err := c.HandleStartCvmApiV1CvmsCvmIdStartPost(ctx, cvmId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleStartCvmApiV1CvmsCvmIdStartPostResponse(rsp) -} - -// HandleGetCvmStateApiV1CvmsCvmIdStateGetWithResponse request returning *HandleGetCvmStateApiV1CvmsCvmIdStateGetResponse -func (c *ClientWithResponses) HandleGetCvmStateApiV1CvmsCvmIdStateGetWithResponse(ctx context.Context, cvmId string, params *HandleGetCvmStateApiV1CvmsCvmIdStateGetParams, reqEditors ...RequestEditorFn) (*HandleGetCvmStateApiV1CvmsCvmIdStateGetResponse, error) { - rsp, err := c.HandleGetCvmStateApiV1CvmsCvmIdStateGet(ctx, cvmId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleGetCvmStateApiV1CvmsCvmIdStateGetResponse(rsp) -} - -// HandleGetCvmStatsApiV1CvmsCvmIdStatsGetWithResponse request returning *HandleGetCvmStatsApiV1CvmsCvmIdStatsGetResponse -func (c *ClientWithResponses) HandleGetCvmStatsApiV1CvmsCvmIdStatsGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*HandleGetCvmStatsApiV1CvmsCvmIdStatsGetResponse, error) { - rsp, err := c.HandleGetCvmStatsApiV1CvmsCvmIdStatsGet(ctx, cvmId, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleGetCvmStatsApiV1CvmsCvmIdStatsGetResponse(rsp) -} - -// HandleStopCvmApiV1CvmsCvmIdStopPostWithBodyWithResponse request with arbitrary body returning *HandleStopCvmApiV1CvmsCvmIdStopPostResponse -func (c *ClientWithResponses) HandleStopCvmApiV1CvmsCvmIdStopPostWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleStopCvmApiV1CvmsCvmIdStopPostResponse, error) { - rsp, err := c.HandleStopCvmApiV1CvmsCvmIdStopPostWithBody(ctx, cvmId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleStopCvmApiV1CvmsCvmIdStopPostResponse(rsp) -} - -func (c *ClientWithResponses) HandleStopCvmApiV1CvmsCvmIdStopPostWithResponse(ctx context.Context, cvmId string, body HandleStopCvmApiV1CvmsCvmIdStopPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleStopCvmApiV1CvmsCvmIdStopPostResponse, error) { - rsp, err := c.HandleStopCvmApiV1CvmsCvmIdStopPost(ctx, cvmId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleStopCvmApiV1CvmsCvmIdStopPostResponse(rsp) -} - -// GetCvmUserConfigApiV1CvmsCvmIdUserConfigGetWithResponse request returning *GetCvmUserConfigApiV1CvmsCvmIdUserConfigGetResponse -func (c *ClientWithResponses) GetCvmUserConfigApiV1CvmsCvmIdUserConfigGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*GetCvmUserConfigApiV1CvmsCvmIdUserConfigGetResponse, error) { - rsp, err := c.GetCvmUserConfigApiV1CvmsCvmIdUserConfigGet(ctx, cvmId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetCvmUserConfigApiV1CvmsCvmIdUserConfigGetResponse(rsp) -} - -// HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchWithBodyWithResponse request with arbitrary body returning *HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchResponse -func (c *ClientWithResponses) HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchWithBodyWithResponse(ctx context.Context, cvmId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchResponse, error) { - rsp, err := c.HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchWithBody(ctx, cvmId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchResponse(rsp) -} - -func (c *ClientWithResponses) HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchWithResponse(ctx context.Context, cvmId string, body HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchResponse, error) { - rsp, err := c.HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatch(ctx, cvmId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchResponse(rsp) -} - -// ListKmsApiV1KmsGetWithResponse request returning *ListKmsApiV1KmsGetResponse -func (c *ClientWithResponses) ListKmsApiV1KmsGetWithResponse(ctx context.Context, params *ListKmsApiV1KmsGetParams, reqEditors ...RequestEditorFn) (*ListKmsApiV1KmsGetResponse, error) { - rsp, err := c.ListKmsApiV1KmsGet(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseListKmsApiV1KmsGetResponse(rsp) -} - -// GetNextAppIdApiV1KmsPhalaNextAppIdGetWithResponse request returning *GetNextAppIdApiV1KmsPhalaNextAppIdGetResponse -func (c *ClientWithResponses) GetNextAppIdApiV1KmsPhalaNextAppIdGetWithResponse(ctx context.Context, params *GetNextAppIdApiV1KmsPhalaNextAppIdGetParams, reqEditors ...RequestEditorFn) (*GetNextAppIdApiV1KmsPhalaNextAppIdGetResponse, error) { - rsp, err := c.GetNextAppIdApiV1KmsPhalaNextAppIdGet(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetNextAppIdApiV1KmsPhalaNextAppIdGetResponse(rsp) -} - -// GetKmsInfoApiV1KmsKmsIdGetWithResponse request returning *GetKmsInfoApiV1KmsKmsIdGetResponse -func (c *ClientWithResponses) GetKmsInfoApiV1KmsKmsIdGetWithResponse(ctx context.Context, kmsId string, reqEditors ...RequestEditorFn) (*GetKmsInfoApiV1KmsKmsIdGetResponse, error) { - rsp, err := c.GetKmsInfoApiV1KmsKmsIdGet(ctx, kmsId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetKmsInfoApiV1KmsKmsIdGetResponse(rsp) -} - -// GetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGetWithResponse request returning *GetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGetResponse -func (c *ClientWithResponses) GetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGetWithResponse(ctx context.Context, kmsId string, appId string, reqEditors ...RequestEditorFn) (*GetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGetResponse, error) { - rsp, err := c.GetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGet(ctx, kmsId, appId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGetResponse(rsp) -} - -// ListRedpillApiKeysApiV1RedpillApiKeysGetWithResponse request returning *ListRedpillApiKeysApiV1RedpillApiKeysGetResponse -func (c *ClientWithResponses) ListRedpillApiKeysApiV1RedpillApiKeysGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListRedpillApiKeysApiV1RedpillApiKeysGetResponse, error) { - rsp, err := c.ListRedpillApiKeysApiV1RedpillApiKeysGet(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseListRedpillApiKeysApiV1RedpillApiKeysGetResponse(rsp) -} - -// CreateRedpillApiKeyApiV1RedpillApiKeysPostWithBodyWithResponse request with arbitrary body returning *CreateRedpillApiKeyApiV1RedpillApiKeysPostResponse -func (c *ClientWithResponses) CreateRedpillApiKeyApiV1RedpillApiKeysPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateRedpillApiKeyApiV1RedpillApiKeysPostResponse, error) { - rsp, err := c.CreateRedpillApiKeyApiV1RedpillApiKeysPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateRedpillApiKeyApiV1RedpillApiKeysPostResponse(rsp) -} - -func (c *ClientWithResponses) CreateRedpillApiKeyApiV1RedpillApiKeysPostWithResponse(ctx context.Context, body CreateRedpillApiKeyApiV1RedpillApiKeysPostJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateRedpillApiKeyApiV1RedpillApiKeysPostResponse, error) { - rsp, err := c.CreateRedpillApiKeyApiV1RedpillApiKeysPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateRedpillApiKeyApiV1RedpillApiKeysPostResponse(rsp) -} - -// UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchWithResponse request returning *UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchResponse -func (c *ClientWithResponses) UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchWithResponse(ctx context.Context, apiKeyId int, params *UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchParams, reqEditors ...RequestEditorFn) (*UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchResponse, error) { - rsp, err := c.UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatch(ctx, apiKeyId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchResponse(rsp) -} - -// ConnectRedpillUserApiV1RedpillConnectPostWithResponse request returning *ConnectRedpillUserApiV1RedpillConnectPostResponse -func (c *ClientWithResponses) ConnectRedpillUserApiV1RedpillConnectPostWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ConnectRedpillUserApiV1RedpillConnectPostResponse, error) { - rsp, err := c.ConnectRedpillUserApiV1RedpillConnectPost(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseConnectRedpillUserApiV1RedpillConnectPostResponse(rsp) -} - -// ListApiKeyLogsApiV1RedpillLogsApiKeyIdGetWithResponse request returning *ListApiKeyLogsApiV1RedpillLogsApiKeyIdGetResponse -func (c *ClientWithResponses) ListApiKeyLogsApiV1RedpillLogsApiKeyIdGetWithResponse(ctx context.Context, apiKeyId int, reqEditors ...RequestEditorFn) (*ListApiKeyLogsApiV1RedpillLogsApiKeyIdGetResponse, error) { - rsp, err := c.ListApiKeyLogsApiV1RedpillLogsApiKeyIdGet(ctx, apiKeyId, reqEditors...) - if err != nil { - return nil, err - } - return ParseListApiKeyLogsApiV1RedpillLogsApiKeyIdGetResponse(rsp) -} - -// ListModelsApiV1RedpillModelsGetWithResponse request returning *ListModelsApiV1RedpillModelsGetResponse -func (c *ClientWithResponses) ListModelsApiV1RedpillModelsGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListModelsApiV1RedpillModelsGetResponse, error) { - rsp, err := c.ListModelsApiV1RedpillModelsGet(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseListModelsApiV1RedpillModelsGetResponse(rsp) -} - -// GetDailyUsageApiV1RedpillUsageDailyGetWithResponse request returning *GetDailyUsageApiV1RedpillUsageDailyGetResponse -func (c *ClientWithResponses) GetDailyUsageApiV1RedpillUsageDailyGetWithResponse(ctx context.Context, params *GetDailyUsageApiV1RedpillUsageDailyGetParams, reqEditors ...RequestEditorFn) (*GetDailyUsageApiV1RedpillUsageDailyGetResponse, error) { - rsp, err := c.GetDailyUsageApiV1RedpillUsageDailyGet(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetDailyUsageApiV1RedpillUsageDailyGetResponse(rsp) -} - -// GetUsageLogsApiV1RedpillUsageLogsGetWithResponse request returning *GetUsageLogsApiV1RedpillUsageLogsGetResponse -func (c *ClientWithResponses) GetUsageLogsApiV1RedpillUsageLogsGetWithResponse(ctx context.Context, params *GetUsageLogsApiV1RedpillUsageLogsGetParams, reqEditors ...RequestEditorFn) (*GetUsageLogsApiV1RedpillUsageLogsGetResponse, error) { - rsp, err := c.GetUsageLogsApiV1RedpillUsageLogsGet(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetUsageLogsApiV1RedpillUsageLogsGetResponse(rsp) -} - -// HandleBatchCvmStatusApiV1StatusBatchPostWithBodyWithResponse request with arbitrary body returning *HandleBatchCvmStatusApiV1StatusBatchPostResponse -func (c *ClientWithResponses) HandleBatchCvmStatusApiV1StatusBatchPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleBatchCvmStatusApiV1StatusBatchPostResponse, error) { - rsp, err := c.HandleBatchCvmStatusApiV1StatusBatchPostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleBatchCvmStatusApiV1StatusBatchPostResponse(rsp) -} - -func (c *ClientWithResponses) HandleBatchCvmStatusApiV1StatusBatchPostWithResponse(ctx context.Context, body HandleBatchCvmStatusApiV1StatusBatchPostJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleBatchCvmStatusApiV1StatusBatchPostResponse, error) { - rsp, err := c.HandleBatchCvmStatusApiV1StatusBatchPost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleBatchCvmStatusApiV1StatusBatchPostResponse(rsp) -} - -// ListTeepodsApiV1TeepodsGetWithResponse request returning *ListTeepodsApiV1TeepodsGetResponse -func (c *ClientWithResponses) ListTeepodsApiV1TeepodsGetWithResponse(ctx context.Context, params *ListTeepodsApiV1TeepodsGetParams, reqEditors ...RequestEditorFn) (*ListTeepodsApiV1TeepodsGetResponse, error) { - rsp, err := c.ListTeepodsApiV1TeepodsGet(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseListTeepodsApiV1TeepodsGetResponse(rsp) -} - -// HandleGetAvailableTeepodsApiV1TeepodsAvailableGetWithResponse request returning *HandleGetAvailableTeepodsApiV1TeepodsAvailableGetResponse -func (c *ClientWithResponses) HandleGetAvailableTeepodsApiV1TeepodsAvailableGetWithResponse(ctx context.Context, params *HandleGetAvailableTeepodsApiV1TeepodsAvailableGetParams, reqEditors ...RequestEditorFn) (*HandleGetAvailableTeepodsApiV1TeepodsAvailableGetResponse, error) { - rsp, err := c.HandleGetAvailableTeepodsApiV1TeepodsAvailableGet(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleGetAvailableTeepodsApiV1TeepodsAvailableGetResponse(rsp) -} - -// HandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGetWithResponse request returning *HandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGetResponse -func (c *ClientWithResponses) HandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGetWithResponse(ctx context.Context, teepodId int, reqEditors ...RequestEditorFn) (*HandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGetResponse, error) { - rsp, err := c.HandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGet(ctx, teepodId, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGetResponse(rsp) -} - -// HandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPostWithResponse request returning *HandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPostResponse -func (c *ClientWithResponses) HandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPostWithResponse(ctx context.Context, teepodId int, appId string, reqEditors ...RequestEditorFn) (*HandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPostResponse, error) { - rsp, err := c.HandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPost(ctx, teepodId, appId, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPostResponse(rsp) -} - -// ListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGetWithResponse request returning *ListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGetResponse -func (c *ClientWithResponses) ListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGetWithResponse(ctx context.Context, teepodId int, reqEditors ...RequestEditorFn) (*ListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGetResponse, error) { - rsp, err := c.ListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGet(ctx, teepodId, reqEditors...) - if err != nil { - return nil, err - } - return ParseListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGetResponse(rsp) -} - -// HandleListPublicCvmsApiV1VerifiedAppsGetWithResponse request returning *HandleListPublicCvmsApiV1VerifiedAppsGetResponse -func (c *ClientWithResponses) HandleListPublicCvmsApiV1VerifiedAppsGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HandleListPublicCvmsApiV1VerifiedAppsGetResponse, error) { - rsp, err := c.HandleListPublicCvmsApiV1VerifiedAppsGet(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleListPublicCvmsApiV1VerifiedAppsGetResponse(rsp) -} - -// HandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGetWithResponse request returning *HandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGetResponse -func (c *ClientWithResponses) HandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGetWithResponse(ctx context.Context, cvmId string, reqEditors ...RequestEditorFn) (*HandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGetResponse, error) { - rsp, err := c.HandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGet(ctx, cvmId, reqEditors...) - if err != nil { - return nil, err - } - return ParseHandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGetResponse(rsp) -} - -// HealthCheckHealthGetWithResponse request returning *HealthCheckHealthGetResponse -func (c *ClientWithResponses) HealthCheckHealthGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthCheckHealthGetResponse, error) { - rsp, err := c.HealthCheckHealthGet(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseHealthCheckHealthGetResponse(rsp) -} - -// ParseListDstackAppsApiV1AppsGetResponse parses an HTTP response from a ListDstackAppsApiV1AppsGetWithResponse call -func ParseListDstackAppsApiV1AppsGetResponse(rsp *http.Response) (*ListDstackAppsApiV1AppsGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &ListDstackAppsApiV1AppsGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - union json.RawMessage - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseGetFilterOptionsApiV1AppsFilterOptionsGetResponse parses an HTTP response from a GetFilterOptionsApiV1AppsFilterOptionsGetWithResponse call -func ParseGetFilterOptionsApiV1AppsFilterOptionsGetResponse(rsp *http.Response) (*GetFilterOptionsApiV1AppsFilterOptionsGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetFilterOptionsApiV1AppsFilterOptionsGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest FilterOptionsResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseGetDstackAppApiV1AppsAppIdGetResponse parses an HTTP response from a GetDstackAppApiV1AppsAppIdGetWithResponse call -func ParseGetDstackAppApiV1AppsAppIdGetResponse(rsp *http.Response) (*GetDstackAppApiV1AppsAppIdGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetDstackAppApiV1AppsAppIdGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - union json.RawMessage - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleGetAppAttestationApiV1AppsAppIdAttestationsGetResponse parses an HTTP response from a HandleGetAppAttestationApiV1AppsAppIdAttestationsGetWithResponse call -func ParseHandleGetAppAttestationApiV1AppsAppIdAttestationsGetResponse(rsp *http.Response) (*HandleGetAppAttestationApiV1AppsAppIdAttestationsGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleGetAppAttestationApiV1AppsAppIdAttestationsGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleGetAppCvmsApiV1AppsAppIdCvmsGetResponse parses an HTTP response from a HandleGetAppCvmsApiV1AppsAppIdCvmsGetWithResponse call -func ParseHandleGetAppCvmsApiV1AppsAppIdCvmsGetResponse(rsp *http.Response) (*HandleGetAppCvmsApiV1AppsAppIdCvmsGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleGetAppCvmsApiV1AppsAppIdCvmsGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - union json.RawMessage - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostResponse parses an HTTP response from a HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostWithResponse call -func ParseHandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostResponse(rsp *http.Response) (*HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleReplicateCvmApiV1AppsAppIdCvmsVmUuidReplicasPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest VM - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseGetAppEventsApiV1AppsAppIdEventsGetResponse parses an HTTP response from a GetAppEventsApiV1AppsAppIdEventsGetWithResponse call -func ParseGetAppEventsApiV1AppsAppIdEventsGetResponse(rsp *http.Response) (*GetAppEventsApiV1AppsAppIdEventsGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetAppEventsApiV1AppsAppIdEventsGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AppEventsResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseGetAppRevisionsApiV1AppsAppIdRevisionsGetResponse parses an HTTP response from a GetAppRevisionsApiV1AppsAppIdRevisionsGetWithResponse call -func ParseGetAppRevisionsApiV1AppsAppIdRevisionsGetResponse(rsp *http.Response) (*GetAppRevisionsApiV1AppsAppIdRevisionsGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetAppRevisionsApiV1AppsAppIdRevisionsGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AppRevisionsResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseGetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetResponse parses an HTTP response from a GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetWithResponse call -func ParseGetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetResponse(rsp *http.Response) (*GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetAppRevisionDetailApiV1AppsAppIdRevisionsRevisionIdGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AppRevisionDetailResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseRedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostResponse parses an HTTP response from a RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostWithResponse call -func ParseRedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostResponse(rsp *http.Response) (*RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &RedeployAppRevisionApiV1AppsAppIdRevisionsRevisionIdRedeployPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON202 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseGetAppUsageApiV1AppsAppIdUsageGetResponse parses an HTTP response from a GetAppUsageApiV1AppsAppIdUsageGetWithResponse call -func ParseGetAppUsageApiV1AppsAppIdUsageGetResponse(rsp *http.Response) (*GetAppUsageApiV1AppsAppIdUsageGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetAppUsageApiV1AppsAppIdUsageGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AppUsageResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseGetCollateralApiV1AttestationsCollateralChecksumGetResponse parses an HTTP response from a GetCollateralApiV1AttestationsCollateralChecksumGetWithResponse call -func ParseGetCollateralApiV1AttestationsCollateralChecksumGetResponse(rsp *http.Response) (*GetCollateralApiV1AttestationsCollateralChecksumGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetCollateralApiV1AttestationsCollateralChecksumGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleListDeviceIdsApiV1AttestationsDeviceIdsGetResponse parses an HTTP response from a HandleListDeviceIdsApiV1AttestationsDeviceIdsGetWithResponse call -func ParseHandleListDeviceIdsApiV1AttestationsDeviceIdsGetResponse(rsp *http.Response) (*HandleListDeviceIdsApiV1AttestationsDeviceIdsGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleListDeviceIdsApiV1AttestationsDeviceIdsGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseHandleListNodesApiV1AttestationsNodesGetResponse parses an HTTP response from a HandleListNodesApiV1AttestationsNodesGetWithResponse call -func ParseHandleListNodesApiV1AttestationsNodesGetResponse(rsp *http.Response) (*HandleListNodesApiV1AttestationsNodesGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleListNodesApiV1AttestationsNodesGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []NodeRef - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseHandleListPpidsApiV1AttestationsPpidsGetResponse parses an HTTP response from a HandleListPpidsApiV1AttestationsPpidsGetWithResponse call -func ParseHandleListPpidsApiV1AttestationsPpidsGetResponse(rsp *http.Response) (*HandleListPpidsApiV1AttestationsPpidsGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleListPpidsApiV1AttestationsPpidsGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseHandleGetRawApiV1AttestationsRawChecksumGetResponse parses an HTTP response from a HandleGetRawApiV1AttestationsRawChecksumGetWithResponse call -func ParseHandleGetRawApiV1AttestationsRawChecksumGetResponse(rsp *http.Response) (*HandleGetRawApiV1AttestationsRawChecksumGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleGetRawApiV1AttestationsRawChecksumGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - case rsp.StatusCode == 200: - // Content-type (application/octet-stream) unsupported - - } - - return response, nil -} - -// ParseHandleCheckRawFileApiV1AttestationsRawChecksumHeadResponse parses an HTTP response from a HandleCheckRawFileApiV1AttestationsRawChecksumHeadWithResponse call -func ParseHandleCheckRawFileApiV1AttestationsRawChecksumHeadResponse(rsp *http.Response) (*HandleCheckRawFileApiV1AttestationsRawChecksumHeadResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleCheckRawFileApiV1AttestationsRawChecksumHeadResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleListRecentApiV1AttestationsRecentGetResponse parses an HTTP response from a HandleListRecentApiV1AttestationsRecentGetWithResponse call -func ParseHandleListRecentApiV1AttestationsRecentGetResponse(rsp *http.Response) (*HandleListRecentApiV1AttestationsRecentGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleListRecentApiV1AttestationsRecentGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleUploadAndVerifyApiV1AttestationsVerifyPostResponse parses an HTTP response from a HandleUploadAndVerifyApiV1AttestationsVerifyPostWithResponse call -func ParseHandleUploadAndVerifyApiV1AttestationsVerifyPostResponse(rsp *http.Response) (*HandleUploadAndVerifyApiV1AttestationsVerifyPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleUploadAndVerifyApiV1AttestationsVerifyPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest VerificationResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleViewApiV1AttestationsViewChecksumGetResponse parses an HTTP response from a HandleViewApiV1AttestationsViewChecksumGetWithResponse call -func ParseHandleViewApiV1AttestationsViewChecksumGetResponse(rsp *http.Response) (*HandleViewApiV1AttestationsViewChecksumGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleViewApiV1AttestationsViewChecksumGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseConfirm2faSetupEndpointApiV1Auth2faConfirmPostResponse parses an HTTP response from a Confirm2faSetupEndpointApiV1Auth2faConfirmPostWithResponse call -func ParseConfirm2faSetupEndpointApiV1Auth2faConfirmPostResponse(rsp *http.Response) (*Confirm2faSetupEndpointApiV1Auth2faConfirmPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &Confirm2faSetupEndpointApiV1Auth2faConfirmPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseDisable2faEndpointApiV1Auth2faDisablePostResponse parses an HTTP response from a Disable2faEndpointApiV1Auth2faDisablePostWithResponse call -func ParseDisable2faEndpointApiV1Auth2faDisablePostResponse(rsp *http.Response) (*Disable2faEndpointApiV1Auth2faDisablePostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &Disable2faEndpointApiV1Auth2faDisablePostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseRegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostResponse parses an HTTP response from a RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostWithResponse call -func ParseRegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostResponse(rsp *http.Response) (*RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &RegenerateBackupCodesEndpointApiV1Auth2faRegenerateBackupCodesPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseSetup2faEndpointApiV1Auth2faSetupPostResponse parses an HTTP response from a Setup2faEndpointApiV1Auth2faSetupPostWithResponse call -func ParseSetup2faEndpointApiV1Auth2faSetupPostResponse(rsp *http.Response) (*Setup2faEndpointApiV1Auth2faSetupPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &Setup2faEndpointApiV1Auth2faSetupPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseGet2faStatusEndpointApiV1Auth2faStatusGetResponse parses an HTTP response from a Get2faStatusEndpointApiV1Auth2faStatusGetWithResponse call -func ParseGet2faStatusEndpointApiV1Auth2faStatusGetResponse(rsp *http.Response) (*Get2faStatusEndpointApiV1Auth2faStatusGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &Get2faStatusEndpointApiV1Auth2faStatusGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseVerify2faEndpointApiV1Auth2faVerifyPostResponse parses an HTTP response from a Verify2faEndpointApiV1Auth2faVerifyPostWithResponse call -func ParseVerify2faEndpointApiV1Auth2faVerifyPostResponse(rsp *http.Response) (*Verify2faEndpointApiV1Auth2faVerifyPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &Verify2faEndpointApiV1Auth2faVerifyPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseVerify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostResponse parses an HTTP response from a Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostWithResponse call -func ParseVerify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostResponse(rsp *http.Response) (*Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &Verify2faAndSetCookieApiV1Auth2faVerifyAndSetCookiePostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseAuthenticatedApiV1AuthAuthenticatedGetResponse parses an HTTP response from a AuthenticatedApiV1AuthAuthenticatedGetWithResponse call -func ParseAuthenticatedApiV1AuthAuthenticatedGetResponse(rsp *http.Response) (*AuthenticatedApiV1AuthAuthenticatedGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &AuthenticatedApiV1AuthAuthenticatedGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseApiChangeEmailApiV1AuthChangeEmailPostResponse parses an HTTP response from a ApiChangeEmailApiV1AuthChangeEmailPostWithResponse call -func ParseApiChangeEmailApiV1AuthChangeEmailPostResponse(rsp *http.Response) (*ApiChangeEmailApiV1AuthChangeEmailPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &ApiChangeEmailApiV1AuthChangeEmailPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseDecodeLinkTokenApiV1AuthDecodeLinkTokenGetResponse parses an HTTP response from a DecodeLinkTokenApiV1AuthDecodeLinkTokenGetWithResponse call -func ParseDecodeLinkTokenApiV1AuthDecodeLinkTokenGetResponse(rsp *http.Response) (*DecodeLinkTokenApiV1AuthDecodeLinkTokenGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &DecodeLinkTokenApiV1AuthDecodeLinkTokenGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseAuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostResponse parses an HTTP response from a AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostWithResponse call -func ParseAuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostResponse(rsp *http.Response) (*AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &AuthorizeDeviceRequestApiV1AuthDeviceAuthorizePostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseRequestDeviceCodeApiV1AuthDeviceCodePostResponse parses an HTTP response from a RequestDeviceCodeApiV1AuthDeviceCodePostWithResponse call -func ParseRequestDeviceCodeApiV1AuthDeviceCodePostResponse(rsp *http.Response) (*RequestDeviceCodeApiV1AuthDeviceCodePostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &RequestDeviceCodeApiV1AuthDeviceCodePostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest DeviceCodeResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseCheckDeviceStatusApiV1AuthDeviceStatusUserCodeGetResponse parses an HTTP response from a CheckDeviceStatusApiV1AuthDeviceStatusUserCodeGetWithResponse call -func ParseCheckDeviceStatusApiV1AuthDeviceStatusUserCodeGetResponse(rsp *http.Response) (*CheckDeviceStatusApiV1AuthDeviceStatusUserCodeGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &CheckDeviceStatusApiV1AuthDeviceStatusUserCodeGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParsePollDeviceTokenApiV1AuthDeviceTokenPostResponse parses an HTTP response from a PollDeviceTokenApiV1AuthDeviceTokenPostWithResponse call -func ParsePollDeviceTokenApiV1AuthDeviceTokenPostResponse(rsp *http.Response) (*PollDeviceTokenApiV1AuthDeviceTokenPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PollDeviceTokenApiV1AuthDeviceTokenPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest DeviceTokenResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseForgotPasswordApiV1AuthForgotPasswordPostResponse parses an HTTP response from a ForgotPasswordApiV1AuthForgotPasswordPostWithResponse call -func ParseForgotPasswordApiV1AuthForgotPasswordPostResponse(rsp *http.Response) (*ForgotPasswordApiV1AuthForgotPasswordPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &ForgotPasswordApiV1AuthForgotPasswordPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseLoginWithCookieApiV1AuthLoginPostResponse parses an HTTP response from a LoginWithCookieApiV1AuthLoginPostWithResponse call -func ParseLoginWithCookieApiV1AuthLoginPostResponse(rsp *http.Response) (*LoginWithCookieApiV1AuthLoginPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &LoginWithCookieApiV1AuthLoginPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseLoginWith2faApiV1AuthLoginWith2faPostResponse parses an HTTP response from a LoginWith2faApiV1AuthLoginWith2faPostWithResponse call -func ParseLoginWith2faApiV1AuthLoginWith2faPostResponse(rsp *http.Response) (*LoginWith2faApiV1AuthLoginWith2faPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &LoginWith2faApiV1AuthLoginWith2faPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseLogoutApiV1AuthLogoutPostResponse parses an HTTP response from a LogoutApiV1AuthLogoutPostWithResponse call -func ParseLogoutApiV1AuthLogoutPostResponse(rsp *http.Response) (*LogoutApiV1AuthLogoutPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &LogoutApiV1AuthLogoutPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseReadUsersMeApiV1AuthMeGetResponse parses an HTTP response from a ReadUsersMeApiV1AuthMeGetWithResponse call -func ParseReadUsersMeApiV1AuthMeGetResponse(rsp *http.Response) (*ReadUsersMeApiV1AuthMeGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &ReadUsersMeApiV1AuthMeGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseGithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetResponse parses an HTTP response from a GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetWithResponse call -func ParseGithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetResponse(rsp *http.Response) (*GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GithubOauthAuthorizeApiV1AuthOauthGithubAuthorizeGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseGithubOauthCallbackApiV1AuthOauthGithubCallbackGetResponse parses an HTTP response from a GithubOauthCallbackApiV1AuthOauthGithubCallbackGetWithResponse call -func ParseGithubOauthCallbackApiV1AuthOauthGithubCallbackGetResponse(rsp *http.Response) (*GithubOauthCallbackApiV1AuthOauthGithubCallbackGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GithubOauthCallbackApiV1AuthOauthGithubCallbackGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseGoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetResponse parses an HTTP response from a GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetWithResponse call -func ParseGoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetResponse(rsp *http.Response) (*GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GoogleOauthAuthorizeApiV1AuthOauthGoogleAuthorizeGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseGoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetResponse parses an HTTP response from a GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetWithResponse call -func ParseGoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetResponse(rsp *http.Response) (*GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GoogleOauthCallbackApiV1AuthOauthGoogleCallbackGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleUpdatePasswordApiV1AuthPasswordPostResponse parses an HTTP response from a HandleUpdatePasswordApiV1AuthPasswordPostWithResponse call -func ParseHandleUpdatePasswordApiV1AuthPasswordPostResponse(rsp *http.Response) (*HandleUpdatePasswordApiV1AuthPasswordPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleUpdatePasswordApiV1AuthPasswordPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest User - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseRegisterUserApiV1AuthRegisterPostResponse parses an HTTP response from a RegisterUserApiV1AuthRegisterPostWithResponse call -func ParseRegisterUserApiV1AuthRegisterPostResponse(rsp *http.Response) (*RegisterUserApiV1AuthRegisterPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &RegisterUserApiV1AuthRegisterPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostResponse parses an HTTP response from a ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostWithResponse call -func ParseApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostResponse(rsp *http.Response) (*ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &ApiRequestEmailVerificationApiV1AuthRequestEmailVerificationPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleResetPasswordWithTokenApiV1AuthResetPasswordPutResponse parses an HTTP response from a HandleResetPasswordWithTokenApiV1AuthResetPasswordPutWithResponse call -func ParseHandleResetPasswordWithTokenApiV1AuthResetPasswordPutResponse(rsp *http.Response) (*HandleResetPasswordWithTokenApiV1AuthResetPasswordPutResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleResetPasswordWithTokenApiV1AuthResetPasswordPutResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest map[string]interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseRevokeAllSessionsApiV1AuthSessionsDeleteResponse parses an HTTP response from a RevokeAllSessionsApiV1AuthSessionsDeleteWithResponse call -func ParseRevokeAllSessionsApiV1AuthSessionsDeleteResponse(rsp *http.Response) (*RevokeAllSessionsApiV1AuthSessionsDeleteResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &RevokeAllSessionsApiV1AuthSessionsDeleteResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseGetActiveSessionsApiV1AuthSessionsGetResponse parses an HTTP response from a GetActiveSessionsApiV1AuthSessionsGetWithResponse call -func ParseGetActiveSessionsApiV1AuthSessionsGetResponse(rsp *http.Response) (*GetActiveSessionsApiV1AuthSessionsGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetActiveSessionsApiV1AuthSessionsGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SessionsListResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseRevokeSessionEndpointApiV1AuthSessionsJtiDeleteResponse parses an HTTP response from a RevokeSessionEndpointApiV1AuthSessionsJtiDeleteWithResponse call -func ParseRevokeSessionEndpointApiV1AuthSessionsJtiDeleteResponse(rsp *http.Response) (*RevokeSessionEndpointApiV1AuthSessionsJtiDeleteResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &RevokeSessionEndpointApiV1AuthSessionsJtiDeleteResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseVerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostResponse parses an HTTP response from a VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostWithResponse call -func ParseVerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostResponse(rsp *http.Response) (*VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &VerifyStepUpAndSetCookieApiV1AuthStepUpVerifyPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseLoginForAccessTokenApiV1AuthTokenPostResponse parses an HTTP response from a LoginForAccessTokenApiV1AuthTokenPostWithResponse call -func ParseLoginForAccessTokenApiV1AuthTokenPostResponse(rsp *http.Response) (*LoginForAccessTokenApiV1AuthTokenPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &LoginForAccessTokenApiV1AuthTokenPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleUpdateUsernameApiV1AuthUsernamePutResponse parses an HTTP response from a HandleUpdateUsernameApiV1AuthUsernamePutWithResponse call -func ParseHandleUpdateUsernameApiV1AuthUsernamePutResponse(rsp *http.Response) (*HandleUpdateUsernameApiV1AuthUsernamePutResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleUpdateUsernameApiV1AuthUsernamePutResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseValidateResetTokenApiV1AuthValidateResetTokenGetResponse parses an HTTP response from a ValidateResetTokenApiV1AuthValidateResetTokenGetWithResponse call -func ParseValidateResetTokenApiV1AuthValidateResetTokenGetResponse(rsp *http.Response) (*ValidateResetTokenApiV1AuthValidateResetTokenGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &ValidateResetTokenApiV1AuthValidateResetTokenGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest map[string]interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseVerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostResponse parses an HTTP response from a VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostWithResponse call -func ParseVerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostResponse(rsp *http.Response) (*VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &VerifyAndLinkOauthApiV1AuthVerifyAndLinkOauthPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostResponse parses an HTTP response from a ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostWithResponse call -func ParseApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostResponse(rsp *http.Response) (*ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &ApiVerifyEmailTokenApiV1AuthVerifyEmailTokenPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest map[string]string - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleListCvmsApiV1CvmsGetResponse parses an HTTP response from a HandleListCvmsApiV1CvmsGetWithResponse call -func ParseHandleListCvmsApiV1CvmsGetResponse(rsp *http.Response) (*HandleListCvmsApiV1CvmsGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleListCvmsApiV1CvmsGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - union json.RawMessage - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleCreateCvmFromPovisionApiV1CvmsPostResponse parses an HTTP response from a HandleCreateCvmFromPovisionApiV1CvmsPostWithResponse call -func ParseHandleCreateCvmFromPovisionApiV1CvmsPostResponse(rsp *http.Response) (*HandleCreateCvmFromPovisionApiV1CvmsPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleCreateCvmFromPovisionApiV1CvmsPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest VM - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseHandleBatchStopCvmsApiV1CvmsBatchStopPostResponse parses an HTTP response from a HandleBatchStopCvmsApiV1CvmsBatchStopPostWithResponse call -func ParseHandleBatchStopCvmsApiV1CvmsBatchStopPostResponse(rsp *http.Response) (*HandleBatchStopCvmsApiV1CvmsBatchStopPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleBatchStopCvmsApiV1CvmsBatchStopPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest BatchStopResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleCreateElizaFromProvisionApiV1CvmsElizaPostResponse parses an HTTP response from a HandleCreateElizaFromProvisionApiV1CvmsElizaPostWithResponse call -func ParseHandleCreateElizaFromProvisionApiV1CvmsElizaPostResponse(rsp *http.Response) (*HandleCreateElizaFromProvisionApiV1CvmsElizaPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleCreateElizaFromProvisionApiV1CvmsElizaPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest VM - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseHandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostResponse parses an HTTP response from a HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostWithResponse call -func ParseHandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostResponse(rsp *http.Response) (*HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleCreateCvmWithVmConfigApiV1CvmsFromCvmConfigurationPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest VM - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchResponse parses an HTTP response from a HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchWithResponse call -func ParseHandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchResponse(rsp *http.Response) (*HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleBatchRefreshCvmInstanceIdsApiV1CvmsInstanceIdsPatchResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest BatchInstanceIdRefreshResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleListCvmsPaginatedApiV1CvmsPaginatedGetResponse parses an HTTP response from a HandleListCvmsPaginatedApiV1CvmsPaginatedGetWithResponse call -func ParseHandleListCvmsPaginatedApiV1CvmsPaginatedGetResponse(rsp *http.Response) (*HandleListCvmsPaginatedApiV1CvmsPaginatedGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleListCvmsPaginatedApiV1CvmsPaginatedGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - union json.RawMessage - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleProvisionCvmApiV1CvmsProvisionPostResponse parses an HTTP response from a HandleProvisionCvmApiV1CvmsProvisionPostWithResponse call -func ParseHandleProvisionCvmApiV1CvmsProvisionPostResponse(rsp *http.Response) (*HandleProvisionCvmApiV1CvmsProvisionPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleProvisionCvmApiV1CvmsProvisionPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseHandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostResponse parses an HTTP response from a HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostWithResponse call -func ParseHandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostResponse(rsp *http.Response) (*HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleProvisionCvmForElizaApiV1CvmsProvisionElizaPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostResponse parses an HTTP response from a HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostWithResponse call -func ParseHandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostResponse(rsp *http.Response) (*HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleGetPubkeyFromCvmConfigurationApiV1CvmsPubkeyFromCvmConfigurationPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleCreateCvmForWorkloadApiV1CvmsWorkloadPostResponse parses an HTTP response from a HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostWithResponse call -func ParseHandleCreateCvmForWorkloadApiV1CvmsWorkloadPostResponse(rsp *http.Response) (*HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleCreateCvmForWorkloadApiV1CvmsWorkloadPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest VM - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleRemoveCvmApiV1CvmsCvmIdDeleteResponse parses an HTTP response from a HandleRemoveCvmApiV1CvmsCvmIdDeleteWithResponse call -func ParseHandleRemoveCvmApiV1CvmsCvmIdDeleteResponse(rsp *http.Response) (*HandleRemoveCvmApiV1CvmsCvmIdDeleteResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleRemoveCvmApiV1CvmsCvmIdDeleteResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleGetCvmApiV1CvmsCvmIdGetResponse parses an HTTP response from a HandleGetCvmApiV1CvmsCvmIdGetWithResponse call -func ParseHandleGetCvmApiV1CvmsCvmIdGetResponse(rsp *http.Response) (*HandleGetCvmApiV1CvmsCvmIdGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleGetCvmApiV1CvmsCvmIdGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - union json.RawMessage - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleGetCvmAttestationApiV1CvmsCvmIdAttestationGetResponse parses an HTTP response from a HandleGetCvmAttestationApiV1CvmsCvmIdAttestationGetWithResponse call -func ParseHandleGetCvmAttestationApiV1CvmsCvmIdAttestationGetResponse(rsp *http.Response) (*HandleGetCvmAttestationApiV1CvmsCvmIdAttestationGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleGetCvmAttestationApiV1CvmsCvmIdAttestationGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CvmAttestation - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseGetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGetResponse parses an HTTP response from a GetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGetWithResponse call -func ParseGetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGetResponse(rsp *http.Response) (*GetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetAvailableOsImagesApiV1CvmsCvmIdAvailableOsImagesGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []TeehouseApiRoutesCvmsPatchComposeFileAvailableOSImage - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleGetCvmComposeApiV1CvmsCvmIdComposeGetResponse parses an HTTP response from a HandleGetCvmComposeApiV1CvmsCvmIdComposeGetWithResponse call -func ParseHandleGetCvmComposeApiV1CvmsCvmIdComposeGetResponse(rsp *http.Response) (*HandleGetCvmComposeApiV1CvmsCvmIdComposeGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleGetCvmComposeApiV1CvmsCvmIdComposeGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CvmComposeFile - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandlePatchCvmComposeApiV1CvmsCvmIdComposePatchResponse parses an HTTP response from a HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchWithResponse call -func ParseHandlePatchCvmComposeApiV1CvmsCvmIdComposePatchResponse(rsp *http.Response) (*HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandlePatchCvmComposeApiV1CvmsCvmIdComposePatchResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON202 = &dest - - } - - return response, nil -} - -// ParseHandleUpdateCvmComposeApiV1CvmsCvmIdComposePutResponse parses an HTTP response from a HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutWithResponse call -func ParseHandleUpdateCvmComposeApiV1CvmsCvmIdComposePutResponse(rsp *http.Response) (*HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleUpdateCvmComposeApiV1CvmsCvmIdComposePutResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseGetCvmComposeFileApiV1CvmsCvmIdComposeFileGetResponse parses an HTTP response from a GetCvmComposeFileApiV1CvmsCvmIdComposeFileGetWithResponse call -func ParseGetCvmComposeFileApiV1CvmsCvmIdComposeFileGetResponse(rsp *http.Response) (*GetCvmComposeFileApiV1CvmsCvmIdComposeFileGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetCvmComposeFileApiV1CvmsCvmIdComposeFileGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseTriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchResponse parses an HTTP response from a TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchWithResponse call -func ParseTriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchResponse(rsp *http.Response) (*TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &TriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatchResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON202 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseSubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostResponse parses an HTTP response from a SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostWithResponse call -func ParseSubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostResponse(rsp *http.Response) (*SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &SubmitCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON202 = &dest - - } - - return response, nil -} - -// ParseProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostResponse parses an HTTP response from a ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostWithResponse call -func ParseProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostResponse(rsp *http.Response) (*ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &ProvisionForCvmComposeFileUpdateApiV1CvmsCvmIdComposeFileProvisionPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ComposeFileProvisionResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseHandleGetCvmCompositionApiV1CvmsCvmIdCompositionGetResponse parses an HTTP response from a HandleGetCvmCompositionApiV1CvmsCvmIdCompositionGetWithResponse call -func ParseHandleGetCvmCompositionApiV1CvmsCvmIdCompositionGetResponse(rsp *http.Response) (*HandleGetCvmCompositionApiV1CvmsCvmIdCompositionGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleGetCvmCompositionApiV1CvmsCvmIdCompositionGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CvmComposition - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseDiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostResponse parses an HTTP response from a DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostWithResponse call -func ParseDiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostResponse(rsp *http.Response) (*DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &DiagnoseCustomDomainsApiV1CvmsCvmIdCustomizeDomainDiagnosePostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest DiagnosisResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseUpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchResponse parses an HTTP response from a UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchWithResponse call -func ParseUpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchResponse(rsp *http.Response) (*UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON202 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGetResponse parses an HTTP response from a HandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGetWithResponse call -func ParseHandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGetResponse(rsp *http.Response) (*HandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest string - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseUpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchResponse parses an HTTP response from a UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchWithResponse call -func ParseUpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchResponse(rsp *http.Response) (*UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &UpdateCvmEnvsApiV1CvmsCvmIdEnvsPatchResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON202 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchResponse parses an HTTP response from a HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchWithResponse call -func ParseHandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchResponse(rsp *http.Response) (*HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleRefreshCvmInstanceIdApiV1CvmsCvmIdInstanceIdPatchResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest InstanceIdRefreshResult - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleUpdateCvmListedApiV1CvmsCvmIdListedPatchResponse parses an HTTP response from a HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchWithResponse call -func ParseHandleUpdateCvmListedApiV1CvmsCvmIdListedPatchResponse(rsp *http.Response) (*HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleUpdateCvmListedApiV1CvmsCvmIdListedPatchResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest VM - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleUpdateCvmNameApiV1CvmsCvmIdNamePatchResponse parses an HTTP response from a HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchWithResponse call -func ParseHandleUpdateCvmNameApiV1CvmsCvmIdNamePatchResponse(rsp *http.Response) (*HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleUpdateCvmNameApiV1CvmsCvmIdNamePatchResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGetResponse parses an HTTP response from a HandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGetWithResponse call -func ParseHandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGetResponse(rsp *http.Response) (*HandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleGetCvmNetworkInfoApiV1CvmsCvmIdNetworkGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CvmNetwork - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseGetOperationStatusApiV1CvmsCvmIdOperationStatusGetResponse parses an HTTP response from a GetOperationStatusApiV1CvmsCvmIdOperationStatusGetWithResponse call -func ParseGetOperationStatusApiV1CvmsCvmIdOperationStatusGetResponse(rsp *http.Response) (*GetOperationStatusApiV1CvmsCvmIdOperationStatusGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetOperationStatusApiV1CvmsCvmIdOperationStatusGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseGetCvmOperationsApiV1CvmsCvmIdOperationsGetResponse parses an HTTP response from a GetCvmOperationsApiV1CvmsCvmIdOperationsGetWithResponse call -func ParseGetCvmOperationsApiV1CvmsCvmIdOperationsGetResponse(rsp *http.Response) (*GetCvmOperationsApiV1CvmsCvmIdOperationsGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetCvmOperationsApiV1CvmsCvmIdOperationsGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest PaginatedCvmOperationsResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseUpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchResponse parses an HTTP response from a UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchWithResponse call -func ParseUpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchResponse(rsp *http.Response) (*UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &UpdateCvmOsImageApiV1CvmsCvmIdOsImagePatchResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON202 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGetResponse parses an HTTP response from a HandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGetWithResponse call -func ParseHandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGetResponse(rsp *http.Response) (*HandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest string - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseUpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchResponse parses an HTTP response from a UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchWithResponse call -func ParseUpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchResponse(rsp *http.Response) (*UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON202 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleReplicateCvmApiV1CvmsCvmIdReplicasPostResponse parses an HTTP response from a HandleReplicateCvmApiV1CvmsCvmIdReplicasPostWithResponse call -func ParseHandleReplicateCvmApiV1CvmsCvmIdReplicasPostResponse(rsp *http.Response) (*HandleReplicateCvmApiV1CvmsCvmIdReplicasPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleReplicateCvmApiV1CvmsCvmIdReplicasPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleResizeCvmApiV1CvmsCvmIdResourcesPatchResponse parses an HTTP response from a HandleResizeCvmApiV1CvmsCvmIdResourcesPatchWithResponse call -func ParseHandleResizeCvmApiV1CvmsCvmIdResourcesPatchResponse(rsp *http.Response) (*HandleResizeCvmApiV1CvmsCvmIdResourcesPatchResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleResizeCvmApiV1CvmsCvmIdResourcesPatchResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON202 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleRestartCvmApiV1CvmsCvmIdRestartPostResponse parses an HTTP response from a HandleRestartCvmApiV1CvmsCvmIdRestartPostWithResponse call -func ParseHandleRestartCvmApiV1CvmsCvmIdRestartPostResponse(rsp *http.Response) (*HandleRestartCvmApiV1CvmsCvmIdRestartPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleRestartCvmApiV1CvmsCvmIdRestartPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest VM - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseRedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostResponse parses an HTTP response from a RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostWithResponse call -func ParseRedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostResponse(rsp *http.Response) (*RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &RedeployCvmRevisionApiV1CvmsCvmIdRevisionsRevisionIdRedeployPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON202 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchResponse parses an HTTP response from a HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchWithResponse call -func ParseHandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchResponse(rsp *http.Response) (*HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleUpdateCvmScheduledDeleteApiV1CvmsCvmIdScheduledDeletePatchResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest VM - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleShutdownCvmApiV1CvmsCvmIdShutdownPostResponse parses an HTTP response from a HandleShutdownCvmApiV1CvmsCvmIdShutdownPostWithResponse call -func ParseHandleShutdownCvmApiV1CvmsCvmIdShutdownPostResponse(rsp *http.Response) (*HandleShutdownCvmApiV1CvmsCvmIdShutdownPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleShutdownCvmApiV1CvmsCvmIdShutdownPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest VM - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleStartCvmApiV1CvmsCvmIdStartPostResponse parses an HTTP response from a HandleStartCvmApiV1CvmsCvmIdStartPostWithResponse call -func ParseHandleStartCvmApiV1CvmsCvmIdStartPostResponse(rsp *http.Response) (*HandleStartCvmApiV1CvmsCvmIdStartPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleStartCvmApiV1CvmsCvmIdStartPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest VM - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleGetCvmStateApiV1CvmsCvmIdStateGetResponse parses an HTTP response from a HandleGetCvmStateApiV1CvmsCvmIdStateGetWithResponse call -func ParseHandleGetCvmStateApiV1CvmsCvmIdStateGetResponse(rsp *http.Response) (*HandleGetCvmStateApiV1CvmsCvmIdStateGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleGetCvmStateApiV1CvmsCvmIdStateGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleGetCvmStatsApiV1CvmsCvmIdStatsGetResponse parses an HTTP response from a HandleGetCvmStatsApiV1CvmsCvmIdStatsGetWithResponse call -func ParseHandleGetCvmStatsApiV1CvmsCvmIdStatsGetResponse(rsp *http.Response) (*HandleGetCvmStatsApiV1CvmsCvmIdStatsGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleGetCvmStatsApiV1CvmsCvmIdStatsGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CvmSystemInfo - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleStopCvmApiV1CvmsCvmIdStopPostResponse parses an HTTP response from a HandleStopCvmApiV1CvmsCvmIdStopPostWithResponse call -func ParseHandleStopCvmApiV1CvmsCvmIdStopPostResponse(rsp *http.Response) (*HandleStopCvmApiV1CvmsCvmIdStopPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleStopCvmApiV1CvmsCvmIdStopPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest VM - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseGetCvmUserConfigApiV1CvmsCvmIdUserConfigGetResponse parses an HTTP response from a GetCvmUserConfigApiV1CvmsCvmIdUserConfigGetWithResponse call -func ParseGetCvmUserConfigApiV1CvmsCvmIdUserConfigGetResponse(rsp *http.Response) (*GetCvmUserConfigApiV1CvmsCvmIdUserConfigGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetCvmUserConfigApiV1CvmsCvmIdUserConfigGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CvmUserConfig - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchResponse parses an HTTP response from a HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchWithResponse call -func ParseHandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchResponse(rsp *http.Response) (*HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleUpdateCvmVisibilityApiV1CvmsCvmIdVisibilityPatchResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest VM - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseListKmsApiV1KmsGetResponse parses an HTTP response from a ListKmsApiV1KmsGetWithResponse call -func ParseListKmsApiV1KmsGetResponse(rsp *http.Response) (*ListKmsApiV1KmsGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &ListKmsApiV1KmsGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest KmsListResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseGetNextAppIdApiV1KmsPhalaNextAppIdGetResponse parses an HTTP response from a GetNextAppIdApiV1KmsPhalaNextAppIdGetWithResponse call -func ParseGetNextAppIdApiV1KmsPhalaNextAppIdGetResponse(rsp *http.Response) (*GetNextAppIdApiV1KmsPhalaNextAppIdGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetNextAppIdApiV1KmsPhalaNextAppIdGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseGetKmsInfoApiV1KmsKmsIdGetResponse parses an HTTP response from a GetKmsInfoApiV1KmsKmsIdGetWithResponse call -func ParseGetKmsInfoApiV1KmsKmsIdGetResponse(rsp *http.Response) (*GetKmsInfoApiV1KmsKmsIdGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetKmsInfoApiV1KmsKmsIdGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest KMSInfo - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseGetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGetResponse parses an HTTP response from a GetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGetWithResponse call -func ParseGetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGetResponse(rsp *http.Response) (*GetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetAppEnvEncryptPubkeyApiV1KmsKmsIdPubkeyAppIdGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseListRedpillApiKeysApiV1RedpillApiKeysGetResponse parses an HTTP response from a ListRedpillApiKeysApiV1RedpillApiKeysGetWithResponse call -func ParseListRedpillApiKeysApiV1RedpillApiKeysGetResponse(rsp *http.Response) (*ListRedpillApiKeysApiV1RedpillApiKeysGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &ListRedpillApiKeysApiV1RedpillApiKeysGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseCreateRedpillApiKeyApiV1RedpillApiKeysPostResponse parses an HTTP response from a CreateRedpillApiKeyApiV1RedpillApiKeysPostWithResponse call -func ParseCreateRedpillApiKeyApiV1RedpillApiKeysPostResponse(rsp *http.Response) (*CreateRedpillApiKeyApiV1RedpillApiKeysPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &CreateRedpillApiKeyApiV1RedpillApiKeysPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseUpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchResponse parses an HTTP response from a UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchWithResponse call -func ParseUpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchResponse(rsp *http.Response) (*UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &UpdateRedpillApiKeyApiV1RedpillApiKeysApiKeyIdPatchResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseConnectRedpillUserApiV1RedpillConnectPostResponse parses an HTTP response from a ConnectRedpillUserApiV1RedpillConnectPostWithResponse call -func ParseConnectRedpillUserApiV1RedpillConnectPostResponse(rsp *http.Response) (*ConnectRedpillUserApiV1RedpillConnectPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &ConnectRedpillUserApiV1RedpillConnectPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseListApiKeyLogsApiV1RedpillLogsApiKeyIdGetResponse parses an HTTP response from a ListApiKeyLogsApiV1RedpillLogsApiKeyIdGetWithResponse call -func ParseListApiKeyLogsApiV1RedpillLogsApiKeyIdGetResponse(rsp *http.Response) (*ListApiKeyLogsApiV1RedpillLogsApiKeyIdGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &ListApiKeyLogsApiV1RedpillLogsApiKeyIdGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseListModelsApiV1RedpillModelsGetResponse parses an HTTP response from a ListModelsApiV1RedpillModelsGetWithResponse call -func ParseListModelsApiV1RedpillModelsGetResponse(rsp *http.Response) (*ListModelsApiV1RedpillModelsGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &ListModelsApiV1RedpillModelsGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseGetDailyUsageApiV1RedpillUsageDailyGetResponse parses an HTTP response from a GetDailyUsageApiV1RedpillUsageDailyGetWithResponse call -func ParseGetDailyUsageApiV1RedpillUsageDailyGetResponse(rsp *http.Response) (*GetDailyUsageApiV1RedpillUsageDailyGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetDailyUsageApiV1RedpillUsageDailyGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseGetUsageLogsApiV1RedpillUsageLogsGetResponse parses an HTTP response from a GetUsageLogsApiV1RedpillUsageLogsGetWithResponse call -func ParseGetUsageLogsApiV1RedpillUsageLogsGetResponse(rsp *http.Response) (*GetUsageLogsApiV1RedpillUsageLogsGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetUsageLogsApiV1RedpillUsageLogsGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleBatchCvmStatusApiV1StatusBatchPostResponse parses an HTTP response from a HandleBatchCvmStatusApiV1StatusBatchPostWithResponse call -func ParseHandleBatchCvmStatusApiV1StatusBatchPostResponse(rsp *http.Response) (*HandleBatchCvmStatusApiV1StatusBatchPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleBatchCvmStatusApiV1StatusBatchPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest map[string]CvmStatus - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseListTeepodsApiV1TeepodsGetResponse parses an HTTP response from a ListTeepodsApiV1TeepodsGetWithResponse call -func ParseListTeepodsApiV1TeepodsGetResponse(rsp *http.Response) (*ListTeepodsApiV1TeepodsGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &ListTeepodsApiV1TeepodsGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []Teepod - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleGetAvailableTeepodsApiV1TeepodsAvailableGetResponse parses an HTTP response from a HandleGetAvailableTeepodsApiV1TeepodsAvailableGetWithResponse call -func ParseHandleGetAvailableTeepodsApiV1TeepodsAvailableGetResponse(rsp *http.Response) (*HandleGetAvailableTeepodsApiV1TeepodsAvailableGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleGetAvailableTeepodsApiV1TeepodsAvailableGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest TierCapacity - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGetResponse parses an HTTP response from a HandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGetWithResponse call -func ParseHandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGetResponse(rsp *http.Response) (*HandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleListHostedCvmsApiV1TeepodsTeepodIdCvmsGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []HostedCvm - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPostResponse parses an HTTP response from a HandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPostWithResponse call -func ParseHandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPostResponse(rsp *http.Response) (*HandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleBindCvmApiV1TeepodsTeepodIdCvmsAppIdListPostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGetResponse parses an HTTP response from a ListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGetWithResponse call -func ParseListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGetResponse(rsp *http.Response) (*ListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &ListTeepodAvailableImageApiV1TeepodsTeepodIdImagesGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHandleListPublicCvmsApiV1VerifiedAppsGetResponse parses an HTTP response from a HandleListPublicCvmsApiV1VerifiedAppsGetWithResponse call -func ParseHandleListPublicCvmsApiV1VerifiedAppsGetResponse(rsp *http.Response) (*HandleListPublicCvmsApiV1VerifiedAppsGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleListPublicCvmsApiV1VerifiedAppsGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []PublicCVM - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseHandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGetResponse parses an HTTP response from a HandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGetWithResponse call -func ParseHandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGetResponse(rsp *http.Response) (*HandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HandleGetCvmAttestationAnonymousApiV1VerifiedAppsCvmIdAttestationGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CvmAttestation - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest HTTPValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - } - - return response, nil -} - -// ParseHealthCheckHealthGetResponse parses an HTTP response from a HealthCheckHealthGetWithResponse call -func ParseHealthCheckHealthGetResponse(rsp *http.Response) (*HealthCheckHealthGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HealthCheckHealthGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} diff --git a/internal/phalaapi/doc.go b/internal/phalaapi/doc.go deleted file mode 100644 index 8155542..0000000 --- a/internal/phalaapi/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -package phalaapi - -// Regenerate this package from the latest public OpenAPI schema: -//go:generate bash ../../openapi/generate-client.sh diff --git a/internal/provider/auth_me.go b/internal/provider/auth_me.go deleted file mode 100644 index 0267a63..0000000 --- a/internal/provider/auth_me.go +++ /dev/null @@ -1,64 +0,0 @@ -package provider - -import ( - "context" - "strings" - - "github.com/hashicorp/terraform-plugin-framework/types" -) - -type authMeResponse struct { - User authMeUser `json:"user"` - - Workspace authMeWorkspace `json:"workspace"` - Credits authMeCredits `json:"credits"` -} - -type authMeUser struct { - Username string `json:"username"` - Email string `json:"email"` - Role string `json:"role"` - Avatar *string `json:"avatar"` - EmailVerified *bool `json:"email_verified"` - TotpEnabled *bool `json:"totp_enabled"` - HasBackupCodes *bool `json:"has_backup_codes"` - FlagHasPassword *bool `json:"flag_has_password"` -} - -type authMeWorkspace struct { - ID string `json:"id"` - Name string `json:"name"` - Slug string `json:"slug"` - Tier string `json:"tier"` - Role string `json:"role"` - Avatar *string `json:"avatar"` -} - -type authMeCredits struct { - Balance string `json:"balance"` - GrantedBalance string `json:"granted_balance"` - IsPostPaid *bool `json:"is_post_paid"` - OutstandingAmount *string `json:"outstanding_amount"` -} - -func fetchAuthMe(ctx context.Context, client *APIClient) (*authMeResponse, error) { - var out authMeResponse - if err := client.GetJSON(ctx, "/auth/me", &out); err != nil { - return nil, err - } - return &out, nil -} - -func nullableBool(v *bool) types.Bool { - if v == nil { - return types.BoolNull() - } - return types.BoolValue(*v) -} - -func nullableStringPtr(v *string) types.String { - if v == nil || strings.TrimSpace(*v) == "" { - return types.StringNull() - } - return types.StringValue(strings.TrimSpace(*v)) -} diff --git a/internal/provider/client.go b/internal/provider/client.go deleted file mode 100644 index 6e165e8..0000000 --- a/internal/provider/client.go +++ /dev/null @@ -1,338 +0,0 @@ -package provider - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - "net/http" - "strconv" - "strings" - "time" - - "github.com/Phala-Network/terraform-provider-phala/internal/phalaapi" -) - -// Async CVM operations can keep resources locked for several minutes. -// Keep retrying retryable errors only for writes that are safe to replay. -const maxWriteRetries = 30 - -type APIClient struct { - baseURL string - apiKey string - apiVersion string - httpClient *http.Client - typed *phalaapi.ClientWithResponses -} - -type APIError struct { - StatusCode int - Status string - Message string - Detail any - Body string - Headers http.Header -} - -func (e *APIError) Error() string { - if e.Message != "" { - return fmt.Sprintf("%s: %s", e.Status, e.Message) - } - return e.Status -} - -func (e *APIError) retryAfter() time.Duration { - if e == nil || e.Headers == nil { - return 0 - } - - v := e.Headers.Get("Retry-After") - if v == "" { - return 0 - } - - secs, err := strconv.Atoi(v) - if err == nil && secs > 0 { - return time.Duration(secs) * time.Second - } - - t, err := http.ParseTime(v) - if err == nil { - d := time.Until(t) - if d > 0 { - return d - } - } - - return 0 -} - -func NewAPIClient(baseURL, apiKey, apiVersion string, timeout time.Duration) *APIClient { - httpClient := &http.Client{ - Timeout: timeout, - } - - return &APIClient{ - baseURL: strings.TrimSuffix(baseURL, "/"), - apiKey: apiKey, - apiVersion: apiVersion, - httpClient: httpClient, - typed: newTypedClient(strings.TrimSuffix(baseURL, "/"), apiKey, apiVersion, httpClient), - } -} - -func (c *APIClient) GetJSON(ctx context.Context, path string, out any) error { - return c.requestJSON(ctx, http.MethodGet, path, "", nil, nil, out) -} - -func (c *APIClient) GetText(ctx context.Context, path string) (string, error) { - var out string - if err := c.requestJSON(ctx, http.MethodGet, path, "", nil, nil, &out); err != nil { - return "", err - } - return out, nil -} - -func (c *APIClient) PostJSON(ctx context.Context, path string, payload any, out any) error { - return c.requestWithRetry(ctx, http.MethodPost, path, "application/json", payload, nil, out) -} - -func (c *APIClient) PatchJSON(ctx context.Context, path string, payload any, out any) error { - return c.requestWithRetry(ctx, http.MethodPatch, path, "application/json", payload, nil, out) -} - -func (c *APIClient) PatchText( - ctx context.Context, - path string, - body string, - headers map[string]string, - out any, -) error { - return c.requestWithRetry(ctx, http.MethodPatch, path, "text/plain", body, headers, out) -} - -func (c *APIClient) Delete(ctx context.Context, path string) error { - return c.requestWithRetry(ctx, http.MethodDelete, path, "", nil, nil, nil) -} - -func (c *APIClient) requestWithRetry( - ctx context.Context, - method, path, contentType string, - payload any, - headers map[string]string, - out any, -) error { - for attempt := 0; attempt <= maxWriteRetries; attempt++ { - err := c.requestJSON(ctx, method, path, contentType, payload, headers, out) - if err == nil { - return nil - } - - apiErr, ok := err.(*APIError) - if !ok || - !isRetryableStatus(apiErr.StatusCode) || - !shouldRetryWrite(method, path) || - attempt == maxWriteRetries { - return err - } - - delay := retryDelayForAttempt(attempt) - if fromHeader := apiErr.retryAfter(); fromHeader > 0 { - delay = fromHeader - } - - select { - case <-ctx.Done(): - return ctx.Err() - case <-time.After(delay): - } - } - - return fmt.Errorf("request failed after retries") -} - -func shouldRetryWrite(method, path string) bool { - normalizedPath := normalizePath(path) - - switch method { - case http.MethodPatch, http.MethodDelete: - return true - case http.MethodPost: - if normalizedPath == "/cvms/provision" { - return true - } - if _, ok := extractCVMID(normalizedPath, "/start"); ok { - return true - } - if _, ok := extractCVMID(normalizedPath, "/stop"); ok { - return true - } - if _, ok := extractCVMID(normalizedPath, "/compose_file/provision"); ok { - return true - } - return false - default: - return false - } -} - -func isRetryableStatus(status int) bool { - switch status { - case http.StatusConflict, http.StatusTooManyRequests, http.StatusServiceUnavailable: - return true - default: - return false - } -} - -func retryDelayForAttempt(attempt int) time.Duration { - // 1s, 2s, 4s, 8s ... capped at 20s - delay := time.Second * time.Duration(1< 20*time.Second { - return 20 * time.Second - } - return delay -} - -func (c *APIClient) requestJSON( - ctx context.Context, - method, path, contentType string, - payload any, - headers map[string]string, - out any, -) error { - if handled, err := c.tryTypedRequest(ctx, method, path, contentType, payload, headers, out); handled { - return err - } - - var bodyBytes []byte - var err error - - if payload != nil { - switch p := payload.(type) { - case string: - bodyBytes = []byte(p) - case []byte: - bodyBytes = p - default: - bodyBytes, err = json.Marshal(payload) - if err != nil { - return fmt.Errorf("marshal request payload: %w", err) - } - } - } - - _, respBody, err := c.doRaw(ctx, method, path, contentType, bodyBytes, headers) - if err != nil { - return err - } - - if out == nil || len(respBody) == 0 { - return nil - } - - switch target := out.(type) { - case *string: - *target = string(respBody) - return nil - default: - if err := json.Unmarshal(respBody, out); err != nil { - return fmt.Errorf("decode response payload: %w", err) - } - return nil - } -} - -func (c *APIClient) doRaw( - ctx context.Context, - method, path, contentType string, - body []byte, - headers map[string]string, -) (int, []byte, error) { - fullURL := c.baseURL + "/" + strings.TrimPrefix(path, "/") - - var reader io.Reader - if len(body) > 0 { - reader = bytes.NewReader(body) - } - - req, err := http.NewRequestWithContext(ctx, method, fullURL, reader) - if err != nil { - return 0, nil, err - } - - req.Header.Set("Accept", "*/*") - req.Header.Set("X-API-Key", c.apiKey) - if c.apiVersion != "" { - req.Header.Set("X-Phala-Version", c.apiVersion) - } - if contentType != "" { - req.Header.Set("Content-Type", contentType) - } - for k, v := range headers { - req.Header.Set(k, v) - } - - resp, err := c.httpClient.Do(req) - if err != nil { - return 0, nil, err - } - defer resp.Body.Close() - - respBody, err := io.ReadAll(resp.Body) - if err != nil { - return resp.StatusCode, nil, err - } - - if resp.StatusCode >= 200 && resp.StatusCode < 300 { - return resp.StatusCode, respBody, nil - } - - safeHeaders := resp.Header.Clone() - safeHeaders.Del("X-API-Key") - safeHeaders.Del("Authorization") - return resp.StatusCode, respBody, c.parseAPIError(resp.StatusCode, resp.Status, respBody, safeHeaders) -} - -func (c *APIClient) parseAPIError( - statusCode int, - statusText string, - body []byte, - headers http.Header, -) error { - errObj := &APIError{ - StatusCode: statusCode, - Status: statusText, - Body: string(body), - Headers: headers, - } - - if len(body) == 0 { - errObj.Message = statusText - return errObj - } - - var payload map[string]any - if err := json.Unmarshal(body, &payload); err != nil { - errObj.Message = string(body) - return errObj - } - - if v, ok := payload["message"].(string); ok && v != "" { - errObj.Message = v - } - if errObj.Message == "" { - if v, ok := payload["detail"].(string); ok && v != "" { - errObj.Message = v - } - } - if errObj.Message == "" { - errObj.Message = statusText - } - if detail, ok := payload["detail"]; ok { - errObj.Detail = detail - } - - return errObj -} diff --git a/internal/provider/client_contract_test.go b/internal/provider/client_contract_test.go deleted file mode 100644 index ca54192..0000000 --- a/internal/provider/client_contract_test.go +++ /dev/null @@ -1,482 +0,0 @@ -package provider - -import ( - "context" - "encoding/json" - "fmt" - "io" - "net/http" - "net/http/httptest" - "strings" - "sync" - "testing" - "time" -) - -type recordedRequest struct { - Method string - Path string - Header http.Header - Body []byte -} - -type requestCapture struct { - mu sync.Mutex - entries []recordedRequest -} - -func (c *requestCapture) add(r *http.Request, body []byte) { - c.mu.Lock() - defer c.mu.Unlock() - - copiedBody := make([]byte, len(body)) - copy(copiedBody, body) - - c.entries = append(c.entries, recordedRequest{ - Method: r.Method, - Path: r.URL.Path, - Header: r.Header.Clone(), - Body: copiedBody, - }) -} - -func (c *requestCapture) mustFind(t *testing.T, method, path string) recordedRequest { - t.Helper() - - c.mu.Lock() - defer c.mu.Unlock() - - for i := len(c.entries) - 1; i >= 0; i-- { - entry := c.entries[i] - if entry.Method == method && entry.Path == path { - return entry - } - } - - seen := make([]string, 0, len(c.entries)) - for _, entry := range c.entries { - seen = append(seen, fmt.Sprintf("%s %s", entry.Method, entry.Path)) - } - t.Fatalf("request not found: %s %s (seen: %v)", method, path, seen) - return recordedRequest{} -} - -func (c *requestCapture) count(method, path string) int { - c.mu.Lock() - defer c.mu.Unlock() - - count := 0 - for _, entry := range c.entries { - if entry.Method == method && entry.Path == path { - count++ - } - } - return count -} - -func writeJSON(t *testing.T, w http.ResponseWriter, status int, body string) { - t.Helper() - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(status) - _, err := io.WriteString(w, body) - if err != nil { - t.Fatalf("write response: %v", err) - } -} - -func TestAPIClientContract_TypedAndFallback(t *testing.T) { - capture := &requestCapture{} - - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - body, _ := io.ReadAll(r.Body) - capture.add(r, body) - - switch { - case r.Method == http.MethodGet && r.URL.Path == "/api/v1/auth/me": - writeJSON(t, w, http.StatusOK, `{"user":{"username":"alice","email":"alice@example.com"},"workspace":{"id":"wks_1","slug":"alice"},"credits":{"balance":"42"}}`) - return - - case r.Method == http.MethodGet && r.URL.Path == "/api/v1/apps/filter-options": - writeJSON(t, w, http.StatusOK, `{"statuses":[],"image_versions":[],"instance_types":["tdx.small"],"kms_slugs":[],"kms_types":[],"regions":["us-east"],"nodes":[]}`) - return - - case r.Method == http.MethodGet && r.URL.Path == "/api/v1/teepods/available": - writeJSON(t, w, http.StatusOK, `{"tier":"PRO","capacity":{},"nodes":[],"kms_list":[]}`) - return - - case r.Method == http.MethodPost && r.URL.Path == "/api/v1/cvms/provision": - writeJSON(t, w, http.StatusOK, `{"app_id":"app_test","compose_hash":"compose_hash_test"}`) - return - - case r.Method == http.MethodPost && r.URL.Path == "/api/v1/cvms": - writeJSON(t, w, http.StatusOK, `{"id":123,"name":"example-app","status":"pending","app_id":"app_test"}`) - return - - case r.Method == http.MethodPatch && r.URL.Path == "/api/v1/cvms/cvm123/resources": - writeJSON(t, w, http.StatusAccepted, `{}`) - return - - case r.Method == http.MethodPatch && r.URL.Path == "/api/v1/cvms/cvm123/docker-compose": - writeJSON(t, w, http.StatusAccepted, `{}`) - return - - case r.Method == http.MethodPatch && r.URL.Path == "/api/v1/cvms/cvm123/pre-launch-script": - writeJSON(t, w, http.StatusAccepted, `{}`) - return - - case r.Method == http.MethodPost && r.URL.Path == "/api/v1/cvms/cvm123/start": - writeJSON(t, w, http.StatusAccepted, `{}`) - return - - case r.Method == http.MethodPost && r.URL.Path == "/api/v1/cvms/cvm123/stop": - writeJSON(t, w, http.StatusAccepted, `{}`) - return - - case r.Method == http.MethodGet && r.URL.Path == "/api/v1/cvms/cvm123/docker-compose.yml": - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - _, _ = io.WriteString(w, "services:\n app:\n") - return - - case r.Method == http.MethodGet && r.URL.Path == "/api/v1/cvms/cvm123/pre-launch-script": - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - _, _ = io.WriteString(w, "#!/bin/sh\necho ready\n") - return - - case r.Method == http.MethodGet && r.URL.Path == "/api/v1/instance-types": - writeJSON(t, w, http.StatusOK, `{"result":[{"name":"cpu","items":[{"id":"tdx.small","name":"tdx.small"}]}]}`) - return - - case r.Method == http.MethodPost && r.URL.Path == "/api/v1/user/ssh-keys": - writeJSON(t, w, http.StatusOK, `{"id":"sshkey_1","name":"laptop","public_key":"ssh-ed25519 AAA","fingerprint":"fp"}`) - return - - default: - w.WriteHeader(http.StatusNotFound) - _, _ = io.WriteString(w, "not found") - } - })) - defer srv.Close() - - client := NewAPIClient(srv.URL+"/api/v1", "phat_test_key", "2026-01-21", 5*time.Second) - ctx := context.Background() - - var me struct { - User struct { - Username string `json:"username"` - Email string `json:"email"` - } `json:"user"` - Workspace struct { - ID string `json:"id"` - } `json:"workspace"` - } - if err := client.GetJSON(ctx, "/auth/me", &me); err != nil { - t.Fatalf("typed auth me request failed: %v", err) - } - if me.User.Username != "alice" || me.Workspace.ID != "wks_1" { - t.Fatalf("unexpected /auth/me response: %#v", me) - } - - var filters struct { - Regions []string `json:"regions"` - } - if err := client.GetJSON(ctx, "/apps/filter-options", &filters); err != nil { - t.Fatalf("typed filter-options request failed: %v", err) - } - if len(filters.Regions) != 1 || filters.Regions[0] != "us-east" { - t.Fatalf("unexpected filter-options response: %#v", filters) - } - - var available map[string]any - if err := client.GetJSON(ctx, "/teepods/available", &available); err != nil { - t.Fatalf("typed teepods available request failed: %v", err) - } - - provisionReq := map[string]any{ - "name": "example-app", - "instance_type": "tdx.small", - "compose_file": map[string]any{ - "name": "example-app", - "docker_compose_file": "services:\n app:\n", - }, - } - var provisionResp struct { - AppID string `json:"app_id"` - ComposeHash string `json:"compose_hash"` - } - if err := client.PostJSON(ctx, "/cvms/provision", provisionReq, &provisionResp); err != nil { - t.Fatalf("typed /cvms/provision failed: %v", err) - } - if provisionResp.AppID == "" || provisionResp.ComposeHash == "" { - t.Fatalf("unexpected provision response: %#v", provisionResp) - } - - var created map[string]any - if err := client.PostJSON(ctx, "/cvms", map[string]any{"app_id": "app_test", "compose_hash": "compose_hash_test"}, &created); err != nil { - t.Fatalf("typed /cvms create failed: %v", err) - } - - if err := client.PatchJSON(ctx, "/cvms/cvm123/resources", map[string]any{ - "allow_restart": true, - "disk_size": 40, - }, nil); err != nil { - t.Fatalf("typed /cvms/{id}/resources failed: %v", err) - } - - if err := client.PatchText( - ctx, - "/cvms/cvm123/docker-compose", - "services:\n app:\n", - map[string]string{"X-Compose-Hash": "0xabc", "X-Transaction-Hash": "0xdef", "Content-Type": "text/yaml"}, - nil, - ); err != nil { - t.Fatalf("typed /cvms/{id}/docker-compose patch failed: %v", err) - } - - if err := client.PatchText( - ctx, - "/cvms/cvm123/pre-launch-script", - "#!/bin/sh\necho update\n", - map[string]string{"X-Compose-Hash": "0xaaa"}, - nil, - ); err != nil { - t.Fatalf("typed /cvms/{id}/pre-launch-script patch failed: %v", err) - } - - if err := client.PostJSON(ctx, "/cvms/cvm123/start", map[string]any{"polling": "v1"}, nil); err != nil { - t.Fatalf("typed /cvms/{id}/start failed: %v", err) - } - - if err := client.PostJSON(ctx, "/cvms/cvm123/stop", map[string]any{"polling": "v1"}, nil); err != nil { - t.Fatalf("typed /cvms/{id}/stop failed: %v", err) - } - - compose, err := client.GetText(ctx, "/cvms/cvm123/docker-compose.yml") - if err != nil { - t.Fatalf("typed compose GET failed: %v", err) - } - if !strings.Contains(compose, "services:") { - t.Fatalf("unexpected compose text: %q", compose) - } - - script, err := client.GetText(ctx, "/cvms/cvm123/pre-launch-script") - if err != nil { - t.Fatalf("typed pre-launch GET failed: %v", err) - } - if !strings.Contains(script, "echo ready") { - t.Fatalf("unexpected pre-launch script: %q", script) - } - - var sizes map[string]any - if err := client.GetJSON(ctx, "/instance-types", &sizes); err != nil { - t.Fatalf("fallback /instance-types failed: %v", err) - } - if _, ok := sizes["result"]; !ok { - t.Fatalf("unexpected /instance-types response: %#v", sizes) - } - - var sshResp struct { - ID string `json:"id"` - } - if err := client.PostJSON(ctx, "/user/ssh-keys", map[string]any{ - "name": "laptop", - "public_key": "ssh-ed25519 AAA", - }, &sshResp); err != nil { - t.Fatalf("fallback /user/ssh-keys failed: %v", err) - } - if sshResp.ID != "sshkey_1" { - t.Fatalf("unexpected ssh response: %#v", sshResp) - } - - handled, err := client.tryTypedRequest(ctx, http.MethodGet, "/instance-types", "", nil, nil, &map[string]any{}) - if err != nil { - t.Fatalf("tryTypedRequest fallback probe errored: %v", err) - } - if handled { - t.Fatalf("expected /instance-types to remain fallback, but typed handler claimed it") - } - - typedReq := capture.mustFind(t, http.MethodGet, "/api/v1/apps/filter-options") - if typedReq.Header.Get("X-API-Key") != "phat_test_key" { - t.Fatalf("typed request missing api key header: %#v", typedReq.Header) - } - if typedReq.Header.Get("X-Phala-Version") != "2026-01-21" { - t.Fatalf("typed request missing api version header: %#v", typedReq.Header) - } - - resourcesReq := capture.mustFind(t, http.MethodPatch, "/api/v1/cvms/cvm123/resources") - var resourcesPayload map[string]any - if err := json.Unmarshal(resourcesReq.Body, &resourcesPayload); err != nil { - t.Fatalf("decode resources payload: %v", err) - } - allowRestart, ok := resourcesPayload["allow_restart"].(float64) - if !ok || allowRestart != 1 { - t.Fatalf("expected allow_restart to be serialized as numeric 1 in typed flow, got: %#v", resourcesPayload["allow_restart"]) - } - - composePatchReq := capture.mustFind(t, http.MethodPatch, "/api/v1/cvms/cvm123/docker-compose") - if composePatchReq.Header.Get("X-Compose-Hash") != "0xabc" { - t.Fatalf("missing X-Compose-Hash on docker-compose patch: %#v", composePatchReq.Header) - } - if composePatchReq.Header.Get("X-Transaction-Hash") != "0xdef" { - t.Fatalf("missing X-Transaction-Hash on docker-compose patch: %#v", composePatchReq.Header) - } - if gotCT := composePatchReq.Header.Get("Content-Type"); gotCT != "text/yaml" { - t.Fatalf("unexpected Content-Type for docker-compose patch: %q", gotCT) - } - - startReq := capture.mustFind(t, http.MethodPost, "/api/v1/cvms/cvm123/start") - var startPayload map[string]any - if err := json.Unmarshal(startReq.Body, &startPayload); err != nil { - t.Fatalf("decode start payload: %v", err) - } - if startPayload["polling"] != "v1" { - t.Fatalf("unexpected start payload: %#v", startPayload) - } - - stopReq := capture.mustFind(t, http.MethodPost, "/api/v1/cvms/cvm123/stop") - var stopPayload map[string]any - if err := json.Unmarshal(stopReq.Body, &stopPayload); err != nil { - t.Fatalf("decode stop payload: %v", err) - } - if stopPayload["polling"] != "v1" { - t.Fatalf("unexpected stop payload: %#v", stopPayload) - } - - fallbackReq := capture.mustFind(t, http.MethodPost, "/api/v1/user/ssh-keys") - if fallbackReq.Header.Get("X-API-Key") != "phat_test_key" { - t.Fatalf("fallback request missing api key header: %#v", fallbackReq.Header) - } - if fallbackReq.Header.Get("X-Phala-Version") != "2026-01-21" { - t.Fatalf("fallback request missing api version header: %#v", fallbackReq.Header) - } -} - -func TestAPIClientContract_TypedErrorReturnsAPIError(t *testing.T) { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if r.Method == http.MethodGet && r.URL.Path == "/api/v1/cvms/missing" { - writeJSON(t, w, http.StatusNotFound, `{"message":"cvm not found"}`) - return - } - w.WriteHeader(http.StatusNotFound) - _, _ = io.WriteString(w, "not found") - })) - defer srv.Close() - - client := NewAPIClient(srv.URL+"/api/v1", "phat_test_key", "2026-01-21", 5*time.Second) - - var out map[string]any - err := client.GetJSON(context.Background(), "/cvms/missing", &out) - if err == nil { - t.Fatal("expected typed GET /cvms/missing to fail") - } - - apiErr, ok := err.(*APIError) - if !ok { - t.Fatalf("expected *APIError, got %T: %v", err, err) - } - if apiErr.StatusCode != http.StatusNotFound { - t.Fatalf("unexpected status code: %d", apiErr.StatusCode) - } - if !strings.Contains(apiErr.Message, "not found") { - t.Fatalf("unexpected API error message: %q", apiErr.Message) - } -} - -func TestAPIClientContract_RetriesOnlyReplaySafeWrites(t *testing.T) { - capture := &requestCapture{} - attempts := map[string]int{} - var attemptsMu sync.Mutex - - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - body, _ := io.ReadAll(r.Body) - capture.add(r, body) - - key := r.Method + " " + r.URL.Path - attemptsMu.Lock() - attempts[key]++ - attempt := attempts[key] - attemptsMu.Unlock() - - switch { - case r.Method == http.MethodPost && r.URL.Path == "/api/v1/user/ssh-keys": - if attempt == 1 { - writeJSON(t, w, http.StatusServiceUnavailable, `{"message":"backend busy"}`) - return - } - writeJSON(t, w, http.StatusOK, `{"id":"sshkey_1"}`) - return - - case r.Method == http.MethodPost && r.URL.Path == "/api/v1/cvms/cvm123/start": - if attempt == 1 { - writeJSON(t, w, http.StatusServiceUnavailable, `{"message":"try again"}`) - return - } - writeJSON(t, w, http.StatusAccepted, `{}`) - return - - case r.Method == http.MethodPost && r.URL.Path == "/api/v1/cvms/provision": - if attempt == 1 { - writeJSON(t, w, http.StatusServiceUnavailable, `{"message":"try again"}`) - return - } - writeJSON(t, w, http.StatusOK, `{"app_id":"app_test","compose_hash":"compose_hash_test"}`) - return - - case r.Method == http.MethodPatch && r.URL.Path == "/api/v1/cvms/cvm123/resources": - if attempt == 1 { - writeJSON(t, w, http.StatusServiceUnavailable, `{"message":"try again"}`) - return - } - writeJSON(t, w, http.StatusAccepted, `{}`) - return - - default: - w.WriteHeader(http.StatusNotFound) - _, _ = io.WriteString(w, "not found") - } - })) - defer srv.Close() - - client := NewAPIClient(srv.URL+"/api/v1", "phat_test_key", "2026-01-21", 5*time.Second) - ctx := context.Background() - - var sshResp map[string]any - err := client.PostJSON(ctx, "/user/ssh-keys", map[string]any{ - "name": "laptop", - "public_key": "ssh-ed25519 AAA", - }, &sshResp) - if err == nil { - t.Fatal("expected create POST not to be retried after 503") - } - apiErr, ok := err.(*APIError) - if !ok || apiErr.StatusCode != http.StatusServiceUnavailable { - t.Fatalf("expected 503 APIError, got %T: %v", err, err) - } - if got := capture.count(http.MethodPost, "/api/v1/user/ssh-keys"); got != 1 { - t.Fatalf("unexpected retry count for create POST: got %d want 1", got) - } - - if err := client.PostJSON(ctx, "/cvms/cvm123/start", map[string]any{"polling": "v1"}, nil); err != nil { - t.Fatalf("expected start POST to be retried safely: %v", err) - } - if got := capture.count(http.MethodPost, "/api/v1/cvms/cvm123/start"); got != 2 { - t.Fatalf("unexpected retry count for start POST: got %d want 2", got) - } - - var provisionResp map[string]any - if err := client.PostJSON(ctx, "/cvms/provision", map[string]any{"name": "demo"}, &provisionResp); err != nil { - t.Fatalf("expected /cvms/provision POST to be retried safely: %v", err) - } - if got := capture.count(http.MethodPost, "/api/v1/cvms/provision"); got != 2 { - t.Fatalf("unexpected retry count for /cvms/provision POST: got %d want 2", got) - } - - if err := client.PatchJSON(ctx, "/cvms/cvm123/resources", map[string]any{"allow_restart": true}, nil); err != nil { - t.Fatalf("expected PATCH to be retried safely: %v", err) - } - if got := capture.count(http.MethodPatch, "/api/v1/cvms/cvm123/resources"); got != 2 { - t.Fatalf("unexpected retry count for PATCH: got %d want 2", got) - } -} diff --git a/internal/provider/client_typed.go b/internal/provider/client_typed.go deleted file mode 100644 index 6e31e0b..0000000 --- a/internal/provider/client_typed.go +++ /dev/null @@ -1,425 +0,0 @@ -package provider - -import ( - "context" - "encoding/json" - "fmt" - "log" - "net/http" - "net/url" - "strconv" - "strings" - - "github.com/Phala-Network/terraform-provider-phala/internal/phalaapi" -) - -func newTypedClient(baseURL, apiKey, apiVersion string, httpClient *http.Client) *phalaapi.ClientWithResponses { - server := typedServerURL(baseURL) - client, err := phalaapi.NewClientWithResponses( - server, - phalaapi.WithHTTPClient(httpClient), - phalaapi.WithRequestEditorFn(func(_ context.Context, req *http.Request) error { - req.Header.Set("X-API-Key", apiKey) - if apiVersion != "" { - req.Header.Set("X-Phala-Version", apiVersion) - } - if req.Header.Get("Accept") == "" { - req.Header.Set("Accept", "*/*") - } - return nil - }), - ) - if err != nil { - log.Printf("[WARN] phala: failed to initialize typed API client, falling back to raw HTTP: %v", err) - return nil - } - - return client -} - -func typedServerURL(baseURL string) string { - trimmed := strings.TrimRight(strings.TrimSpace(baseURL), "/") - if trimmed == "" { - return baseURL - } - - lower := strings.ToLower(trimmed) - if strings.HasSuffix(lower, "/api/v1") { - return trimmed[:len(trimmed)-len("/api/v1")] - } - return trimmed -} - -func (c *APIClient) tryTypedRequest( - ctx context.Context, - method, path, contentType string, - payload any, - headers map[string]string, - out any, -) (bool, error) { - if c.typed == nil { - return false, nil - } - - normalizedPath := normalizePath(path) - - switch { - case method == http.MethodGet && normalizedPath == "/auth/me": - resp, err := c.typed.ReadUsersMeApiV1AuthMeGetWithResponse(ctx) - if resp == nil { - return true, err - } - return true, c.finishTyped(resp.HTTPResponse, resp.Body, err, out) - - case method == http.MethodGet && normalizedPath == "/apps/filter-options": - resp, err := c.typed.GetFilterOptionsApiV1AppsFilterOptionsGetWithResponse(ctx) - if resp == nil { - return true, err - } - return true, c.finishTyped(resp.HTTPResponse, resp.Body, err, out) - - case method == http.MethodGet && normalizedPath == "/teepods/available": - resp, err := c.typed.HandleGetAvailableTeepodsApiV1TeepodsAvailableGetWithResponse(ctx, nil) - if resp == nil { - return true, err - } - return true, c.finishTyped(resp.HTTPResponse, resp.Body, err, out) - - case method == http.MethodPost && normalizedPath == "/cvms/provision": - var req phalaapi.HandleProvisionCvmApiV1CvmsProvisionPostJSONRequestBody - if err := convertPayload(payload, &req); err != nil { - return true, fmt.Errorf("convert /cvms/provision payload: %w", err) - } - resp, err := c.typed.HandleProvisionCvmApiV1CvmsProvisionPostWithResponse(ctx, req) - if resp == nil { - return true, err - } - return true, c.finishTyped(resp.HTTPResponse, resp.Body, err, out) - - case method == http.MethodPost && normalizedPath == "/cvms": - var req phalaapi.HandleCreateCvmFromPovisionApiV1CvmsPostJSONRequestBody - if err := convertPayload(payload, &req); err != nil { - return true, fmt.Errorf("convert /cvms payload: %w", err) - } - resp, err := c.typed.HandleCreateCvmFromPovisionApiV1CvmsPostWithResponse(ctx, req) - if resp == nil { - return true, err - } - return true, c.finishTyped(resp.HTTPResponse, resp.Body, err, out) - - case method == http.MethodPost: - if cvmID, ok := extractCVMID(normalizedPath, "/start"); ok { - var req phalaapi.HandleStartCvmApiV1CvmsCvmIdStartPostJSONRequestBody - if payload != nil { - if err := convertPayload(payload, &req); err != nil { - return true, fmt.Errorf("convert /cvms/{id}/start payload: %w", err) - } - } - resp, err := c.typed.HandleStartCvmApiV1CvmsCvmIdStartPostWithResponse(ctx, cvmID, req) - if resp == nil { - return true, err - } - return true, c.finishTyped(resp.HTTPResponse, resp.Body, err, out) - } - - if cvmID, ok := extractCVMID(normalizedPath, "/stop"); ok { - var req phalaapi.HandleStopCvmApiV1CvmsCvmIdStopPostJSONRequestBody - if payload != nil { - if err := convertPayload(payload, &req); err != nil { - return true, fmt.Errorf("convert /cvms/{id}/stop payload: %w", err) - } - } - resp, err := c.typed.HandleStopCvmApiV1CvmsCvmIdStopPostWithResponse(ctx, cvmID, req) - if resp == nil { - return true, err - } - return true, c.finishTyped(resp.HTTPResponse, resp.Body, err, out) - } - - case method == http.MethodDelete: - if cvmID, ok := extractCVMID(normalizedPath, ""); ok { - resp, err := c.typed.HandleRemoveCvmApiV1CvmsCvmIdDeleteWithResponse(ctx, cvmID, nil) - if resp == nil { - return true, err - } - return true, c.finishTyped(resp.HTTPResponse, resp.Body, err, out) - } - - case method == http.MethodGet: - if cvmID, ok := extractCVMID(normalizedPath, ""); ok { - resp, err := c.typed.HandleGetCvmApiV1CvmsCvmIdGetWithResponse(ctx, cvmID) - if resp == nil { - return true, err - } - return true, c.finishTyped(resp.HTTPResponse, resp.Body, err, out) - } - if cvmID, ok := extractCVMID(normalizedPath, "/docker-compose.yml"); ok { - resp, err := c.typed.HandleGetCvmDockerComposeApiV1CvmsCvmIdDockerComposeYmlGetWithResponse(ctx, cvmID) - if resp == nil { - return true, err - } - return true, c.finishTyped(resp.HTTPResponse, resp.Body, err, out) - } - if cvmID, ok := extractCVMID(normalizedPath, "/pre-launch-script"); ok { - resp, err := c.typed.HandleGetCvmPrelaunchScriptApiV1CvmsCvmIdPreLaunchScriptGetWithResponse(ctx, cvmID) - if resp == nil { - return true, err - } - return true, c.finishTyped(resp.HTTPResponse, resp.Body, err, out) - } - - case method == http.MethodPatch: - if cvmID, ok := extractCVMID(normalizedPath, "/resources"); ok { - req, err := toResizePayload(payload) - if err != nil { - return true, fmt.Errorf("convert /cvms/{id}/resources payload: %w", err) - } - resp, err := c.typed.HandleResizeCvmApiV1CvmsCvmIdResourcesPatchWithResponse(ctx, cvmID, nil, req) - if resp == nil { - return true, err - } - return true, c.finishTyped(resp.HTTPResponse, resp.Body, err, out) - } - - if cvmID, ok := extractCVMID(normalizedPath, "/docker-compose"); ok { - bodyText, err := payloadToString(payload) - if err != nil { - return true, fmt.Errorf("convert /cvms/{id}/docker-compose payload: %w", err) - } - contentTypeToSend := firstHeader(headers, "Content-Type") - if contentTypeToSend == "" { - contentTypeToSend = nonEmpty(contentType, "text/yaml") - } - params := &phalaapi.UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchParams{} - if v := firstHeader(headers, "X-Compose-Hash"); v != "" { - params.XComposeHash = &v - } - if v := firstHeader(headers, "X-Transaction-Hash"); v != "" { - params.XTransactionHash = &v - } - resp, err := c.typed.UpdateCvmDockerComposeApiV1CvmsCvmIdDockerComposePatchWithBodyWithResponse( - ctx, - cvmID, - params, - contentTypeToSend, - strings.NewReader(bodyText), - ) - if resp == nil { - return true, err - } - return true, c.finishTyped(resp.HTTPResponse, resp.Body, err, out) - } - - if cvmID, ok := extractCVMID(normalizedPath, "/pre-launch-script"); ok { - bodyText, err := payloadToString(payload) - if err != nil { - return true, fmt.Errorf("convert /cvms/{id}/pre-launch-script payload: %w", err) - } - contentTypeToSend := firstHeader(headers, "Content-Type") - if contentTypeToSend == "" { - contentTypeToSend = nonEmpty(contentType, "text/plain") - } - params := &phalaapi.UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchParams{} - if v := firstHeader(headers, "X-Compose-Hash"); v != "" { - params.XComposeHash = &v - } - if v := firstHeader(headers, "X-Transaction-Hash"); v != "" { - params.XTransactionHash = &v - } - resp, err := c.typed.UpdateCvmPreLaunchScriptApiV1CvmsCvmIdPreLaunchScriptPatchWithBodyWithResponse( - ctx, - cvmID, - params, - contentTypeToSend, - strings.NewReader(bodyText), - ) - if resp == nil { - return true, err - } - return true, c.finishTyped(resp.HTTPResponse, resp.Body, err, out) - } - } - - return false, nil -} - -func (c *APIClient) finishTyped(resp *http.Response, body []byte, callErr error, out any) error { - if callErr != nil { - return callErr - } - if resp == nil { - return fmt.Errorf("typed API client returned nil response") - } - - if resp.StatusCode < 200 || resp.StatusCode >= 300 { - return c.parseAPIError(resp.StatusCode, resp.Status, body, resp.Header) - } - - if out == nil || len(body) == 0 { - return nil - } - - switch target := out.(type) { - case *string: - *target = string(body) - return nil - default: - if err := json.Unmarshal(body, out); err != nil { - return fmt.Errorf("decode typed response payload: %w", err) - } - return nil - } -} - -func toResizePayload(payload any) (phalaapi.HandleResizeCvmApiV1CvmsCvmIdResourcesPatchJSONRequestBody, error) { - var raw map[string]any - if err := convertPayload(payload, &raw); err != nil { - return phalaapi.CvmResizePayload{}, err - } - - req := phalaapi.CvmResizePayload{} - - if v, ok := raw["instance_type"].(string); ok && strings.TrimSpace(v) != "" { - req.InstanceType = &v - } - if v, ok := intFromAny(raw["disk_size"]); ok { - req.DiskSize = &v - } - if v, ok := intFromAny(raw["memory"]); ok { - req.Memory = &v - } - if v, ok := intFromAny(raw["vcpu"]); ok { - req.Vcpu = &v - } - - if allowRaw, ok := raw["allow_restart"]; ok { - if allowBool, ok := allowRaw.(bool); ok { - allow := 0 - if allowBool { - allow = 1 - } - req.AllowRestart = &allow - } else if allowInt, ok := intFromAny(allowRaw); ok { - req.AllowRestart = &allowInt - } - } - - return req, nil -} - -func intFromAny(v any) (int, bool) { - switch x := v.(type) { - case int: - return x, true - case int8: - return int(x), true - case int16: - return int(x), true - case int32: - return int(x), true - case int64: - return int(x), true - case float32: - return int(x), true - case float64: - return int(x), true - case json.Number: - iv, err := x.Int64() - if err != nil { - return 0, false - } - return int(iv), true - case string: - iv, err := strconv.Atoi(strings.TrimSpace(x)) - if err != nil { - return 0, false - } - return iv, true - default: - return 0, false - } -} - -func payloadToString(payload any) (string, error) { - switch p := payload.(type) { - case string: - return p, nil - case []byte: - return string(p), nil - default: - return "", fmt.Errorf("unsupported payload type %T", payload) - } -} - -func convertPayload(in any, out any) error { - b, err := json.Marshal(in) - if err != nil { - return err - } - return json.Unmarshal(b, out) -} - -func normalizePath(path string) string { - trimmed := strings.TrimSpace(path) - if trimmed == "" { - return "/" - } - - normalized := "/" + strings.TrimPrefix(trimmed, "/") - if normalized != "/" { - normalized = strings.TrimSuffix(normalized, "/") - } - return normalized -} - -func extractCVMID(path, suffix string) (string, bool) { - const prefix = "/cvms/" - - if !strings.HasPrefix(path, prefix) { - return "", false - } - - tail := strings.TrimPrefix(path, prefix) - if suffix != "" { - if !strings.HasSuffix(tail, suffix) { - return "", false - } - tail = strings.TrimSuffix(tail, suffix) - } - - if tail == "" || strings.Contains(tail, "/") { - return "", false - } - - id, err := url.PathUnescape(tail) - if err != nil { - return "", false - } - return id, true -} - -func firstHeader(headers map[string]string, key string) string { - if len(headers) == 0 { - return "" - } - if v := strings.TrimSpace(headers[key]); v != "" { - return v - } - - lowerKey := strings.ToLower(key) - for k, v := range headers { - if strings.ToLower(k) == lowerKey && strings.TrimSpace(v) != "" { - return strings.TrimSpace(v) - } - } - return "" -} - -func nonEmpty(values ...string) string { - for _, v := range values { - if strings.TrimSpace(v) != "" { - return v - } - } - return "" -} diff --git a/internal/provider/cvm_helpers.go b/internal/provider/cvm_helpers.go index 7fa9467..c76bf21 100644 --- a/internal/provider/cvm_helpers.go +++ b/internal/provider/cvm_helpers.go @@ -12,190 +12,116 @@ import ( "fmt" "net/url" "sort" - "strconv" "strings" "time" + phala "github.com/Phala-Network/phala-cloud/sdks/go" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/types" ) -// cvmAPIResponse is the common response structure returned by the Phala Cloud -// CVM endpoints. It is shared across resource_app, resource_cvm_power, and -// resource_shared. -type cvmAPIResponse struct { - ID json.RawMessage `json:"id"` - Name string `json:"name"` - Status string `json:"status"` - InProgress bool `json:"in_progress"` - Listed *bool `json:"listed"` - AppID string `json:"app_id"` - VMUUID string `json:"vm_uuid"` - InstanceID string `json:"instance_id"` - EnvPubkey *string `json:"encrypted_env_pubkey"` - KMSInfo *struct { - EncryptedEnvPubkey string `json:"encrypted_env_pubkey"` - } `json:"kms_info"` - - Resource *struct { - InstanceType string `json:"instance_type"` - DiskInGB *int64 `json:"disk_in_gb"` - } `json:"resource"` - - InstanceType string `json:"instance_type"` - DiskSize *int64 `json:"disk_size"` - - Progress *struct { - Target string `json:"target"` - } `json:"progress"` - - NodeInfo *struct { - Region string `json:"region"` - } `json:"node_info"` - Node *struct { - RegionIdentifier string `json:"region_identifier"` - } `json:"node"` - OS *struct { - Name string `json:"name"` - } `json:"os"` - BaseImage string `json:"base_image"` - PublicLogs *bool `json:"public_logs"` - PublicSysinfo *bool `json:"public_sysinfo"` - PublicTCBInfo *bool `json:"public_tcbinfo"` - GatewayEnabled *bool `json:"gateway_enabled"` - SecureTime *bool `json:"secure_time"` - StorageFS string `json:"storage_fs"` - ComposeFile *struct { - PublicLogs *bool `json:"public_logs"` - PublicSysinfo *bool `json:"public_sysinfo"` - PublicTCBInfo *bool `json:"public_tcbinfo"` - GatewayEnabled *bool `json:"gateway_enabled"` - SecureTime *bool `json:"secure_time"` - StorageFS string `json:"storage_fs"` - } `json:"compose_file"` - - Endpoints []struct { - App string `json:"app"` - } `json:"endpoints"` - PublicURLs []struct { - App string `json:"app"` - } `json:"public_urls"` -} - -func (r cvmAPIResponse) idString() string { - if len(r.ID) == 0 { - return "" - } - - var asString string - if err := json.Unmarshal(r.ID, &asString); err == nil { - return strings.TrimSpace(asString) - } - - var asInt int64 - if err := json.Unmarshal(r.ID, &asInt); err == nil { - return strconv.FormatInt(asInt, 10) - } - - var asFloat float64 - if err := json.Unmarshal(r.ID, &asFloat); err == nil { - return strconv.FormatInt(int64(asFloat), 10) - } +// --------------------------------------------------------------------------- +// CVMInfo accessor helpers +// --------------------------------------------------------------------------- - return "" +func cvmInfoIDString(info *phala.CVMInfo) string { + return strings.TrimSpace(info.ID) } -func (r cvmAPIResponse) envEncryptionPubkey() string { - if r.EnvPubkey != nil && strings.TrimSpace(*r.EnvPubkey) != "" { - return strings.TrimSpace(*r.EnvPubkey) +func cvmInfoEnvEncryptionPubkey(info *phala.CVMInfo) string { + if info.EncryptedEnvPubkey != nil && strings.TrimSpace(*info.EncryptedEnvPubkey) != "" { + return strings.TrimSpace(*info.EncryptedEnvPubkey) } - if r.KMSInfo != nil && strings.TrimSpace(r.KMSInfo.EncryptedEnvPubkey) != "" { - return strings.TrimSpace(r.KMSInfo.EncryptedEnvPubkey) + if info.KMSInfo != nil && info.KMSInfo.EncryptedEnvPubkey != nil && strings.TrimSpace(*info.KMSInfo.EncryptedEnvPubkey) != "" { + return strings.TrimSpace(*info.KMSInfo.EncryptedEnvPubkey) } return "" } -func (r cvmAPIResponse) osImageName() string { - if r.OS != nil && strings.TrimSpace(r.OS.Name) != "" { - return strings.TrimSpace(r.OS.Name) +func cvmInfoOSImageName(info *phala.CVMInfo) string { + if info.OS != nil && info.OS.Name != nil && strings.TrimSpace(*info.OS.Name) != "" { + return strings.TrimSpace(*info.OS.Name) } - if strings.TrimSpace(r.BaseImage) != "" { - return strings.TrimSpace(r.BaseImage) + if info.BaseImage != nil && strings.TrimSpace(*info.BaseImage) != "" { + return strings.TrimSpace(*info.BaseImage) } return "" } -func (r cvmAPIResponse) inProgress() bool { - return r.InProgress || (r.Progress != nil && strings.TrimSpace(r.Progress.Target) != "") +func cvmInfoInProgress(info *phala.CVMInfo) bool { + return info.InProgress || (info.Progress != nil && info.Progress.Target != nil && strings.TrimSpace(*info.Progress.Target) != "") } -func (r cvmAPIResponse) instanceType() string { - if r.Resource != nil && strings.TrimSpace(r.Resource.InstanceType) != "" { - return r.Resource.InstanceType +func cvmInfoInstanceType(info *phala.CVMInfo) string { + if info.Resource.InstanceType != nil && strings.TrimSpace(*info.Resource.InstanceType) != "" { + return *info.Resource.InstanceType } - return r.InstanceType + return "" } -func (r cvmAPIResponse) region() string { - if r.NodeInfo != nil && strings.TrimSpace(r.NodeInfo.Region) != "" { - return r.NodeInfo.Region - } - if r.Node != nil && strings.TrimSpace(r.Node.RegionIdentifier) != "" { - return r.Node.RegionIdentifier +func cvmInfoRegion(info *phala.CVMInfo) string { + if info.NodeInfo != nil && info.NodeInfo.Region != nil && strings.TrimSpace(*info.NodeInfo.Region) != "" { + return *info.NodeInfo.Region } return "" } -func (r cvmAPIResponse) endpoint() string { - if len(r.Endpoints) > 0 && strings.TrimSpace(r.Endpoints[0].App) != "" { - return r.Endpoints[0].App +func cvmInfoEndpoint(info *phala.CVMInfo) string { + if len(info.Endpoints) > 0 && strings.TrimSpace(info.Endpoints[0].App) != "" { + return info.Endpoints[0].App } - if len(r.PublicURLs) > 0 && strings.TrimSpace(r.PublicURLs[0].App) != "" { - return r.PublicURLs[0].App + if len(info.PublicURLs) > 0 && strings.TrimSpace(info.PublicURLs[0].App) != "" { + return info.PublicURLs[0].App } return "" } -func (r cvmAPIResponse) publicLogsValue() *bool { - if r.ComposeFile != nil && r.ComposeFile.PublicLogs != nil { - return r.ComposeFile.PublicLogs - } - return r.PublicLogs +func cvmInfoPublicLogsValue(info *phala.CVMInfo) *bool { + return info.PublicLogs } -func (r cvmAPIResponse) publicSysinfoValue() *bool { - if r.ComposeFile != nil && r.ComposeFile.PublicSysinfo != nil { - return r.ComposeFile.PublicSysinfo - } - return r.PublicSysinfo +func cvmInfoPublicSysinfoValue(info *phala.CVMInfo) *bool { + return info.PublicSysinfo +} + +func cvmInfoPublicTCBInfoValue(info *phala.CVMInfo) *bool { + return info.PublicTcbinfo } -func (r cvmAPIResponse) publicTCBInfoValue() *bool { - if r.ComposeFile != nil && r.ComposeFile.PublicTCBInfo != nil { - return r.ComposeFile.PublicTCBInfo +func cvmInfoGatewayEnabledValue(info *phala.CVMInfo) *bool { + return info.GatewayEnabled +} + +func cvmInfoSecureTimeValue(info *phala.CVMInfo) *bool { + return info.SecureTime +} + +func cvmInfoStorageFSValue(info *phala.CVMInfo) string { + if info.StorageFS != nil && strings.TrimSpace(*info.StorageFS) != "" { + return *info.StorageFS } - return r.PublicTCBInfo + return "" } -func (r cvmAPIResponse) gatewayEnabledValue() *bool { - if r.ComposeFile != nil && r.ComposeFile.GatewayEnabled != nil { - return r.ComposeFile.GatewayEnabled +func cvmInfoVMUUID(info *phala.CVMInfo) string { + if info.VMUUID != nil { + return strings.TrimSpace(*info.VMUUID) } - return r.GatewayEnabled + return "" } -func (r cvmAPIResponse) secureTimeValue() *bool { - if r.ComposeFile != nil && r.ComposeFile.SecureTime != nil { - return r.ComposeFile.SecureTime +func cvmInfoAppID(info *phala.CVMInfo) string { + if info.AppID != nil { + return strings.TrimSpace(*info.AppID) } - return r.SecureTime + return "" } -func (r cvmAPIResponse) storageFSValue() string { - if r.ComposeFile != nil && strings.TrimSpace(r.ComposeFile.StorageFS) != "" { - return r.ComposeFile.StorageFS +func cvmInfoInstanceID(info *phala.CVMInfo) string { + if info.InstanceID != nil { + return strings.TrimSpace(*info.InstanceID) } - return r.StorageFS + return "" } // --------------------------------------------------------------------------- @@ -206,15 +132,15 @@ func cvmPath(id string) string { return "/cvms/" + url.PathEscape(id) } -func selectCVMIdentifier(resp cvmAPIResponse, provisionAppID string) string { - if id := resp.idString(); id != "" { +func selectCVMIdentifier(info *phala.CVMInfo, provisionAppID string) string { + if id := cvmInfoIDString(info); id != "" { return id } - if strings.TrimSpace(resp.VMUUID) != "" { - return resp.VMUUID + if vmUUID := cvmInfoVMUUID(info); vmUUID != "" { + return vmUUID } - if strings.TrimSpace(resp.AppID) != "" { - return ensureAppPrefix(resp.AppID) + if appID := cvmInfoAppID(info); appID != "" { + return ensureAppPrefix(appID) } if strings.TrimSpace(provisionAppID) != "" { return ensureAppPrefix(provisionAppID) @@ -242,7 +168,7 @@ func ensureAppPrefix(v string) string { func provisionAndApplyComposeFileUpdate( ctx context.Context, - client *APIClient, + client *phala.Client, cvmID string, provisionReq map[string]any, ) error { @@ -253,23 +179,30 @@ func provisionAndApplyComposeFileUpdate( return fmt.Errorf("compose update requires non-empty name") } - var provisionResp struct { - ComposeHash string `json:"compose_hash"` + // Convert map[string]any to the SDK type via JSON round-trip. + provisionBody, err := json.Marshal(provisionReq) + if err != nil { + return fmt.Errorf("marshal compose provision request: %w", err) + } + sdkReq := &phala.ProvisionComposeUpdateRequest{} + if err := json.Unmarshal(provisionBody, sdkReq); err != nil { + return fmt.Errorf("convert compose provision request: %w", err) } - if err := client.PostJSON(ctx, cvmPath(cvmID)+"/compose_file/provision", provisionReq, &provisionResp); err != nil { + resp, err := client.ProvisionCVMComposeFileUpdate(ctx, cvmID, sdkReq) + if err != nil { return err } - if strings.TrimSpace(provisionResp.ComposeHash) == "" { + if strings.TrimSpace(resp.ComposeHash) == "" { return fmt.Errorf("compose update provision did not return compose_hash") } - triggerReq := map[string]any{ - "compose_hash": provisionResp.ComposeHash, + commitReq := &phala.CommitComposeUpdateRequest{ + ComposeHash: resp.ComposeHash, } - if err := client.PatchJSON(ctx, cvmPath(cvmID)+"/compose_file", triggerReq, nil); err != nil { - return err + if updateEnvVars, ok := provisionReq["update_env_vars"].(bool); ok && updateEnvVars { + commitReq.UpdateEnvVars = &updateEnvVars } - return nil + return client.CommitCVMComposeFileUpdate(ctx, cvmID, commitReq) } // --------------------------------------------------------------------------- @@ -283,6 +216,20 @@ func nullableString(v string) types.String { return types.StringValue(v) } +func nullableBool(v *bool) types.Bool { + if v == nil { + return types.BoolNull() + } + return types.BoolValue(*v) +} + +func nullableStringPtr(v *string) types.String { + if v == nil || strings.TrimSpace(*v) == "" { + return types.StringNull() + } + return types.StringValue(strings.TrimSpace(*v)) +} + func waitTimeout(v types.Int64) time.Duration { if v.IsNull() || v.IsUnknown() || v.ValueInt64() <= 0 { return 10 * time.Minute @@ -393,8 +340,6 @@ func knownOptionalInt64(value types.Int64, fieldName string) (int64, bool, diag. // Provisioning identity helpers // --------------------------------------------------------------------------- -// provisionIdentity holds the resolved KMS and custom app identity values -// for a provision request. type provisionIdentity struct { KMSType string CustomAppID string @@ -603,12 +548,10 @@ func decodeEnvPublicKey(v string) ([]byte, error) { trimmed = strings.TrimPrefix(trimmed, "0x") trimmed = strings.TrimPrefix(trimmed, "0X") - // Newer API versions return a hex-encoded X25519 public key. if out, err := hex.DecodeString(trimmed); err == nil && len(out) == 32 { return out, nil } - // Backward compatibility for legacy base64 responses. if out, err := base64.StdEncoding.DecodeString(trimmed); err == nil { return out, nil } @@ -638,14 +581,14 @@ func normalizeTextBody(raw string) string { } func isNotFound(err error) bool { - apiErr, ok := err.(*APIError) + apiErr, ok := err.(*phala.APIError) return ok && apiErr.StatusCode == 404 } func isRetryable(err error) bool { - apiErr, ok := err.(*APIError) + apiErr, ok := err.(*phala.APIError) if !ok { return false } - return isRetryableStatus(apiErr.StatusCode) + return apiErr.IsRetryable() } diff --git a/internal/provider/data_source_account.go b/internal/provider/data_source_account.go index e4f8f1a..423aad7 100644 --- a/internal/provider/data_source_account.go +++ b/internal/provider/data_source_account.go @@ -3,6 +3,7 @@ package provider import ( "context" + phala "github.com/Phala-Network/phala-cloud/sdks/go" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/types" @@ -11,7 +12,7 @@ import ( var _ datasource.DataSource = &accountDataSource{} type accountDataSource struct { - client *APIClient + client *phala.Client } type accountDataSourceModel struct { @@ -115,11 +116,11 @@ func (d *accountDataSource) Configure(_ context.Context, req datasource.Configur return } - client, ok := req.ProviderData.(*APIClient) + client, ok := req.ProviderData.(*phala.Client) if !ok { resp.Diagnostics.AddError( "Unexpected provider data type", - "Expected *APIClient while configuring account data source.", + "Expected *phala.Client while configuring account data source.", ) return } @@ -128,7 +129,7 @@ func (d *accountDataSource) Configure(_ context.Context, req datasource.Configur } func (d *accountDataSource) Read(ctx context.Context, _ datasource.ReadRequest, resp *datasource.ReadResponse) { - me, err := fetchAuthMe(ctx, d.client) + me, err := d.client.GetCurrentUser(ctx) if err != nil { resp.Diagnostics.AddError("Failed to read account info", err.Error()) return @@ -145,18 +146,18 @@ func (d *accountDataSource) Read(ctx context.Context, _ datasource.ReadRequest, Avatar: nullableStringPtr(me.User.Avatar), EmailVerified: nullableBool(me.User.EmailVerified), - TotpEnabled: nullableBool(me.User.TotpEnabled), + TotpEnabled: nullableBool(me.User.TOTPEnabled), HasBackupCodes: nullableBool(me.User.HasBackupCodes), HasPassword: nullableBool(me.User.FlagHasPassword), WorkspaceID: nullableString(me.Workspace.ID), WorkspaceName: nullableString(me.Workspace.Name), - WorkspaceSlug: nullableString(me.Workspace.Slug), + WorkspaceSlug: nullableStringPtr(me.Workspace.Slug), WorkspaceTier: nullableString(me.Workspace.Tier), WorkspaceRole: nullableString(me.Workspace.Role), - CreditBalance: nullableString(me.Credits.Balance), - CreditGrantedBalance: nullableString(me.Credits.GrantedBalance), + CreditBalance: nullableStringPtr(me.Credits.Balance), + CreditGrantedBalance: nullableStringPtr(me.Credits.GrantedBalance), CreditIsPostPaid: nullableBool(me.Credits.IsPostPaid), CreditOutstandingAmount: nullableStringPtr(me.Credits.OutstandingAmount), } diff --git a/internal/provider/data_source_attestation.go b/internal/provider/data_source_attestation.go index e6c3abd..432dd4e 100644 --- a/internal/provider/data_source_attestation.go +++ b/internal/provider/data_source_attestation.go @@ -5,6 +5,7 @@ import ( "encoding/json" "strings" + phala "github.com/Phala-Network/phala-cloud/sdks/go" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/path" @@ -14,7 +15,7 @@ import ( var _ datasource.DataSource = &attestationDataSource{} type attestationDataSource struct { - client *APIClient + client *phala.Client } type attestationDataSourceModel struct { @@ -29,15 +30,6 @@ type attestationDataSourceModel struct { RawJSON types.String `tfsdk:"raw_json"` } -type attestationAPIResponse struct { - IsOnline bool `json:"is_online"` - IsPublic bool `json:"is_public"` - Error *string `json:"error"` - AppCertificates json.RawMessage `json:"app_certificates"` - TCBInfo json.RawMessage `json:"tcb_info"` - ComposeFile *string `json:"compose_file"` -} - func NewAttestationDataSource() datasource.DataSource { return &attestationDataSource{} } @@ -91,11 +83,11 @@ func (d *attestationDataSource) Configure(_ context.Context, req datasource.Conf return } - client, ok := req.ProviderData.(*APIClient) + client, ok := req.ProviderData.(*phala.Client) if !ok { resp.Diagnostics.AddError( "Unexpected provider data type", - "Expected *APIClient while configuring attestation data source.", + "Expected *phala.Client while configuring attestation data source.", ) return } @@ -129,33 +121,63 @@ func (d *attestationDataSource) Read(ctx context.Context, req datasource.ReadReq return } - var payload attestationAPIResponse - if err := d.client.GetJSON(ctx, cvmPath(cvmID)+"/attestation", &payload); err != nil { + attestation, err := d.client.GetCVMAttestation(ctx, cvmID) + if err != nil { resp.Diagnostics.AddError("Failed to fetch attestation", err.Error()) return } - state := attestationDataSourceModel{ - ID: types.StringValue(cvmID), - CVMID: types.StringValue(cvmID), - IsOnline: types.BoolValue(payload.IsOnline), - IsPublic: types.BoolValue(payload.IsPublic), - Error: nullableStringPtr(payload.Error), - ComposeFile: nullableStringPtr(payload.ComposeFile), - TCBInfoJSON: nullableJSON(payload.TCBInfo), - CertificatesJSON: nullableJSON(payload.AppCertificates), + // Marshal typed sub-fields to JSON strings for Terraform state. + tcbInfoJSON, err := marshalNullableToJSON(attestation.TCBInfo) + if err != nil { + resp.Diagnostics.AddError("Failed to encode tcb_info", err.Error()) + return + } + + certsJSON, err := marshalNullableToJSON(attestation.AppCertificates) + if err != nil { + resp.Diagnostics.AddError("Failed to encode app_certificates", err.Error()) + return } - rawJSON, err := json.Marshal(payload) + rawJSON, err := json.Marshal(attestation) if err != nil { resp.Diagnostics.AddError("Failed to encode attestation response", err.Error()) return } - state.RawJSON = types.StringValue(string(rawJSON)) + + state := attestationDataSourceModel{ + ID: types.StringValue(cvmID), + CVMID: types.StringValue(cvmID), + IsOnline: types.BoolValue(attestation.IsOnline), + IsPublic: types.BoolValue(attestation.IsPublic), + Error: nullableStringPtr(attestation.Error), + ComposeFile: nullableStringPtr(attestation.ComposeFile), + TCBInfoJSON: tcbInfoJSON, + CertificatesJSON: certsJSON, + RawJSON: types.StringValue(string(rawJSON)), + } resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) } +// marshalNullableToJSON marshals v to a JSON string. Returns types.StringNull() +// if v is nil or marshals to JSON null/empty. +func marshalNullableToJSON(v any) (types.String, error) { + if v == nil { + return types.StringNull(), nil + } + b, err := json.Marshal(v) + if err != nil { + return types.StringNull(), err + } + s := string(b) + if s == "null" || s == "" || s == "[]" { + return types.StringNull(), nil + } + return types.StringValue(s), nil +} + func nullableJSON(raw json.RawMessage) types.String { if len(raw) == 0 || string(raw) == "null" { return types.StringNull() diff --git a/internal/provider/data_source_images.go b/internal/provider/data_source_images.go index 297e25e..c599c16 100644 --- a/internal/provider/data_source_images.go +++ b/internal/provider/data_source_images.go @@ -2,10 +2,11 @@ package provider import ( "context" + "fmt" "sort" - "strconv" "strings" + phala "github.com/Phala-Network/phala-cloud/sdks/go" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/path" @@ -15,7 +16,7 @@ import ( var _ datasource.DataSource = &imagesDataSource{} type imagesDataSource struct { - client *APIClient + client *phala.Client } type imagesDataSourceModel struct { @@ -82,11 +83,11 @@ func (d *imagesDataSource) Configure(_ context.Context, req datasource.Configure return } - client, ok := req.ProviderData.(*APIClient) + client, ok := req.ProviderData.(*phala.Client) if !ok { resp.Diagnostics.AddError( "Unexpected provider data type", - "Expected *APIClient while configuring images data source.", + "Expected *phala.Client while configuring images data source.", ) return } @@ -111,26 +112,18 @@ func (d *imagesDataSource) Read(ctx context.Context, req datasource.ReadRequest, } regionFilter := strings.TrimSpace(stringFromTF(config.Region)) - var payload struct { - Nodes []struct { - RegionIdentifier string `json:"region_identifier"` - Images []struct { - Name string `json:"name"` - IsDev bool `json:"is_dev"` - Version []int64 `json:"version"` - OSImageHash *string `json:"os_image_hash"` - } `json:"images"` - } `json:"nodes"` - } - - if err := d.client.GetJSON(ctx, "/teepods/available", &payload); err != nil { + availability, err := d.client.GetAvailableNodes(ctx) + if err != nil { resp.Diagnostics.AddError("Failed to list images", err.Error()) return } aggregates := map[string]*imageAggregate{} - for _, node := range payload.Nodes { - region := strings.TrimSpace(node.RegionIdentifier) + for _, node := range availability.Nodes { + region := "" + if node.RegionIdentifier != nil { + region = strings.TrimSpace(*node.RegionIdentifier) + } if regionFilter != "" && !strings.EqualFold(region, regionFilter) { continue } @@ -145,7 +138,7 @@ func (d *imagesDataSource) Read(ctx context.Context, req datasource.ReadRequest, if !exists { agg = &imageAggregate{ Name: slug, - Version: formatVersionTuple(image.Version), + Version: formatVersionFromAny(image.Version), IsDev: image.IsDev, OSImageHash: stringValueOrEmpty(image.OSImageHash), Regions: map[string]struct{}{}, @@ -154,7 +147,7 @@ func (d *imagesDataSource) Read(ctx context.Context, req datasource.ReadRequest, } if agg.Version == "" { - agg.Version = formatVersionTuple(image.Version) + agg.Version = formatVersionFromAny(image.Version) } if agg.OSImageHash == "" { agg.OSImageHash = stringValueOrEmpty(image.OSImageHash) @@ -201,16 +194,28 @@ func (d *imagesDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp.Diagnostics.Append(resp.State.Set(ctx, &config)...) } -func formatVersionTuple(version []int64) string { - if len(version) == 0 { +// formatVersionFromAny formats the version field from an AvailableImage. +// The SDK uses `any` for this field — it may be a []any of numbers or a string. +func formatVersionFromAny(version any) string { + if version == nil { return "" } - - parts := make([]string, 0, len(version)) - for _, v := range version { - parts = append(parts, strconv.FormatInt(v, 10)) + switch v := version.(type) { + case string: + return strings.TrimSpace(v) + case []any: + parts := make([]string, 0, len(v)) + for _, elem := range v { + parts = append(parts, fmt.Sprintf("%v", elem)) + } + return strings.Join(parts, ".") + default: + s := strings.TrimSpace(fmt.Sprintf("%v", v)) + if s == "" || s == "[]" { + return "" + } + return s } - return strings.Join(parts, ".") } func stringValueOrEmpty(v *string) string { diff --git a/internal/provider/data_source_nodes.go b/internal/provider/data_source_nodes.go index 13325bf..9d23eb6 100644 --- a/internal/provider/data_source_nodes.go +++ b/internal/provider/data_source_nodes.go @@ -5,6 +5,7 @@ import ( "sort" "strings" + phala "github.com/Phala-Network/phala-cloud/sdks/go" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/path" @@ -14,7 +15,7 @@ import ( var _ datasource.DataSource = &nodesDataSource{} type nodesDataSource struct { - client *APIClient + client *phala.Client } type nodesDataSourceModel struct { @@ -90,11 +91,11 @@ func (d *nodesDataSource) Configure(_ context.Context, req datasource.ConfigureR return } - client, ok := req.ProviderData.(*APIClient) + client, ok := req.ProviderData.(*phala.Client) if !ok { resp.Diagnostics.AddError( "Unexpected provider data type", - "Expected *APIClient while configuring nodes data source.", + "Expected *phala.Client while configuring nodes data source.", ) return } @@ -133,47 +134,23 @@ func (d *nodesDataSource) Read(ctx context.Context, req datasource.ReadRequest, wantOnchain = config.SupportOnchainKMS.ValueBool() } - var payload struct { - Nodes []struct { - TeepodID *int64 `json:"teepod_id"` - ID *int64 `json:"id"` - Name string `json:"name"` - Listed *bool `json:"listed"` - ResourceScore *float64 `json:"resource_score"` - RemainingVCPU *float64 `json:"remaining_vcpu"` - RemainingMemory *float64 `json:"remaining_memory"` - RemainingCVMSlots *float64 `json:"remaining_cvm_slots"` - RegionIdentifier string `json:"region_identifier"` - SupportOnchainKMS *bool `json:"support_onchain_kms"` - FMSPC *string `json:"fmspc"` - DeviceID *string `json:"device_id"` - Images []struct { - Name string `json:"name"` - } `json:"images"` - } `json:"nodes"` - } - - if err := d.client.GetJSON(ctx, "/teepods/available", &payload); err != nil { + availability, err := d.client.GetAvailableNodes(ctx) + if err != nil { resp.Diagnostics.AddError("Failed to list nodes", err.Error()) return } - rows := make([]nodeDataSourceRow, 0, len(payload.Nodes)) - for _, node := range payload.Nodes { - nodeID := int64(0) - switch { - case node.TeepodID != nil: - nodeID = *node.TeepodID - case node.ID != nil: - nodeID = *node.ID - default: - continue - } + rows := make([]nodeDataSourceRow, 0, len(availability.Nodes)) + for _, node := range availability.Nodes { + nodeID := int64(node.TeepodID) if nodeID <= 0 { continue } - region := strings.TrimSpace(node.RegionIdentifier) + region := "" + if node.RegionIdentifier != nil { + region = strings.TrimSpace(*node.RegionIdentifier) + } if regionFilter != "" && !strings.EqualFold(region, regionFilter) { continue } @@ -203,12 +180,12 @@ func (d *nodesDataSource) Read(ctx context.Context, req datasource.ReadRequest, NodeID: types.Int64Value(nodeID), Name: nullableString(node.Name), Region: nullableString(region), - Listed: types.BoolValue(node.Listed != nil && *node.Listed), + Listed: types.BoolValue(node.Listed), SupportOnchainKMS: types.BoolValue(onchain), - ResourceScore: nullableFloat64(node.ResourceScore), - RemainingVCPU: nullableFloat64(node.RemainingVCPU), - RemainingMemoryMB: nullableFloat64(node.RemainingMemory), - RemainingCVMSlots: nullableFloat64(node.RemainingCVMSlots), + ResourceScore: nullableFloat64Val(node.ResourceScore), + RemainingVCPU: nullableFloat64Val(node.RemainingVCPU), + RemainingMemoryMB: nullableFloat64Val(node.RemainingMemory), + RemainingCVMSlots: nullableFloat64Val(node.RemainingCVMSlots), FMSPC: nullableStringPtr(node.FMSPC), DeviceID: nullableStringPtr(node.DeviceID), Images: images, @@ -223,6 +200,13 @@ func (d *nodesDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp.Diagnostics.Append(resp.State.Set(ctx, &config)...) } +// nullableFloat64Val wraps a plain float64 value (from the SDK's non-pointer fields). +// Returns types.Float64Null() when the value is zero, preserving the original +// semantics where zero means "not provided / unknown". +func nullableFloat64Val(v float64) types.Float64 { + return types.Float64Value(v) +} + func nullableFloat64(v *float64) types.Float64 { if v == nil { return types.Float64Null() diff --git a/internal/provider/data_source_regions.go b/internal/provider/data_source_regions.go index 5655de6..7d22514 100644 --- a/internal/provider/data_source_regions.go +++ b/internal/provider/data_source_regions.go @@ -2,9 +2,11 @@ package provider import ( "context" + "encoding/json" "sort" "strings" + phala "github.com/Phala-Network/phala-cloud/sdks/go" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/types" @@ -13,7 +15,7 @@ import ( var _ datasource.DataSource = ®ionsDataSource{} type regionsDataSource struct { - client *APIClient + client *phala.Client } type regionsDataSourceModel struct { @@ -58,11 +60,11 @@ func (d *regionsDataSource) Configure(_ context.Context, req datasource.Configur return } - client, ok := req.ProviderData.(*APIClient) + client, ok := req.ProviderData.(*phala.Client) if !ok { resp.Diagnostics.AddError( "Unexpected provider data type", - "Expected *APIClient while configuring regions data source.", + "Expected *phala.Client while configuring regions data source.", ) return } @@ -74,18 +76,31 @@ func (d *regionsDataSource) Read(ctx context.Context, _ datasource.ReadRequest, regions := map[string]bool{} loaded := false - var filters struct { - Regions []string `json:"regions"` - } - if err := d.client.GetJSON(ctx, "/apps/filter-options", &filters); err == nil { - for _, region := range filters.Regions { - key := strings.TrimSpace(region) - if key == "" { - continue + // GetAppFilterOptions returns map[string]any — decode the "regions" key manually. + filterOpts, err := d.client.GetAppFilterOptions(ctx) + if err == nil { + encoded, jsonErr := json.Marshal(filterOpts) + if jsonErr == nil { + var filters struct { + Regions []string `json:"regions"` + } + if jsonErr = json.Unmarshal(encoded, &filters); jsonErr == nil { + for _, region := range filters.Regions { + key := strings.TrimSpace(region) + if key == "" { + continue + } + regions[key] = false + } + loaded = true } - regions[key] = false } - loaded = true + if !loaded { + resp.Diagnostics.AddWarning( + "Could not decode filter-options regions", + "Unexpected response shape from /apps/filter-options.", + ) + } } else { resp.Diagnostics.AddWarning( "Could not read filter-options regions", @@ -93,14 +108,14 @@ func (d *regionsDataSource) Read(ctx context.Context, _ datasource.ReadRequest, ) } - var availability struct { - Nodes []struct { - RegionIdentifier string `json:"region_identifier"` - } `json:"nodes"` - } - if err := d.client.GetJSON(ctx, "/teepods/available", &availability); err == nil { + // GetAvailableNodes returns typed *phala.AvailableNodes. + availability, err := d.client.GetAvailableNodes(ctx) + if err == nil { for _, node := range availability.Nodes { - region := strings.TrimSpace(node.RegionIdentifier) + if node.RegionIdentifier == nil { + continue + } + region := strings.TrimSpace(*node.RegionIdentifier) if region == "" { continue } diff --git a/internal/provider/data_source_sizes.go b/internal/provider/data_source_sizes.go index 530326d..b94d714 100644 --- a/internal/provider/data_source_sizes.go +++ b/internal/provider/data_source_sizes.go @@ -2,9 +2,11 @@ package provider import ( "context" + "encoding/json" "sort" "strings" + phala "github.com/Phala-Network/phala-cloud/sdks/go" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/path" @@ -14,7 +16,7 @@ import ( var _ datasource.DataSource = &sizesDataSource{} type sizesDataSource struct { - client *APIClient + client *phala.Client } type sizesDataSourceModel struct { @@ -76,11 +78,11 @@ func (d *sizesDataSource) Configure(_ context.Context, req datasource.ConfigureR return } - client, ok := req.ProviderData.(*APIClient) + client, ok := req.ProviderData.(*phala.Client) if !ok { resp.Diagnostics.AddError( "Unexpected provider data type", - "Expected *APIClient while configuring sizes data source.", + "Expected *phala.Client while configuring sizes data source.", ) return } @@ -104,6 +106,20 @@ func (d *sizesDataSource) Read(ctx context.Context, req datasource.ReadRequest, return } + // SDK returns map[string]any — re-encode to JSON and decode into the + // local struct that matches the expected API shape. + raw, err := d.client.ListAllInstanceTypeFamilies(ctx) + if err != nil { + resp.Diagnostics.AddError("Failed to list sizes", err.Error()) + return + } + + encoded, err := json.Marshal(raw) + if err != nil { + resp.Diagnostics.AddError("Failed to encode instance types response", err.Error()) + return + } + var payload struct { Result []struct { Name string `json:"name"` @@ -121,8 +137,8 @@ func (d *sizesDataSource) Read(ctx context.Context, req datasource.ReadRequest, } `json:"result"` } - if err := d.client.GetJSON(ctx, "/instance-types", &payload); err != nil { - resp.Diagnostics.AddError("Failed to list sizes", err.Error()) + if err := json.Unmarshal(encoded, &payload); err != nil { + resp.Diagnostics.AddError("Failed to decode instance types response", err.Error()) return } diff --git a/internal/provider/data_source_workspace.go b/internal/provider/data_source_workspace.go index 76621b3..aa46413 100644 --- a/internal/provider/data_source_workspace.go +++ b/internal/provider/data_source_workspace.go @@ -4,6 +4,7 @@ import ( "context" "strings" + phala "github.com/Phala-Network/phala-cloud/sdks/go" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/types" @@ -12,7 +13,7 @@ import ( var _ datasource.DataSource = &workspaceDataSource{} type workspaceDataSource struct { - client *APIClient + client *phala.Client } type workspaceDataSourceModel struct { @@ -65,11 +66,11 @@ func (d *workspaceDataSource) Configure(_ context.Context, req datasource.Config return } - client, ok := req.ProviderData.(*APIClient) + client, ok := req.ProviderData.(*phala.Client) if !ok { resp.Diagnostics.AddError( "Unexpected provider data type", - "Expected *APIClient while configuring workspace data source.", + "Expected *phala.Client while configuring workspace data source.", ) return } @@ -78,7 +79,7 @@ func (d *workspaceDataSource) Configure(_ context.Context, req datasource.Config } func (d *workspaceDataSource) Read(ctx context.Context, _ datasource.ReadRequest, resp *datasource.ReadResponse) { - me, err := fetchAuthMe(ctx, d.client) + me, err := d.client.GetCurrentUser(ctx) if err != nil { resp.Diagnostics.AddError("Failed to read workspace info", err.Error()) return @@ -94,7 +95,7 @@ func (d *workspaceDataSource) Read(ctx context.Context, _ datasource.ReadRequest state := workspaceDataSourceModel{ ID: types.StringValue(wsID), Name: nullableString(me.Workspace.Name), - Slug: nullableString(me.Workspace.Slug), + Slug: nullableStringPtr(me.Workspace.Slug), Tier: nullableString(me.Workspace.Tier), Role: nullableString(me.Workspace.Role), Avatar: nullableStringPtr(me.Workspace.Avatar), diff --git a/internal/provider/provider.go b/internal/provider/provider.go index b9ad7e7..c2afb6b 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -3,8 +3,10 @@ package provider import ( "context" "os" + "strings" "time" + phala "github.com/Phala-Network/phala-cloud/sdks/go" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/provider" @@ -118,7 +120,17 @@ func (p *phalaProvider) Configure(ctx context.Context, req provider.ConfigureReq } } - client := NewAPIClient(apiPrefix, apiKey, apiVersion, time.Duration(timeoutSec)*time.Second) + client, err := phala.NewClient( + phala.WithBaseURL(apiPrefix), + phala.WithAPIKey(apiKey), + phala.WithAPIVersion(apiVersion), + phala.WithTimeout(time.Duration(timeoutSec)*time.Second), + ) + if err != nil { + resp.Diagnostics.AddError("Failed to create API client", err.Error()) + return + } + resp.DataSourceData = client resp.ResourceData = client } @@ -149,3 +161,13 @@ func stringFromTF(v types.String) string { } return v.ValueString() } + +func nonEmpty(values ...string) string { + for _, v := range values { + if strings.TrimSpace(v) != "" { + return v + } + } + return "" +} + diff --git a/internal/provider/resource_app.go b/internal/provider/resource_app.go index f4df1c0..6a512c9 100644 --- a/internal/provider/resource_app.go +++ b/internal/provider/resource_app.go @@ -10,6 +10,7 @@ import ( "strings" "time" + phala "github.com/Phala-Network/phala-cloud/sdks/go" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" @@ -24,7 +25,7 @@ var _ resource.Resource = &appResource{} var _ resource.ResourceWithImportState = &appResource{} type appResource struct { - client *APIClient + client *phala.Client } type appResourceModel struct { @@ -63,18 +64,10 @@ type appResourceModel struct { Endpoint types.String `tfsdk:"endpoint"` } -type appAPIResponse struct { - ID json.RawMessage `json:"id"` - Name string `json:"name"` - AppID string `json:"app_id"` - CurrentCVM *cvmAPIResponse `json:"current_cvm"` - CVMs []cvmAPIResponse `json:"cvms"` - CVMCount *int64 `json:"cvm_count"` -} - +// appFetchResult holds the results of fetching app and CVM data. type appFetchResult struct { - App *appAPIResponse - CVMs []cvmAPIResponse + App *phala.AppInfo + CVMs []phala.CVMInfo ReplicaListWarning error } @@ -131,7 +124,7 @@ func (r *appResource) Configure(_ context.Context, req resource.ConfigureRequest if req.ProviderData == nil { return } - if client, ok := req.ProviderData.(*APIClient); ok { + if client, ok := req.ProviderData.(*phala.Client); ok { r.client = client } } @@ -204,8 +197,8 @@ func (r *appResource) Create(ctx context.Context, req resource.CreateRequest, re return } - var provResp provisionResponse - if err := r.client.PostJSON(ctx, "/cvms/provision", provReq, &provResp); err != nil { + provResp, err := r.client.ProvisionCVM(ctx, provReq) + if err != nil { resp.Diagnostics.AddError("Failed to provision app", err.Error()) return } @@ -375,14 +368,18 @@ func (r *appResource) Update(ctx context.Context, req resource.UpdateRequest, re } if !plan.Size.Equal(state.Size) || diskSizeChanged { - resourceReq := map[string]any{"allow_restart": true} + resReq := &phala.UpdateResourcesRequest{ + AllowRestart: boolPtr(true), + } if !plan.Size.Equal(state.Size) { - resourceReq["instance_type"] = plan.Size.ValueString() + s := plan.Size.ValueString() + resReq.InstanceType = &s } if diskSizeChanged { - resourceReq["disk_size"] = plan.DiskSize.ValueInt64() + ds := int(plan.DiskSize.ValueInt64()) + resReq.DiskSize = &ds } - if err := r.client.PatchJSON(ctx, cvmPath(primaryCVMID)+"/resources", resourceReq, nil); err != nil { + if err := r.client.UpdateCVMResources(ctx, primaryCVMID, resReq); err != nil { resp.Diagnostics.AddError("Failed to update app resources", err.Error()) return } @@ -420,7 +417,7 @@ func (r *appResource) Update(ctx context.Context, req resource.UpdateRequest, re } if !plan.DockerCompose.Equal(state.DockerCompose) { - if err := r.patchTextAcrossReplicas(ctx, cvms, primaryCVMID, "/docker-compose", plan.DockerCompose.ValueString(), map[string]string{"Content-Type": "text/yaml"}); err != nil { + if err := r.patchDockerComposeAcrossReplicas(ctx, cvms, primaryCVMID, plan.DockerCompose.ValueString()); err != nil { resp.Diagnostics.AddError("Failed to update app docker compose", err.Error()) return } @@ -431,7 +428,7 @@ func (r *appResource) Update(ctx context.Context, req resource.UpdateRequest, re if !plan.PreLaunchScript.IsNull() && !plan.PreLaunchScript.IsUnknown() { script = plan.PreLaunchScript.ValueString() } - if err := r.patchTextAcrossReplicas(ctx, cvms, primaryCVMID, "/pre-launch-script", script, map[string]string{"Content-Type": "text/plain"}); err != nil { + if err := r.patchPreLaunchScriptAcrossReplicas(ctx, cvms, primaryCVMID, script); err != nil { resp.Diagnostics.AddError("Failed to update app pre-launch script", err.Error()) return } @@ -448,7 +445,7 @@ func (r *appResource) Update(ctx context.Context, req resource.UpdateRequest, re resp.Diagnostics.AddError("Failed to load app encryption key", err.Error()) return } - pubkey := current.envEncryptionPubkey() + pubkey := cvmInfoEnvEncryptionPubkey(current) if pubkey == "" { resp.Diagnostics.AddError("Missing encryption public key", "Primary CVM response did not include encrypted_env_pubkey. Use manual encrypted_env/env_keys mode.") return @@ -463,8 +460,9 @@ func (r *appResource) Update(ctx context.Context, req resource.UpdateRequest, re resp.Diagnostics.AddError("Missing encrypted_env", err.Error()) return } - if err := r.patchJSONAcrossReplicas(ctx, cvms, primaryCVMID, "/envs", envReq); err != nil { - if apiErr, ok := err.(*APIError); ok && apiErr.StatusCode == 465 { + if err := r.patchEnvsAcrossReplicas(ctx, cvms, primaryCVMID, envReq); err != nil { + apiErr, ok := err.(*phala.APIError) + if ok && apiErr.StatusCode == 465 { resp.Diagnostics.AddError( "Encrypted env update requires on-chain verification", "API returned HTTP 465 (compose hash registration required). Register compose_hash on-chain and retry with env_compose_hash and env_transaction_hash.", @@ -538,7 +536,7 @@ func (r *appResource) Delete(ctx context.Context, req resource.DeleteRequest, re if identifier == "" { continue } - if err := r.client.Delete(ctx, cvmPath(identifier)); err != nil && !isNotFound(err) { + if err := r.client.DeleteCVM(ctx, identifier); err != nil && !isNotFound(err) { resp.Diagnostics.AddError("Failed to delete app replica", err.Error()) return } @@ -573,8 +571,8 @@ func (r *appResource) ImportState( } func (r *appResource) fetchAppAndCVMs(ctx context.Context, appID string) (*appFetchResult, error) { - app := &appAPIResponse{} - if err := r.client.GetJSON(ctx, appPath(appID), app); err != nil { + app, err := r.client.GetAppInfo(ctx, appIDWithoutPrefix(appID)) + if err != nil { return nil, err } if strings.TrimSpace(app.AppID) == "" { @@ -601,24 +599,21 @@ func (r *appResource) fetchAppAndCVMs(ctx context.Context, appID string) (*appFe }, nil } -func (r *appResource) fetchAppCVMs(ctx context.Context, appID string) ([]cvmAPIResponse, error) { - var rawItems []map[string]any - if err := r.client.GetJSON(ctx, appPath(appID)+"/cvms", &rawItems); err != nil { +func (r *appResource) fetchAppCVMs(ctx context.Context, appID string) ([]phala.CVMInfo, error) { + rawItems, err := r.client.GetAppCVMs(ctx, appIDWithoutPrefix(appID)) + if err != nil { return nil, err } - items := make([]cvmAPIResponse, 0, len(rawItems)) + items := make([]phala.CVMInfo, 0, len(rawItems)) for _, raw := range rawItems { - items = append(items, normalizeCVMFromAny(raw)) + cvm := normalizeCVMFromAny(raw) + items = append(items, cvm) } return normalizeCVMInfos(items), nil } -func (r *appResource) fetchCVM(ctx context.Context, id string) (*cvmAPIResponse, error) { - var out cvmAPIResponse - if err := r.client.GetJSON(ctx, cvmPath(id), &out); err != nil { - return nil, err - } - return &out, nil +func (r *appResource) fetchCVM(ctx context.Context, id string) (*phala.CVMInfo, error) { + return r.client.GetCVMInfo(ctx, id) } func (r *appResource) reconcileReplicas( @@ -641,10 +636,12 @@ func (r *appResource) reconcileReplicas( if len(cvms) == 0 { if strings.TrimSpace(preferredSourceVMUUID) != "" { // Freshly created apps may not immediately show CVMs in list endpoint. - cvms = append(cvms, cvmAPIResponse{ - VMUUID: strings.TrimSpace(preferredSourceVMUUID), + placeholder := phala.CVMInfo{ Status: "starting", - }) + } + vmuuid := strings.TrimSpace(preferredSourceVMUUID) + placeholder.VMUUID = &vmuuid + cvms = append(cvms, placeholder) } else { for time.Now().Before(deadline) { cvms, err = r.fetchAppCVMs(ctx, appID) @@ -685,7 +682,9 @@ func (r *appResource) reconcileReplicas( } replicatePath := appPath(appID) + "/cvms/" + url.PathEscape(source) + "/replicas" - if err := r.client.PostJSON(ctx, replicatePath, map[string]any{}, nil); err != nil { + _ = replicatePath + // Use the SDK's ReplicateCVM method which sends POST /cvms/{id}/replicas. + if _, err := r.client.ReplicateCVM(ctx, source, &phala.ReplicateCVMOptions{}); err != nil { return err } @@ -709,7 +708,7 @@ func (r *appResource) reconcileReplicas( return fmt.Errorf("unable to determine removable replica for app %q", appID) } - if err := r.client.Delete(ctx, cvmPath(removable)); err != nil && !isNotFound(err) { + if err := r.client.DeleteCVM(ctx, removable); err != nil && !isNotFound(err) { return err } @@ -812,7 +811,7 @@ func (r *appResource) waitForAppReady(ctx context.Context, appID string, replica allRunning := true for _, cvm := range cvms { - if !strings.EqualFold(strings.TrimSpace(cvm.Status), "running") || cvm.inProgress() { + if !strings.EqualFold(strings.TrimSpace(cvm.Status), "running") || cvmInfoInProgress(&cvm) { allRunning = false break } @@ -830,10 +829,11 @@ func (r *appResource) waitForAppReady(ctx context.Context, appID string, replica return fmt.Errorf("timeout after %s waiting for app %q replicas to become running", timeout, appID) } -func stoppedReplicaFailure(cvms []cvmAPIResponse) (bool, string) { +func stoppedReplicaFailure(cvms []phala.CVMInfo) (bool, string) { failures := make([]string, 0, len(cvms)) - for _, cvm := range cvms { - if stablePowerState(cvm.Status) != "stopped" || cvm.inProgress() { + for i := range cvms { + cvm := &cvms[i] + if stablePowerState(cvm.Status) != "stopped" || cvmInfoInProgress(cvm) { continue } failures = append(failures, describeReplicaState(cvm)) @@ -845,13 +845,13 @@ func stoppedReplicaFailure(cvms []cvmAPIResponse) (bool, string) { return true, "replica entered terminal stopped state: " + strings.Join(failures, ", ") } -func describeReplicaState(cvm cvmAPIResponse) string { - id := strings.TrimSpace(cvm.VMUUID) +func describeReplicaState(cvm *phala.CVMInfo) string { + id := cvmInfoVMUUID(cvm) if id == "" { - id = strings.TrimSpace(cvm.InstanceID) + id = cvmInfoInstanceID(cvm) } if id == "" { - id = cvm.idString() + id = cvmInfoIDString(cvm) } if id == "" { id = "" @@ -862,8 +862,8 @@ func describeReplicaState(cvm cvmAPIResponse) string { status = "unknown" } - if cvm.Progress != nil && strings.TrimSpace(cvm.Progress.Target) != "" { - return fmt.Sprintf("%s(status=%s,target=%s)", id, status, strings.TrimSpace(cvm.Progress.Target)) + if cvm.Progress != nil && cvm.Progress.Target != nil && strings.TrimSpace(*cvm.Progress.Target) != "" { + return fmt.Sprintf("%s(status=%s,target=%s)", id, status, strings.TrimSpace(*cvm.Progress.Target)) } return fmt.Sprintf("%s(status=%s)", id, status) } @@ -871,8 +871,8 @@ func describeReplicaState(cvm cvmAPIResponse) string { func (r *appResource) populateState( ctx context.Context, state *appResourceModel, - app *appAPIResponse, - cvms []cvmAPIResponse, + app *phala.AppInfo, + cvms []phala.CVMInfo, ) diag.Diagnostics { var diags diag.Diagnostics @@ -889,7 +889,7 @@ func (r *appResource) populateState( } } - appID := ensureAppPrefix(nonEmpty(app.AppID, stringFromRawJSON(app.ID), state.ID.ValueString())) + appID := ensureAppPrefix(nonEmpty(app.AppID, app.ID, state.ID.ValueString())) if appID != "" { state.ID = types.StringValue(appID) state.AppID = types.StringValue(appID) @@ -908,36 +908,60 @@ func (r *appResource) populateState( } } - if v := primary.instanceType(); v != "" { + if v := cvmInfoInstanceType(primary); v != "" { state.Size = types.StringValue(v) } if primary.DiskSize != nil { state.DiskSize = types.Int64Value(*primary.DiskSize) } - if primary.Resource != nil && primary.Resource.DiskInGB != nil { - state.DiskSize = types.Int64Value(*primary.Resource.DiskInGB) + if primary.Resource.DiskInGB != nil { + state.DiskSize = types.Int64Value(int64(*primary.Resource.DiskInGB)) } - if region := primary.region(); region != "" { + if region := cvmInfoRegion(primary); region != "" { state.Region = types.StringValue(region) } - if image := primary.osImageName(); image != "" { + if image := cvmInfoOSImageName(primary); image != "" { state.Image = types.StringValue(image) } - state.PublicLogs = nullableBool(primary.publicLogsValue()) - state.PublicSysinfo = nullableBool(primary.publicSysinfoValue()) - state.PublicTCBInfo = nullableBool(primary.publicTCBInfoValue()) - state.GatewayEnabled = nullableBool(primary.gatewayEnabledValue()) - state.SecureTime = nullableBool(primary.secureTimeValue()) - state.StorageFS = nullableString(primary.storageFSValue()) - state.Status = nullableString(primary.Status) - state.Endpoint = nullableString(primary.endpoint()) - if primary.Listed != nil { - state.Listed = types.BoolValue(*primary.Listed) + + // Prefer compose_file sub-fields over top-level CVM fields for settings. + publicLogs := cvmInfoPublicLogsValue(primary) + publicSysinfo := cvmInfoPublicSysinfoValue(primary) + publicTCBInfo := cvmInfoPublicTCBInfoValue(primary) + storageFSVal := cvmInfoStorageFSValue(primary) + if cf, ok := composeFileFromCVMInfo(primary); ok { + if v, ok := cf["public_logs"].(*bool); ok && v != nil { + publicLogs = v + } else if v, ok := cf["public_logs"].(bool); ok { + publicLogs = &v + } + if v, ok := cf["public_sysinfo"].(*bool); ok && v != nil { + publicSysinfo = v + } else if v, ok := cf["public_sysinfo"].(bool); ok { + publicSysinfo = &v + } + if v, ok := cf["public_tcbinfo"].(*bool); ok && v != nil { + publicTCBInfo = v + } else if v, ok := cf["public_tcbinfo"].(bool); ok { + publicTCBInfo = &v + } + if v, ok := cf["storage_fs"].(string); ok && strings.TrimSpace(v) != "" { + storageFSVal = strings.TrimSpace(v) + } } + state.PublicLogs = nullableBool(publicLogs) + state.PublicSysinfo = nullableBool(publicSysinfo) + state.PublicTCBInfo = nullableBool(publicTCBInfo) + state.GatewayEnabled = nullableBool(cvmInfoGatewayEnabledValue(primary)) + state.SecureTime = nullableBool(cvmInfoSecureTimeValue(primary)) + state.StorageFS = nullableString(storageFSVal) + state.Status = nullableString(primary.Status) + state.Endpoint = nullableString(cvmInfoEndpoint(primary)) + state.Listed = types.BoolValue(primary.Listed) if primaryID != "" { state.PrimaryCVMID = types.StringValue(primaryID) if state.DockerCompose.IsNull() || state.DockerCompose.IsUnknown() { - compose, err := r.client.GetText(ctx, cvmPath(primaryID)+"/docker-compose.yml") + compose, err := r.client.GetCVMDockerCompose(ctx, primaryID) if err == nil { state.DockerCompose = types.StringValue(normalizeTextBody(compose)) } @@ -946,7 +970,7 @@ func (r *appResource) populateState( // did not set pre_launch_script. Keep null/unknown state null so an // optional unmanaged field does not become provider-managed drift. if !state.PreLaunchScript.IsNull() && !state.PreLaunchScript.IsUnknown() { - preLaunchScript, err := r.client.GetText(ctx, cvmPath(primaryID)+"/pre-launch-script") + preLaunchScript, err := r.client.GetCVMPreLaunchScript(ctx, primaryID) if err == nil { state.PreLaunchScript = nullableString(normalizeTextBody(preLaunchScript)) } @@ -1062,7 +1086,7 @@ func appIDFromState(state appResourceModel) string { return "" } -func selectPrimaryIdentifier(planPrimary, statePrimary types.String, cvms []cvmAPIResponse) string { +func selectPrimaryIdentifier(planPrimary, statePrimary types.String, cvms []phala.CVMInfo) string { if !planPrimary.IsNull() && !planPrimary.IsUnknown() && strings.TrimSpace(planPrimary.ValueString()) != "" { return planPrimary.ValueString() } @@ -1076,10 +1100,10 @@ func selectPrimaryIdentifier(planPrimary, statePrimary types.String, cvms []cvmA return selectReplicaIdentifier(*primary) } -func selectPrimaryCVM(cvms []cvmAPIResponse, preferredSourceVMUUID string) *cvmAPIResponse { +func selectPrimaryCVM(cvms []phala.CVMInfo, preferredSourceVMUUID string) *phala.CVMInfo { if preferredSourceVMUUID != "" { for i := range cvms { - if strings.EqualFold(strings.TrimSpace(cvms[i].VMUUID), strings.TrimSpace(preferredSourceVMUUID)) { + if strings.EqualFold(cvmInfoVMUUID(&cvms[i]), strings.TrimSpace(preferredSourceVMUUID)) { return &cvms[i] } } @@ -1095,44 +1119,45 @@ func selectPrimaryCVM(cvms []cvmAPIResponse, preferredSourceVMUUID string) *cvmA return &cvms[0] } -func selectReplicaIdentifier(cvm cvmAPIResponse) string { - if strings.TrimSpace(cvm.VMUUID) != "" { - return strings.TrimSpace(cvm.VMUUID) +func selectReplicaIdentifier(cvm phala.CVMInfo) string { + if v := cvmInfoVMUUID(&cvm); v != "" { + return v } - if id := cvm.idString(); strings.TrimSpace(id) != "" { - return strings.TrimSpace(id) + if v := cvmInfoIDString(&cvm); v != "" { + return v } - if strings.TrimSpace(cvm.InstanceID) != "" { - return strings.TrimSpace(cvm.InstanceID) + if v := cvmInfoInstanceID(&cvm); v != "" { + return v } return "" } -func selectReplicaSource(cvms []cvmAPIResponse, preferredSourceVMUUID string) string { +func selectReplicaSource(cvms []phala.CVMInfo, preferredSourceVMUUID string) string { if preferredSourceVMUUID != "" { for _, cvm := range cvms { - if strings.EqualFold(strings.TrimSpace(cvm.VMUUID), strings.TrimSpace(preferredSourceVMUUID)) { - return strings.TrimSpace(cvm.VMUUID) + if strings.EqualFold(cvmInfoVMUUID(&cvm), strings.TrimSpace(preferredSourceVMUUID)) { + return cvmInfoVMUUID(&cvm) } } } for _, cvm := range cvms { - if strings.TrimSpace(cvm.VMUUID) != "" && strings.EqualFold(strings.TrimSpace(cvm.Status), "running") { - return strings.TrimSpace(cvm.VMUUID) + uuid := cvmInfoVMUUID(&cvm) + if uuid != "" && strings.EqualFold(strings.TrimSpace(cvm.Status), "running") { + return uuid } } for _, cvm := range cvms { - if strings.TrimSpace(cvm.VMUUID) != "" { - return strings.TrimSpace(cvm.VMUUID) + if uuid := cvmInfoVMUUID(&cvm); uuid != "" { + return uuid } } return "" } -func selectReplicaForRemoval(cvms []cvmAPIResponse, preserveVMUUID string) string { +func selectReplicaForRemoval(cvms []phala.CVMInfo, preserveVMUUID string) string { for i := len(cvms) - 1; i >= 0; i-- { candidate := cvms[i] - if preserveVMUUID != "" && strings.EqualFold(strings.TrimSpace(candidate.VMUUID), strings.TrimSpace(preserveVMUUID)) { + if preserveVMUUID != "" && strings.EqualFold(cvmInfoVMUUID(&candidate), strings.TrimSpace(preserveVMUUID)) { continue } if id := selectReplicaIdentifier(candidate); id != "" { @@ -1147,7 +1172,7 @@ func selectReplicaForRemoval(cvms []cvmAPIResponse, preserveVMUUID string) strin return "" } -func orderedReplicaIDs(cvms []cvmAPIResponse, preferred string) []string { +func orderedReplicaIDs(cvms []phala.CVMInfo, preferred string) []string { ids := make([]string, 0, len(cvms)+1) seen := map[string]struct{}{} add := func(id string) { @@ -1168,13 +1193,42 @@ func orderedReplicaIDs(cvms []cvmAPIResponse, preferred string) []string { return ids } -func (r *appResource) patchTextAcrossReplicas( +func (r *appResource) patchDockerComposeAcrossReplicas( + ctx context.Context, + cvms []phala.CVMInfo, + preferredID string, + compose string, +) error { + ids := orderedReplicaIDs(cvms, preferredID) + if len(ids) == 0 { + return fmt.Errorf("no app replicas available for patch operation") + } + + var lastErr error + for i, id := range ids { + _, err := r.client.UpdateDockerCompose(ctx, id, compose, nil) + if err == nil { + return nil + } + apiErr, ok := err.(*phala.APIError) + if ok && apiErr.StatusCode == http.StatusConflict && i < len(ids)-1 { + lastErr = err + continue + } + return err + } + + if lastErr != nil { + return lastErr + } + return fmt.Errorf("patch operation failed on all app replicas") +} + +func (r *appResource) patchPreLaunchScriptAcrossReplicas( ctx context.Context, - cvms []cvmAPIResponse, + cvms []phala.CVMInfo, preferredID string, - pathSuffix string, - body string, - headers map[string]string, + script string, ) error { ids := orderedReplicaIDs(cvms, preferredID) if len(ids) == 0 { @@ -1183,11 +1237,11 @@ func (r *appResource) patchTextAcrossReplicas( var lastErr error for i, id := range ids { - err := r.client.PatchText(ctx, cvmPath(id)+pathSuffix, body, headers, nil) + _, err := r.client.UpdatePreLaunchScript(ctx, id, script, nil) if err == nil { return nil } - apiErr, ok := err.(*APIError) + apiErr, ok := err.(*phala.APIError) if ok && apiErr.StatusCode == http.StatusConflict && i < len(ids)-1 { lastErr = err continue @@ -1201,25 +1255,26 @@ func (r *appResource) patchTextAcrossReplicas( return fmt.Errorf("patch operation failed on all app replicas") } -func (r *appResource) patchJSONAcrossReplicas( +func (r *appResource) patchEnvsAcrossReplicas( ctx context.Context, - cvms []cvmAPIResponse, + cvms []phala.CVMInfo, preferredID string, - pathSuffix string, - payload any, + payload map[string]any, ) error { ids := orderedReplicaIDs(cvms, preferredID) if len(ids) == 0 { return fmt.Errorf("no app replicas available for patch operation") } + req := buildUpdateEnvsRequest(payload) + var lastErr error for i, id := range ids { - err := r.client.PatchJSON(ctx, cvmPath(id)+pathSuffix, payload, nil) + _, err := r.client.UpdateCVMEnvs(ctx, id, req) if err == nil { return nil } - apiErr, ok := err.(*APIError) + apiErr, ok := err.(*phala.APIError) if ok && apiErr.StatusCode == http.StatusConflict && i < len(ids)-1 { lastErr = err continue @@ -1235,7 +1290,7 @@ func (r *appResource) patchJSONAcrossReplicas( func (r *appResource) patchOSImageAcrossReplicas( ctx context.Context, - cvms []cvmAPIResponse, + cvms []phala.CVMInfo, preferredID string, imageName string, ) error { @@ -1244,17 +1299,13 @@ func (r *appResource) patchOSImageAcrossReplicas( return fmt.Errorf("no app replicas available for OS image update") } - payload := map[string]any{ - "os_image_name": imageName, - } - var lastErr error for i, id := range ids { - err := r.client.PatchJSON(ctx, cvmPath(id)+"/os-image", payload, nil) + err := r.client.UpdateOSImage(ctx, id, &phala.UpdateOSImageRequest{OSImageName: imageName}) if err == nil { return nil } - apiErr, ok := err.(*APIError) + apiErr, ok := err.(*phala.APIError) if ok && apiErr.StatusCode == http.StatusConflict && i < len(ids)-1 { lastErr = err continue @@ -1270,7 +1321,7 @@ func (r *appResource) patchOSImageAcrossReplicas( func (r *appResource) provisionAndApplyComposeSettingsAcrossReplicas( ctx context.Context, - cvms []cvmAPIResponse, + cvms []phala.CVMInfo, preferredID string, provisionReq map[string]any, ) error { @@ -1285,7 +1336,7 @@ func (r *appResource) provisionAndApplyComposeSettingsAcrossReplicas( if err == nil { return nil } - apiErr, ok := err.(*APIError) + apiErr, ok := err.(*phala.APIError) if ok && apiErr.StatusCode == http.StatusConflict && i < len(ids)-1 { lastErr = err continue @@ -1299,14 +1350,16 @@ func (r *appResource) provisionAndApplyComposeSettingsAcrossReplicas( return fmt.Errorf("compose settings update failed on all app replicas") } -func normalizeCVMInfos(cvms []cvmAPIResponse) []cvmAPIResponse { - out := make([]cvmAPIResponse, 0, len(cvms)) +func normalizeCVMInfos(cvms []phala.CVMInfo) []phala.CVMInfo { + out := make([]phala.CVMInfo, 0, len(cvms)) for _, cvm := range cvms { - if strings.TrimSpace(cvm.AppID) == "" && - strings.TrimSpace(cvm.VMUUID) == "" && + appID := cvmInfoAppID(&cvm) + vmUUID := cvmInfoVMUUID(&cvm) + if appID == "" && + vmUUID == "" && strings.TrimSpace(cvm.Name) == "" && strings.TrimSpace(cvm.Status) == "" && - len(cvm.ID) == 0 { + strings.TrimSpace(cvm.ID) == "" { continue } out = append(out, cvm) @@ -1314,16 +1367,19 @@ func normalizeCVMInfos(cvms []cvmAPIResponse) []cvmAPIResponse { return out } -func normalizeCVMFromAny(raw map[string]any) cvmAPIResponse { +func normalizeCVMFromAny(raw map[string]any) phala.CVMInfo { b, err := json.Marshal(raw) if err != nil { - return cvmAPIResponse{} + return phala.CVMInfo{} } - var out cvmAPIResponse + var out phala.CVMInfo if err := json.Unmarshal(b, &out); err != nil { - return cvmAPIResponse{} + return phala.CVMInfo{} + } + if appID := cvmInfoAppID(&out); appID != "" { + normalized := ensureAppPrefix(appID) + out.AppID = &normalized } - out.AppID = ensureAppPrefix(out.AppID) // The API sometimes nests CVM fields inside a "hosted" sub-object. // Unmarshal it separately and use as fallback for any empty top-level fields. @@ -1335,7 +1391,7 @@ func normalizeCVMFromAny(raw map[string]any) cvmAPIResponse { if err != nil { return out } - var hosted cvmAPIResponse + var hosted phala.CVMInfo if err := json.Unmarshal(hb, &hosted); err != nil { return out } @@ -1346,20 +1402,28 @@ func normalizeCVMFromAny(raw map[string]any) cvmAPIResponse { if out.Status == "" { out.Status = hosted.Status } - if out.AppID == "" { - out.AppID = ensureAppPrefix(hosted.AppID) + if cvmInfoAppID(&out) == "" && cvmInfoAppID(&hosted) != "" { + normalized := ensureAppPrefix(cvmInfoAppID(&hosted)) + out.AppID = &normalized } - if out.InstanceID == "" { - out.InstanceID = hosted.InstanceID + if cvmInfoInstanceID(&out) == "" && cvmInfoInstanceID(&hosted) != "" { + v := cvmInfoInstanceID(&hosted) + out.InstanceID = &v } - if out.VMUUID == "" { - out.VMUUID = hosted.idString() + if cvmInfoVMUUID(&out) == "" { + if id := cvmInfoIDString(&hosted); id != "" { + out.VMUUID = &id + } } - if out.BaseImage == "" { - out.BaseImage = hosted.BaseImage + if cvmInfoOSImageName(&out) == "" { + if img := cvmInfoOSImageName(&hosted); img != "" { + out.BaseImage = &img + } } - if out.StorageFS == "" { - out.StorageFS = hosted.StorageFS + if cvmInfoStorageFSValue(&out) == "" { + if sf := cvmInfoStorageFSValue(&hosted); sf != "" { + out.StorageFS = &sf + } } if out.PublicLogs == nil { out.PublicLogs = hosted.PublicLogs @@ -1367,8 +1431,8 @@ func normalizeCVMFromAny(raw map[string]any) cvmAPIResponse { if out.PublicSysinfo == nil { out.PublicSysinfo = hosted.PublicSysinfo } - if out.PublicTCBInfo == nil { - out.PublicTCBInfo = hosted.PublicTCBInfo + if out.PublicTcbinfo == nil { + out.PublicTcbinfo = hosted.PublicTcbinfo } if out.GatewayEnabled == nil { out.GatewayEnabled = hosted.GatewayEnabled @@ -1376,13 +1440,11 @@ func normalizeCVMFromAny(raw map[string]any) cvmAPIResponse { if out.SecureTime == nil { out.SecureTime = hosted.SecureTime } - if len(out.ID) == 0 { + if strings.TrimSpace(out.ID) == "" { out.ID = hosted.ID } if appURL := stringFromAny(hostedRaw["app_url"]); appURL != "" && len(out.Endpoints) == 0 { - out.Endpoints = append(out.Endpoints, struct { - App string `json:"app"` - }{App: appURL}) + out.Endpoints = append(out.Endpoints, phala.CVMEndpoint{App: appURL}) } return out @@ -1390,21 +1452,13 @@ func normalizeCVMFromAny(raw map[string]any) cvmAPIResponse { func appPath(id string) string { trimmed := strings.TrimSpace(id) - if strings.HasPrefix(trimmed, "app_") { - trimmed = strings.TrimPrefix(trimmed, "app_") - } - return "/apps/" + url.PathEscape(trimmed) + return "/apps/" + url.PathEscape(appIDWithoutPrefix(trimmed)) } -func stringFromRawJSON(v json.RawMessage) string { - if len(v) == 0 { - return "" - } - var s string - if err := json.Unmarshal(v, &s); err == nil { - return strings.TrimSpace(s) - } - return "" +// appIDWithoutPrefix removes the "app_" prefix from an app ID. +func appIDWithoutPrefix(id string) string { + trimmed := strings.TrimSpace(id) + return strings.TrimPrefix(trimmed, "app_") } func stringFromAny(v any) string { @@ -1417,3 +1471,55 @@ func stringFromAny(v any) string { return "" } } + +// composeFileFromCVMInfo extracts the compose_file map from a CVMInfo. +// Returns the map and true if compose_file was present and usable. +func composeFileFromCVMInfo(info *phala.CVMInfo) (map[string]any, bool) { + if info.ComposeFile == nil { + return nil, false + } + switch cf := info.ComposeFile.(type) { + case map[string]any: + return cf, true + default: + // Try marshal/unmarshal round-trip for other concrete types. + b, err := json.Marshal(cf) + if err != nil { + return nil, false + } + var m map[string]any + if err := json.Unmarshal(b, &m); err != nil { + return nil, false + } + return m, true + } +} + +// buildUpdateEnvsRequest converts a generic env update map to the SDK type. +func buildUpdateEnvsRequest(payload map[string]any) *phala.UpdateEnvsRequest { + req := &phala.UpdateEnvsRequest{} + if v, ok := payload["encrypted_env"].(string); ok { + req.EncryptedEnv = v + } + if v, ok := payload["env_keys"]; ok { + switch keys := v.(type) { + case []string: + joined := strings.Join(keys, ",") + req.EnvKeys = &joined + case string: + req.EnvKeys = &keys + } + } + if v, ok := payload["compose_hash"].(string); ok && v != "" { + req.ComposeHash = &v + } + if v, ok := payload["transaction_hash"].(string); ok && v != "" { + req.TransactionHash = &v + } + return req +} + +// boolPtr returns a pointer to the given bool value. +func boolPtr(v bool) *bool { + return &v +} diff --git a/internal/provider/resource_app_test.go b/internal/provider/resource_app_test.go index f463069..47b8ca1 100644 --- a/internal/provider/resource_app_test.go +++ b/internal/provider/resource_app_test.go @@ -10,9 +10,25 @@ import ( "testing" "time" + phala "github.com/Phala-Network/phala-cloud/sdks/go" "github.com/hashicorp/terraform-plugin-framework/types" ) +// newTestPhalaClient creates a *phala.Client pointed at the given test server URL. +func newTestPhalaClient(t *testing.T, baseURL string) *phala.Client { + t.Helper() + client, err := phala.NewClient( + phala.WithBaseURL(baseURL), + phala.WithAPIKey("phat_test_key"), + phala.WithAPIVersion("2026-01-21"), + phala.WithTimeout(5*time.Second), + ) + if err != nil { + t.Fatalf("create phala client: %v", err) + } + return client +} + func TestAppResourceFetchAppAndCVMsReturnsReplicaListWarning(t *testing.T) { srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch { @@ -30,7 +46,7 @@ func TestAppResourceFetchAppAndCVMsReturnsReplicaListWarning(t *testing.T) { defer srv.Close() resource := &appResource{ - client: NewAPIClient(srv.URL+"/api/v1", "phat_test_key", "2026-01-21", 5*time.Second), + client: newTestPhalaClient(t, srv.URL+"/api/v1"), } fetched, err := resource.fetchAppAndCVMs(context.Background(), "app_test") @@ -43,9 +59,9 @@ func TestAppResourceFetchAppAndCVMsReturnsReplicaListWarning(t *testing.T) { if fetched.ReplicaListWarning == nil { t.Fatal("expected replica list warning") } - apiErr, ok := fetched.ReplicaListWarning.(*APIError) + apiErr, ok := fetched.ReplicaListWarning.(*phala.APIError) if !ok { - t.Fatalf("expected *APIError warning, got %T: %v", fetched.ReplicaListWarning, fetched.ReplicaListWarning) + t.Fatalf("expected *phala.APIError warning, got %T: %v", fetched.ReplicaListWarning, fetched.ReplicaListWarning) } if apiErr.StatusCode != http.StatusServiceUnavailable { t.Fatalf("unexpected status code: got %d want %d", apiErr.StatusCode, http.StatusServiceUnavailable) @@ -74,7 +90,7 @@ func TestAppResourcePopulateStateKeepsUnmanagedPreLaunchScriptNull(t *testing.T) defer srv.Close() resource := &appResource{ - client: NewAPIClient(srv.URL+"/api/v1", "phat_test_key", "2026-01-21", 5*time.Second), + client: newTestPhalaClient(t, srv.URL+"/api/v1"), } state := appResourceModel{ @@ -83,12 +99,13 @@ func TestAppResourcePopulateStateKeepsUnmanagedPreLaunchScriptNull(t *testing.T) PreLaunchScript: types.StringNull(), Replicas: types.Int64Null(), } - app := &appAPIResponse{ + app := &phala.AppInfo{ AppID: "app_test", Name: "demo", } - cvms := []cvmAPIResponse{{ - VMUUID: "cvm123", + vmUUID := "cvm123" + cvms := []phala.CVMInfo{{ + VMUUID: &vmUUID, Status: "running", }} @@ -119,7 +136,7 @@ func TestAppResourcePopulateStateRefreshesManagedPreLaunchScript(t *testing.T) { defer srv.Close() resource := &appResource{ - client: NewAPIClient(srv.URL+"/api/v1", "phat_test_key", "2026-01-21", 5*time.Second), + client: newTestPhalaClient(t, srv.URL+"/api/v1"), } state := appResourceModel{ @@ -127,12 +144,13 @@ func TestAppResourcePopulateStateRefreshesManagedPreLaunchScript(t *testing.T) { PreLaunchScript: types.StringValue("#!/bin/sh\necho old\n"), Replicas: types.Int64Null(), } - app := &appAPIResponse{ + app := &phala.AppInfo{ AppID: "app_test", Name: "demo", } - cvms := []cvmAPIResponse{{ - VMUUID: "cvm123", + vmUUID := "cvm123" + cvms := []phala.CVMInfo{{ + VMUUID: &vmUUID, Status: "running", }} @@ -165,7 +183,7 @@ func TestAppResourcePopulateStatePreservesReplicaDerivedFieldsWithoutFreshCVMs(t DockerCompose: types.StringValue("services:\n app:\n"), PreLaunchScript: types.StringValue("#!/bin/sh\necho existing\n"), } - app := &appAPIResponse{ + app := &phala.AppInfo{ AppID: "app_test", Name: "renamed", } @@ -220,7 +238,7 @@ func TestAppResourceWaitForAppReadyFailsFastOnStoppedReplica(t *testing.T) { defer srv.Close() resource := &appResource{ - client: NewAPIClient(srv.URL+"/api/v1", "phat_test_key", "2026-01-21", 5*time.Second), + client: newTestPhalaClient(t, srv.URL+"/api/v1"), } err := resource.waitForAppReady(context.Background(), "app_test", 1, 2*time.Second) @@ -258,7 +276,7 @@ func TestAppResourceWaitForAppDeletionRetriesTransientVerificationErrors(t *test defer srv.Close() resource := &appResource{ - client: NewAPIClient(srv.URL+"/api/v1", "phat_test_key", "2026-01-21", 5*time.Second), + client: newTestPhalaClient(t, srv.URL+"/api/v1"), } confirmed, err := resource.waitForAppDeletion(context.Background(), "test", time.Now().Add(2*time.Second), time.Millisecond) @@ -299,7 +317,7 @@ func TestAppResourcePopulateStatePrefersComposeFileVisibilityFlags(t *testing.T) defer srv.Close() resource := &appResource{ - client: NewAPIClient(srv.URL+"/api/v1", "phat_test_key", "2026-01-21", 5*time.Second), + client: newTestPhalaClient(t, srv.URL+"/api/v1"), } state := appResourceModel{ ID: types.StringValue("app_test"), @@ -308,16 +326,17 @@ func TestAppResourcePopulateStatePrefersComposeFileVisibilityFlags(t *testing.T) PreLaunchScript: types.StringNull(), } trueValue := true - app := &appAPIResponse{ + app := &phala.AppInfo{ AppID: "app_test", Name: "demo", } - cvms := []cvmAPIResponse{{ - VMUUID: "cvm123", + vmUUID := "cvm123" + cvms := []phala.CVMInfo{{ + VMUUID: &vmUUID, Status: "running", PublicLogs: &trueValue, PublicSysinfo: &trueValue, - PublicTCBInfo: &trueValue, + PublicTcbinfo: &trueValue, }} diags := resource.populateState(context.Background(), &state, app, cvms) diff --git a/internal/provider/resource_cvm_power.go b/internal/provider/resource_cvm_power.go index d8e1ff1..b476cf1 100644 --- a/internal/provider/resource_cvm_power.go +++ b/internal/provider/resource_cvm_power.go @@ -6,6 +6,7 @@ import ( "strings" "time" + phala "github.com/Phala-Network/phala-cloud/sdks/go" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" @@ -18,7 +19,7 @@ import ( var _ resource.Resource = &cvmPowerResource{} type cvmPowerResource struct { - client *APIClient + client *phala.Client } type cvmPowerResourceModel struct { @@ -85,11 +86,11 @@ func (r *cvmPowerResource) Configure(_ context.Context, req resource.ConfigureRe return } - client, ok := req.ProviderData.(*APIClient) + client, ok := req.ProviderData.(*phala.Client) if !ok { resp.Diagnostics.AddError( "Unexpected provider data type", - "Expected *APIClient while configuring cvm_power resource.", + "Expected *phala.Client while configuring cvm_power resource.", ) return } @@ -227,7 +228,7 @@ func (r *cvmPowerResource) ensureDesiredPowerState( ctx context.Context, cvmID string, desired string, -) (*cvmAPIResponse, error) { +) (*phala.CVMInfo, error) { current, err := r.fetchPowerTarget(ctx, cvmID) if err != nil { return nil, err @@ -236,14 +237,14 @@ func (r *cvmPowerResource) ensureDesiredPowerState( switch desired { case "running": if shouldStart(current.Status) { - if err := r.client.PostJSON(ctx, cvmPath(cvmID)+"/start", map[string]any{"polling": "v1"}, nil); err != nil { + if _, err := r.client.StartCVM(ctx, cvmID); err != nil { return nil, err } return r.fetchPowerTarget(ctx, cvmID) } case "stopped": if shouldStop(current.Status) { - if err := r.client.PostJSON(ctx, cvmPath(cvmID)+"/stop", map[string]any{"polling": "v1"}, nil); err != nil { + if _, err := r.client.StopCVM(ctx, cvmID); err != nil { return nil, err } return r.fetchPowerTarget(ctx, cvmID) @@ -255,12 +256,8 @@ func (r *cvmPowerResource) ensureDesiredPowerState( return current, nil } -func (r *cvmPowerResource) fetchPowerTarget(ctx context.Context, id string) (*cvmAPIResponse, error) { - var out cvmAPIResponse - if err := r.client.GetJSON(ctx, cvmPath(id), &out); err != nil { - return nil, err - } - return &out, nil +func (r *cvmPowerResource) fetchPowerTarget(ctx context.Context, id string) (*phala.CVMInfo, error) { + return r.client.GetCVMInfo(ctx, id) } func (r *cvmPowerResource) waitForPowerState( @@ -284,7 +281,7 @@ func (r *cvmPowerResource) waitForPowerState( return err } - if stablePowerState(current.Status) == target && !current.inProgress() { + if stablePowerState(current.Status) == target && !cvmInfoInProgress(current) { return nil } diff --git a/internal/provider/resource_shared.go b/internal/provider/resource_shared.go index fec2f73..e95f4e3 100644 --- a/internal/provider/resource_shared.go +++ b/internal/provider/resource_shared.go @@ -3,12 +3,12 @@ package provider import ( "context" "encoding/hex" - "encoding/json" "fmt" "math/rand/v2" "strings" "time" + phala "github.com/Phala-Network/phala-cloud/sdks/go" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" @@ -287,77 +287,108 @@ type provisionFields struct { SSHAuthorizedKeys []string } -func buildProvisionReq(f provisionFields) (map[string]any, error) { - req := map[string]any{ - "name": f.Name, - "instance_type": f.Size, - "compose_file": f.ComposeFile, - "kms": kmsPayloadValue(f.KMS), - "listed": f.Listed, +func buildProvisionReq(f provisionFields) (*phala.ProvisionCVMRequest, error) { + kms := kmsPayloadValue(f.KMS) + listed := f.Listed + req := &phala.ProvisionCVMRequest{ + Name: f.Name, + InstanceType: f.Size, + KMSType: &kms, + Listed: &listed, + } + + // Build ComposeFile from the map representation. + if f.ComposeFile != nil { + cf := &phala.ComposeFile{} + if v, ok := f.ComposeFile["name"].(string); ok { + cf.Name = v + } + if v, ok := f.ComposeFile["docker_compose_file"].(string); ok { + cf.DockerComposeFile = v + } + if v, ok := f.ComposeFile["pre_launch_script"].(string); ok { + cf.PreLaunchScript = &v + } + if v, ok := f.ComposeFile["gateway_enabled"].(bool); ok { + cf.GatewayEnabled = &v + } + if v, ok := f.ComposeFile["encrypted_env"].(string); ok { + cf.EncryptedEnv = &v + } + if v, ok := f.ComposeFile["env_keys"].(string); ok { + cf.EnvKeys = &v + } else if keys, ok := f.ComposeFile["allowed_envs"].([]string); ok && len(keys) > 0 { + joined := strings.Join(keys, ",") + cf.EnvKeys = &joined + } + req.ComposeFile = cf } + if !f.Region.IsNull() && !f.Region.IsUnknown() { - req["region"] = f.Region.ValueString() + // Region is passed as a hint; SDK ProvisionCVMRequest doesn't have this field. + // The Terraform provider ignores it at provision time since region selection + // is typically done via TeepodID. + _ = f.Region.ValueString() } if f.HasNodeID { - req["teepod_id"] = f.NodeID + teepodID := int(f.NodeID) + req.TeepodID = &teepodID } if !f.Image.IsNull() && !f.Image.IsUnknown() { - req["image"] = f.Image.ValueString() + img := f.Image.ValueString() + req.Image = &img } if f.HasCustomAppID { - req["app_id"] = f.CustomAppID + req.CustomAppID = &f.CustomAppID } if f.HasNonce { - req["nonce"] = f.Nonce + req.Nonce = &f.Nonce } if !f.DiskSize.IsNull() && !f.DiskSize.IsUnknown() { - req["disk_size"] = f.DiskSize.ValueInt64() + ds := int(f.DiskSize.ValueInt64()) + req.DiskSize = &ds } if len(f.SSHAuthorizedKeys) > 0 { - userConfig, err := json.Marshal(map[string]any{ - "ssh_authorized_keys": f.SSHAuthorizedKeys, - }) - if err != nil { - return nil, fmt.Errorf("build user_config JSON: %w", err) - } - req["user_config"] = string(userConfig) + req.SSHAuthorizedKeys = f.SSHAuthorizedKeys } return req, nil } -// provisionResponse holds the common fields returned from /cvms/provision. -type provisionResponse struct { - AppID string `json:"app_id"` - ComposeHash string `json:"compose_hash"` - AppEnvEncryptPubkey string `json:"app_env_encrypt_pubkey"` +// commitCreateResult holds the fields needed from the commit response. +type commitCreateResult struct { + AppID string + VMUUID string } // commitAndCreate calls POST /cvms to finalize a provision request. -// Returns the CVM API response from the commit. +// Returns the essential fields from the commit response. func commitAndCreate( ctx context.Context, - client *APIClient, - provResp provisionResponse, + client *phala.Client, + provResp *phala.ProvisionCVMResponse, encryptedEnv string, hasEncryptedEnv bool, envKeys []string, -) (*cvmAPIResponse, error) { - commitReq := map[string]any{ - "app_id": provResp.AppID, - "compose_hash": provResp.ComposeHash, +) (*commitCreateResult, error) { + commitReq := &phala.CommitCVMProvisionRequest{ + AppID: provResp.AppID, + ComposeHash: provResp.ComposeHash, } if hasEncryptedEnv { - commitReq["encrypted_env"] = encryptedEnv + commitReq.EncryptedEnv = &encryptedEnv } if len(envKeys) > 0 { - commitReq["env_keys"] = envKeys + commitReq.EnvKeys = envKeys } - var createResp cvmAPIResponse - if err := client.PostJSON(ctx, "/cvms", commitReq, &createResp); err != nil { + createResp, err := client.CommitCVMProvision(ctx, commitReq) + if err != nil { return nil, err } - return &createResp, nil + return &commitCreateResult{ + AppID: provResp.AppID, + VMUUID: createResp.CvmID(), + }, nil } // --------------------------------------------------------------------------- diff --git a/internal/provider/resource_shared_test.go b/internal/provider/resource_shared_test.go index a0af70a..273e5b5 100644 --- a/internal/provider/resource_shared_test.go +++ b/internal/provider/resource_shared_test.go @@ -136,19 +136,16 @@ func TestBuildProvisionReq(t *testing.T) { if err != nil { t.Fatal(err) } - if req["name"] != "test-cvm" { - t.Errorf("name = %v", req["name"]) + if req.Name != "test-cvm" { + t.Errorf("name = %v", req.Name) } - if req["instance_type"] != "tdx.small" { - t.Errorf("instance_type = %v", req["instance_type"]) + if req.InstanceType != "tdx.small" { + t.Errorf("instance_type = %v", req.InstanceType) } - if req["kms"] != "PHALA" { - t.Errorf("kms = %v", req["kms"]) + if req.KMSType == nil || *req.KMSType != "PHALA" { + t.Errorf("kms = %v", req.KMSType) } - if _, ok := req["region"]; ok { - t.Error("region should not be set when null") - } - if _, ok := req["teepod_id"]; ok { + if req.TeepodID != nil { t.Error("teepod_id should not be set when HasNodeID is false") } }) @@ -174,29 +171,26 @@ func TestBuildProvisionReq(t *testing.T) { if err != nil { t.Fatal(err) } - if req["region"] != "us-east" { - t.Errorf("region = %v", req["region"]) - } - if req["teepod_id"] != int64(42) { - t.Errorf("teepod_id = %v", req["teepod_id"]) + if req.TeepodID == nil || *req.TeepodID != 42 { + t.Errorf("teepod_id = %v", req.TeepodID) } - if req["kms"] != "ETHEREUM" { - t.Errorf("kms = %v", req["kms"]) + if req.KMSType == nil || *req.KMSType != "ETHEREUM" { + t.Errorf("kms = %v", req.KMSType) } - if req["image"] != "dstack-v0.3.5" { - t.Errorf("image = %v", req["image"]) + if req.Image == nil || *req.Image != "dstack-v0.3.5" { + t.Errorf("image = %v", req.Image) } - if req["app_id"] != "custom123" { - t.Errorf("app_id = %v", req["app_id"]) + if req.CustomAppID == nil || *req.CustomAppID != "custom123" { + t.Errorf("app_id = %v", req.CustomAppID) } - if req["nonce"] != int64(7) { - t.Errorf("nonce = %v", req["nonce"]) + if req.Nonce == nil || *req.Nonce != 7 { + t.Errorf("nonce = %v", req.Nonce) } - if req["disk_size"] != int64(50) { - t.Errorf("disk_size = %v", req["disk_size"]) + if req.DiskSize == nil || *req.DiskSize != 50 { + t.Errorf("disk_size = %v", req.DiskSize) } - if req["user_config"] == nil { - t.Error("user_config should be set") + if len(req.SSHAuthorizedKeys) != 1 { + t.Errorf("ssh_authorized_keys = %v", req.SSHAuthorizedKeys) } }) } diff --git a/internal/provider/resource_ssh_key.go b/internal/provider/resource_ssh_key.go index bf2f57b..aed9b65 100644 --- a/internal/provider/resource_ssh_key.go +++ b/internal/provider/resource_ssh_key.go @@ -2,9 +2,9 @@ package provider import ( "context" - "net/url" "strings" + phala "github.com/Phala-Network/phala-cloud/sdks/go" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" @@ -17,7 +17,7 @@ var _ resource.Resource = &sshKeyResource{} var _ resource.ResourceWithImportState = &sshKeyResource{} type sshKeyResource struct { - client *APIClient + client *phala.Client } type sshKeyResourceModel struct { @@ -31,17 +31,6 @@ type sshKeyResourceModel struct { UpdatedAt types.String `tfsdk:"updated_at"` } -type sshKeyAPI struct { - ID string `json:"id"` - Name string `json:"name"` - PublicKey string `json:"public_key"` - Fingerprint string `json:"fingerprint"` - KeyType string `json:"key_type"` - Source string `json:"source"` - CreatedAt string `json:"created_at"` - UpdatedAt string `json:"updated_at"` -} - func NewSSHKeyResource() resource.Resource { return &sshKeyResource{} } @@ -119,11 +108,11 @@ func (r *sshKeyResource) Configure(_ context.Context, req resource.ConfigureRequ return } - client, ok := req.ProviderData.(*APIClient) + client, ok := req.ProviderData.(*phala.Client) if !ok { resp.Diagnostics.AddError( "Unexpected provider data type", - "Expected *APIClient while configuring ssh_key resource.", + "Expected *phala.Client while configuring ssh_key resource.", ) return } @@ -138,19 +127,17 @@ func (r *sshKeyResource) Create(ctx context.Context, req resource.CreateRequest, return } - payload := map[string]string{ - "name": plan.Name.ValueString(), - "public_key": plan.PublicKey.ValueString(), - } - - var created sshKeyAPI - if err := r.client.PostJSON(ctx, "/user/ssh-keys", payload, &created); err != nil { + created, err := r.client.CreateSSHKey(ctx, &phala.CreateSSHKeyRequest{ + Name: plan.Name.ValueString(), + PublicKey: plan.PublicKey.ValueString(), + }) + if err != nil { resp.Diagnostics.AddError("Failed to create SSH key", err.Error()) return } state := plan - state.mergeAPI(created) + state.mergeAPI(*created) if state.ID.IsNull() || state.ID.IsUnknown() || state.ID.ValueString() == "" { resp.Diagnostics.AddError("Invalid create response", "Created SSH key response did not include id.") return @@ -219,7 +206,7 @@ func (r *sshKeyResource) Delete(ctx context.Context, req resource.DeleteRequest, return } - if err := r.client.Delete(ctx, "/user/ssh-keys/"+url.PathEscape(id)); err != nil && !isNotFound(err) { + if err := r.client.DeleteSSHKey(ctx, id); err != nil && !isNotFound(err) { resp.Diagnostics.AddError("Failed to delete SSH key", err.Error()) } } @@ -235,9 +222,9 @@ func (r *sshKeyResource) ImportState( // findSSHKey fetches all SSH keys and scans for the given id. // The Phala Cloud API does not expose a GET /user/ssh-keys/{id} endpoint, // so a list-and-filter is the only option. -func (r *sshKeyResource) findSSHKey(ctx context.Context, id string) (*sshKeyAPI, error) { - var keys []sshKeyAPI - if err := r.client.GetJSON(ctx, "/user/ssh-keys", &keys); err != nil { +func (r *sshKeyResource) findSSHKey(ctx context.Context, id string) (*phala.SSHKey, error) { + keys, err := r.client.ListSSHKeys(ctx) + if err != nil { return nil, err } @@ -249,7 +236,7 @@ func (r *sshKeyResource) findSSHKey(ctx context.Context, id string) (*sshKeyAPI, return nil, nil } -func (m *sshKeyResourceModel) mergeAPI(api sshKeyAPI) { +func (m *sshKeyResourceModel) mergeAPI(api phala.SSHKey) { if v := strings.TrimSpace(api.ID); v != "" { m.ID = types.StringValue(v) } @@ -259,9 +246,9 @@ func (m *sshKeyResourceModel) mergeAPI(api sshKeyAPI) { if v := strings.TrimSpace(api.PublicKey); v != "" { m.PublicKey = types.StringValue(v) } - m.Fingerprint = nullableString(api.Fingerprint) - m.KeyType = nullableString(api.KeyType) - m.Source = nullableString(api.Source) - m.CreatedAt = nullableString(api.CreatedAt) - m.UpdatedAt = nullableString(api.UpdatedAt) + m.Fingerprint = nullableStringPtr(api.Fingerprint) + m.KeyType = nullableStringPtr(api.KeyType) + m.Source = nullableStringPtr(api.Source) + m.CreatedAt = nullableStringPtr(api.CreatedAt) + m.UpdatedAt = nullableStringPtr(api.UpdatedAt) } diff --git a/internal/provider/test_helpers_test.go b/internal/provider/test_helpers_test.go new file mode 100644 index 0000000..208dad7 --- /dev/null +++ b/internal/provider/test_helpers_test.go @@ -0,0 +1,17 @@ +package provider + +import ( + "io" + "net/http" + "testing" +) + +func writeJSON(t *testing.T, w http.ResponseWriter, status int, body string) { + t.Helper() + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(status) + _, err := io.WriteString(w, body) + if err != nil { + t.Fatalf("write response: %v", err) + } +} diff --git a/openapi/generate-client.sh b/openapi/generate-client.sh deleted file mode 100755 index c4cef1f..0000000 --- a/openapi/generate-client.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" -SPEC_RAW="${ROOT_DIR}/openapi/phala-cloud-openapi.json" -SPEC_NORMALIZED="${ROOT_DIR}/openapi/phala-cloud-openapi.normalized.json" -GEN_OUT="${ROOT_DIR}/internal/phalaapi/client.gen.go" - -curl -sS https://cloud-api.phala.network/openapi.json -o "${SPEC_RAW}" -jq -f "${ROOT_DIR}/openapi/normalize-openapi.jq" "${SPEC_RAW}" > "${SPEC_NORMALIZED}" - -GOCACHE="${GOCACHE:-/tmp/phala-go-build}" \ -GOMODCACHE="${GOMODCACHE:-/tmp/phala-go-modcache}" \ - go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@v2.4.1 \ - -generate types,client,skip-prune \ - -package phalaapi \ - -o "${GEN_OUT}" \ - "${SPEC_NORMALIZED}" - -gofmt -w "${GEN_OUT}" diff --git a/openapi/normalize-openapi.jq b/openapi/normalize-openapi.jq deleted file mode 100644 index c2287c7..0000000 --- a/openapi/normalize-openapi.jq +++ /dev/null @@ -1,60 +0,0 @@ -def has_null_variant: - (type == "array") and (map((.type? // "") == "null") | any); - -def non_null_variant: - [ .[] | select((.type? // "") != "null") ]; - -def fixnode: - if type == "object" then - ( - if .type? == "null" then - del(.type) | .nullable = true - else - . - end - ) - | - ( - if (.type? | type) == "array" and (.type | index("null")) != null then - .type = ((.type - ["null"])[0] // .type) | .nullable = true - else - . - end - ) - | - ( - if (.anyOf? | has_null_variant) then - . as $o - | ($o.anyOf | non_null_variant) as $nn - | if ($nn | length) == 1 then - ($o | del(.anyOf) + $nn[0] + {nullable: true}) - else - .anyOf = $nn | .nullable = true - end - else - . - end - ) - | - ( - if (.oneOf? | has_null_variant) then - . as $o - | ($o.oneOf | non_null_variant) as $nn - | if ($nn | length) == 1 then - ($o | del(.oneOf) + $nn[0] + {nullable: true}) - else - .oneOf = $nn | .nullable = true - end - else - . - end - ) - | - with_entries(.value |= fixnode) - elif type == "array" then - map(fixnode) - else - . - end; - -fixnode | .openapi = "3.0.3" diff --git a/openapi/oapi-codegen.yaml b/openapi/oapi-codegen.yaml deleted file mode 100644 index 1b24742..0000000 --- a/openapi/oapi-codegen.yaml +++ /dev/null @@ -1,8 +0,0 @@ -package: phalaapi -generate: - models: true - client: true - client-with-responses: true -output-options: - skip-prune: true -output: internal/phalaapi/client.gen.go diff --git a/openapi/phala-cloud-openapi.json b/openapi/phala-cloud-openapi.json deleted file mode 100644 index 8ea4ed9..0000000 --- a/openapi/phala-cloud-openapi.json +++ /dev/null @@ -1 +0,0 @@ -{"openapi":"3.1.0","info":{"title":"Phala Cloud API","version":"0.1.0"},"paths":{"/api/v1/auth/oauth/google/authorize":{"get":{"tags":["auth","auth","OAuth"],"summary":"Start Google OAuth","description":"Redirects user to Google authorization page. Supports login, registration, and account linking modes.","operationId":"google_oauth_authorize_api_v1_auth_oauth_google_authorize_get","parameters":[{"name":"returnUrl","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Returnurl"}},{"name":"invite","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invite"}},{"name":"mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"307":{"description":"Redirect to Google authorization URL"},"501":{"description":"Google OAuth not configured on server"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/oauth/google/callback":{"get":{"tags":["auth","auth","OAuth"],"summary":"Handle Google OAuth callback","description":"Processes Google authorization response. Creates session cookie on success or redirects with error parameter on failure.","operationId":"google_oauth_callback_api_v1_auth_oauth_google_callback_get","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"307":{"description":"Redirect to dashboard on success, login/register/settings page on error"},"400":{"description":"Invalid state parameter or token exchange failed"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/oauth/github/authorize":{"get":{"tags":["auth","auth","OAuth"],"summary":"Start GitHub OAuth","description":"Redirects user to GitHub authorization page. Supports login, registration, and account linking modes.","operationId":"github_oauth_authorize_api_v1_auth_oauth_github_authorize_get","parameters":[{"name":"returnUrl","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Returnurl"}},{"name":"invite","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invite"}},{"name":"mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"307":{"description":"Redirect to GitHub authorization URL"},"501":{"description":"GitHub OAuth not configured on server"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/oauth/github/callback":{"get":{"tags":["auth","auth","OAuth"],"summary":"Handle GitHub OAuth callback","description":"Processes GitHub authorization response. Creates session cookie on success or redirects with error parameter on failure.","operationId":"github_oauth_callback_api_v1_auth_oauth_github_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},{"name":"error_description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Description"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"307":{"description":"Redirect to dashboard on success, login/register/settings page on error"},"400":{"description":"Invalid state parameter or token exchange failed"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/me":{"get":{"tags":["auth","auth"],"summary":"Get current user","description":"Return detailed info for the authenticated user including workspace and credits.","operationId":"read_users_me_api_v1_auth_me_get","responses":{"200":{"description":"User profile with workspace and credits","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authenticated"},"403":{"description":"User is disabled"}},"security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/auth/authenticated":{"get":{"tags":["auth","auth"],"summary":"Check authentication","description":"Return authentication status and user info if authenticated.","operationId":"authenticated_api_v1_auth_authenticated_get","responses":{"200":{"description":"Authentication status with user info if authenticated","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/auth/register":{"post":{"tags":["auth","auth"],"summary":"Register new user","description":"Create a new account with email verification. Requires invite code if configured.","operationId":"register_user_api_v1_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterPayload"}}},"required":true},"responses":{"200":{"description":"User created or verification email sent","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input, email already exists, or rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/token":{"post":{"tags":["auth","auth"],"summary":"Get access token","description":"OAuth2 password grant. Returns JWT token. Pass TOTP code in client_id field if 2FA enabled.","operationId":"login_for_access_token_api_v1_auth_token_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_login_for_access_token_api_v1_auth_token_post"}}},"required":true},"responses":{"200":{"description":"Access token issued","content":{"application/json":{"schema":{}}}},"401":{"description":"Invalid credentials, email not verified, or invalid 2FA"},"500":{"description":"Internal authentication error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/login":{"post":{"tags":["auth","auth"],"summary":"Login with cookie","description":"Authenticate and set session cookie. Pass TOTP code in client_id field if 2FA enabled.","operationId":"login_with_cookie_api_v1_auth_login_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_login_with_cookie_api_v1_auth_login_post"}}},"required":true},"responses":{"200":{"description":"Login successful, cookie set","content":{"application/json":{"schema":{}}}},"401":{"description":"Invalid credentials or email not verified"},"500":{"description":"Session creation failed"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/login-with-2fa":{"post":{"tags":["auth","auth"],"summary":"Login with explicit 2FA","description":"Authenticate with explicit TOTP code field. Preferred over /login for 2FA users.","operationId":"login_with_2fa_api_v1_auth_login_with_2fa_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Login successful, cookie set","content":{"application/json":{"schema":{}}}},"401":{"description":"Invalid credentials or email not verified"},"500":{"description":"Session creation failed"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/logout":{"post":{"tags":["auth","auth"],"summary":"Logout","description":"Revoke the current session and clear authentication cookies.","operationId":"logout_api_v1_auth_logout_post","responses":{"200":{"description":"Logged out successfully","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/auth/forgot-password":{"post":{"tags":["auth","auth"],"summary":"Request password reset","description":"Send password reset email if account exists. Response is identical whether account exists or not.","operationId":"forgot_password_api_v1_auth_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordResetRequest"}}},"required":true},"responses":{"200":{"description":"Reset email sent (if account exists)","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/validate-reset-token":{"get":{"tags":["auth","auth"],"summary":"Validate reset token","description":"Check if a password reset token is valid and not expired.","operationId":"validate_reset_token_api_v1_auth_validate_reset_token_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Token is valid","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Validate Reset Token Api V1 Auth Validate Reset Token Get"}}}},"400":{"description":"Invalid or expired token"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/reset-password":{"put":{"tags":["auth","auth"],"summary":"Reset password with token","description":"Set a new password using the reset token from email.","operationId":"handle_reset_password_with_token_api_v1_auth_reset_password_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordWithToken"}}},"required":true},"responses":{"200":{"description":"Password reset successfully","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Handle Reset Password With Token Api V1 Auth Reset Password Put"}}}},"400":{"description":"Invalid token, expired, or weak password"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/password":{"post":{"tags":["auth","auth"],"summary":"Update password","description":"Change password. Requires TOTP code (if 2FA enabled) or current password. Sends notification email.","operationId":"handle_update_password_api_v1_auth_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePasswordRequest"}}},"required":true},"responses":{"200":{"description":"Password updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"description":"TOTP code required or invalid, or password validation failed"},"401":{"description":"Not authenticated or current password incorrect"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/auth/username":{"put":{"tags":["auth","auth"],"summary":"Update username","description":"Change username. Requires TOTP code (if 2FA enabled) or current password. Revokes all other sessions.","operationId":"handle_update_username_api_v1_auth_username_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUsernameRequest"}}},"required":true},"responses":{"200":{"description":"Username updated","content":{"application/json":{"schema":{}}}},"400":{"description":"TOTP required, invalid TOTP, or username validation failed"},"401":{"description":"Not authenticated or current password incorrect"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/auth/request-email-verification":{"post":{"tags":["auth","auth"],"summary":"Request email verification","description":"Send or resend verification email. Can also be used to change email address.","operationId":"api_request_email_verification_api_v1_auth_request_email_verification_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WrappedEmailVerificationRequest"}}},"required":true},"responses":{"200":{"description":"Verification email sent","content":{"application/json":{"schema":{}}}},"400":{"description":"No email provided or send failed"},"401":{"description":"Not authenticated"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/auth/change-email":{"post":{"tags":["auth","auth"],"summary":"Change email address","description":"Initiate email change. Requires verification (password or 2FA). Sends verification to new address.","operationId":"api_change_email_api_v1_auth_change_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WrappedChangeEmailRequest"}}},"required":true},"responses":{"200":{"description":"Verification email sent to new address","content":{"application/json":{"schema":{}}}},"400":{"description":"Email send failed or invalid"},"401":{"description":"Not authenticated or verification failed"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/auth/verify-email-token":{"post":{"tags":["auth","auth"],"summary":"Verify email token","description":"Complete email verification using token from email link.","operationId":"api_verify_email_token_api_v1_auth_verify_email_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_api_verify_email_token_api_v1_auth_verify_email_token_post"}}},"required":true},"responses":{"200":{"description":"Email verified","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Api Verify Email Token Api V1 Auth Verify Email Token Post"}}}},"400":{"description":"Invalid token, expired, or site key invalid"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/2fa/status":{"get":{"tags":["auth","auth-2fa"],"summary":"Get 2FA status","description":"Return 2FA configuration status including enabled flag and backup codes count.","operationId":"get_2fa_status_endpoint_api_v1_auth_2fa_status_get","responses":{"200":{"description":"2FA status","content":{"application/json":{"schema":{}}}},"400":{"description":"Status check failed"},"401":{"description":"Not authenticated"}},"security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/auth/2fa/setup":{"post":{"tags":["auth","auth-2fa"],"summary":"Initialize 2FA setup","description":"Generate TOTP secret and QR code. Secret is only shown once. Call /2fa/confirm to activate.","operationId":"setup_2fa_endpoint_api_v1_auth_2fa_setup_post","responses":{"200":{"description":"Secret and QR code for authenticator app","content":{"application/json":{"schema":{}}}},"400":{"description":"2FA already enabled"},"401":{"description":"Not authenticated"}},"security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/auth/2fa/confirm":{"post":{"tags":["auth","auth-2fa"],"summary":"Confirm 2FA setup","description":"Activate 2FA by verifying a TOTP code from authenticator app. Returns backup codes.","operationId":"confirm_2fa_setup_endpoint_api_v1_auth_2fa_confirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwoFactorSetupRequest"}}},"required":true},"responses":{"200":{"description":"2FA enabled with backup codes","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid code or no pending setup"},"401":{"description":"Not authenticated"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/auth/2fa/disable":{"post":{"tags":["auth","auth-2fa"],"summary":"Disable 2FA","description":"Turn off 2FA. Requires valid TOTP code or backup code.","operationId":"disable_2fa_endpoint_api_v1_auth_2fa_disable_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwoFactorDisableRequest"}}},"required":true},"responses":{"200":{"description":"2FA disabled","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid verification code"},"401":{"description":"Not authenticated"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/auth/2fa/regenerate-backup-codes":{"post":{"tags":["auth","auth-2fa"],"summary":"Regenerate backup codes","description":"Generate new backup codes. Invalidates previous codes. Requires valid TOTP code.","operationId":"regenerate_backup_codes_endpoint_api_v1_auth_2fa_regenerate_backup_codes_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwoFactorRegenerateRequest"}}},"required":true},"responses":{"200":{"description":"New backup codes","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid verification code or 2FA not enabled"},"401":{"description":"Not authenticated"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/auth/2fa/verify":{"post":{"tags":["auth","auth-2fa"],"summary":"Verify 2FA code","description":"Verify a TOTP or backup code. Sets step-up cookie on success.","operationId":"verify_2fa_endpoint_api_v1_auth_2fa_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwoFactorVerificationRequest"}}},"required":true},"responses":{"200":{"description":"Code valid, step-up cookie set","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid code"},"401":{"description":"Not authenticated"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/auth/2fa/verify-and-set-cookie":{"post":{"tags":["auth","auth-2fa"],"summary":"Verify 2FA and set cookie","description":"Verify TOTP code and set step-up cookie for subsequent sensitive operations.","operationId":"verify_2fa_and_set_cookie_api_v1_auth_2fa_verify_and_set_cookie_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwoFactorPageVerifyRequest"}}},"required":true},"responses":{"200":{"description":"2FA verified, step-up cookie set","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid code"},"401":{"description":"Not authenticated"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/auth/step-up/verify":{"post":{"tags":["auth","auth"],"summary":"Step-up verification","description":"Verify password or TOTP to get step-up cookie. Required for sensitive operations.","operationId":"verify_step_up_and_set_cookie_api_v1_auth_step_up_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StepUpVerifyRequest"}}},"required":true},"responses":{"200":{"description":"Verification passed, step-up cookie set","content":{"application/json":{"schema":{}}}},"400":{"description":"Neither password nor TOTP provided, or code invalid"},"401":{"description":"Not authenticated or password incorrect"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/auth/sessions":{"get":{"tags":["auth","auth-sessions"],"summary":"List active sessions","description":"Return all active sessions for the current user with device info.","operationId":"get_active_sessions_api_v1_auth_sessions_get","security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}],"responses":{"200":{"description":"List of sessions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionsListResponse"}}}},"401":{"description":"Not authenticated"},"500":{"description":"Session query failed"}}},"delete":{"tags":["auth","auth-sessions"],"summary":"Revoke all sessions","description":"Revoke all sessions. By default keeps current session. Requires 2FA step-up.","operationId":"revoke_all_sessions_api_v1_auth_sessions_delete","security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"revoke_current","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Revoke Current"}}],"responses":{"200":{"description":"Sessions revoked","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authenticated"},"428":{"description":"2FA step-up required"},"500":{"description":"Revocation failed"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/sessions/{jti}":{"delete":{"tags":["auth","auth-sessions"],"summary":"Revoke session","description":"Revoke a specific session by JTI. Requires 2FA step-up verification.","operationId":"revoke_session_endpoint_api_v1_auth_sessions__jti__delete","security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"jti","in":"path","required":true,"schema":{"type":"string","title":"Jti"}}],"responses":{"200":{"description":"Session revoked","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authenticated"},"404":{"description":"Session not found"},"428":{"description":"2FA step-up required"},"500":{"description":"Revocation failed"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/decode-link-token":{"get":{"tags":["auth","auth-oauth"],"summary":"Decode OAuth link token","description":"Extract provider and email from OAuth link token for UI display.","operationId":"decode_link_token_api_v1_auth_decode_link_token_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Token data (provider, email, name, avatar_url)","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid or expired token"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/verify-and-link-oauth":{"post":{"tags":["auth","auth-oauth"],"summary":"Link OAuth account","description":"Verify password/2FA and link OAuth account. Used when OAuth email matches existing user.","operationId":"verify_and_link_oauth_api_v1_auth_verify_and_link_oauth_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyAndLinkOAuthRequest"}}},"required":true},"responses":{"200":{"description":"Account linked and logged in, or requires_2fa flag","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid token, password required, or link failed"},"401":{"description":"Invalid password or 2FA code"},"404":{"description":"User not found"},"423":{"description":"Account is disabled"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/device/code":{"post":{"tags":["auth","device-auth"],"summary":"Request device codes","description":"Initiate device authorization flow (RFC 8628). Returns codes for CLI polling and user verification.","operationId":"request_device_code_api_v1_auth_device_code_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceCodeRequest"}}},"required":true},"responses":{"200":{"description":"Device and user codes generated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceCodeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/device/token":{"post":{"tags":["auth","device-auth"],"summary":"Poll for access token","description":"Long-poll for authorization status. Returns token when user approves, or error codes per RFC 8628.","operationId":"poll_device_token_api_v1_auth_device_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceTokenRequest"}}},"required":true},"responses":{"200":{"description":"Token issued or requires_2fa flag","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceTokenResponse"}}}},"400":{"description":"authorization_pending, expired_token, or access_denied"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/device/status/{user_code}":{"get":{"tags":["auth","device-auth"],"summary":"Check device code status","description":"Check if a verification code is valid and the CLI is still connected. Used by web UI to show real-time status.","operationId":"check_device_status_api_v1_auth_device_status__user_code__get","parameters":[{"name":"user_code","in":"path","required":true,"schema":{"type":"string","title":"User Code"}}],"responses":{"200":{"description":"Status with valid flag and message","content":{"application/json":{"schema":{}}}},"404":{"description":"Code not found or expired"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/device/authorize":{"post":{"tags":["auth","device-auth"],"summary":"Authorize device request","description":"Approve a CLI device request. Called from web UI after user enters the verification code.","operationId":"authorize_device_request_api_v1_auth_device_authorize_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceAuthorizeRequest"}}},"required":true},"responses":{"200":{"description":"Device authorized","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid code, expired, or 2FA required/invalid"},"401":{"description":"Not authenticated or user not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/verified_apps":{"get":{"tags":["cvm","cvms-anonymous","Public"],"summary":"List public CVMs","description":"Returns all CVMs marked as listed and running. No authentication required.","operationId":"handle_list_public_cvms_api_v1_verified_apps_get","responses":{"200":{"description":"List of publicly listed CVMs","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PublicCVM"},"type":"array","title":"Response Handle List Public Cvms Api V1 Verified Apps Get"}}}}}}},"/api/v1/verified_apps/{cvm_id}/attestation":{"get":{"tags":["cvm","cvms-anonymous","Public"],"summary":"Get public CVM attestation","description":"Returns attestation data for a publicly listed CVM. Includes TCB info and app certificates.","operationId":"handle_get_cvm_attestation_anonymous_api_v1_verified_apps__cvm_id__attestation_get","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"responses":{"200":{"description":"Attestation report with TCB info","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CvmAttestation"}}}},"404":{"description":"CVM not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/pubkey/from_cvm_configuration":{"post":{"tags":["cvm","cvms-deployment","CVM Deployment (Legacy)"],"summary":"Get pubkey from config (legacy)","description":"Deprecated. Returns app_id and encryption pubkey from VM configuration.","operationId":"handle_get_pubkey_from_cvm_configuration_api_v1_cvms_pubkey_from_cvm_configuration_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VMCreateWithTeepod","description":"The Compose Manifest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true,"security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/cvms/from_cvm_configuration":{"post":{"tags":["cvm","cvms-deployment","CVM Deployment (Legacy)"],"summary":"Create CVM from config (legacy)","description":"Deprecated. Creates CVM from raw VM configuration payload.","operationId":"handle_create_cvm_with_vm_config_api_v1_cvms_from_cvm_configuration_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VMCreateWithTeepod","description":"The Compose Manifest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VM"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true,"security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/cvms/provision/eliza":{"post":{"tags":["cvm","cvms-deployment","CVM Deployment"],"summary":"Provision Eliza app","description":"Validates Eliza configuration and caches it for 7 days. Returns compose_hash and KMS info for on-chain registration.","operationId":"handle_provision_cvm_for_eliza_api_v1_cvms_provision_eliza_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisionElizaRequest"}}},"required":true},"responses":{"200":{"description":"Provision data with compose_hash for creation","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid configuration"},"401":{"description":"Authentication required"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/provision":{"post":{"tags":["cvm","cvms-deployment","CVM Deployment"],"summary":"Provision DStack app","description":"Validates Docker Compose configuration and caches it for 7 days. Returns compose_hash and KMS info for on-chain registration before creation.","operationId":"handle_provision_cvm_api_v1_cvms_provision_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisionDstackAppRequestV2"}}},"required":true},"responses":{"200":{"description":"Provision data with compose_hash for creation","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid Docker Compose configuration"},"401":{"description":"Authentication required"},"422":{"description":"Validation error"}}}},"/api/v1/cvms/workload":{"post":{"tags":["cvm","cvms-deployment","CVM Deployment"],"summary":"Create GPU workload CVM","description":"Creates a CVM for GPU workloads. Node is auto-selected from available GPU nodes.","operationId":"handle_create_cvm_for_workload_api_v1_cvms_workload_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkloadTappRequest"}}},"required":true},"responses":{"200":{"description":"Created CVM record","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VM"}}}},"400":{"description":"Creation failed"},"401":{"description":"Authentication required"},"409":{"description":"CVM name already exists in workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/cvms":{"post":{"tags":["cvm","cvms-deployment","CVM Deployment"],"summary":"Create CVM from provision","description":"Creates a CVM using cached provision data from /cvms/provision. Requires compose_hash from the provision response.","operationId":"handle_create_cvm_from_povision_api_v1_cvms_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTappRequest"}}}},"responses":{"200":{"description":"Created CVM record with teepod info","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VM"}}}},"400":{"description":"Invalid payload or provision data expired"},"401":{"description":"Authentication required"},"422":{"description":"Provision data not found"}}},"get":{"tags":["cvm","cvms-management","CVM Management"],"summary":"List CVMs","description":"Returns CVMs in current workspace. Admins can filter by user_id or teepod_id.","operationId":"handle_list_cvms_api_v1_cvms_get","security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"const":"0","type":"string"},{"type":"string","format":"hashid","description":"A hashed identifier that maps to an internal database ID","pattern":"^usr_.+","title":"HashedId[users]","examples":["usr_0123abcd"]},{"type":"null"}],"description":"Filter by owner (admin only). Use '0' for unassigned.","title":"User Id"},"description":"Filter by owner (admin only). Use '0' for unassigned."},{"name":"teepod_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by node ID (admin only)","title":"Teepod Id"},"description":"Filter by node ID (admin only)"}],"responses":{"200":{"description":"List of CVM summaries","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/HostedCvm"}},{"type":"array","items":{"$ref":"#/components/schemas/CVMInfo"}}],"title":"Response Handle List Cvms Api V1 Cvms Get"}}}},"401":{"description":"Authentication required"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/eliza":{"post":{"tags":["cvm","cvms-deployment","CVM Deployment"],"summary":"Create Eliza from provision","description":"Creates an Eliza CVM using cached provision data from /cvms/provision/eliza. Requires compose_hash from the provision response.","operationId":"handle_create_eliza_from_provision_api_v1_cvms_eliza_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTappRequest"}}},"required":true},"responses":{"200":{"description":"Created Eliza CVM record","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VM"}}}},"400":{"description":"Invalid payload"},"401":{"description":"Authentication required"},"422":{"description":"Provision data not found or expired"}}}},"/api/v1/cvms/{cvm_id}/compose_file":{"get":{"tags":["cvm","cvms-deployment","CVM Configuration"],"summary":"Get raw compose file","description":"Returns the complete compose file as JSON or raw text based on query param.","operationId":"get_cvm_compose_file_api_v1_cvms__cvm_id__compose_file_get","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}},{"name":"raw","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Raw"}}],"responses":{"200":{"description":"Compose file content","content":{"application/json":{"schema":{}}}},"401":{"description":"Authentication required"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM not found"},"500":{"description":"Failed to retrieve compose file"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["cvm","cvms-deployment","CVM Configuration"],"summary":"Trigger compose file update","description":"Applies a provisioned compose file update. Requires compose_hash from provision endpoint. Restarts the CVM with new configuration.","operationId":"trigger_cvm_compose_file_update_api_v1_cvms__cvm_id__compose_file_patch","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_trigger_cvm_compose_file_update_api_v1_cvms__cvm_id__compose_file_patch"}}}},"responses":{"202":{"description":"Update initiated","content":{"application/json":{"schema":{}}}},"400":{"description":"Provision not found or invalid CVM"},"401":{"description":"Authentication required"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM not found"},"503":{"description":"Node under maintenance"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["cvm","cvms-deployment","CVM Configuration"],"summary":"Submit compose file update","description":"Submit complete compose file with hash verification. Use when you have pre-computed compose_hash and want to skip provision step.","operationId":"submit_cvm_compose_file_update_api_v1_cvms__cvm_id__compose_file_post","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComposeFileUpdateRequest","description":"Complete compose file with hash"}}}},"responses":{"202":{"description":"Update initiated","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid CVM or hash mismatch"},"401":{"description":"Authentication required"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM not found"},"422":{"description":"Invalid Docker Compose syntax"},"503":{"description":"Node under maintenance"}}}},"/api/v1/cvms/{cvm_id}/compose_file/provision":{"post":{"tags":["cvm","cvms-deployment","CVM Configuration"],"summary":"Provision compose file update","description":"Validates new compose file and returns compose_hash for on-chain registration. Cache expires after 7 days.","operationId":"provision_for_cvm_compose_file_update_api_v1_cvms__cvm_id__compose_file_provision_post","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisionComposeFileUpdateRequest","description":"Updated compose configuration"}}}},"responses":{"200":{"description":"Provision response with compose_hash and KMS info","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComposeFileProvisionResponse"}}}},"400":{"description":"Empty Docker Compose file or invalid CVM"},"401":{"description":"Authentication required"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM not found"},"422":{"description":"Invalid Docker Compose syntax"}}}},"/api/v1/cvms/{cvm_id}/compose":{"get":{"tags":["cvm","cvms-deployment","CVM Configuration (Legacy)"],"summary":"Get compose with metadata (legacy)","description":"Deprecated. Returns compose file with env pubkey and salt.","operationId":"handle_get_cvm_compose_api_v1_cvms__cvm_id__compose_get","deprecated":true,"parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CvmComposeFile"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["cvm","cvms-deployment","CVM Configuration (Legacy)"],"summary":"Replace compose file (legacy)","description":"Deprecated. Replaces entire compose configuration and restarts CVM.","operationId":"handle_update_cvm_compose_api_v1_cvms__cvm_id__compose_put","deprecated":true,"parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CvmUpgradePayload","description":"Complete upgrade payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"202":{"description":"Update initiated"},"400":{"description":"Empty Docker Compose or terms violation"},"422":{"description":"Invalid Docker Compose syntax"},"503":{"description":"Node under maintenance"}}},"patch":{"tags":["cvm","cvms-deployment","CVM Configuration"],"summary":"Patch compose file","description":"Partially updates compose file fields (docker_compose_file, pre_launch_script, env) without replacing unchanged parts.","operationId":"handle_patch_cvm_compose_api_v1_cvms__cvm_id__compose_patch","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComposeFilePatchRequest","description":"Fields to update"}}}},"responses":{"202":{"description":"Update initiated","content":{"application/json":{"schema":{}}}},"400":{"description":"Empty Docker Compose or terms violation"},"401":{"description":"Authentication required"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM not found"},"422":{"description":"Invalid Docker Compose syntax"},"500":{"description":"Failed to get current compose"},"503":{"description":"Node under maintenance or offline"}}}},"/api/v1/cvms/{cvm_id}/replicas":{"post":{"tags":["cvm","cvms-deployment","CVM Deployment"],"summary":"Replicate CVM","description":"Create a replica of the CVM on a target node. If request body is omitted, it replicates to the source node and reuses existing env.","operationId":"handle_replicate_cvm_api_v1_cvms__cvm_id__replicas_post","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/teehouse__api__routes__cvms__deployment__ReplicateRequest"},{"type":"null"}],"title":"Request"}}}},"responses":{"200":{"description":"Replica CVM created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid target node, image mismatch, or invalid encrypted_env"},"401":{"description":"Not authenticated"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM or target node not found"},"465":{"description":"KMS allowlist rejection (contract-owned KMS)"},"500":{"description":"Replication failed"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/operations":{"get":{"tags":["cvm","cvms-events","CVM Operations"],"summary":"List CVM operations","description":"Returns operation records grouped by correlation_id. Only includes events with correlation_id (new format since 2024-01). Error messages are sanitized for non-admin users.","operationId":"get_cvm_operations_api_v1_cvms__cvm_id__operations_get","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Opaque cursor from previous response","title":"Cursor"},"description":"Opaque cursor from previous response"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Page size","default":50,"title":"Limit"},"description":"Page size"},{"name":"start_time","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Include operations started after this UTC time","title":"Start Time"},"description":"Include operations started after this UTC time"},{"name":"end_time","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Include operations started before this UTC time","title":"End Time"},"description":"Include operations started before this UTC time"},{"name":"operation_types","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter by operation types (e.g. compose_update, power_on)","title":"Operation Types"},"description":"Filter by operation types (e.g. compose_update, power_on)"}],"responses":{"200":{"description":"Paginated operation records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedCvmOperationsResponse"}}}},"401":{"description":"Authentication required"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/docker-compose.yml":{"get":{"tags":["cvm","cvms-compose-file","CVM Configuration"],"summary":"Get Docker Compose file","description":"Returns the raw Docker Compose YAML content from the CVM configuration.","operationId":"handle_get_cvm_docker_compose_api_v1_cvms__cvm_id__docker_compose_yml_get","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"responses":{"200":{"description":"Docker Compose YAML content","content":{"application/json":{"schema":{"type":"string","title":"Response Handle Get Cvm Docker Compose Api V1 Cvms Cvm Id Docker Compose Yml Get"}}}},"401":{"description":"Authentication required"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/pre-launch-script":{"get":{"tags":["cvm","cvms-compose-file","CVM Configuration"],"summary":"Get pre-launch script","description":"Returns the shell script that runs before containers start.","operationId":"handle_get_cvm_prelaunch_script_api_v1_cvms__cvm_id__pre_launch_script_get","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"responses":{"200":{"description":"Pre-launch shell script content","content":{"application/json":{"schema":{"type":"string","title":"Response Handle Get Cvm Prelaunch Script Api V1 Cvms Cvm Id Pre Launch Script Get"}}}},"401":{"description":"Authentication required"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["cvm","cvms-update-pre-launch-script","CVM Configuration"],"summary":"Update pre-launch script","description":"Replaces the pre-launch script and restarts the CVM. For contract-owned KMS, requires two-phase flow with on-chain hash registration.","operationId":"update_cvm_pre_launch_script_api_v1_cvms__cvm_id__pre_launch_script_patch","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}},{"name":"X-Compose-Hash","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Compose hash from Phase 1 response","title":"X-Compose-Hash"},"description":"Compose hash from Phase 1 response"},{"name":"X-Transaction-Hash","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Transaction hash proving on-chain registration","title":"X-Transaction-Hash"},"description":"Transaction hash proving on-chain registration"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_update_cvm_pre_launch_script_api_v1_cvms__cvm_id__pre_launch_script_patch"}}}},"responses":{"202":{"description":"Update initiated, track via correlation_id","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid content type or empty body"},"401":{"description":"Authentication required"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM not found"},"409":{"description":"Another operation in progress"},"465":{"description":"Compose hash registration required (Phase 1)"},"466":{"description":"Compose hash invalid or expired"},"467":{"description":"Transaction verification failed"},"468":{"description":"Compose hash not allowed on-chain"},"500":{"description":"KMS configuration or RPC error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/available-os-images":{"get":{"tags":["cvm","cvms-patch-compose-file","CVM Configuration"],"summary":"List available OS images","description":"Returns OS images this CVM can upgrade to, filtered by node availability, KMS allowlist, dev/prod upgrade rules, and GPU compatibility.","operationId":"get_available_os_images_api_v1_cvms__cvm_id__available_os_images_get","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"responses":{"200":{"description":"OS images grouped by version (newest first)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/teehouse__api__routes__cvms__patch_compose_file__AvailableOSImage"},"title":"Response Get Available Os Images Api V1 Cvms Cvm Id Available Os Images Get"}}}},"401":{"description":"Authentication required"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/os-image":{"patch":{"tags":["cvm","cvms-patch-compose-file","CVM Configuration"],"summary":"Update OS image","description":"Upgrades the CVM to a different OS image. Shuts down, updates, and restarts. Takes several minutes. Track progress via correlation_id.","operationId":"update_cvm_os_image_api_v1_cvms__cvm_id__os_image_patch","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_update_cvm_os_image_api_v1_cvms__cvm_id__os_image_patch"}}}},"responses":{"202":{"description":"Upgrade initiated, returns correlation_id","content":{"application/json":{"schema":{}}}},"400":{"description":"OS image not available for this CVM"},"401":{"description":"Authentication required"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM not found"},"409":{"description":"Another operation in progress"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/envs":{"patch":{"tags":["cvm","cvms-patch-compose-file","CVM Configuration"],"summary":"Update environment variables","description":"Updates encrypted environment variables. If env_keys changes for contract-owned KMS, requires two-phase flow with on-chain hash registration.","operationId":"update_cvm_envs_api_v1_cvms__cvm_id__envs_patch","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_update_cvm_envs_api_v1_cvms__cvm_id__envs_patch"}}}},"responses":{"202":{"description":"Update initiated, returns correlation_id and allowed_envs_changed flag","content":{"application/json":{"schema":{}}}},"401":{"description":"Authentication required"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM not found"},"409":{"description":"Another operation in progress"},"465":{"description":"Compose hash registration required (env_keys changed, Phase 1)"},"466":{"description":"Compose hash invalid or expired"},"467":{"description":"Transaction verification failed"},"468":{"description":"Compose hash not allowed on-chain"},"500":{"description":"KMS configuration or RPC error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/docker-compose":{"patch":{"tags":["cvm","cvms-update-docker-compose","CVM Configuration"],"summary":"Update Docker Compose file","description":"Replaces the docker-compose.yml and restarts the CVM. For contract-owned KMS, requires two-phase flow with on-chain hash registration.","operationId":"update_cvm_docker_compose_api_v1_cvms__cvm_id__docker_compose_patch","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}},{"name":"X-Compose-Hash","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Compose hash from Phase 1 response","title":"X-Compose-Hash"},"description":"Compose hash from Phase 1 response"},{"name":"X-Transaction-Hash","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Transaction hash proving on-chain registration","title":"X-Transaction-Hash"},"description":"Transaction hash proving on-chain registration"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_update_cvm_docker_compose_api_v1_cvms__cvm_id__docker_compose_patch"}}}},"responses":{"202":{"description":"Update initiated, track via correlation_id","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid content type or empty body"},"401":{"description":"Authentication required"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM not found"},"409":{"description":"Another operation in progress"},"465":{"description":"Compose hash registration required (Phase 1)"},"466":{"description":"Compose hash invalid or expired"},"467":{"description":"Transaction verification failed"},"468":{"description":"Compose hash not allowed on-chain"},"500":{"description":"KMS configuration or RPC error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/revisions/{revision_id}/redeploy":{"post":{"tags":["cvm","cvms-activate-revision","cvms"],"summary":"Redeploy CVM from a specific revision","description":"Switch/rollback a CVM to a specified app revision (compose_hash).","operationId":"redeploy_cvm_revision_api_v1_cvms__cvm_id__revisions__revision_id__redeploy_post","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}},{"name":"revision_id","in":"path","required":true,"schema":{"type":"string","title":"Revision Id"}},{"name":"transaction_hash","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional transaction hash proving on-chain compose hash registration","title":"Transaction Hash"},"description":"Optional transaction hash proving on-chain compose hash registration"}],"responses":{"202":{"description":"Activation initiated","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authenticated"},"403":{"description":"No workspace access"},"404":{"description":"CVM or revision not found"},"409":{"description":"Another operation is in progress"},"465":{"description":"Compose hash registration required (contract-owned KMS)"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/instance-ids":{"patch":{"tags":["cvm","cvms-management","CVM Management"],"summary":"Batch refresh CVM instance IDs","description":"Resolves and persists missing instance_id values. Admin can pass cross-workspace CVM IDs.","operationId":"handle_batch_refresh_cvm_instance_ids_api_v1_cvms_instance_ids_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchInstanceIdRefreshRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchInstanceIdRefreshResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/paginated":{"get":{"tags":["cvm","cvms-management","CVM Management"],"summary":"List CVMs (paginated)","description":"Returns paginated CVMs in current workspace with total count.","operationId":"handle_list_cvms_paginated_api_v1_cvms_paginated_get","security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"const":"0","type":"string"},{"type":"string","format":"hashid","description":"A hashed identifier that maps to an internal database ID","pattern":"^usr_.+","title":"HashedId[users]","examples":["usr_0123abcd"]},{"type":"null"}],"description":"Filter by owner (admin only). Use '0' for unassigned.","title":"User Id"},"description":"Filter by owner (admin only). Use '0' for unassigned."},{"name":"teepod_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by node ID (admin only)","title":"Teepod Id"},"description":"Filter by node ID (admin only)"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page (max 100)","default":30,"title":"Page Size"},"description":"Items per page (max 100)"}],"responses":{"200":{"description":"Paginated CVM list with total count","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PaginatedHostedCvms"},{"$ref":"#/components/schemas/PaginatedCvmInfos"}],"title":"Response Handle List Cvms Paginated Api V1 Cvms Paginated Get"}}}},"401":{"description":"Authentication required"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/instance-id":{"patch":{"tags":["cvm","cvms-management","CVM Management"],"summary":"Refresh CVM instance ID","description":"Resolve and persist instance_id for a CVM. Default behavior only backfills missing values.","operationId":"handle_refresh_cvm_instance_id_api_v1_cvms__cvm_id__instance_id_patch","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstanceIdRefreshRequest","default":{"overwrite":false,"dry_run":false}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstanceIdRefreshResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}":{"get":{"tags":["cvm","cvms-management","CVM Management"],"summary":"Get CVM details","description":"Returns full CVM details including status, network info, and KMS configuration.","operationId":"handle_get_cvm_api_v1_cvms__cvm_id__get","security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"responses":{"200":{"description":"CVM details","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/teehouse__api__routes__cvms__management__CvmBasicInfo"},{"$ref":"#/components/schemas/CVMInfoDetail"}],"title":"Response Handle Get Cvm Api V1 Cvms Cvm Id Get"}}}},"401":{"description":"Authentication required"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["cvm","cvms-management","CVM Operations"],"summary":"Delete CVM","description":"Stops and permanently deletes CVM. Data is not recoverable.","operationId":"handle_remove_cvm_api_v1_cvms__cvm_id__delete","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}},{"name":"polling","in":"query","required":false,"schema":{"anyOf":[{"enum":["v1","v2"],"type":"string"},{"type":"null"}],"description":"Polling version for task routing","title":"Polling"},"description":"Polling version for task routing"}],"responses":{"204":{"description":"Deletion initiated"},"401":{"description":"Authentication required"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/visibility":{"patch":{"tags":["cvm","cvms-management","CVM Management"],"summary":"Update visibility settings","description":"Sets public_sysinfo and public_logs flags. Restarts CVM to apply.","operationId":"handle_update_cvm_visibility_api_v1_cvms__cvm_id__visibility_patch","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_handle_update_cvm_visibility_api_v1_cvms__cvm_id__visibility_patch"}}}},"responses":{"200":{"description":"Updated CVM record","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VM"}}}},"401":{"description":"Authentication required"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM not found"},"409":{"description":"Another operation in progress"},"500":{"description":"Failed to get VM info"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/stats":{"get":{"tags":["cvm","cvms-management","CVM Status"],"summary":"Get CVM system stats","description":"Returns live system metrics (CPU, memory, disk) from the running CVM.","operationId":"handle_get_cvm_stats_api_v1_cvms__cvm_id__stats_get","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"responses":{"200":{"description":"System stats (may be partial if CVM offline)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CvmSystemInfo"}}}},"401":{"description":"Authentication required"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/composition":{"get":{"tags":["cvm","cvms-management","CVM Status"],"summary":"Get CVM composition (deprecated)","description":"Deprecated. Returns container composition and runtime config.","operationId":"handle_get_cvm_composition_api_v1_cvms__cvm_id__composition_get","deprecated":true,"parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CvmComposition"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/attestation":{"get":{"tags":["cvm","cvms-management","CVM Status"],"summary":"Get CVM attestation","description":"Returns TEE attestation data including TCB info and app certificates.","operationId":"handle_get_cvm_attestation_api_v1_cvms__cvm_id__attestation_get","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"responses":{"200":{"description":"Attestation report (may have error if CVM offline)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CvmAttestation"}}}},"401":{"description":"Authentication required"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/network":{"get":{"tags":["cvm","cvms-management","CVM Status"],"summary":"Get CVM network info","description":"Returns network status including internal IP, handshake time, and public URLs.","operationId":"handle_get_cvm_network_info_api_v1_cvms__cvm_id__network_get","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"responses":{"200":{"description":"Network info (may have error if offline)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CvmNetwork"}}}},"401":{"description":"Authentication required"},"403":{"description":"Access denied"},"404":{"description":"CVM not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/start":{"post":{"tags":["cvm","cvms-management","CVM Operations"],"summary":"Start CVM","description":"Powers on a stopped CVM. GPU allocation happens during start.","operationId":"handle_start_cvm_api_v1_cvms__cvm_id__start_post","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_handle_start_cvm_api_v1_cvms__cvm_id__start_post"}}}},"responses":{"200":{"description":"CVM record with starting status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VM"}}}},"401":{"description":"Authentication required"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM not found"},"400":{"description":"Insufficient balance"},"409":{"description":"Another operation in progress"},"500":{"description":"GPU allocation failed"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/shutdown":{"post":{"tags":["cvm","cvms-management","CVM Operations"],"summary":"Shutdown CVM","description":"Gracefully shuts down CVM (SIGTERM then SIGKILL after timeout). Triggers billing.","operationId":"handle_shutdown_cvm_api_v1_cvms__cvm_id__shutdown_post","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_handle_shutdown_cvm_api_v1_cvms__cvm_id__shutdown_post"}}}},"responses":{"200":{"description":"CVM record with shutting_down status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VM"}}}},"401":{"description":"Authentication required"},"403":{"description":"CVM managed by on-demand GPU rental"},"404":{"description":"CVM not found"},"409":{"description":"Another operation in progress"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/stop":{"post":{"tags":["cvm","cvms-management","CVM Operations"],"summary":"Force stop CVM","description":"Immediately stops CVM (like pulling power). Cancels any in-progress operation. Triggers billing.","operationId":"handle_stop_cvm_api_v1_cvms__cvm_id__stop_post","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_handle_stop_cvm_api_v1_cvms__cvm_id__stop_post"}}}},"responses":{"200":{"description":"CVM record with stopping status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VM"}}}},"401":{"description":"Authentication required"},"403":{"description":"CVM managed by on-demand GPU rental"},"404":{"description":"CVM not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/restart":{"post":{"tags":["cvm","cvms-management","CVM Operations"],"summary":"Restart CVM","description":"Stops and starts CVM. Use force=true to skip graceful shutdown.","operationId":"handle_restart_cvm_api_v1_cvms__cvm_id__restart_post","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_handle_restart_cvm_api_v1_cvms__cvm_id__restart_post"}}}},"responses":{"200":{"description":"CVM record with restarting status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VM"}}}},"401":{"description":"Authentication required"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM not found"},"400":{"description":"Insufficient balance"},"409":{"description":"Another operation in progress"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/operation-status":{"get":{"tags":["cvm","cvms-management","CVM Operations"],"summary":"Get operation status","description":"Returns current in-progress operation details including Celery task status.","operationId":"get_operation_status_api_v1_cvms__cvm_id__operation_status_get","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"responses":{"200":{"description":"Operation status (idle if none in progress)","content":{"application/json":{"schema":{}}}},"401":{"description":"Authentication required"},"403":{"description":"CVM not in workspace"},"404":{"description":"CVM not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/resources":{"patch":{"tags":["cvm","cvms-management","CVM Operations"],"summary":"Resize CVM resources","description":"Changes vCPU, memory, or disk size. Restarts CVM to apply. Triggers billing for new rate.","operationId":"handle_resize_cvm_api_v1_cvms__cvm_id__resources_patch","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}},{"name":"polling","in":"query","required":false,"schema":{"anyOf":[{"enum":["v1","v2"],"type":"string"},{"type":"null"}],"description":"Polling version for task routing","title":"Polling"},"description":"Polling version for task routing"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CvmResizePayload"}}}},"responses":{"202":{"description":"Resize initiated","content":{"application/json":{"schema":{}}}},"401":{"description":"Authentication required"},"403":{"description":"CVM managed by on-demand GPU rental"},"404":{"description":"CVM not found"},"409":{"description":"Another operation in progress"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/name":{"patch":{"tags":["cvm","cvms-management"],"summary":"Handle Update Cvm Name","description":"Update CVM name with RFC 1123 validation and availability check","operationId":"handle_update_cvm_name_api_v1_cvms__cvm_id__name_patch","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_handle_update_cvm_name_api_v1_cvms__cvm_id__name_patch"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/listed":{"patch":{"tags":["cvm","cvms-management"],"summary":"Handle Update Cvm Listed","operationId":"handle_update_cvm_listed_api_v1_cvms__cvm_id__listed_patch","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_handle_update_cvm_listed_api_v1_cvms__cvm_id__listed_patch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VM"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/scheduled-delete":{"patch":{"tags":["cvm","cvms-management"],"summary":"Handle Update Cvm Scheduled Delete","description":"Update CVM scheduled delete time","operationId":"handle_update_cvm_scheduled_delete_api_v1_cvms__cvm_id__scheduled_delete_patch","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_handle_update_cvm_scheduled_delete_api_v1_cvms__cvm_id__scheduled_delete_patch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VM"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/batch-stop":{"post":{"tags":["cvm","cvms-management","CVM Operations"],"summary":"Batch stop CVMs","description":"Force stop multiple CVMs at once. Non-admin users can only stop CVMs in their current workspace. Admin users can stop any CVM. Max 50 per request.","operationId":"handle_batch_stop_cvms_api_v1_cvms_batch_stop_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchStopRequest"}}},"required":true},"responses":{"200":{"description":"Batch stop summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchStopResponse"}}}},"401":{"description":"Authentication required"},"400":{"description":"Invalid request (e.g. too many CVMs)"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/status/batch":{"post":{"tags":["cvm","cvms-management"],"summary":"Handle Batch Cvm Status","description":"Batch query CVM real-time status.\n\nGroups by teepod and queries in parallel, returns status updates with\ncomplete async operation information.","operationId":"handle_batch_cvm_status_api_v1_status_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchStatusRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"$ref":"#/components/schemas/CvmStatus"},"type":"object","title":"Response Handle Batch Cvm Status Api V1 Status Batch Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/cvms/{cvm_id}/state":{"get":{"tags":["cvm","cvms-management"],"summary":"Handle Get Cvm State","description":"Get CVM state. Supports two modes:\n\n1. Immediate mode (no target): Returns current state immediately\n2. SSE mode (with target): Streams state updates until status matches target or timeout\n\nExample:\n GET /cvms/{cvm_id}/state - Returns current state\n GET /cvms/{cvm_id}/state?target=running - Streams until status becomes 'running'\n\nSSE connection limit: 5 concurrent connections per user","operationId":"handle_get_cvm_state_api_v1_cvms__cvm_id__state_get","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}},{"name":"target","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Target status to wait for. If specified, returns SSE stream.","title":"Target"},"description":"Target status to wait for. If specified, returns SSE stream."},{"name":"interval","in":"query","required":false,"schema":{"type":"integer","maximum":30,"minimum":5,"description":"Polling interval in seconds (5-30)","default":5,"title":"Interval"},"description":"Polling interval in seconds (5-30)"},{"name":"timeout","in":"query","required":false,"schema":{"type":"integer","maximum":600,"minimum":10,"description":"Maximum wait time in seconds (10-600)","default":300,"title":"Timeout"},"description":"Maximum wait time in seconds (10-600)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/customize-domain-diagnose":{"post":{"tags":["cvm","cvms-tools","CVM Tools"],"summary":"Diagnose custom domain DNS","description":"Verify DNS records for custom domain configuration. Checks CNAME pointing to CVM, TXT records for app verification, and CAA records.","operationId":"diagnose_custom_domains_api_v1_cvms__cvm_id__customize_domain_diagnose_post","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiagnoseDomainsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiagnosisResponse"}}}},"400":{"description":"Invalid request or multiple CVMs with same name"},"401":{"description":"Not authenticated"},"403":{"description":"No access to this CVM"},"404":{"description":"CVM not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cvms/{cvm_id}/user_config":{"get":{"tags":["cvm","cvms-management","cvms-management"],"summary":"Get CVM user config","description":"Returns the user_config stored in Teepod for this CVM, including injected SSH keys.","operationId":"get_cvm_user_config_api_v1_cvms__cvm_id__user_config_get","parameters":[{"name":"cvm_id","in":"path","required":true,"schema":{"type":"string","title":"Cvm Id"}}],"responses":{"200":{"description":"User config retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CvmUserConfig"}}}},"400":{"description":"Invalid CVM identifier format, or multiple CVMs share the same name"},"401":{"description":"Not authenticated"},"404":{"description":"CVM not found or not accessible in this workspace"},"502":{"description":"Teepod returned an error or invalid user_config JSON"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/teepods":{"get":{"tags":["teepod","teepods"],"summary":"List teepods","description":"Return teepod nodes. Regular users see enabled nodes only; admins see all. Use enabled param to filter.","operationId":"list_teepods_api_v1_teepods_get","security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"enabled","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by enabled status (admin only)","title":"Enabled"},"description":"Filter by enabled status (admin only)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Teepod"},"title":"Response List Teepods Api V1 Teepods Get"}}}},"401":{"description":"Not authenticated"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/teepods/available":{"get":{"tags":["teepod","teepods"],"summary":"Get available teepods","description":"Return teepods available for CVM deployment with capacity, KMS list, and GPU availability.","operationId":"handle_get_available_teepods_api_v1_teepods_available_get","parameters":[{"name":"v03x_only","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Only return dstack v0.3.x nodes","title":"V03X Only"},"description":"Only return dstack v0.3.x nodes"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TierCapacity"}}}},"401":{"description":"Not authenticated"},"403":{"description":"No workspace access"},"404":{"description":"User or workspace not found"},"500":{"description":"Teepod query failed"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/teepods/{teepod_id}/images":{"get":{"tags":["teepod","teepods"],"summary":"List teepod images","description":"[DEPRECATED] Use /admin/os-images instead. Returns OS images available on this teepod.","operationId":"list_teepod_available_image_api_v1_teepods__teepod_id__images_get","deprecated":true,"parameters":[{"name":"teepod_id","in":"path","required":true,"schema":{"type":"integer","title":"Teepod Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"description":"Teepod not found"},"500":{"description":"Failed to fetch images from teepod"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/teepods/{teepod_id}/cvms":{"get":{"tags":["teepod","teepods"],"summary":"List hosted CVMs","description":"Admin only. Return all CVMs hosted on a teepod, including unmanaged ones from external DStack deployments.","operationId":"handle_list_hosted_cvms_api_v1_teepods__teepod_id__cvms_get","security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"teepod_id","in":"path","required":true,"schema":{"type":"integer","title":"Teepod Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/HostedCvm"},"title":"Response Handle List Hosted Cvms Api V1 Teepods Teepod Id Cvms Get"}}}},"401":{"description":"Not authenticated"},"403":{"description":"Admin access required"},"404":{"description":"Teepod not found"},"500":{"description":"Failed to fetch CVMs from teepod"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/teepods/{teepod_id}/cvms/{app_id}/list":{"post":{"tags":["teepod","teepods"],"summary":"Bind and list CVM","description":"Admin only. Register an external CVM in the database and mark it as listed.","operationId":"handle_bind_cvm_api_v1_teepods__teepod_id__cvms__app_id__list_post","security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"teepod_id","in":"path","required":true,"schema":{"type":"integer","title":"Teepod Id"}},{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}}],"responses":{"200":{"description":"CVM bound and listed","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authenticated"},"403":{"description":"Admin access required"},"404":{"description":"Teepod not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/kms":{"get":{"tags":["kms","KMS"],"summary":"List KMS instances","description":"Query available KMS instances with pagination. Filter by onchain status to find instances with blockchain integration.","operationId":"list_kms_api_v1_kms_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page (1-100)","default":20,"title":"Page Size"},"description":"Items per page (1-100)"},{"name":"is_onchain","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter: true=onchain only, false=offchain only, omit=all","title":"Is Onchain"},"description":"Filter: true=onchain only, false=offchain only, omit=all"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KmsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/kms/{kms_id}":{"get":{"tags":["kms","KMS"],"summary":"Get KMS details","description":"Retrieve KMS instance details by hashed ID or slug.","operationId":"get_kms_info_api_v1_kms__kms_id__get","parameters":[{"name":"kms_id","in":"path","required":true,"schema":{"type":"string","description":"KMS ID (hashed) or slug","title":"Kms Id"},"description":"KMS ID (hashed) or slug"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KMSInfo"}}}},"404":{"description":"KMS not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/kms/{kms_id}/pubkey/{app_id}":{"get":{"tags":["kms","KMS"],"summary":"Get app encryption pubkey","description":"Retrieve the public key for encrypting environment variables before deployment.","operationId":"get_app_env_encrypt_pubkey_api_v1_kms__kms_id__pubkey__app_id__get","parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","description":"40-character hex string, with or without 0x prefix","title":"App Id"},"description":"40-character hex string, with or without 0x prefix"},{"name":"kms_id","in":"path","required":true,"schema":{"type":"string","description":"KMS ID (hashed) or slug","title":"Kms Id"},"description":"KMS ID (hashed) or slug"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid app ID format"},"404":{"description":"KMS not found"},"500":{"description":"KMS connection or internal error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/kms/phala/next_app_id":{"get":{"tags":["kms","KMS"],"summary":"Predict next app IDs","description":"Predict the next N app IDs that will be assigned to the team's wallet. Maximum 20 predictions allowed.","operationId":"get_next_app_id_api_v1_kms_phala_next_app_id_get","parameters":[{"name":"counts","in":"query","required":false,"schema":{"type":"integer","maximum":20,"minimum":1,"description":"Number of app IDs to predict (1-20)","default":1,"title":"Counts"},"description":"Number of app IDs to predict (1-20)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authenticated"},"403":{"description":"No workspace access"},"404":{"description":"Workspace not found"},"500":{"description":"Team has no wallet or prediction failed"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/apps":{"get":{"tags":["apps","apps-list","apps"],"summary":"List apps","description":"Returns paginated app list with filtering. Response schema varies by API version.","operationId":"list_dstack_apps_api_v1_apps_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":20,"title":"Page Size"},"description":"Items per page"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search name, app_id, vm_uuid, instance_id","title":"Search"},"description":"Search name, app_id, vm_uuid, instance_id"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"CVM status filter","title":"Status"},"description":"CVM status filter"},{"name":"listed","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Listed status filter","title":"Listed"},"description":"Listed status filter"},{"name":"base_image","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"OS image name filter","title":"Base Image"},"description":"OS image name filter"},{"name":"instance_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Instance type filter","title":"Instance Type"},"description":"Instance type filter"},{"name":"kms_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"KMS slug filter","title":"Kms Slug"},"description":"KMS slug filter"},{"name":"kms_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"KMS type filter","title":"Kms Type"},"description":"KMS type filter"},{"name":"node","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Node name filter (matches teepod or node name)","title":"Node"},"description":"Node name filter (matches teepod or node name)"},{"name":"region","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Region identifier filter","title":"Region"},"description":"Region identifier filter"}],"responses":{"200":{"description":"Paginated app list","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/teehouse__api__routes__apps__v20251028__schemas__DstackAppListResponse"},{"$ref":"#/components/schemas/teehouse__api__routes__apps__v20260121__schemas__DstackAppListResponse"}],"title":"Response List Dstack Apps Api V1 Apps Get"}}}},"401":{"description":"Not authenticated"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/apps/filter-options":{"get":{"tags":["apps","apps-list","apps"],"summary":"Get app filter options","description":"Returns distinct values for each filterable field based on user's apps.","operationId":"get_filter_options_api_v1_apps_filter_options_get","responses":{"200":{"description":"Available filter values","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilterOptionsResponse"}}}},"401":{"description":"Not authenticated"}}}},"/api/v1/apps/{app_id}":{"get":{"tags":["apps","apps-detail","apps"],"summary":"Get app details","description":"Returns app metadata and current CVM configuration. Response schema varies by API version.","operationId":"get_dstack_app_api_v1_apps__app_id__get","parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","description":"Hex app identifier","title":"App Id"},"description":"Hex app identifier"}],"responses":{"200":{"description":"App details with CVM info","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/teehouse__api__routes__apps__v20251028__schemas__DstackAppFullResponse"},{"$ref":"#/components/schemas/DstackAppMinimalResponse"},{"$ref":"#/components/schemas/teehouse__api__routes__apps__v20260121__schemas__DstackAppFullResponse"},{"$ref":"#/components/schemas/DstackAppMinimalResponse"}],"title":"Response Get Dstack App Api V1 Apps App Id Get"}}}},"401":{"description":"Not authenticated"},"403":{"description":"No workspace access"},"404":{"description":"App not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/apps/{app_id}/cvms":{"get":{"tags":["apps","apps-cvms","apps"],"summary":"List app CVMs","description":"Returns CVM instances for an app. Admins see all instances; users see only their own.","operationId":"handle_get_app_cvms_api_v1_apps__app_id__cvms_get","security":[{"OAuth2AuthorizationCodeBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","description":"Hex app identifier","title":"App Id"},"description":"Hex app identifier"}],"responses":{"200":{"description":"List of CVM instances","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/HostedCvm"}},{"type":"array","items":{"$ref":"#/components/schemas/CVMInfo"}}],"title":"Response Handle Get App Cvms Api V1 Apps App Id Cvms Get"}}}},"401":{"description":"Not authenticated"},"403":{"description":"No workspace access"},"404":{"description":"App not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/apps/{app_id}/cvms/{vm_uuid}/replicas":{"post":{"tags":["apps","apps-cvms","apps"],"summary":"Create CVM replica","description":"Clones a CVM to a target node. Uses source node if target not specified.","operationId":"handle_replicate_cvm_api_v1_apps__app_id__cvms__vm_uuid__replicas_post","parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","description":"Hex app identifier","title":"App Id"},"description":"Hex app identifier"},{"name":"vm_uuid","in":"path","required":true,"schema":{"type":"string","description":"Source CVM UUID","title":"Vm Uuid"},"description":"Source CVM UUID"}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/teehouse__api__routes__apps__schemas__ReplicateRequest"},{"type":"null"}],"title":"Request"}}}},"responses":{"200":{"description":"Replica CVM created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VM"}}}},"400":{"description":"App ID mismatch, no OS image, or invalid target node"},"401":{"description":"Not authenticated"},"403":{"description":"No workspace access"},"404":{"description":"CVM or target node not found"},"500":{"description":"Replication failed"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/apps/{app_id}/attestations":{"get":{"tags":["apps","apps-attestations","apps"],"summary":"Get app attestation data","description":"Returns TEE attestation quotes, event logs, and KMS configuration for running CVMs.","operationId":"handle_get_app_attestation_api_v1_apps__app_id__attestations_get","parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","description":"Hex app identifier","title":"App Id"},"description":"Hex app identifier"}],"responses":{"200":{"description":"Attestation data with KMS info and instance quotes","content":{"application/json":{"schema":{}}}},"404":{"description":"App not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/apps/{app_id}/revisions":{"get":{"tags":["apps","apps-revisions","apps"],"summary":"List app revisions","description":"Returns deployment history with compose hashes, operation types, and user refs.","operationId":"get_app_revisions_api_v1_apps__app_id__revisions_get","parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","description":"Hex app identifier","title":"App Id"},"description":"Hex app identifier"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Items per page","default":50,"title":"Page Size"},"description":"Items per page"}],"responses":{"200":{"description":"Paginated revision list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppRevisionsResponse"}}}},"401":{"description":"Not authenticated"},"403":{"description":"No workspace access"},"404":{"description":"App not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/apps/{app_id}/revisions/{revision_id}":{"get":{"tags":["apps","apps-revisions","apps"],"summary":"Get revision detail","description":"Returns full revision data including compose file, encrypted env, and user config.","operationId":"get_app_revision_detail_api_v1_apps__app_id__revisions__revision_id__get","parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","description":"Hex app identifier","title":"App Id"},"description":"Hex app identifier"},{"name":"revision_id","in":"path","required":true,"schema":{"type":"string","title":"Revision Id"}},{"name":"raw_compose_file","in":"query","required":false,"schema":{"type":"boolean","description":"Return compose_file as string instead of dict","default":false,"title":"Raw Compose File"},"description":"Return compose_file as string instead of dict"}],"responses":{"200":{"description":"Revision detail with compose file","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppRevisionDetailResponse"}}}},"401":{"description":"Not authenticated"},"403":{"description":"No workspace access"},"404":{"description":"App or revision not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/apps/{app_id}/revisions/{revision_id}/redeploy":{"post":{"tags":["apps","apps-revisions","apps"],"summary":"Redeploy app from a specific revision","description":"Redeploy a CVM to a specific revision. If the app has exactly one CVM, it will be redeployed by default. If the app has multiple CVMs, you must specify target vm_uuids in request body. This schedules async CVM update task(s).","operationId":"redeploy_app_revision_api_v1_apps__app_id__revisions__revision_id__redeploy_post","parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","description":"Hex app identifier","title":"App Id"},"description":"Hex app identifier"},{"name":"revision_id","in":"path","required":true,"schema":{"type":"string","title":"Revision Id"}},{"name":"transaction_hash","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional transaction hash proving on-chain compose hash registration","title":"Transaction Hash"},"description":"Optional transaction hash proving on-chain compose hash registration"}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/RedeployRevisionRequest"},{"type":"null"}],"description":"Optional target CVM selection. If the app has multiple CVMs, you must specify vm_uuids.","title":"Payload"}}}},"responses":{"202":{"description":"Activation initiated","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authenticated"},"403":{"description":"No workspace access"},"404":{"description":"App or revision not found"},"409":{"description":"Another operation is in progress"},"465":{"description":"Compose hash registration required (contract-owned KMS)"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/apps/{app_id}/events":{"get":{"tags":["apps","apps-events","apps"],"summary":"Get app events","description":"**DEPRECATED**: Returns instance lifecycle events from ClickHouse. Will be removed.","operationId":"get_app_events_api_v1_apps__app_id__events_get","deprecated":true,"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","description":"Hex app identifier","title":"App Id"},"description":"Hex app identifier"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Max events to return","default":100,"title":"Limit"},"description":"Max events to return"},{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by event type","title":"Event Type"},"description":"Filter by event type"},{"name":"instance_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by instance UUID","title":"Instance Id"},"description":"Filter by instance UUID"},{"name":"operation_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by operation type","title":"Operation Type"},"description":"Filter by operation type"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start date (ISO 8601)","title":"Start Date"},"description":"Start date (ISO 8601)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End date (ISO 8601)","title":"End Date"},"description":"End date (ISO 8601)"}],"responses":{"200":{"description":"Event list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppEventsResponse"}}}},"401":{"description":"Not authenticated"},"403":{"description":"No workspace access"},"404":{"description":"App not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/apps/{app_id}/usage":{"get":{"tags":["apps","apps-usage","apps"],"summary":"Get app metered usage","description":"Returns billing usage records from ClickHouse. Defaults to 7-day window if dates not specified.","operationId":"get_app_usage_api_v1_apps__app_id__usage_get","parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","description":"Hex app identifier","title":"App Id"},"description":"Hex app identifier"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time","examples":["2024-01-01T00:00:00Z"]},{"type":"null"}],"description":"Start date (ISO 8601)","title":"Start Date"},"description":"Start date (ISO 8601)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time","examples":["2024-01-01T00:00:00Z"]},{"type":"null"}],"description":"End date (ISO 8601)","title":"End Date"},"description":"End date (ISO 8601)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":5000,"minimum":1,"description":"Max records to return","default":500,"title":"Limit"},"description":"Max records to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Records to skip","default":0,"title":"Offset"},"description":"Records to skip"}],"responses":{"200":{"description":"Usage records with cost breakdown","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppUsageResponse"}}}},"400":{"description":"end_date before start_date"},"401":{"description":"Not authenticated"},"403":{"description":"No workspace access"},"404":{"description":"App not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/redpill/connect":{"post":{"tags":["redpill","Redpill"],"summary":"Connect user to Redpill","description":"Creates a Redpill account for the user and allocates initial credits. Requires minimum 5 credits in the workspace account.","operationId":"connect_redpill_user_api_v1_redpill_connect_post","responses":{"200":{"description":"Connection successful","content":{"application/json":{"schema":{}}}},"400":{"description":"Insufficient credits (minimum 5 required) or already connected"},"401":{"description":"Not authenticated"}}}},"/api/v1/redpill/api-keys":{"get":{"tags":["redpill","Redpill"],"summary":"List Redpill API keys","description":"Returns all API keys for the user's Redpill account. Keys are masked; full key is only shown at creation.","operationId":"list_redpill_api_keys_api_v1_redpill_api_keys_get","responses":{"200":{"description":"List of API keys with count","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authenticated"}}},"post":{"tags":["redpill","Redpill"],"summary":"Create Redpill API key","description":"Generates a new API key for accessing Redpill LLM services.","operationId":"create_redpill_api_key_api_v1_redpill_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedpillApiKeyCreate"}}}},"responses":{"200":{"description":"API key created","content":{"application/json":{"schema":{}}}},"400":{"description":"Failed to create API key"},"401":{"description":"Not authenticated"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/redpill/api-keys/{api_key_id}":{"patch":{"tags":["redpill","Redpill"],"summary":"Toggle Redpill API key","description":"Enables or disables a Redpill API key. Disabled keys reject requests.","operationId":"update_redpill_api_key_api_v1_redpill_api_keys__api_key_id__patch","parameters":[{"name":"api_key_id","in":"path","required":true,"schema":{"type":"integer","description":"Redpill API key ID","title":"Api Key Id"},"description":"Redpill API key ID"},{"name":"active","in":"query","required":true,"schema":{"type":"boolean","description":"True to enable, false to disable","title":"Active"},"description":"True to enable, false to disable"}],"responses":{"200":{"description":"API key updated","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authenticated"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/redpill/models":{"get":{"tags":["redpill","Redpill"],"summary":"List available LLM models","description":"Returns all LLM models available through Redpill. No authentication required.","operationId":"list_models_api_v1_redpill_models_get","responses":{"200":{"description":"List of models with count","content":{"application/json":{"schema":{}}}},"400":{"description":"Failed to fetch models from Redpill"}}}},"/api/v1/redpill/usage/daily":{"get":{"tags":["redpill","Redpill"],"summary":"Get daily usage statistics","description":"Returns aggregated daily usage data for the user's Redpill connection.","operationId":"get_daily_usage_api_v1_redpill_usage_daily_get","parameters":[{"name":"key_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by API key ID","title":"Key Id"},"description":"Filter by API key ID"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start date (ISO 8601)","title":"Start Date"},"description":"Start date (ISO 8601)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End date (ISO 8601)","title":"End Date"},"description":"End date (ISO 8601)"}],"responses":{"200":{"description":"Daily usage data","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authenticated"},"404":{"description":"Not connected to Redpill"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/redpill/usage/logs":{"get":{"tags":["redpill","Redpill"],"summary":"Get usage logs","description":"Returns paginated usage logs for the user's Redpill connection.","operationId":"get_usage_logs_api_v1_redpill_usage_logs_get","parameters":[{"name":"key_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by API key ID","title":"Key Id"},"description":"Filter by API key ID"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start date (ISO 8601)","title":"Start Date"},"description":"Start date (ISO 8601)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End date (ISO 8601)","title":"End Date"},"description":"End date (ISO 8601)"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":20,"title":"Page Size"},"description":"Items per page"}],"responses":{"200":{"description":"Usage logs","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authenticated"},"404":{"description":"Not connected to Redpill"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/redpill/logs/{api_key_id}":{"get":{"tags":["redpill","Redpill"],"summary":"Get API key usage logs","description":"Returns usage history for a specific Redpill API key, including model calls and token counts.","operationId":"list_api_key_logs_api_v1_redpill_logs__api_key_id__get","parameters":[{"name":"api_key_id","in":"path","required":true,"schema":{"type":"integer","description":"Redpill API key ID","title":"Api Key Id"},"description":"Redpill API key ID"}],"responses":{"200":{"description":"List of usage logs with count","content":{"application/json":{"schema":{}}}},"400":{"description":"Failed to fetch logs from Redpill"},"401":{"description":"Not authenticated"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attestations/verify":{"post":{"tags":["attestations","attestations","attestations"],"summary":"Verify TEE quote","description":"Accepts quote as file upload, form hex, or JSON hex. 0x prefix handled automatically.","operationId":"handle_upload_and_verify_api_v1_attestations_verify_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_handle_upload_and_verify_api_v1_attestations_verify_post"}}}},"responses":{"200":{"description":"Quote verified","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerificationResponse"}}}},"400":{"description":"Invalid quote format or verification failed"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attestations/recent":{"get":{"tags":["attestations","attestations","attestations"],"summary":"List recent quotes","description":"Public endpoint. Returns recently uploaded quotes ordered by timestamp.","operationId":"handle_list_recent_api_v1_attestations_recent_get","parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Offset for pagination","default":0,"title":"Skip"},"description":"Offset for pagination"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Max results","default":20,"title":"Limit"},"description":"Max results"}],"responses":{"200":{"description":"List of recent quotes","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attestations/view/{checksum}":{"get":{"tags":["attestations","attestations","attestations"],"summary":"View quote details","description":"Public endpoint. Returns parsed quote data with verification status.","operationId":"handle_view_api_v1_attestations_view__checksum__get","parameters":[{"name":"checksum","in":"path","required":true,"schema":{"type":"string","description":"Quote SHA256 checksum","title":"Checksum"},"description":"Quote SHA256 checksum"}],"responses":{"200":{"description":"Quote details","content":{"application/json":{"schema":{}}}},"404":{"description":"Quote not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attestations/collateral/{checksum}":{"get":{"tags":["attestations","attestations","attestations"],"summary":"Get quote collateral","description":"Returns TCB collateral data for quote verification. Cached for 24 hours.","operationId":"get_collateral_api_v1_attestations_collateral__checksum__get","parameters":[{"name":"checksum","in":"path","required":true,"schema":{"type":"string","description":"Quote SHA256 checksum","title":"Checksum"},"description":"Quote SHA256 checksum"}],"responses":{"200":{"description":"Collateral data","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad quote data"},"404":{"description":"Quote not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attestations/raw/{checksum}":{"get":{"tags":["attestations","attestations","attestations"],"summary":"Download raw quote","description":"Returns raw quote bytes as binary file attachment.","operationId":"handle_get_raw_api_v1_attestations_raw__checksum__get","parameters":[{"name":"checksum","in":"path","required":true,"schema":{"type":"string","description":"Quote SHA256 checksum","title":"Checksum"},"description":"Quote SHA256 checksum"}],"responses":{"200":{"description":"Binary quote file","content":{"application/json":{"schema":{}},"application/octet-stream":{}}},"404":{"description":"Quote not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"head":{"tags":["attestations","attestations","attestations"],"summary":"Check raw quote exists","description":"Returns headers without body. Use to check existence and get Content-Length.","operationId":"handle_check_raw_file_api_v1_attestations_raw__checksum__head","parameters":[{"name":"checksum","in":"path","required":true,"schema":{"type":"string","description":"Quote SHA256 checksum","title":"Checksum"},"description":"Quote SHA256 checksum"}],"responses":{"200":{"description":"Quote exists","content":{"application/json":{"schema":{}}}},"404":{"description":"Quote not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attestations/ppids":{"get":{"tags":["attestations","attestations"],"summary":"List node PPIDs","description":"Public endpoint. Returns PPID list from nodes table (excluding deleted).","operationId":"handle_list_ppids_api_v1_attestations_ppids_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/attestations/device_ids":{"get":{"tags":["attestations","attestations"],"summary":"List node device IDs","description":"Public endpoint. Returns device_id list from nodes table (excluding deleted).","operationId":"handle_list_device_ids_api_v1_attestations_device_ids_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/attestations/nodes":{"get":{"tags":["attestations","attestations"],"summary":"List nodes","description":"Public endpoint. Returns NodeRef list derived from nodes table (excluding deleted).","operationId":"handle_list_nodes_api_v1_attestations_nodes_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/NodeRef"},"type":"array","title":"Response Handle List Nodes Api V1 Attestations Nodes Get"}}}}}}},"/health":{"get":{"summary":"Health Check","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AcmeFetchResult":{"properties":{"url":{"type":"string","title":"Url","description":"ACME endpoint URL queried"},"http_ok":{"type":"boolean","title":"Http Ok","description":"True if HTTP 200 response received"},"uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uri","description":"Account URI from response body"},"status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status Code","description":"HTTP status code returned"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error message if request failed"}},"type":"object","required":["url","http_ok"],"title":"AcmeFetchResult","description":"Result of an ACME account fetch attempt."},"AppComposeV2":{"properties":{"allowed_envs":{"items":{"type":"string"},"type":"array","title":"Allowed Envs"},"bash_script":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bash Script"},"default_gateway_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Gateway Domain"},"docker_compose_file":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Docker Compose File"},"init_script":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Init Script"},"kms_enabled":{"type":"boolean","title":"Kms Enabled","default":true},"local_key_provider_enabled":{"type":"boolean","title":"Local Key Provider Enabled","default":false},"manifest_version":{"type":"integer","title":"Manifest Version","default":2},"name":{"type":"string","title":"Name"},"no_instance_id":{"type":"boolean","title":"No Instance Id","default":false},"pre_launch_script":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pre Launch Script"},"public_logs":{"type":"boolean","title":"Public Logs","default":true},"public_sysinfo":{"type":"boolean","title":"Public Sysinfo","default":true},"public_tcbinfo":{"type":"boolean","title":"Public Tcbinfo","default":true},"runner":{"type":"string","title":"Runner","default":"docker-compose"},"gateway_enabled":{"type":"boolean","title":"Gateway Enabled","default":true},"features":{"items":{"type":"string"},"type":"array","title":"Features","default":["kms","tproxy-net"]},"salt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Salt"},"secure_time":{"type":"boolean","title":"Secure Time","default":false},"storage_fs":{"anyOf":[{"type":"string","const":"ext4"},{"type":"string","const":"zfs"},{"type":"null"}],"title":"Storage Fs","default":"zfs"},"tproxy_enabled":{"type":"boolean","title":"Tproxy Enabled","default":true}},"type":"object","required":["name"],"title":"AppComposeV2"},"AppEventsResponse":{"properties":{"events":{"items":{"$ref":"#/components/schemas/InstanceEventResponse"},"type":"array","title":"Events","description":"Event records"},"total":{"type":"integer","title":"Total","description":"Number of events returned"}},"type":"object","required":["events","total"],"title":"AppEventsResponse","description":"Instance event list response."},"AppRevisionDetailResponse":{"properties":{"revision_id":{"type":"string","title":"Revision Id","description":"Revision record identifier (hashid of snowflake_id)"},"app_id":{"type":"string","title":"App Id","description":"Hex app identifier"},"vm_uuid":{"type":"string","title":"Vm Uuid","description":"CVM UUID"},"compose_hash":{"type":"string","title":"Compose Hash","description":"SHA-256 hash of compose file"},"compose_file":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"string"},{"type":"null"}],"title":"Compose File","description":"Docker compose content (dict or raw string)"},"encrypted_env":{"type":"string","title":"Encrypted Env","description":"Hex-encoded encrypted environment variables"},"user_config":{"type":"string","title":"User Config","description":"JSON user configuration string"},"created_at":{"type":"string","title":"Created At","description":"Revision timestamp (ISO 8601)"},"trace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trace Id","description":"Request trace ID for debugging"},"operation_type":{"type":"string","title":"Operation Type","description":"Operation: deploy, update, restart, etc."},"triggered_by":{"anyOf":[{"$ref":"#/components/schemas/UserRef"},{"type":"null"}],"description":"User who triggered the operation"},"cvm":{"anyOf":[{"$ref":"#/components/schemas/CvmRef"},{"type":"null"}],"description":"CVM reference"},"workspace":{"anyOf":[{"$ref":"#/components/schemas/WorkspaceRef"},{"type":"null"}],"description":"Workspace reference"}},"type":"object","required":["revision_id","app_id","vm_uuid","compose_hash","compose_file","encrypted_env","user_config","created_at","trace_id","operation_type"],"title":"AppRevisionDetailResponse","description":"Full revision detail with configuration data."},"AppRevisionResponse":{"properties":{"revision_id":{"type":"string","title":"Revision Id","description":"Revision record identifier (hashid of snowflake_id)"},"app_id":{"type":"string","title":"App Id","description":"Hex app identifier"},"vm_uuid":{"type":"string","title":"Vm Uuid","description":"CVM UUID"},"compose_hash":{"type":"string","title":"Compose Hash","description":"SHA-256 hash of compose file"},"created_at":{"type":"string","title":"Created At","description":"Revision timestamp (ISO 8601)"},"trace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trace Id","description":"Request trace ID for debugging"},"operation_type":{"type":"string","title":"Operation Type","description":"Operation: deploy, update, restart, etc."},"triggered_by":{"anyOf":[{"$ref":"#/components/schemas/UserRef"},{"type":"null"}],"description":"User who triggered the operation"},"cvm":{"anyOf":[{"$ref":"#/components/schemas/CvmRef"},{"type":"null"}],"description":"CVM reference"},"workspace":{"anyOf":[{"$ref":"#/components/schemas/WorkspaceRef"},{"type":"null"}],"description":"Workspace reference"}},"type":"object","required":["revision_id","app_id","vm_uuid","compose_hash","created_at","trace_id","operation_type"],"title":"AppRevisionResponse","description":"App deployment revision summary."},"AppRevisionsResponse":{"properties":{"revisions":{"items":{"$ref":"#/components/schemas/AppRevisionResponse"},"type":"array","title":"Revisions","description":"Revision records"},"total":{"type":"integer","title":"Total","description":"Total revision count"},"page":{"type":"integer","title":"Page","description":"Current page number"},"page_size":{"type":"integer","title":"Page Size","description":"Items per page"},"total_pages":{"type":"integer","title":"Total Pages","description":"Total page count"}},"type":"object","required":["revisions","total","page","page_size","total_pages"],"title":"AppRevisionsResponse","description":"Paginated revision list."},"AppUsageResponse":{"properties":{"usage":{"items":{"$ref":"#/components/schemas/MeteredUsageResponse"},"type":"array","title":"Usage","description":"Usage records"},"total":{"type":"integer","title":"Total","description":"Number of records returned"},"total_cost":{"type":"number","title":"Total Cost","description":"Sum of costs in USD"}},"type":"object","required":["usage","total","total_cost"],"title":"AppUsageResponse","description":"App usage response with cost summary."},"AttestationKeyType":{"type":"integer","enum":[2,3],"title":"AttestationKeyType","description":"Attestation key type (subset used in SGX/TDX DCAP quotes)."},"BatchInstanceIdRefreshRequest":{"properties":{"cvm_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Cvm Ids","description":"Optional CVM identifiers. Admin can pass cross-workspace IDs."},"running_only":{"type":"boolean","title":"Running Only","description":"Only process CVMs with status=running","default":true},"missing_only":{"type":"boolean","title":"Missing Only","description":"Only process CVMs with missing instance_id","default":true},"overwrite":{"type":"boolean","title":"Overwrite","description":"Overwrite existing instance_id when different","default":false},"limit":{"type":"integer","maximum":500.0,"minimum":1.0,"title":"Limit","description":"Max CVMs to process in one request","default":100},"dry_run":{"type":"boolean","title":"Dry Run","description":"Preview changes without persisting","default":false}},"type":"object","title":"BatchInstanceIdRefreshRequest"},"BatchInstanceIdRefreshResponse":{"properties":{"total":{"type":"integer","title":"Total"},"scanned":{"type":"integer","title":"Scanned"},"updated":{"type":"integer","title":"Updated"},"unchanged":{"type":"integer","title":"Unchanged"},"skipped":{"type":"integer","title":"Skipped"},"conflicts":{"type":"integer","title":"Conflicts"},"errors":{"type":"integer","title":"Errors"},"items":{"items":{"$ref":"#/components/schemas/InstanceIdRefreshResult"},"type":"array","title":"Items"}},"type":"object","required":["total","scanned","updated","unchanged","skipped","conflicts","errors","items"],"title":"BatchInstanceIdRefreshResponse"},"BatchStatusRequest":{"properties":{"vm_uuids":{"items":{"type":"string"},"type":"array","title":"Vm Uuids"}},"type":"object","required":["vm_uuids"],"title":"BatchStatusRequest"},"BatchStopErrorEntry":{"properties":{"cvm_id":{"type":"string","title":"Cvm Id","description":"Hashed CVM ID"},"error":{"type":"string","title":"Error","description":"Error message"}},"type":"object","required":["cvm_id","error"],"title":"BatchStopErrorEntry","description":"Error detail for a single CVM in batch stop."},"BatchStopRequest":{"properties":{"cvm_ids":{"items":{"type":"string"},"type":"array","maxItems":50,"title":"Cvm Ids","description":"List of CVM hash IDs to stop"}},"type":"object","required":["cvm_ids"],"title":"BatchStopRequest","description":"Request to batch stop multiple CVMs."},"BatchStopResponse":{"properties":{"total":{"type":"integer","title":"Total","description":"Total CVMs requested"},"stopped":{"type":"integer","title":"Stopped","description":"CVMs successfully scheduled for stop"},"skipped":{"type":"integer","title":"Skipped","description":"CVMs skipped (in_progress, no vm_uuid, GPU rental managed)"},"errors":{"items":{"$ref":"#/components/schemas/BatchStopErrorEntry"},"type":"array","title":"Errors","description":"CVMs that failed to stop"}},"type":"object","required":["total","stopped","skipped"],"title":"BatchStopResponse","description":"Summary of batch stop operation."},"BillingPeriod":{"type":"string","enum":["skip","hourly","monthly"],"title":"BillingPeriod"},"Body_api_verify_email_token_api_v1_auth_verify_email_token_post":{"properties":{"request":{"$ref":"#/components/schemas/EmailTokenVerificationRequest"},"site_key":{"type":"string","title":"Site Key"}},"type":"object","required":["request"],"title":"Body_api_verify_email_token_api_v1_auth_verify_email_token_post"},"Body_handle_restart_cvm_api_v1_cvms__cvm_id__restart_post":{"properties":{"force":{"type":"boolean","title":"Force","description":"Skip graceful shutdown","default":false},"polling":{"anyOf":[{"type":"string","enum":["v1","v2"]},{"type":"null"}],"title":"Polling","description":"Polling version for task routing"}},"type":"object","title":"Body_handle_restart_cvm_api_v1_cvms__cvm_id__restart_post"},"Body_handle_shutdown_cvm_api_v1_cvms__cvm_id__shutdown_post":{"properties":{"polling":{"anyOf":[{"type":"string","enum":["v1","v2"]},{"type":"null"}],"title":"Polling","description":"Polling version for task routing"}},"type":"object","title":"Body_handle_shutdown_cvm_api_v1_cvms__cvm_id__shutdown_post"},"Body_handle_start_cvm_api_v1_cvms__cvm_id__start_post":{"properties":{"polling":{"anyOf":[{"type":"string","enum":["v1","v2"]},{"type":"null"}],"title":"Polling","description":"Polling version for task routing"}},"type":"object","title":"Body_handle_start_cvm_api_v1_cvms__cvm_id__start_post"},"Body_handle_stop_cvm_api_v1_cvms__cvm_id__stop_post":{"properties":{"polling":{"anyOf":[{"type":"string","enum":["v1","v2"]},{"type":"null"}],"title":"Polling","description":"Polling version for task routing"}},"type":"object","title":"Body_handle_stop_cvm_api_v1_cvms__cvm_id__stop_post"},"Body_handle_update_cvm_listed_api_v1_cvms__cvm_id__listed_patch":{"properties":{"listed":{"type":"boolean","title":"Listed"}},"type":"object","required":["listed"],"title":"Body_handle_update_cvm_listed_api_v1_cvms__cvm_id__listed_patch"},"Body_handle_update_cvm_name_api_v1_cvms__cvm_id__name_patch":{"properties":{"name":{"type":"string","title":"Name"}},"type":"object","required":["name"],"title":"Body_handle_update_cvm_name_api_v1_cvms__cvm_id__name_patch"},"Body_handle_update_cvm_scheduled_delete_api_v1_cvms__cvm_id__scheduled_delete_patch":{"properties":{"scheduled_delete_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled Delete At"}},"type":"object","title":"Body_handle_update_cvm_scheduled_delete_api_v1_cvms__cvm_id__scheduled_delete_patch"},"Body_handle_update_cvm_visibility_api_v1_cvms__cvm_id__visibility_patch":{"properties":{"public_sysinfo":{"type":"boolean","title":"Public Sysinfo","description":"Expose system info publicly"},"public_logs":{"type":"boolean","title":"Public Logs","description":"Expose container logs publicly"},"public_tcbinfo":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Public Tcbinfo","description":"Expose TCB attestation info publicly"},"polling":{"anyOf":[{"type":"string","enum":["v1","v2"]},{"type":"null"}],"title":"Polling","description":"Polling version for task routing"}},"type":"object","required":["public_sysinfo","public_logs"],"title":"Body_handle_update_cvm_visibility_api_v1_cvms__cvm_id__visibility_patch"},"Body_handle_upload_and_verify_api_v1_attestations_verify_post":{"properties":{"file":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"File"},"hex":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hex"}},"type":"object","title":"Body_handle_upload_and_verify_api_v1_attestations_verify_post"},"Body_login_for_access_token_api_v1_auth_token_post":{"properties":{"grant_type":{"anyOf":[{"type":"string","pattern":"^password$"},{"type":"null"}],"title":"Grant Type"},"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"},"scope":{"type":"string","title":"Scope","default":""},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Secret"}},"type":"object","required":["username","password"],"title":"Body_login_for_access_token_api_v1_auth_token_post"},"Body_login_with_cookie_api_v1_auth_login_post":{"properties":{"grant_type":{"anyOf":[{"type":"string","pattern":"^password$"},{"type":"null"}],"title":"Grant Type"},"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"},"scope":{"type":"string","title":"Scope","default":""},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Secret"}},"type":"object","required":["username","password"],"title":"Body_login_with_cookie_api_v1_auth_login_post"},"Body_trigger_cvm_compose_file_update_api_v1_cvms__cvm_id__compose_file_patch":{"properties":{"compose_hash":{"type":"string","title":"Compose Hash","description":"Hash from provision response"},"encrypted_env":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Encrypted Env","description":"New encrypted env blob (hex)"},"env_keys":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Env Keys","description":"Allowed env var names"},"update_env_vars":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Update Env Vars","description":"Update allowed_envs list","default":false}},"type":"object","required":["compose_hash"],"title":"Body_trigger_cvm_compose_file_update_api_v1_cvms__cvm_id__compose_file_patch"},"Body_update_cvm_docker_compose_api_v1_cvms__cvm_id__docker_compose_patch":{"properties":{"file":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"File","description":"Docker Compose YAML file to upload"}},"type":"object","title":"Body_update_cvm_docker_compose_api_v1_cvms__cvm_id__docker_compose_patch"},"Body_update_cvm_envs_api_v1_cvms__cvm_id__envs_patch":{"properties":{"encrypted_env":{"type":"string","title":"Encrypted Env","description":"Encrypted env blob as hex string"},"env_keys":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Env Keys","description":"Allowed env var names. Changes trigger verification for contract-owned KMS."},"compose_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compose Hash","description":"Hash from Phase 1 response (Phase 2 only)"},"transaction_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Hash","description":"Transaction hash proving on-chain registration (Phase 2 only)"}},"type":"object","required":["encrypted_env"],"title":"Body_update_cvm_envs_api_v1_cvms__cvm_id__envs_patch"},"Body_update_cvm_os_image_api_v1_cvms__cvm_id__os_image_patch":{"properties":{"os_image_name":{"type":"string","title":"Os Image Name","description":"Image name or slug from available-os-images"}},"type":"object","required":["os_image_name"],"title":"Body_update_cvm_os_image_api_v1_cvms__cvm_id__os_image_patch"},"Body_update_cvm_pre_launch_script_api_v1_cvms__cvm_id__pre_launch_script_patch":{"properties":{"file":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"File","description":"Shell script file to upload"}},"type":"object","title":"Body_update_cvm_pre_launch_script_api_v1_cvms__cvm_id__pre_launch_script_patch"},"CVMGatewayInfo":{"properties":{"base_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Domain"},"cname":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cname"}},"type":"object","title":"CVMGatewayInfo"},"CVMInfo":{"properties":{"id":{"type":"string","pattern":"^cvm_.+","format":"hashid","title":"HashedId[cvms]","description":"A hashed identifier that maps to an internal database ID","examples":["cvm_0123abcd"]},"name":{"type":"string","title":"Name"},"app_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Id"},"vm_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vm Uuid"},"instance_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance Id"},"resource":{"$ref":"#/components/schemas/CVMResourceInfo"},"node_info":{"anyOf":[{"$ref":"#/components/schemas/NodeRef"},{"type":"null"}]},"os":{"anyOf":[{"$ref":"#/components/schemas/CVMOSInfo"},{"type":"null"}]},"kms_type":{"anyOf":[{"$ref":"#/components/schemas/KmsType"},{"type":"null"}]},"kms_info":{"anyOf":[{"$ref":"#/components/schemas/CVMKmsInfo"},{"type":"null"}]},"status":{"type":"string","title":"Status"},"progress":{"anyOf":[{"$ref":"#/components/schemas/CVMProgressInfo"},{"type":"null"}]},"compose_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compose Hash"},"docker_compose_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Docker Compose Hash"},"pre_launch_script_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pre Launch Script Hash"},"gateway":{"$ref":"#/components/schemas/CVMGatewayInfo"},"services":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Services"},"endpoints":{"anyOf":[{"items":{"$ref":"#/components/schemas/CvmNetworkUrls"},"type":"array"},{"type":"null"}],"title":"Endpoints"},"public_logs":{"type":"boolean","title":"Public Logs","default":false},"public_sysinfo":{"type":"boolean","title":"Public Sysinfo","default":false},"public_tcbinfo":{"type":"boolean","title":"Public Tcbinfo","default":true},"gateway_enabled":{"type":"boolean","title":"Gateway Enabled","default":false},"secure_time":{"type":"boolean","title":"Secure Time","default":false},"storage_fs":{"type":"string","title":"Storage Fs","default":"zfs"},"workspace":{"anyOf":[{"$ref":"#/components/schemas/WorkspaceRef"},{"type":"null"}]},"creator":{"anyOf":[{"$ref":"#/components/schemas/UserRef"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"},"listed":{"type":"boolean","title":"Listed","default":false},"project_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Type"}},"type":"object","required":["id","name","resource","status","gateway"],"title":"CVMInfo"},"CVMInfoDetail":{"properties":{"id":{"type":"string","pattern":"^cvm_.+","format":"hashid","title":"HashedId[cvms]","description":"A hashed identifier that maps to an internal database ID","examples":["cvm_0123abcd"]},"name":{"type":"string","title":"Name"},"app_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Id"},"vm_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vm Uuid"},"instance_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance Id"},"resource":{"$ref":"#/components/schemas/CVMResourceInfo"},"node_info":{"anyOf":[{"$ref":"#/components/schemas/NodeRef"},{"type":"null"}]},"os":{"anyOf":[{"$ref":"#/components/schemas/CVMOSInfo"},{"type":"null"}]},"kms_type":{"anyOf":[{"$ref":"#/components/schemas/KmsType"},{"type":"null"}]},"kms_info":{"anyOf":[{"$ref":"#/components/schemas/CVMKmsInfo"},{"type":"null"}]},"status":{"type":"string","title":"Status"},"progress":{"anyOf":[{"$ref":"#/components/schemas/CVMProgressInfo"},{"type":"null"}]},"compose_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compose Hash"},"docker_compose_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Docker Compose Hash"},"pre_launch_script_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pre Launch Script Hash"},"gateway":{"$ref":"#/components/schemas/CVMGatewayInfo"},"services":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Services"},"endpoints":{"anyOf":[{"items":{"$ref":"#/components/schemas/CvmNetworkUrls"},"type":"array"},{"type":"null"}],"title":"Endpoints"},"public_logs":{"type":"boolean","title":"Public Logs","default":false},"public_sysinfo":{"type":"boolean","title":"Public Sysinfo","default":false},"public_tcbinfo":{"type":"boolean","title":"Public Tcbinfo","default":true},"gateway_enabled":{"type":"boolean","title":"Gateway Enabled","default":false},"secure_time":{"type":"boolean","title":"Secure Time","default":false},"storage_fs":{"type":"string","title":"Storage Fs","default":"zfs"},"workspace":{"anyOf":[{"$ref":"#/components/schemas/WorkspaceRef"},{"type":"null"}]},"creator":{"anyOf":[{"$ref":"#/components/schemas/UserRef"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"},"listed":{"type":"boolean","title":"Listed","default":false},"project_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Type"},"compose_file":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"string"},{"type":"null"}],"title":"Compose File"}},"type":"object","required":["id","name","resource","status","gateway"],"title":"CVMInfoDetail"},"CVMKmsInfo":{"properties":{"chain_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Chain Id"},"dstack_kms_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dstack Kms Address"},"dstack_app_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dstack App Address"},"deployer_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deployer Address"},"rpc_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rpc Endpoint"},"encrypted_env_pubkey":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Encrypted Env Pubkey"}},"type":"object","title":"CVMKmsInfo"},"CVMOSInfo":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"},"is_dev":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Dev"},"os_image_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Os Image Hash"}},"type":"object","title":"CVMOSInfo"},"CVMProgressInfo":{"properties":{"target":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"correlation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correlation Id"}},"type":"object","title":"CVMProgressInfo"},"CVMResourceInfo":{"properties":{"instance_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance Type"},"vcpu":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Vcpu"},"memory_in_gb":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Memory In Gb"},"disk_in_gb":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Disk In Gb"},"gpus":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Gpus"},"compute_billing_price":{"anyOf":[{"type":"string","format":"decimal","description":"A monetary value with precise decimal arithmetic","examples":["19.99","123.456000"]},{"type":"null"}],"title":"Compute Billing Price"},"billing_period":{"anyOf":[{"$ref":"#/components/schemas/BillingPeriod"},{"type":"null"}]}},"type":"object","title":"CVMResourceInfo"},"CaaCheckResult":{"properties":{"caa_records":{"items":{"type":"string"},"type":"array","title":"Caa Records","description":"Raw CAA DNS records found"},"accounturi":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accounturi","description":"Account URI extracted from CAA record"},"acme_fetches":{"items":{"$ref":"#/components/schemas/AcmeFetchResult"},"type":"array","title":"Acme Fetches","description":"ACME endpoint query attempts"},"expected_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Uri","description":"Expected URI from ACME account"},"is_match":{"type":"boolean","title":"Is Match","description":"True if CAA accounturi matches ACME account"},"info_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Info Message","description":"Additional context or guidance"}},"type":"object","required":["caa_records","acme_fetches","is_match"],"title":"CaaCheckResult","description":"CAA record check result (informational, not required for validation)."},"Certificate":{"properties":{"subject":{"$ref":"#/components/schemas/CertificateSubject"},"issuer":{"$ref":"#/components/schemas/CertificateIssuer"},"serial_number":{"type":"string","title":"Serial Number"},"not_before":{"type":"string","format":"date-time","title":"Not Before"},"not_after":{"type":"string","format":"date-time","title":"Not After"},"version":{"type":"string","title":"Version"},"fingerprint":{"type":"string","title":"Fingerprint"},"signature_algorithm":{"type":"string","title":"Signature Algorithm"},"sans":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Sans"},"is_ca":{"type":"boolean","title":"Is Ca","default":false},"position_in_chain":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Position In Chain"},"quote":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quote"},"app_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Id"},"cert_usage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cert Usage"}},"type":"object","required":["subject","issuer","serial_number","not_before","not_after","version","fingerprint","signature_algorithm"],"title":"Certificate"},"CertificateIssuer":{"properties":{"common_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Common Name","description":"Issuer common name"},"organization":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization","description":"Issuer organization"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country","description":"Issuer country code"}},"type":"object","title":"CertificateIssuer"},"CertificateSubject":{"properties":{"common_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Common Name","description":"Certificate subject common name"},"organization":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization","description":"Organization name"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country","description":"Country code"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State","description":"State or province"},"locality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locality","description":"Locality name"}},"type":"object","title":"CertificateSubject"},"ChangeEmailPayload":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"site_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Key"},"current_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Password"},"totp_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Totp Code"}},"type":"object","required":["email"],"title":"ChangeEmailPayload","description":"Request payload for changing email address"},"ComposeFilePatchRequest":{"properties":{"compose_manifest":{"anyOf":[{"$ref":"#/components/schemas/ComposeManifestPatchRequest"},{"type":"null"}]},"encrypted_env":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Encrypted Env"},"env_keys":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Env Keys"}},"type":"object","title":"ComposeFilePatchRequest","description":"API request model for partially updating CVM compose files - matches CvmUpgradePayload structure"},"ComposeFileProvisionResponse":{"properties":{"app_id":{"type":"string","title":"App Id"},"device_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Id"},"compose_hash":{"type":"string","title":"Compose Hash"},"kms_info":{"anyOf":[{"$ref":"#/components/schemas/KMSInfo"},{"type":"null"}]}},"type":"object","required":["app_id","compose_hash"],"title":"ComposeFileProvisionResponse","description":"API response model for compose file provision"},"ComposeFileUpdateRequest":{"properties":{"compose_file":{"$ref":"#/components/schemas/AppComposeV2"},"compose_hash":{"type":"string","title":"Compose Hash"},"encrypted_env":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Encrypted Env"},"env_keys":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Env Keys"}},"type":"object","required":["compose_file","compose_hash"],"title":"ComposeFileUpdateRequest","description":"API request model for updating CVM compose files"},"ComposeManifest":{"properties":{"bash_script":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bash Script"},"default_gateway_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Gateway Domain"},"docker_compose_file":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Docker Compose File"},"docker_config":{"anyOf":[{"$ref":"#/components/schemas/DockerConfig"},{"type":"null"}]},"features":{"items":{"type":"string"},"type":"array","title":"Features","default":["kms","tproxy-net"]},"kms_enabled":{"type":"boolean","title":"Kms Enabled","default":true},"manifest_version":{"type":"integer","title":"Manifest Version","default":1},"name":{"type":"string","title":"Name"},"pre_launch_script":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pre Launch Script"},"public_logs":{"type":"boolean","title":"Public Logs","default":true},"public_sysinfo":{"type":"boolean","title":"Public Sysinfo","default":true},"runner":{"type":"string","title":"Runner","default":"docker-compose"},"salt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Salt"},"tproxy_enabled":{"type":"boolean","title":"Tproxy Enabled","default":true},"version":{"type":"string","title":"Version","default":"1.0.0"}},"type":"object","required":["name"],"title":"ComposeManifest","description":"@see https://github.com/Dstack-TEE/dstack/blob/master/tdxctl/src/utils.rs#L77\n@see https://github.com/Dstack-TEE/dstack/blob/master/basefiles/app-compose.sh"},"ComposeManifestPatchRequest":{"properties":{"docker_compose_file":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Docker Compose File"},"pre_launch_script":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pre Launch Script"}},"type":"object","title":"ComposeManifestPatchRequest","description":"Partial update for compose_manifest fields"},"CreateTappRequest":{"properties":{"app_id":{"type":"string","title":"App Id","description":"The calculated app ID from compose file."},"compose_hash":{"type":"string","title":"Compose Hash","description":"The compose hash of the app compose file."},"encrypted_env":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Encrypted Env","description":"The encrypted environment variables."},"kms_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kms Id","description":"The KMS ID."},"contract_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contract Address","description":"The contract address."},"deployer_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deployer Address","description":"The deployer address."},"env_keys":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Env Keys","description":"The environment variables to use for the app."}},"type":"object","required":["app_id","compose_hash"],"title":"CreateTappRequest"},"CreateWorkloadTappRequest":{"properties":{"name":{"type":"string","title":"Name","description":"The name of the tapp."},"instance_type":{"type":"string","title":"Instance Type","description":"The instance_type of the tapp."},"model_id":{"type":"string","title":"Model Id","description":"The model_id of the tapp."},"scheduled_delete_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled Delete At","description":"The scheduled delete time of the tapp."}},"type":"object","required":["name","instance_type","model_id"],"title":"CreateWorkloadTappRequest"},"Credit":{"properties":{"id":{"type":"integer","title":"Id"},"balance":{"type":"number","title":"Balance"},"granted_balance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Granted Balance"}},"type":"object","required":["id","balance"],"title":"Credit"},"CvmAttestation":{"properties":{"is_online":{"type":"boolean","title":"Is Online"},"is_public":{"type":"boolean","title":"Is Public","default":true},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"app_certificates":{"anyOf":[{"items":{"$ref":"#/components/schemas/Certificate"},"type":"array"},{"type":"null"}],"title":"App Certificates"},"tcb_info":{"anyOf":[{"$ref":"#/components/schemas/TcbInfo"},{"type":"null"}]},"compose_file":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compose File"}},"type":"object","required":["is_online"],"title":"CvmAttestation","description":"Model representing CVM attestation information"},"CvmComposeFile":{"properties":{"compose_file":{"$ref":"#/components/schemas/ComposeManifest"},"env_pubkey":{"type":"string","title":"Env Pubkey"},"salt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Salt"}},"type":"object","required":["compose_file","env_pubkey"],"title":"CvmComposeFile","description":"Model representing CVM compose file information"},"CvmComposition":{"properties":{"is_online":{"type":"boolean","title":"Is Online"},"is_public":{"type":"boolean","title":"Is Public","default":true},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"docker_compose_file":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Docker Compose File"},"manifest_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Manifest Version"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"},"runner":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Runner"},"features":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Features"},"containers":{"anyOf":[{"items":{"$ref":"#/components/schemas/ExtendedContainer"},"type":"array"},{"type":"null"}],"title":"Containers"}},"type":"object","required":["is_online"],"title":"CvmComposition","description":"Model representing CVM container list information"},"CvmNetwork":{"properties":{"is_online":{"type":"boolean","title":"Is Online"},"is_public":{"type":"boolean","title":"Is Public","default":true},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"internal_ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Internal Ip"},"latest_handshake":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Latest Handshake"},"public_urls":{"anyOf":[{"items":{"$ref":"#/components/schemas/CvmNetworkUrls"},"type":"array"},{"type":"null"}],"title":"Public Urls"}},"type":"object","required":["is_online"],"title":"CvmNetwork","description":"Model representing CVM network information"},"CvmNetworkUrls":{"properties":{"app":{"type":"string","title":"App"},"instance":{"type":"string","title":"Instance"}},"type":"object","required":["app","instance"],"title":"CvmNetworkUrls","description":"Model representing public URLs for a CVM port"},"CvmNode":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"region_identifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region Identifier"}},"type":"object","required":["id","name"],"title":"CvmNode"},"CvmOperationResponse":{"properties":{"correlation_id":{"type":"string","title":"Correlation Id","description":"Unique ID linking all events in this operation"},"operation_type":{"type":"string","title":"Operation Type","description":"Type: compose_update, power_on, resize, etc."},"target_state":{"type":"string","title":"Target State","description":"Expected CVM state after completion"},"triggered_by":{"type":"integer","title":"Triggered By","description":"User ID who initiated the operation"},"triggered_by_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Triggered By Username","description":"Username if available"},"triggered_by_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Triggered By Email","description":"Email if available"},"started_at":{"type":"string","format":"date-time","title":"Started At","description":"UTC timestamp of first event"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At","description":"UTC timestamp of last event"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms","description":"Total duration from start to completion"},"status":{"type":"string","title":"Status","description":"Current status: completed, in_progress, or failed"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Failure reason (sanitized for non-admins)"},"sub_operations":{"items":{"type":"string"},"type":"array","title":"Sub Operations","description":"Ordered list of sub-operation types"},"events":{"items":{"$ref":"#/components/schemas/OperationEventDetail"},"type":"array","title":"Events","description":"Chronological event timeline"},"instance_name":{"type":"string","title":"Instance Name","description":"CVM name at operation time"},"compose_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compose Hash","description":"Hash identifying compose configuration"}},"type":"object","required":["correlation_id","operation_type","target_state","triggered_by","started_at","status","sub_operations","events","instance_name"],"title":"CvmOperationResponse","description":"Aggregated operation record grouped by correlation_id."},"CvmRef":{"properties":{"object_type":{"type":"string","const":"cvm","title":"Object Type","description":"Fixed value 'cvm'","default":"cvm"},"vm_uuid":{"type":"string","title":"Vm Uuid","description":"CVM instance UUID"},"app_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Id","description":"Deterministic app identifier from manifest"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"User-assigned CVM name"}},"type":"object","required":["vm_uuid"],"title":"CvmRef","description":"Minimal CVM reference for embedding in responses."},"CvmResizePayload":{"properties":{"vcpu":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Vcpu"},"memory":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Memory"},"disk_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Disk Size"},"allow_restart":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Allow Restart"},"instance_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance Type"}},"type":"object","title":"CvmResizePayload"},"CvmStatus":{"properties":{"vm_uuid":{"type":"string","title":"Vm Uuid"},"status":{"type":"string","title":"Status"},"uptime":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uptime"},"in_progress":{"type":"boolean","title":"In Progress","default":false},"boot_progress":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Boot Progress"},"boot_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Boot Error"},"operation_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Operation Type"},"operation_started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Operation Started At"},"correlation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correlation Id"}},"type":"object","required":["vm_uuid","status"],"title":"CvmStatus","description":"CVM status information for API response.\n\nThis schema is used for both internal status determination and API responses.\nContains current state, progress information, and async operation tracking."},"CvmSystemInfo":{"properties":{"is_online":{"type":"boolean","title":"Is Online"},"is_public":{"type":"boolean","title":"Is Public","default":true},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"sysinfo":{"anyOf":[{"$ref":"#/components/schemas/SystemInfo"},{"type":"null"}]},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"in_progress":{"type":"boolean","title":"In Progress","default":false},"boot_progress":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Boot Progress"},"boot_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Boot Error"}},"type":"object","required":["is_online"],"title":"CvmSystemInfo"},"CvmUpgradePayload":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"compose_manifest":{"$ref":"#/components/schemas/AppComposeV2"},"encrypted_env":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Encrypted Env"},"user_config":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Config"},"update_ports":{"type":"boolean","title":"Update Ports","default":false},"ports":{"anyOf":[{"items":{"$ref":"#/components/schemas/PortMapping"},"type":"array"},{"type":"null"}],"title":"Ports"},"allow_restart":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Allow Restart"},"env_keys":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Env Keys"}},"type":"object","required":["compose_manifest"],"title":"CvmUpgradePayload"},"CvmUserConfig":{"properties":{"hostname":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hostname","description":"CVM hostname"},"ssh_authorized_keys":{"items":{"type":"string"},"type":"array","title":"Ssh Authorized Keys","description":"SSH public keys injected at launch"},"default_gateway_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Gateway Domain","description":"Default gateway domain"}},"type":"object","title":"CvmUserConfig"},"DeviceAuthorizeRequest":{"properties":{"user_code":{"type":"string","title":"User Code","description":"Verification code from CLI (e.g., XXXX-XXXX)"},"workspace_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Slug","description":"Workspace to bind the token to"},"totp_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Totp Code","description":"2FA code if user has TOTP enabled"}},"type":"object","required":["user_code"],"title":"DeviceAuthorizeRequest","description":"Request body for user approval of a device authorization."},"DeviceCodeRequest":{"properties":{"client_id":{"type":"string","title":"Client Id","description":"OAuth client identifier","default":"phala-cli"},"scope":{"type":"string","title":"Scope","description":"Space-separated list of requested permissions","default":"user:profile cvms:* nodes:*"}},"type":"object","title":"DeviceCodeRequest","description":"Request body for initiating device authorization flow (RFC 8628)."},"DeviceCodeResponse":{"properties":{"device_code":{"type":"string","title":"Device Code","description":"Opaque code for CLI polling"},"user_code":{"type":"string","title":"User Code","description":"Short code user enters in browser (e.g., XXXX-XXXX)"},"verification_uri":{"type":"string","title":"Verification Uri","description":"URL where user enters the code"},"verification_uri_complete":{"type":"string","title":"Verification Uri Complete","description":"URL with code pre-filled"},"expires_in":{"type":"integer","title":"Expires In","description":"Seconds until codes expire"},"interval":{"type":"integer","title":"Interval","description":"Minimum polling interval in seconds"}},"type":"object","required":["device_code","user_code","verification_uri","verification_uri_complete","expires_in","interval"],"title":"DeviceCodeResponse","description":"Response containing codes for device authorization flow."},"DeviceTokenRequest":{"properties":{"device_code":{"type":"string","title":"Device Code","description":"Device code from /device/code response"},"grant_type":{"type":"string","title":"Grant Type","description":"OAuth grant type (must be device_code)","default":"urn:ietf:params:oauth:grant-type:device_code"}},"type":"object","required":["device_code"],"title":"DeviceTokenRequest","description":"Request body for polling device authorization status."},"DeviceTokenResponse":{"properties":{"access_token":{"type":"string","title":"Access Token","description":"API token for CLI authentication"},"token_type":{"type":"string","title":"Token Type","description":"Token type (always 'bearer')","default":"bearer"},"expires_in":{"type":"integer","title":"Expires In","description":"Token lifetime in seconds (90 days)","default":7776000}},"type":"object","required":["access_token"],"title":"DeviceTokenResponse","description":"Response containing the issued access token."},"DiagnoseDomainsRequest":{"properties":{"domains":{"items":{"$ref":"#/components/schemas/DomainCheckRequest"},"type":"array","title":"Domains","description":"List of domain and port pairs to check"}},"type":"object","required":["domains"],"title":"DiagnoseDomainsRequest","description":"Request for diagnosing custom domain DNS configuration."},"DiagnosisResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/DomainDiagnosisResult"},"type":"array","title":"Results","description":"Diagnosis results in request order"}},"type":"object","required":["results"],"title":"DiagnosisResponse","description":"Response containing diagnosis results for all requested domains."},"DiskInfo":{"properties":{"name":{"type":"string","title":"Name"},"mount_point":{"type":"string","title":"Mount Point"},"total_size":{"type":"integer","title":"Total Size"},"free_size":{"type":"integer","title":"Free Size"}},"type":"object","required":["name","mount_point","total_size","free_size"],"title":"DiskInfo"},"DnsRecordResult":{"properties":{"record_type":{"type":"string","title":"Record Type","description":"Record type: CNAME or TXT"},"query_name":{"type":"string","title":"Query Name","description":"Domain name queried"},"expected_value":{"type":"string","title":"Expected Value","description":"Expected record value"},"actual_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actual Value","description":"Actual value found, null if missing"},"is_valid":{"type":"boolean","title":"Is Valid","description":"True if actual matches expected"},"is_deprecated":{"type":"boolean","title":"Is Deprecated","description":"True if this record format is deprecated","default":false},"warning_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Warning Message","description":"Deprecation or migration warning"}},"type":"object","required":["record_type","query_name","expected_value","is_valid"],"title":"DnsRecordResult","description":"DNS record check result."},"DockerConfig":{"properties":{"password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password","default":""},"registry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registry"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username","default":""}},"type":"object","title":"DockerConfig"},"DomainCheckRequest":{"properties":{"domain":{"type":"string","title":"Domain","description":"Domain name to diagnose (e.g., app.example.com)"},"port":{"type":"integer","title":"Port","description":"Port number the domain routes to"}},"type":"object","required":["domain","port"],"title":"DomainCheckRequest","description":"Single domain check entry."},"DomainDiagnosisResult":{"properties":{"domain":{"type":"string","title":"Domain","description":"Domain name checked"},"port":{"type":"integer","title":"Port","description":"Port number checked"},"records":{"items":{"$ref":"#/components/schemas/DnsRecordResult"},"type":"array","title":"Records","description":"DNS record check results"},"is_valid":{"type":"boolean","title":"Is Valid","description":"True if all required records (CNAME, TXT) are correct"},"caa_check":{"anyOf":[{"$ref":"#/components/schemas/CaaCheckResult"},{"type":"null"}],"description":"CAA record check (informational only)"}},"type":"object","required":["domain","port","records","is_valid"],"title":"DomainDiagnosisResult","description":"Diagnosis result for a single domain."},"DstackAppMinimalResponse":{"properties":{"id":{"type":"null","title":"Id"},"app_id":{"type":"string","title":"App Id"},"name":{"type":"null","title":"Name"},"app_provision_type":{"type":"null","title":"App Provision Type"},"app_icon_url":{"type":"null","title":"App Icon Url"},"created_at":{"type":"null","title":"Created At"},"kms_type":{"type":"null","title":"Kms Type"},"profile":{"type":"null","title":"Profile"},"current_cvm":{"type":"null","title":"Current Cvm"},"cvms":{"type":"null","title":"Cvms"},"cvm_count":{"type":"null","title":"Cvm Count"}},"type":"object","required":["app_id"],"title":"DstackAppMinimalResponse"},"EmailTokenVerificationRequest":{"properties":{"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"EmailTokenVerificationRequest"},"EmailVerificationPayload":{"properties":{"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"site_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Key"}},"type":"object","title":"EmailVerificationPayload","description":"Request payload for email verification"},"EventLog":{"properties":{"imr":{"type":"integer","title":"Imr"},"event_type":{"type":"integer","title":"Event Type"},"digest":{"type":"string","title":"Digest"},"event":{"type":"string","title":"Event"},"event_payload":{"type":"string","title":"Event Payload"}},"type":"object","required":["imr","event_type","digest","event","event_payload"],"title":"EventLog"},"ExtendedContainer":{"properties":{"id":{"type":"string","title":"Id"},"names":{"items":{"type":"string"},"type":"array","title":"Names"},"image":{"type":"string","title":"Image"},"image_id":{"type":"string","title":"Image Id"},"command":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Command"},"created":{"type":"integer","title":"Created"},"state":{"type":"string","title":"State"},"status":{"type":"string","title":"Status"},"log_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Log Endpoint"}},"type":"object","required":["id","names","image","image_id","created","state","status"],"title":"ExtendedContainer","description":"Extended Container with the public log endpoint if any."},"FilterOptionsResponse":{"properties":{"statuses":{"items":{"type":"string"},"type":"array","title":"Statuses","description":"Distinct CVM status values"},"image_versions":{"items":{"type":"string"},"type":"array","title":"Image Versions","description":"Distinct OS image names"},"instance_types":{"items":{"type":"string"},"type":"array","title":"Instance Types","description":"Distinct instance type identifiers"},"kms_slugs":{"items":{"type":"string"},"type":"array","title":"Kms Slugs","description":"Distinct KMS slug values"},"kms_types":{"items":{"type":"string"},"type":"array","title":"Kms Types","description":"Distinct KMS type values"},"regions":{"items":{"type":"string"},"type":"array","title":"Regions","description":"Distinct region identifiers"},"nodes":{"items":{"type":"string"},"type":"array","title":"Nodes","description":"Distinct node names (union of teepod and node names)"}},"type":"object","required":["statuses","image_versions","instance_types","kms_slugs","kms_types","regions","nodes"],"title":"FilterOptionsResponse","description":"Available filter values for app list queries."},"GpuAvailability":{"properties":{"has_reserved_gpus":{"type":"boolean","title":"Has Reserved Gpus","description":"Whether team has reserved GPU access","default":false},"reserved_gpu_count":{"type":"integer","title":"Reserved Gpu Count","description":"Number of reserved GPUs available to use","default":0},"has_public_gpus":{"type":"boolean","title":"Has Public Gpus","description":"Whether there are public GPUs available","default":false},"public_gpu_count":{"type":"integer","title":"Public Gpu Count","description":"Number of public GPUs available","default":0}},"type":"object","title":"GpuAvailability","description":"GPU availability information for the current team"},"GpuConfig":{"properties":{"gpus":{"items":{"$ref":"#/components/schemas/GpuSpec"},"type":"array","title":"Gpus"},"attach_mode":{"anyOf":[{"type":"string","enum":["listed","all"]},{"type":"string"}],"title":"Attach Mode","default":"listed"}},"type":"object","required":["gpus"],"title":"GpuConfig"},"GpuSpec":{"properties":{"slot":{"type":"string","title":"Slot"},"product_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Id"}},"type":"object","required":["slot"],"title":"GpuSpec"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HostedCvm":{"properties":{"hosted":{"$ref":"#/components/schemas/VmInfo"},"name":{"type":"string","title":"Name"},"managed_user":{"anyOf":[{"$ref":"#/components/schemas/ManagedUser"},{"type":"null"}]},"node":{"anyOf":[{"$ref":"#/components/schemas/CvmNode"},{"type":"null"}]},"listed":{"type":"boolean","title":"Listed","default":false},"status":{"type":"string","title":"Status"},"in_progress":{"type":"boolean","title":"In Progress","default":false},"dapp_dashboard_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dapp Dashboard Url"},"syslog_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Syslog Endpoint"},"allow_upgrade":{"type":"boolean","title":"Allow Upgrade","default":false},"project_id":{"anyOf":[{"type":"string","pattern":"^prj_.+","format":"hashid","title":"HashedId[projects]","description":"A hashed identifier that maps to an internal database ID","examples":["prj_0123abcd"]},{"type":"null"}],"title":"Project Id"},"project_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Type"},"billing_period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Period"},"kms_info":{"anyOf":[{"$ref":"#/components/schemas/KMSInfo"},{"type":"null"}]},"contract_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contract Address"},"deployer_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deployer Address"},"vcpu":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Vcpu"},"memory":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Memory"},"disk_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Disk Size"},"gateway_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gateway Domain"},"public_urls":{"items":{"$ref":"#/components/schemas/CvmNetworkUrls"},"type":"array","title":"Public Urls"}},"type":"object","required":["hosted","name","status","public_urls"],"title":"HostedCvm"},"InstanceEventResponse":{"properties":{"message_id":{"type":"string","title":"Message Id","description":"Unique event identifier"},"correlation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correlation Id","description":"Request correlation ID"},"event_type":{"type":"string","title":"Event Type","description":"Event type: created, started, stopped, etc."},"operation_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Operation Type","description":"Operation that triggered the event"},"target_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target State","description":"Intended state after operation"},"operation_payload":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Operation Payload","description":"JSON operation parameters"},"triggered_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Triggered By","description":"User ID who triggered the event"},"instance_id":{"type":"string","title":"Instance Id","description":"CVM instance UUID"},"timestamp":{"type":"string","title":"Timestamp","description":"Event timestamp (ISO 8601)"},"priority":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority","description":"Event priority level"},"instance_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance Name","description":"CVM display name"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State","description":"CVM state at event time"},"instance_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance Type","description":"Instance type identifier"},"project_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Id","description":"Project database ID"},"team_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Team Id","description":"Team database ID"},"user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id","description":"Owner user ID"}},"type":"object","required":["message_id","correlation_id","event_type","operation_type","target_state","operation_payload","triggered_by","instance_id","timestamp","priority","instance_name","state","instance_type","project_id","team_id","user_id"],"title":"InstanceEventResponse","description":"CVM instance lifecycle event."},"InstanceIdRefreshRequest":{"properties":{"overwrite":{"type":"boolean","title":"Overwrite","description":"Overwrite existing instance_id when different","default":false},"dry_run":{"type":"boolean","title":"Dry Run","description":"Preview changes without persisting","default":false}},"type":"object","title":"InstanceIdRefreshRequest"},"InstanceIdRefreshResult":{"properties":{"cvm_id":{"type":"integer","title":"Cvm Id"},"identifier":{"type":"string","title":"Identifier"},"status":{"type":"string","enum":["updated","unchanged","skipped","conflict","error"],"title":"Status"},"old_instance_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Old Instance Id"},"new_instance_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Instance Id"},"source":{"type":"string","enum":["teepod_state","teepod_info","gateway","none"],"title":"Source","default":"none"},"verified_with_gateway":{"type":"boolean","title":"Verified With Gateway","default":false},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["cvm_id","identifier","status"],"title":"InstanceIdRefreshResult"},"KMSInfo":{"properties":{"id":{"type":"string","pattern":"^kms_.+","format":"hashid","title":"HashedId[kms]","description":"Hashed KMS identifier (kms_xxxxx)","examples":["kms_0123abcd"]},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug","description":"Human-readable KMS name"},"url":{"type":"string","title":"Url","description":"KMS endpoint URL"},"version":{"type":"string","title":"Version","description":"KMS software version"},"chain_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Chain Id","description":"Blockchain chain ID if onchain"},"kms_contract_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kms Contract Address","description":"Smart contract address if onchain"},"gateway_app_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gateway App Id","description":"Gateway application ID"}},"type":"object","required":["id","url","version"],"title":"KMSInfo","description":"KMS instance information."},"KmsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/KMSInfo"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","page_size","pages"],"title":"KmsListResponse","description":"Paginated KMS list response."},"KmsType":{"type":"string","enum":["phala","ethereum","base","legacy"],"title":"KmsType"},"KmsWithSupportedOSImage":{"properties":{"id":{"type":"string","pattern":"^kms_.+","format":"hashid","title":"HashedId[kms]","description":"Hashed KMS identifier (kms_xxxxx)","examples":["kms_0123abcd"]},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug","description":"Human-readable KMS name"},"url":{"type":"string","title":"Url","description":"KMS endpoint URL"},"version":{"type":"string","title":"Version","description":"KMS software version"},"chain_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Chain Id","description":"Blockchain chain ID if onchain"},"kms_contract_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kms Contract Address","description":"Smart contract address if onchain"},"gateway_app_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gateway App Id","description":"Gateway application ID"},"supported_os_images":{"items":{"type":"string"},"type":"array","title":"Supported Os Images"}},"type":"object","required":["id","url","version"],"title":"KmsWithSupportedOSImage"},"LoginRequest":{"properties":{"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"},"totp_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Totp Code"}},"type":"object","required":["username","password"],"title":"LoginRequest"},"MachineInfo":{"properties":{"vcpu":{"type":"integer","title":"Vcpu","description":"Virtual CPU count"},"memory":{"type":"integer","title":"Memory","description":"Memory in MB"},"disk_size":{"type":"integer","title":"Disk Size","description":"Disk size in GB"},"gpu_count":{"type":"integer","title":"Gpu Count","description":"GPU count (0 if none)"}},"type":"object","required":["vcpu","memory","disk_size","gpu_count"],"title":"MachineInfo","description":"CVM hardware configuration."},"ManagedUser":{"properties":{"id":{"type":"integer","title":"Id"},"username":{"type":"string","title":"Username"}},"type":"object","required":["id","username"],"title":"ManagedUser"},"MeteredUsageResponse":{"properties":{"instance_id":{"type":"string","title":"Instance Id","description":"CVM instance UUID"},"project_id":{"type":"integer","title":"Project Id","description":"Project database ID"},"team_id":{"type":"integer","title":"Team Id","description":"Team database ID"},"timestamp":{"type":"string","title":"Timestamp","description":"Record timestamp (ISO 8601)"},"event_type":{"type":"string","title":"Event Type","description":"Usage event type"},"cost":{"type":"number","title":"Cost","description":"Cost in USD"},"details":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Details","description":"JSON usage details"},"usage_type":{"type":"string","title":"Usage Type","description":"Billing category: compute, storage, etc."},"billing_start":{"type":"string","title":"Billing Start","description":"Billing period start (date)"},"billing_end":{"type":"string","title":"Billing End","description":"Billing period end (date)"},"duration_minutes":{"type":"number","title":"Duration Minutes","description":"Usage duration in minutes"},"billing_key":{"type":"string","title":"Billing Key","description":"Unique billing record key"},"billing_hour":{"type":"string","title":"Billing Hour","description":"Billing hour bucket"},"billing_day":{"type":"string","title":"Billing Day","description":"Billing day bucket"}},"type":"object","required":["instance_id","project_id","team_id","timestamp","event_type","cost","details","usage_type","billing_start","billing_end","duration_minutes","billing_key","billing_hour","billing_day"],"title":"MeteredUsageResponse","description":"Single metered usage record."},"NodeRef":{"properties":{"object_type":{"type":"string","const":"node","title":"Object Type","description":"Fixed value 'node'","default":"node"},"id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Id","description":"Teepod numeric ID"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Node display name"},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region","description":"Region identifier"},"device_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Id","description":"Device ID"},"ppid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ppid","description":"PPID"},"status":{"anyOf":[{"$ref":"#/components/schemas/TeepodStatus"},{"type":"null"}],"description":"Node status"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version","description":"Teepod version"}},"type":"object","title":"NodeRef","description":"Minimal node/teepod reference for embedding in responses."},"OSImageVariant":{"properties":{"name":{"type":"string","title":"Name","description":"Human-readable image name (e.g. dstack-0.5.5)"},"slug":{"type":"string","title":"Slug","description":"Unique identifier for API calls (e.g. dstack-0.5.5-e18f5407)"},"os_image_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Os Image Hash","description":"SHA256 hash of the OS image"},"is_current":{"type":"boolean","title":"Is Current","description":"True if this is the currently running image","default":false}},"type":"object","required":["name","slug"],"title":"OSImageVariant","description":"Single OS image variant (production or development build)."},"OperationEventDetail":{"properties":{"event_type":{"type":"string","title":"Event Type","description":"Event type identifier (e.g. instance.power_on.start)"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp","description":"UTC timestamp when event occurred"},"state":{"type":"string","title":"State","description":"CVM state at event time (e.g. running, stopped)"}},"type":"object","required":["event_type","timestamp","state"],"title":"OperationEventDetail","description":"Single atomic event within an operation."},"PaginatedCvmInfos":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CVMInfo"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","page_size","pages"],"title":"PaginatedCvmInfos"},"PaginatedCvmOperationsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CvmOperationResponse"},"type":"array","title":"Items","description":"Operations ordered by started_at DESC"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Opaque cursor for next page, null if last page"},"total":{"type":"integer","title":"Total","description":"Approximate total count (not exact for performance)"}},"type":"object","required":["items","total"],"title":"PaginatedCvmOperationsResponse","description":"Cursor-paginated list of CVM operations."},"PaginatedHostedCvms":{"properties":{"items":{"items":{"$ref":"#/components/schemas/HostedCvm"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","page_size","pages"],"title":"PaginatedHostedCvms","description":"Paginated response for CVM list endpoints"},"PasswordResetRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"site_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Key"}},"type":"object","required":["email"],"title":"PasswordResetRequest"},"PortMapping":{"properties":{"protocol":{"type":"string","title":"Protocol"},"host_port":{"type":"integer","title":"Host Port"},"vm_port":{"type":"integer","title":"Vm Port"},"host_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Host Address"}},"type":"object","required":["protocol","host_port","vm_port"],"title":"PortMapping"},"ProfileGetResponse":{"properties":{"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"custom_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Domain"}},"type":"object","title":"ProfileGetResponse","description":"Response model for entity profile - only public display data."},"ProvisionComposeFileUpdateRequest":{"properties":{"allowed_envs":{"items":{"type":"string"},"type":"array","title":"Allowed Envs"},"bash_script":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bash Script"},"default_gateway_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Gateway Domain"},"docker_compose_file":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Docker Compose File"},"init_script":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Init Script"},"kms_enabled":{"type":"boolean","title":"Kms Enabled","default":true},"local_key_provider_enabled":{"type":"boolean","title":"Local Key Provider Enabled","default":false},"manifest_version":{"type":"integer","title":"Manifest Version","default":2},"name":{"type":"string","title":"Name"},"no_instance_id":{"type":"boolean","title":"No Instance Id","default":false},"pre_launch_script":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pre Launch Script"},"public_logs":{"type":"boolean","title":"Public Logs","default":true},"public_sysinfo":{"type":"boolean","title":"Public Sysinfo","default":true},"public_tcbinfo":{"type":"boolean","title":"Public Tcbinfo","default":true},"runner":{"type":"string","title":"Runner","default":"docker-compose"},"gateway_enabled":{"type":"boolean","title":"Gateway Enabled","default":true},"features":{"items":{"type":"string"},"type":"array","title":"Features","default":["kms","tproxy-net"]},"salt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Salt"},"secure_time":{"type":"boolean","title":"Secure Time","default":false},"storage_fs":{"anyOf":[{"type":"string","const":"ext4"},{"type":"string","const":"zfs"},{"type":"null"}],"title":"Storage Fs","default":"zfs"},"tproxy_enabled":{"type":"boolean","title":"Tproxy Enabled","default":true},"update_env_vars":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Update Env Vars","description":"Whether to also update allowed_envs","default":false}},"type":"object","required":["name"],"title":"ProvisionComposeFileUpdateRequest","description":"Request model for provisioning compose file updates."},"ProvisionDstackAppRequestV2":{"properties":{"compose_file":{"$ref":"#/components/schemas/AppComposeV2"},"name":{"type":"string","title":"Name","description":"CVM name (used as hostname): 5-63 chars, must start with letter, can contain letters/numbers/hyphens"},"instance_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance Type"},"vcpu":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Vcpu"},"memory":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Memory"},"disk_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Disk Size"},"image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image"},"prefer_dev":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Prefer Dev","description":"Prefer dev OS image (True) or non-dev OS image (False). When None, auto-selects based on image name or defaults to dev."},"teepod_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Teepod Id"},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region"},"listed":{"type":"boolean","title":"Listed","default":true},"kms_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kms Id"},"kms":{"anyOf":[{"$ref":"#/components/schemas/KmsType"},{"type":"null"}],"default":"phala"},"nonce":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Nonce","description":"Optional nonce for deterministic app_id generation. When provided, app_id must also be provided. System will verify: app_id == get_create_address(team_wallet, nonce)"},"app_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Id","description":"Optional app_id for manual specification. Required when nonce is provided. Only works with PHALA KMS."},"env_keys":{"items":{"type":"string"},"type":"array","title":"Env Keys"},"ports":{"anyOf":[{"items":{"$ref":"#/components/schemas/PortMapping"},"type":"array"},{"type":"null"}],"title":"Ports"},"encrypted_env":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Encrypted Env"},"user_config":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Config"},"hugepages":{"type":"boolean","title":"Hugepages","default":false},"pin_numa":{"type":"boolean","title":"Pin Numa","default":false},"gpus":{"anyOf":[{"$ref":"#/components/schemas/GpuConfig"},{"type":"null"}]},"kms_urls":{"items":{"type":"string"},"type":"array","title":"Kms Urls"},"gateway_urls":{"items":{"type":"string"},"type":"array","title":"Gateway Urls"},"experimental_vpc_server_app_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Experimental Vpc Server App Id"}},"type":"object","required":["compose_file","name"],"title":"ProvisionDstackAppRequestV2","description":"Request for provisioning a DStack app with automatic resource matching.\n\nMost fields are optional and will be automatically determined by the resource\nmatching logic in preflight_dstack_app. Only compose_file and name are required."},"ProvisionElizaRequest":{"properties":{"name":{"type":"string","title":"Name","description":"The name of the tapp."},"characterfile":{"type":"string","title":"Characterfile","description":"The characterfile to use for the a16z/eliza."},"env_keys":{"items":{"type":"string"},"type":"array","title":"Env Keys","description":"The environment variables to use for the a16z/eliza."},"teepod_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Teepod Id","description":"The Teepod ID to use for the a16z/eliza. If not provided, it will auto select an available one."},"image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image","description":"The image to use for the a16z/eliza. If not provided, it will use the latest image."}},"type":"object","required":["name","characterfile","env_keys"],"title":"ProvisionElizaRequest"},"PublicCVM":{"properties":{"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"app_id":{"type":"string","title":"App Id"},"vm_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vm Uuid"},"instance_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance Id"},"base_image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Image","readOnly":true}},"type":"object","required":["name","status","app_id","base_image"],"title":"PublicCVM"},"Quote":{"properties":{"header":{"$ref":"#/components/schemas/QuoteHeader"},"cert_data":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cert Data"},"body":{"$ref":"#/components/schemas/QuoteBody"},"verified":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Verified","default":false}},"type":"object","required":["header","cert_data","body"],"title":"Quote"},"QuoteBody":{"properties":{"tee_tcb_svn":{"type":"string","title":"Tee Tcb Svn"},"mrseam":{"type":"string","format":"binary","title":"Mrseam"},"mrsignerseam":{"type":"string","format":"binary","title":"Mrsignerseam"},"seamattributes":{"type":"string","format":"binary","title":"Seamattributes"},"tdattributes":{"type":"string","format":"binary","title":"Tdattributes"},"xfam":{"type":"string","format":"binary","title":"Xfam"},"mrtd":{"type":"string","format":"binary","title":"Mrtd"},"mrconfig":{"type":"string","format":"binary","title":"Mrconfig"},"mrowner":{"type":"string","format":"binary","title":"Mrowner"},"mrownerconfig":{"type":"string","format":"binary","title":"Mrownerconfig"},"rtmr0":{"type":"string","format":"binary","title":"Rtmr0"},"rtmr1":{"type":"string","format":"binary","title":"Rtmr1"},"rtmr2":{"type":"string","format":"binary","title":"Rtmr2"},"rtmr3":{"type":"string","format":"binary","title":"Rtmr3"},"reportdata":{"type":"string","format":"binary","title":"Reportdata"}},"type":"object","required":["tee_tcb_svn","mrseam","mrsignerseam","seamattributes","tdattributes","xfam","mrtd","mrconfig","mrowner","mrownerconfig","rtmr0","rtmr1","rtmr2","rtmr3","reportdata"],"title":"QuoteBody"},"QuoteCollateralV3":{"properties":{"pck_crl_issuer_chain":{"type":"string","title":"Pck Crl Issuer Chain"},"root_ca_crl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Root Ca Crl"},"pck_crl":{"type":"string","title":"Pck Crl"},"tcb_info_issuer_chain":{"type":"string","title":"Tcb Info Issuer Chain"},"tcb_info":{"type":"string","title":"Tcb Info"},"tcb_info_signature":{"type":"string","title":"Tcb Info Signature"},"qe_identity_issuer_chain":{"type":"string","title":"Qe Identity Issuer Chain"},"qe_identity":{"type":"string","title":"Qe Identity"},"qe_identity_signature":{"type":"string","title":"Qe Identity Signature"}},"type":"object","required":["pck_crl_issuer_chain","root_ca_crl","pck_crl","tcb_info_issuer_chain","tcb_info","tcb_info_signature","qe_identity_issuer_chain","qe_identity","qe_identity_signature"],"title":"QuoteCollateralV3"},"QuoteHeader":{"properties":{"version":{"type":"integer","title":"Version"},"ak_type":{"$ref":"#/components/schemas/AttestationKeyType"},"tee_type":{"$ref":"#/components/schemas/TeeType"},"qe_vendor":{"type":"string","format":"binary","title":"Qe Vendor"},"user_data":{"type":"string","format":"binary","title":"User Data"}},"type":"object","required":["version","ak_type","tee_type","qe_vendor","user_data"],"title":"QuoteHeader"},"RedeployRevisionRequest":{"properties":{"vm_uuids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Vm Uuids"}},"type":"object","title":"RedeployRevisionRequest"},"RedpillApiKeyCreate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Display name for the API key","default":"Redpill API Key"}},"type":"object","title":"RedpillApiKeyCreate","description":"Request body for creating a Redpill API key."},"RegisterPayload":{"properties":{"username":{"type":"string","title":"Username"},"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"},"invite_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invite Code"},"site_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Key"}},"type":"object","required":["username","email","password"],"title":"RegisterPayload"},"ResetPasswordWithToken":{"properties":{"token":{"type":"string","title":"Token"},"password":{"type":"string","title":"Password"},"site_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Key"}},"type":"object","required":["token","password"],"title":"ResetPasswordWithToken","description":"Request model for resetting password with token."},"ResourceThreshold":{"properties":{"max_instances":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Instances"},"max_vcpu":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Vcpu"},"max_memory":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Memory"},"max_disk":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Disk"},"max_memory_each":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Memory Each"},"max_disk_each":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Disk Each"}},"type":"object","required":["max_instances","max_vcpu","max_memory","max_disk"],"title":"ResourceThreshold","description":"Resource threshold for VM creation."},"SessionResponse":{"properties":{"id":{"type":"string","title":"Id"},"jti":{"type":"string","title":"Jti"},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Agent"},"device_info":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Info"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_seen_at":{"type":"string","format":"date-time","title":"Last Seen At"},"is_current":{"type":"boolean","title":"Is Current"},"revoked":{"type":"boolean","title":"Revoked"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"device_kind":{"type":"string","enum":["Mobile","Desktop","Unknown"],"title":"Device Kind","description":"Get device kind (Mobile/Desktop) based on user agent.","readOnly":true},"device_os":{"type":"string","title":"Device Os","description":"Expose detected operating system as a computed field.","readOnly":true},"device_label":{"type":"string","title":"Device Label","description":"Generate a user-friendly device label, including OS.","readOnly":true}},"type":"object","required":["id","jti","created_at","last_seen_at","is_current","revoked","device_kind","device_os","device_label"],"title":"SessionResponse","description":"API response model for user sessions with sanitized device info."},"SessionsListResponse":{"properties":{"sessions":{"items":{"$ref":"#/components/schemas/SessionResponse"},"type":"array","title":"Sessions"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["sessions","total"],"title":"SessionsListResponse","description":"Response for listing user sessions."},"StepUpVerifyRequest":{"properties":{"current_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Password"},"totp_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Totp Code"}},"type":"object","title":"StepUpVerifyRequest","description":"Generic step-up verification request.\n\nAccepts either current_password (for users without 2FA) or totp_code (for users with 2FA).\nOn success, server will issue a short-lived cookie used by sensitive endpoints."},"SystemInfo":{"properties":{"os_name":{"type":"string","title":"Os Name"},"os_version":{"type":"string","title":"Os Version"},"kernel_version":{"type":"string","title":"Kernel Version"},"cpu_model":{"type":"string","title":"Cpu Model"},"num_cpus":{"type":"integer","title":"Num Cpus"},"total_memory":{"type":"integer","title":"Total Memory"},"available_memory":{"type":"integer","title":"Available Memory"},"used_memory":{"type":"integer","title":"Used Memory"},"free_memory":{"type":"integer","title":"Free Memory"},"total_swap":{"type":"integer","title":"Total Swap"},"used_swap":{"type":"integer","title":"Used Swap"},"free_swap":{"type":"integer","title":"Free Swap"},"uptime":{"type":"integer","title":"Uptime"},"loadavg_one":{"type":"integer","title":"Loadavg One"},"loadavg_five":{"type":"integer","title":"Loadavg Five"},"loadavg_fifteen":{"type":"integer","title":"Loadavg Fifteen"},"disks":{"items":{"$ref":"#/components/schemas/DiskInfo"},"type":"array","title":"Disks"}},"type":"object","required":["os_name","os_version","kernel_version","cpu_model","num_cpus","total_memory","available_memory","used_memory","free_memory","total_swap","used_swap","free_swap","uptime","loadavg_one","loadavg_five","loadavg_fifteen","disks"],"title":"SystemInfo"},"TcbInfo":{"properties":{"mrtd":{"type":"string","title":"Mrtd"},"rootfs_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rootfs Hash"},"rtmr0":{"type":"string","title":"Rtmr0"},"rtmr1":{"type":"string","title":"Rtmr1"},"rtmr2":{"type":"string","title":"Rtmr2"},"rtmr3":{"type":"string","title":"Rtmr3"},"event_log":{"items":{"$ref":"#/components/schemas/EventLog"},"type":"array","title":"Event Log"},"app_compose":{"type":"string","title":"App Compose"}},"type":"object","required":["mrtd","rtmr0","rtmr1","rtmr2","rtmr3","event_log","app_compose"],"title":"TcbInfo"},"TeamTier":{"type":"string","enum":["PRO","ENTERPRISE","LEVEL_1","LEVEL_2"],"title":"TeamTier"},"TeeType":{"type":"integer","enum":[0,129],"title":"TeeType","description":"TEE type values used by Intel DCAP quote header."},"Teepod":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"endpoint":{"type":"string","title":"Endpoint"},"kms_url":{"type":"string","title":"Kms Url"},"kms_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kms Version"},"tproxy_url":{"type":"string","title":"Tproxy Url"},"tproxy_base_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tproxy Base Domain"},"tproxy_port":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tproxy Port"},"tproxy_tappd_port":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tproxy Tappd Port"},"teepod_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teepod Version"},"status":{"$ref":"#/components/schemas/TeepodStatus"},"enabled":{"type":"boolean","title":"Enabled"},"last_ping_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Ping At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"region_identifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region Identifier"}},"type":"object","required":["id","name","endpoint","kms_url","tproxy_url","status","enabled","created_at"],"title":"Teepod"},"TeepodCapacity":{"properties":{"teepod_id":{"type":"integer","title":"Teepod Id"},"name":{"type":"string","title":"Name"},"listed":{"type":"boolean","title":"Listed"},"resource_score":{"type":"number","title":"Resource Score"},"remaining_vcpu":{"type":"number","title":"Remaining Vcpu"},"remaining_memory":{"type":"number","title":"Remaining Memory"},"remaining_cvm_slots":{"type":"integer","title":"Remaining Cvm Slots"},"remaining_disk":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Remaining Disk"},"images":{"items":{"$ref":"#/components/schemas/teehouse__api__routes__cvms__preflight__AvailableOSImage"},"type":"array","title":"Images"},"dedicated_for_team_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dedicated For Team Id"},"support_onchain_kms":{"type":"boolean","title":"Support Onchain Kms","default":false},"fmspc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fmspc"},"device_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Id"},"region_identifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region Identifier"},"default_kms":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Kms"},"kms_list":{"items":{"type":"string"},"type":"array","title":"Kms List","default":[]}},"type":"object","required":["teepod_id","name","listed","resource_score","remaining_vcpu","remaining_memory","remaining_cvm_slots","images"],"title":"TeepodCapacity","description":"Represents a teepod (remain) capacity"},"TeepodMeta":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"TeepodMeta"},"TeepodStatus":{"type":"string","enum":["ONLINE","OFFLINE","MAINTENANCE"],"title":"TeepodStatus"},"TierCapacity":{"properties":{"tier":{"$ref":"#/components/schemas/TeamTier"},"capacity":{"$ref":"#/components/schemas/ResourceThreshold"},"nodes":{"items":{"$ref":"#/components/schemas/TeepodCapacity"},"type":"array","title":"Nodes"},"kms_list":{"items":{"$ref":"#/components/schemas/KmsWithSupportedOSImage"},"type":"array","title":"Kms List"},"gpu_availability":{"$ref":"#/components/schemas/GpuAvailability"}},"type":"object","required":["tier","capacity","nodes","kms_list"],"title":"TierCapacity"},"TwoFactorDisableRequest":{"properties":{"verification_code":{"type":"string","title":"Verification Code"}},"type":"object","required":["verification_code"],"title":"TwoFactorDisableRequest"},"TwoFactorPageVerifyRequest":{"properties":{"code":{"type":"string","title":"Code"}},"type":"object","required":["code"],"title":"TwoFactorPageVerifyRequest"},"TwoFactorRegenerateRequest":{"properties":{"verification_code":{"type":"string","title":"Verification Code"}},"type":"object","required":["verification_code"],"title":"TwoFactorRegenerateRequest"},"TwoFactorSetupRequest":{"properties":{"totp_code":{"type":"string","title":"Totp Code"}},"type":"object","required":["totp_code"],"title":"TwoFactorSetupRequest"},"TwoFactorVerificationRequest":{"properties":{"code":{"type":"string","title":"Code"}},"type":"object","required":["code"],"title":"TwoFactorVerificationRequest"},"UpdatePasswordRequest":{"properties":{"password":{"type":"string","title":"Password"},"current_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Password"},"totp_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Totp Code"},"site_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Key"}},"type":"object","required":["password"],"title":"UpdatePasswordRequest"},"UpdateUsernameRequest":{"properties":{"username":{"type":"string","title":"Username"},"current_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Password"},"totp_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Totp Code"}},"type":"object","required":["username"],"title":"UpdateUsernameRequest"},"User":{"properties":{"username":{"type":"string","title":"Username"},"id":{"type":"integer","title":"Id"},"role":{"type":"string","title":"Role"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"credit":{"anyOf":[{"$ref":"#/components/schemas/Credit"},{"type":"null"}]}},"type":"object","required":["username","id","role","created_at"],"title":"User"},"UserRef":{"properties":{"object_type":{"type":"string","const":"user","title":"Object Type","description":"Fixed value 'user'","default":"user"},"id":{"anyOf":[{"type":"string","pattern":"^usr_.+","format":"hashid","title":"HashedId[users]","description":"A hashed identifier that maps to an internal database ID","examples":["usr_0123abcd"]},{"type":"null"}],"title":"Id","description":"Hashed user ID"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username","description":"Display username"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url","description":"Gravatar or OAuth provider avatar URL"}},"type":"object","title":"UserRef","description":"Minimal user reference for embedding in responses."},"VM":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"teepod_id":{"type":"integer","title":"Teepod Id"},"teepod":{"anyOf":[{"$ref":"#/components/schemas/TeepodMeta"},{"type":"null"}]},"user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id"},"app_id":{"type":"string","title":"App Id"},"vm_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vm Uuid"},"instance_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance Id"},"app_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Url"},"base_image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Image"},"vcpu":{"type":"integer","title":"Vcpu"},"memory":{"type":"integer","title":"Memory"},"disk_size":{"type":"integer","title":"Disk Size"},"manifest_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Manifest Version"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"},"runner":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Runner"},"docker_compose_file":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Docker Compose File"},"features":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Features"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"encrypted_env_pubkey":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Encrypted Env Pubkey"}},"type":"object","required":["id","name","status","teepod_id","app_id","vcpu","memory","disk_size","created_at"],"title":"VM"},"VMCreateWithTeepod":{"properties":{"user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id"},"name":{"type":"string","maxLength":20,"minLength":4,"title":"Name"},"image":{"type":"string","title":"Image"},"vcpu":{"type":"integer","title":"Vcpu"},"memory":{"type":"integer","title":"Memory"},"disk_size":{"type":"integer","title":"Disk Size"},"compose_manifest":{"$ref":"#/components/schemas/ComposeManifest"},"ports":{"anyOf":[{"items":{"$ref":"#/components/schemas/PortMapping"},"type":"array"},{"type":"null"}],"title":"Ports"},"encrypted_env":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Encrypted Env"},"app_id_salt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Id Salt"},"teepod_id":{"type":"integer","title":"Teepod Id"},"listed":{"type":"boolean","title":"Listed","default":false},"instance_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance Type"},"env_keys":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Env Keys"}},"type":"object","required":["name","image","vcpu","memory","disk_size","compose_manifest","teepod_id"],"title":"VMCreateWithTeepod"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerificationResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Quote checksum identifier"},"success":{"type":"boolean","title":"Success","description":"Verification passed"},"proof_of_cloud":{"type":"boolean","title":"Proof Of Cloud","description":"Quote from Phala Cloud TEE"},"quote":{"anyOf":[{"$ref":"#/components/schemas/Quote"},{"type":"null"}],"description":"Parsed quote structure"},"checksum":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checksum","description":"SHA256 of quote bytes"},"can_download":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Can Download","description":"Raw quote downloadable"},"uploaded_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uploaded At","description":"ISO8601 upload timestamp"},"quote_collateral":{"anyOf":[{"$ref":"#/components/schemas/QuoteCollateralV3"},{"type":"null"}],"description":"TCB collateral data"}},"type":"object","required":["id","success","proof_of_cloud"],"title":"VerificationResponse","description":"Quote verification result."},"VerifyAndLinkOAuthRequest":{"properties":{"link_token":{"type":"string","title":"Link Token"},"password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password"},"totp_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Totp Code"}},"type":"object","required":["link_token"],"title":"VerifyAndLinkOAuthRequest","description":"Request to verify password/2FA and link OAuth account during Link-on-Login flow."},"VmConfiguration":{"properties":{"name":{"type":"string","title":"Name"},"image":{"type":"string","title":"Image"},"compose_file":{"anyOf":[{"$ref":"#/components/schemas/AppComposeV2"},{"type":"null"}]},"vcpu":{"type":"integer","title":"Vcpu"},"memory":{"type":"integer","title":"Memory"},"disk_size":{"type":"integer","title":"Disk Size"},"ports":{"anyOf":[{"items":{"$ref":"#/components/schemas/PortMapping"},"type":"array"},{"type":"null"}],"title":"Ports"},"encrypted_env":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Encrypted Env"},"app_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Id"},"user_config":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Config"},"hugepages":{"type":"boolean","title":"Hugepages","default":false},"pin_numa":{"type":"boolean","title":"Pin Numa","default":false},"gpus":{"anyOf":[{"$ref":"#/components/schemas/GpuConfig"},{"type":"null"}],"default":{"gpus":[],"attach_mode":"listed"}},"kms_urls":{"items":{"type":"string"},"type":"array","title":"Kms Urls","default":[]},"gateway_urls":{"items":{"type":"string"},"type":"array","title":"Gateway Urls","default":[]}},"type":"object","required":["name","image","vcpu","memory","disk_size"],"title":"VmConfiguration","description":"Mapping from Teepod RPC's VmConfiguration."},"VmInfo":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"uptime":{"type":"string","title":"Uptime"},"app_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Url"},"app_id":{"type":"string","title":"App Id"},"instance_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance Id"},"configuration":{"anyOf":[{"$ref":"#/components/schemas/VmConfiguration"},{"type":"null"}]},"exited_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exited At"},"boot_progress":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Boot Progress"},"boot_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Boot Error"},"shutdown_progress":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shutdown Progress"},"image_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Version"}},"type":"object","required":["id","name","status","uptime","app_id"],"title":"VmInfo","description":"Mapping from Teepod RPC's VmInfo."},"WorkspaceRef":{"properties":{"object_type":{"type":"string","const":"workspace","title":"Object Type","description":"Fixed value 'workspace'","default":"workspace"},"id":{"type":"string","pattern":"^wks_.+","format":"hashid","title":"HashedId[teams]","description":"Hashed workspace ID","examples":["wks_0123abcd"]},"name":{"type":"string","title":"Name","description":"Workspace display name"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug","description":"URL-safe workspace identifier"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url","description":"Workspace avatar URL from profile"}},"type":"object","required":["id","name"],"title":"WorkspaceRef","description":"Minimal workspace reference for embedding in responses."},"WrappedChangeEmailRequest":{"properties":{"request":{"$ref":"#/components/schemas/ChangeEmailPayload"},"site_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Key"}},"type":"object","required":["request"],"title":"WrappedChangeEmailRequest","description":"Wrapped request format from frontend API route"},"WrappedEmailVerificationRequest":{"properties":{"request":{"$ref":"#/components/schemas/EmailVerificationPayload"},"site_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Key"}},"type":"object","required":["request"],"title":"WrappedEmailVerificationRequest","description":"Wrapped request format from frontend API route"},"teehouse__api__routes__apps__schemas__ReplicateRequest":{"properties":{"teepod_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Teepod Id","description":"Target node ID (deprecated, use node_id)"},"node_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Node Id","description":"Target node ID for replica"},"encrypted_env":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Encrypted Env","description":"Hex-encoded encrypted environment"}},"type":"object","title":"ReplicateRequest","description":"CVM replication request parameters."},"teehouse__api__routes__apps__v20251028__schemas__CvmBasicInfo":{"properties":{"vm_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vm Uuid"},"app_id":{"type":"string","title":"App Id"},"name":{"type":"string","title":"Name","default":""},"status":{"type":"string","title":"Status"},"vcpu":{"type":"integer","title":"Vcpu"},"memory":{"type":"integer","title":"Memory"},"disk_size":{"type":"integer","title":"Disk Size"},"teepod_id":{"type":"integer","title":"Teepod Id"},"teepod_name":{"type":"string","title":"Teepod Name"},"region_identifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region Identifier"},"kms_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kms Type"},"instance_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance Type"},"listed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Listed"},"base_image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Image"},"kms_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kms Slug"},"kms_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kms Id"},"instance_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance Id"},"machine_info":{"anyOf":[{"$ref":"#/components/schemas/MachineInfo"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["vm_uuid","app_id","status","vcpu","memory","disk_size","teepod_id","teepod_name","region_identifier","kms_type","instance_type"],"title":"CvmBasicInfo"},"teehouse__api__routes__apps__v20251028__schemas__DstackAppFullResponse":{"properties":{"id":{"type":"string","pattern":"^prj_.+","format":"hashid","title":"HashedId[projects]","description":"A hashed identifier that maps to an internal database ID","examples":["prj_0123abcd"]},"name":{"type":"string","title":"Name"},"app_id":{"type":"string","title":"App Id"},"app_provision_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Provision Type"},"app_icon_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Icon Url"},"created_at":{"type":"string","title":"Created At"},"kms_type":{"type":"string","title":"Kms Type"},"profile":{"anyOf":[{"$ref":"#/components/schemas/ProfileGetResponse"},{"type":"null"}]},"current_cvm":{"anyOf":[{"$ref":"#/components/schemas/teehouse__api__routes__apps__v20251028__schemas__CvmBasicInfo"},{"type":"null"}]},"cvms":{"items":{"$ref":"#/components/schemas/teehouse__api__routes__apps__v20251028__schemas__CvmBasicInfo"},"type":"array","title":"Cvms"},"cvm_count":{"type":"integer","title":"Cvm Count","default":0},"team_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Slug"},"team_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Name"}},"type":"object","required":["id","name","app_id","created_at","kms_type"],"title":"DstackAppFullResponse"},"teehouse__api__routes__apps__v20251028__schemas__DstackAppListResponse":{"properties":{"dstack_apps":{"items":{"anyOf":[{"$ref":"#/components/schemas/teehouse__api__routes__apps__v20251028__schemas__DstackAppFullResponse"},{"$ref":"#/components/schemas/DstackAppMinimalResponse"}]},"type":"array","title":"Dstack Apps"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"total":{"type":"integer","title":"Total"},"total_pages":{"type":"integer","title":"Total Pages"}},"type":"object","required":["dstack_apps","page","page_size","total","total_pages"],"title":"DstackAppListResponse"},"teehouse__api__routes__apps__v20260121__schemas__DstackAppFullResponse":{"properties":{"id":{"type":"string","pattern":"^prj_.+","format":"hashid","title":"HashedId[projects]","description":"A hashed identifier that maps to an internal database ID","examples":["prj_0123abcd"]},"name":{"type":"string","title":"Name"},"app_id":{"type":"string","title":"App Id"},"app_provision_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Provision Type"},"app_icon_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Icon Url"},"created_at":{"type":"string","title":"Created At"},"kms_type":{"type":"string","title":"Kms Type"},"profile":{"anyOf":[{"$ref":"#/components/schemas/ProfileGetResponse"},{"type":"null"}]},"current_cvm":{"anyOf":[{"$ref":"#/components/schemas/CVMInfo"},{"type":"null"}]},"cvms":{"items":{"$ref":"#/components/schemas/CVMInfo"},"type":"array","title":"Cvms"},"cvm_count":{"type":"integer","title":"Cvm Count","default":0}},"type":"object","required":["id","name","app_id","created_at","kms_type"],"title":"DstackAppFullResponse"},"teehouse__api__routes__apps__v20260121__schemas__DstackAppListResponse":{"properties":{"dstack_apps":{"items":{"anyOf":[{"$ref":"#/components/schemas/teehouse__api__routes__apps__v20260121__schemas__DstackAppFullResponse"},{"$ref":"#/components/schemas/DstackAppMinimalResponse"}]},"type":"array","title":"Dstack Apps"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"total":{"type":"integer","title":"Total"},"total_pages":{"type":"integer","title":"Total Pages"}},"type":"object","required":["dstack_apps","page","page_size","total","total_pages"],"title":"DstackAppListResponse"},"teehouse__api__routes__cvms__deployment__ReplicateRequest":{"properties":{"teepod_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Teepod Id","description":"Target node ID (deprecated, use node_id)"},"node_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Node Id","description":"Target node ID for the replica"},"encrypted_env":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Encrypted Env","description":"New encrypted env blob (hex)"}},"type":"object","title":"ReplicateRequest","description":"Request model for CVM replication (currently disabled)."},"teehouse__api__routes__cvms__management__CvmBasicInfo":{"properties":{"id":{"type":"integer","title":"Id","description":"Internal CVM database ID"},"teepod_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Teepod Id","description":"Node ID (admin only)"},"teepod":{"anyOf":[{"$ref":"#/components/schemas/CvmNode"},{"type":"null"}],"description":"Node metadata"},"name":{"type":"string","title":"Name","description":"RFC 1123 compliant CVM name"},"status":{"type":"string","title":"Status","description":"Current status: running, stopped, starting, etc."},"in_progress":{"type":"boolean","title":"In Progress","description":"True if an operation is currently executing","default":false},"app_id":{"type":"string","title":"App Id","description":"Unique application identifier"},"vm_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vm Uuid","description":"VM instance UUID on the node"},"instance_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance Id","description":"Public instance identifier"},"vcpu":{"type":"integer","title":"Vcpu","description":"Allocated vCPU count"},"memory":{"type":"integer","title":"Memory","description":"Allocated memory in MB"},"disk_size":{"type":"integer","title":"Disk Size","description":"Allocated disk size in GB"},"base_image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Image","description":"OS image name"},"encrypted_env_pubkey":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Encrypted Env Pubkey","description":"Public key for encrypting env vars"},"listed":{"type":"boolean","title":"Listed","description":"True if publicly listed","default":false},"project_id":{"anyOf":[{"type":"string","format":"hashid","description":"A hashed identifier that maps to an internal database ID","examples":["0123abcd"]},{"type":"null"}],"title":"Project Id","description":"Associated project ID"},"project_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Type","description":"Project provision type"},"instance_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance Type","description":"Instance type identifier"},"public_sysinfo":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Public Sysinfo","description":"Expose system info publicly"},"public_logs":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Public Logs","description":"Expose logs publicly"},"dapp_dashboard_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dapp Dashboard Url","description":"DApp dashboard URL if applicable"},"syslog_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Syslog Endpoint","description":"Syslog streaming endpoint"},"kms_info":{"anyOf":[{"$ref":"#/components/schemas/KMSInfo"},{"type":"null"}],"description":"KMS configuration"},"contract_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contract Address","description":"On-chain contract address"},"deployer_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deployer Address","description":"Deployer wallet address"},"scheduled_delete_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled Delete At","description":"Auto-delete timestamp (UTC)"},"public_urls":{"anyOf":[{"items":{"$ref":"#/components/schemas/CvmNetworkUrls"},"type":"array"},{"type":"null"}],"title":"Public Urls","description":"Exposed service URLs"},"gateway_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gateway Domain","description":"Gateway base domain"}},"type":"object","required":["id","name","status","app_id","vcpu","memory","disk_size"],"title":"CvmBasicInfo","description":"Detailed CVM information returned by GET /cvms/{cvm_id}."},"teehouse__api__routes__cvms__patch_compose_file__AvailableOSImage":{"properties":{"version":{"anyOf":[{"prefixItems":[{"type":"integer"},{"type":"integer"},{"type":"integer"},{"type":"integer"}],"type":"array","maxItems":4,"minItems":4},{"prefixItems":[{"type":"integer"},{"type":"integer"},{"type":"integer"}],"type":"array","maxItems":3,"minItems":3}],"title":"Version","description":"Semantic version as tuple (major, minor, patch[, build])"},"prod":{"anyOf":[{"$ref":"#/components/schemas/OSImageVariant"},{"type":"null"}],"description":"Production build (stable)"},"dev":{"anyOf":[{"$ref":"#/components/schemas/OSImageVariant"},{"type":"null"}],"description":"Development build (testing)"}},"type":"object","required":["version"],"title":"AvailableOSImage","description":"OS image version with production and development variants."},"teehouse__api__routes__cvms__preflight__AvailableOSImage":{"properties":{"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"is_dev":{"type":"boolean","title":"Is Dev"},"version":{"anyOf":[{"prefixItems":[{"type":"integer"},{"type":"integer"},{"type":"integer"},{"type":"integer"}],"type":"array","maxItems":4,"minItems":4},{"prefixItems":[{"type":"integer"},{"type":"integer"},{"type":"integer"}],"type":"array","maxItems":3,"minItems":3}],"title":"Version"},"os_image_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Os Image Hash"},"requires_gpu":{"type":"boolean","title":"Requires Gpu","default":false}},"type":"object","required":["name","slug","is_dev","version"],"title":"AvailableOSImage"}},"securitySchemes":{"OAuth2AuthorizationCodeBearer":{"type":"oauth2","flows":{"authorizationCode":{"scopes":{},"authorizationUrl":"","tokenUrl":"token"}}},"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key"}}},"tags":[{"name":"auth","description":"User authentication and authorization for Phala Cloud"},{"name":"users","description":"Manage user profiles and account settings in Phala Cloud"},{"name":"cvm","description":"Confidential computing instance management in Phala Network"},{"name":"teepod","description":"Trusted Execution Environment (TEE) workload deployment and management"},{"name":"credits","description":"Phala Cloud credits and usage billing management"},{"name":"tokens","description":"API token management for Phala Cloud services"},{"name":"projects","description":"Project management and listing for Phala Cloud"}]} \ No newline at end of file diff --git a/openapi/phala-cloud-openapi.normalized.json b/openapi/phala-cloud-openapi.normalized.json deleted file mode 100644 index a3c9b0e..0000000 --- a/openapi/phala-cloud-openapi.normalized.json +++ /dev/null @@ -1,14314 +0,0 @@ -{ - "openapi": "3.0.3", - "info": { - "title": "Phala Cloud API", - "version": "0.1.0" - }, - "paths": { - "/api/v1/auth/oauth/google/authorize": { - "get": { - "tags": [ - "auth", - "auth", - "OAuth" - ], - "summary": "Start Google OAuth", - "description": "Redirects user to Google authorization page. Supports login, registration, and account linking modes.", - "operationId": "google_oauth_authorize_api_v1_auth_oauth_google_authorize_get", - "parameters": [ - { - "name": "returnUrl", - "in": "query", - "required": false, - "schema": { - "title": "Returnurl", - "type": "string", - "nullable": true - } - }, - { - "name": "invite", - "in": "query", - "required": false, - "schema": { - "title": "Invite", - "type": "string", - "nullable": true - } - }, - { - "name": "mode", - "in": "query", - "required": false, - "schema": { - "title": "Mode", - "type": "string", - "nullable": true - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "307": { - "description": "Redirect to Google authorization URL" - }, - "501": { - "description": "Google OAuth not configured on server" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/auth/oauth/google/callback": { - "get": { - "tags": [ - "auth", - "auth", - "OAuth" - ], - "summary": "Handle Google OAuth callback", - "description": "Processes Google authorization response. Creates session cookie on success or redirects with error parameter on failure.", - "operationId": "google_oauth_callback_api_v1_auth_oauth_google_callback_get", - "parameters": [ - { - "name": "code", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Code" - } - }, - { - "name": "state", - "in": "query", - "required": false, - "schema": { - "title": "State", - "type": "string", - "nullable": true - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "307": { - "description": "Redirect to dashboard on success, login/register/settings page on error" - }, - "400": { - "description": "Invalid state parameter or token exchange failed" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/auth/oauth/github/authorize": { - "get": { - "tags": [ - "auth", - "auth", - "OAuth" - ], - "summary": "Start GitHub OAuth", - "description": "Redirects user to GitHub authorization page. Supports login, registration, and account linking modes.", - "operationId": "github_oauth_authorize_api_v1_auth_oauth_github_authorize_get", - "parameters": [ - { - "name": "returnUrl", - "in": "query", - "required": false, - "schema": { - "title": "Returnurl", - "type": "string", - "nullable": true - } - }, - { - "name": "invite", - "in": "query", - "required": false, - "schema": { - "title": "Invite", - "type": "string", - "nullable": true - } - }, - { - "name": "mode", - "in": "query", - "required": false, - "schema": { - "title": "Mode", - "type": "string", - "nullable": true - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "307": { - "description": "Redirect to GitHub authorization URL" - }, - "501": { - "description": "GitHub OAuth not configured on server" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/auth/oauth/github/callback": { - "get": { - "tags": [ - "auth", - "auth", - "OAuth" - ], - "summary": "Handle GitHub OAuth callback", - "description": "Processes GitHub authorization response. Creates session cookie on success or redirects with error parameter on failure.", - "operationId": "github_oauth_callback_api_v1_auth_oauth_github_callback_get", - "parameters": [ - { - "name": "code", - "in": "query", - "required": false, - "schema": { - "title": "Code", - "type": "string", - "nullable": true - } - }, - { - "name": "state", - "in": "query", - "required": false, - "schema": { - "title": "State", - "type": "string", - "nullable": true - } - }, - { - "name": "error", - "in": "query", - "required": false, - "schema": { - "title": "Error", - "type": "string", - "nullable": true - } - }, - { - "name": "error_description", - "in": "query", - "required": false, - "schema": { - "title": "Error Description", - "type": "string", - "nullable": true - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "307": { - "description": "Redirect to dashboard on success, login/register/settings page on error" - }, - "400": { - "description": "Invalid state parameter or token exchange failed" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/auth/me": { - "get": { - "tags": [ - "auth", - "auth" - ], - "summary": "Get current user", - "description": "Return detailed info for the authenticated user including workspace and credits.", - "operationId": "read_users_me_api_v1_auth_me_get", - "responses": { - "200": { - "description": "User profile with workspace and credits", - "content": { - "application/json": { - "schema": {} - } - } - }, - "401": { - "description": "Not authenticated" - }, - "403": { - "description": "User is disabled" - } - }, - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ] - } - }, - "/api/v1/auth/authenticated": { - "get": { - "tags": [ - "auth", - "auth" - ], - "summary": "Check authentication", - "description": "Return authentication status and user info if authenticated.", - "operationId": "authenticated_api_v1_auth_authenticated_get", - "responses": { - "200": { - "description": "Authentication status with user info if authenticated", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ] - } - }, - "/api/v1/auth/register": { - "post": { - "tags": [ - "auth", - "auth" - ], - "summary": "Register new user", - "description": "Create a new account with email verification. Requires invite code if configured.", - "operationId": "register_user_api_v1_auth_register_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RegisterPayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "User created or verification email sent", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Invalid input, email already exists, or rate limited" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/auth/token": { - "post": { - "tags": [ - "auth", - "auth" - ], - "summary": "Get access token", - "description": "OAuth2 password grant. Returns JWT token. Pass TOTP code in client_id field if 2FA enabled.", - "operationId": "login_for_access_token_api_v1_auth_token_post", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/Body_login_for_access_token_api_v1_auth_token_post" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Access token issued", - "content": { - "application/json": { - "schema": {} - } - } - }, - "401": { - "description": "Invalid credentials, email not verified, or invalid 2FA" - }, - "500": { - "description": "Internal authentication error" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/auth/login": { - "post": { - "tags": [ - "auth", - "auth" - ], - "summary": "Login with cookie", - "description": "Authenticate and set session cookie. Pass TOTP code in client_id field if 2FA enabled.", - "operationId": "login_with_cookie_api_v1_auth_login_post", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/Body_login_with_cookie_api_v1_auth_login_post" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Login successful, cookie set", - "content": { - "application/json": { - "schema": {} - } - } - }, - "401": { - "description": "Invalid credentials or email not verified" - }, - "500": { - "description": "Session creation failed" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/auth/login-with-2fa": { - "post": { - "tags": [ - "auth", - "auth" - ], - "summary": "Login with explicit 2FA", - "description": "Authenticate with explicit TOTP code field. Preferred over /login for 2FA users.", - "operationId": "login_with_2fa_api_v1_auth_login_with_2fa_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoginRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Login successful, cookie set", - "content": { - "application/json": { - "schema": {} - } - } - }, - "401": { - "description": "Invalid credentials or email not verified" - }, - "500": { - "description": "Session creation failed" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/auth/logout": { - "post": { - "tags": [ - "auth", - "auth" - ], - "summary": "Logout", - "description": "Revoke the current session and clear authentication cookies.", - "operationId": "logout_api_v1_auth_logout_post", - "responses": { - "200": { - "description": "Logged out successfully", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ] - } - }, - "/api/v1/auth/forgot-password": { - "post": { - "tags": [ - "auth", - "auth" - ], - "summary": "Request password reset", - "description": "Send password reset email if account exists. Response is identical whether account exists or not.", - "operationId": "forgot_password_api_v1_auth_forgot_password_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PasswordResetRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Reset email sent (if account exists)", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/auth/validate-reset-token": { - "get": { - "tags": [ - "auth", - "auth" - ], - "summary": "Validate reset token", - "description": "Check if a password reset token is valid and not expired.", - "operationId": "validate_reset_token_api_v1_auth_validate_reset_token_get", - "parameters": [ - { - "name": "token", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Token" - } - } - ], - "responses": { - "200": { - "description": "Token is valid", - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true, - "title": "Response Validate Reset Token Api V1 Auth Validate Reset Token Get" - } - } - } - }, - "400": { - "description": "Invalid or expired token" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/auth/reset-password": { - "put": { - "tags": [ - "auth", - "auth" - ], - "summary": "Reset password with token", - "description": "Set a new password using the reset token from email.", - "operationId": "handle_reset_password_with_token_api_v1_auth_reset_password_put", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ResetPasswordWithToken" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Password reset successfully", - "content": { - "application/json": { - "schema": { - "additionalProperties": true, - "type": "object", - "title": "Response Handle Reset Password With Token Api V1 Auth Reset Password Put" - } - } - } - }, - "400": { - "description": "Invalid token, expired, or weak password" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/auth/password": { - "post": { - "tags": [ - "auth", - "auth" - ], - "summary": "Update password", - "description": "Change password. Requires TOTP code (if 2FA enabled) or current password. Sends notification email.", - "operationId": "handle_update_password_api_v1_auth_password_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdatePasswordRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Password updated", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/User" - } - } - } - }, - "400": { - "description": "TOTP code required or invalid, or password validation failed" - }, - "401": { - "description": "Not authenticated or current password incorrect" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ] - } - }, - "/api/v1/auth/username": { - "put": { - "tags": [ - "auth", - "auth" - ], - "summary": "Update username", - "description": "Change username. Requires TOTP code (if 2FA enabled) or current password. Revokes all other sessions.", - "operationId": "handle_update_username_api_v1_auth_username_put", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateUsernameRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Username updated", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "TOTP required, invalid TOTP, or username validation failed" - }, - "401": { - "description": "Not authenticated or current password incorrect" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ] - } - }, - "/api/v1/auth/request-email-verification": { - "post": { - "tags": [ - "auth", - "auth" - ], - "summary": "Request email verification", - "description": "Send or resend verification email. Can also be used to change email address.", - "operationId": "api_request_email_verification_api_v1_auth_request_email_verification_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WrappedEmailVerificationRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Verification email sent", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "No email provided or send failed" - }, - "401": { - "description": "Not authenticated" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ] - } - }, - "/api/v1/auth/change-email": { - "post": { - "tags": [ - "auth", - "auth" - ], - "summary": "Change email address", - "description": "Initiate email change. Requires verification (password or 2FA). Sends verification to new address.", - "operationId": "api_change_email_api_v1_auth_change_email_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WrappedChangeEmailRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Verification email sent to new address", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Email send failed or invalid" - }, - "401": { - "description": "Not authenticated or verification failed" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ] - } - }, - "/api/v1/auth/verify-email-token": { - "post": { - "tags": [ - "auth", - "auth" - ], - "summary": "Verify email token", - "description": "Complete email verification using token from email link.", - "operationId": "api_verify_email_token_api_v1_auth_verify_email_token_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Body_api_verify_email_token_api_v1_auth_verify_email_token_post" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Email verified", - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object", - "title": "Response Api Verify Email Token Api V1 Auth Verify Email Token Post" - } - } - } - }, - "400": { - "description": "Invalid token, expired, or site key invalid" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/auth/2fa/status": { - "get": { - "tags": [ - "auth", - "auth-2fa" - ], - "summary": "Get 2FA status", - "description": "Return 2FA configuration status including enabled flag and backup codes count.", - "operationId": "get_2fa_status_endpoint_api_v1_auth_2fa_status_get", - "responses": { - "200": { - "description": "2FA status", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Status check failed" - }, - "401": { - "description": "Not authenticated" - } - }, - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ] - } - }, - "/api/v1/auth/2fa/setup": { - "post": { - "tags": [ - "auth", - "auth-2fa" - ], - "summary": "Initialize 2FA setup", - "description": "Generate TOTP secret and QR code. Secret is only shown once. Call /2fa/confirm to activate.", - "operationId": "setup_2fa_endpoint_api_v1_auth_2fa_setup_post", - "responses": { - "200": { - "description": "Secret and QR code for authenticator app", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "2FA already enabled" - }, - "401": { - "description": "Not authenticated" - } - }, - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ] - } - }, - "/api/v1/auth/2fa/confirm": { - "post": { - "tags": [ - "auth", - "auth-2fa" - ], - "summary": "Confirm 2FA setup", - "description": "Activate 2FA by verifying a TOTP code from authenticator app. Returns backup codes.", - "operationId": "confirm_2fa_setup_endpoint_api_v1_auth_2fa_confirm_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TwoFactorSetupRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "2FA enabled with backup codes", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Invalid code or no pending setup" - }, - "401": { - "description": "Not authenticated" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ] - } - }, - "/api/v1/auth/2fa/disable": { - "post": { - "tags": [ - "auth", - "auth-2fa" - ], - "summary": "Disable 2FA", - "description": "Turn off 2FA. Requires valid TOTP code or backup code.", - "operationId": "disable_2fa_endpoint_api_v1_auth_2fa_disable_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TwoFactorDisableRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "2FA disabled", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Invalid verification code" - }, - "401": { - "description": "Not authenticated" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ] - } - }, - "/api/v1/auth/2fa/regenerate-backup-codes": { - "post": { - "tags": [ - "auth", - "auth-2fa" - ], - "summary": "Regenerate backup codes", - "description": "Generate new backup codes. Invalidates previous codes. Requires valid TOTP code.", - "operationId": "regenerate_backup_codes_endpoint_api_v1_auth_2fa_regenerate_backup_codes_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TwoFactorRegenerateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "New backup codes", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Invalid verification code or 2FA not enabled" - }, - "401": { - "description": "Not authenticated" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ] - } - }, - "/api/v1/auth/2fa/verify": { - "post": { - "tags": [ - "auth", - "auth-2fa" - ], - "summary": "Verify 2FA code", - "description": "Verify a TOTP or backup code. Sets step-up cookie on success.", - "operationId": "verify_2fa_endpoint_api_v1_auth_2fa_verify_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TwoFactorVerificationRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Code valid, step-up cookie set", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Invalid code" - }, - "401": { - "description": "Not authenticated" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ] - } - }, - "/api/v1/auth/2fa/verify-and-set-cookie": { - "post": { - "tags": [ - "auth", - "auth-2fa" - ], - "summary": "Verify 2FA and set cookie", - "description": "Verify TOTP code and set step-up cookie for subsequent sensitive operations.", - "operationId": "verify_2fa_and_set_cookie_api_v1_auth_2fa_verify_and_set_cookie_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TwoFactorPageVerifyRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "2FA verified, step-up cookie set", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Invalid code" - }, - "401": { - "description": "Not authenticated" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ] - } - }, - "/api/v1/auth/step-up/verify": { - "post": { - "tags": [ - "auth", - "auth" - ], - "summary": "Step-up verification", - "description": "Verify password or TOTP to get step-up cookie. Required for sensitive operations.", - "operationId": "verify_step_up_and_set_cookie_api_v1_auth_step_up_verify_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StepUpVerifyRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Verification passed, step-up cookie set", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Neither password nor TOTP provided, or code invalid" - }, - "401": { - "description": "Not authenticated or password incorrect" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ] - } - }, - "/api/v1/auth/sessions": { - "get": { - "tags": [ - "auth", - "auth-sessions" - ], - "summary": "List active sessions", - "description": "Return all active sessions for the current user with device info.", - "operationId": "get_active_sessions_api_v1_auth_sessions_get", - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ], - "responses": { - "200": { - "description": "List of sessions", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SessionsListResponse" - } - } - } - }, - "401": { - "description": "Not authenticated" - }, - "500": { - "description": "Session query failed" - } - } - }, - "delete": { - "tags": [ - "auth", - "auth-sessions" - ], - "summary": "Revoke all sessions", - "description": "Revoke all sessions. By default keeps current session. Requires 2FA step-up.", - "operationId": "revoke_all_sessions_api_v1_auth_sessions_delete", - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ], - "parameters": [ - { - "name": "revoke_current", - "in": "query", - "required": false, - "schema": { - "type": "boolean", - "default": false, - "title": "Revoke Current" - } - } - ], - "responses": { - "200": { - "description": "Sessions revoked", - "content": { - "application/json": { - "schema": {} - } - } - }, - "401": { - "description": "Not authenticated" - }, - "428": { - "description": "2FA step-up required" - }, - "500": { - "description": "Revocation failed" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/auth/sessions/{jti}": { - "delete": { - "tags": [ - "auth", - "auth-sessions" - ], - "summary": "Revoke session", - "description": "Revoke a specific session by JTI. Requires 2FA step-up verification.", - "operationId": "revoke_session_endpoint_api_v1_auth_sessions__jti__delete", - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ], - "parameters": [ - { - "name": "jti", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Jti" - } - } - ], - "responses": { - "200": { - "description": "Session revoked", - "content": { - "application/json": { - "schema": {} - } - } - }, - "401": { - "description": "Not authenticated" - }, - "404": { - "description": "Session not found" - }, - "428": { - "description": "2FA step-up required" - }, - "500": { - "description": "Revocation failed" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/auth/decode-link-token": { - "get": { - "tags": [ - "auth", - "auth-oauth" - ], - "summary": "Decode OAuth link token", - "description": "Extract provider and email from OAuth link token for UI display.", - "operationId": "decode_link_token_api_v1_auth_decode_link_token_get", - "parameters": [ - { - "name": "token", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Token" - } - } - ], - "responses": { - "200": { - "description": "Token data (provider, email, name, avatar_url)", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Invalid or expired token" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/auth/verify-and-link-oauth": { - "post": { - "tags": [ - "auth", - "auth-oauth" - ], - "summary": "Link OAuth account", - "description": "Verify password/2FA and link OAuth account. Used when OAuth email matches existing user.", - "operationId": "verify_and_link_oauth_api_v1_auth_verify_and_link_oauth_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VerifyAndLinkOAuthRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Account linked and logged in, or requires_2fa flag", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Invalid token, password required, or link failed" - }, - "401": { - "description": "Invalid password or 2FA code" - }, - "404": { - "description": "User not found" - }, - "423": { - "description": "Account is disabled" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/auth/device/code": { - "post": { - "tags": [ - "auth", - "device-auth" - ], - "summary": "Request device codes", - "description": "Initiate device authorization flow (RFC 8628). Returns codes for CLI polling and user verification.", - "operationId": "request_device_code_api_v1_auth_device_code_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeviceCodeRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Device and user codes generated", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeviceCodeResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/auth/device/token": { - "post": { - "tags": [ - "auth", - "device-auth" - ], - "summary": "Poll for access token", - "description": "Long-poll for authorization status. Returns token when user approves, or error codes per RFC 8628.", - "operationId": "poll_device_token_api_v1_auth_device_token_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeviceTokenRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Token issued or requires_2fa flag", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeviceTokenResponse" - } - } - } - }, - "400": { - "description": "authorization_pending, expired_token, or access_denied" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/auth/device/status/{user_code}": { - "get": { - "tags": [ - "auth", - "device-auth" - ], - "summary": "Check device code status", - "description": "Check if a verification code is valid and the CLI is still connected. Used by web UI to show real-time status.", - "operationId": "check_device_status_api_v1_auth_device_status__user_code__get", - "parameters": [ - { - "name": "user_code", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "User Code" - } - } - ], - "responses": { - "200": { - "description": "Status with valid flag and message", - "content": { - "application/json": { - "schema": {} - } - } - }, - "404": { - "description": "Code not found or expired" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/auth/device/authorize": { - "post": { - "tags": [ - "auth", - "device-auth" - ], - "summary": "Authorize device request", - "description": "Approve a CLI device request. Called from web UI after user enters the verification code.", - "operationId": "authorize_device_request_api_v1_auth_device_authorize_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeviceAuthorizeRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Device authorized", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Invalid code, expired, or 2FA required/invalid" - }, - "401": { - "description": "Not authenticated or user not found" - }, - "429": { - "description": "Rate limit exceeded" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/verified_apps": { - "get": { - "tags": [ - "cvm", - "cvms-anonymous", - "Public" - ], - "summary": "List public CVMs", - "description": "Returns all CVMs marked as listed and running. No authentication required.", - "operationId": "handle_list_public_cvms_api_v1_verified_apps_get", - "responses": { - "200": { - "description": "List of publicly listed CVMs", - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/PublicCVM" - }, - "type": "array", - "title": "Response Handle List Public Cvms Api V1 Verified Apps Get" - } - } - } - } - } - } - }, - "/api/v1/verified_apps/{cvm_id}/attestation": { - "get": { - "tags": [ - "cvm", - "cvms-anonymous", - "Public" - ], - "summary": "Get public CVM attestation", - "description": "Returns attestation data for a publicly listed CVM. Includes TCB info and app certificates.", - "operationId": "handle_get_cvm_attestation_anonymous_api_v1_verified_apps__cvm_id__attestation_get", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "responses": { - "200": { - "description": "Attestation report with TCB info", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CvmAttestation" - } - } - } - }, - "404": { - "description": "CVM not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/pubkey/from_cvm_configuration": { - "post": { - "tags": [ - "cvm", - "cvms-deployment", - "CVM Deployment (Legacy)" - ], - "summary": "Get pubkey from config (legacy)", - "description": "Deprecated. Returns app_id and encryption pubkey from VM configuration.", - "operationId": "handle_get_pubkey_from_cvm_configuration_api_v1_cvms_pubkey_from_cvm_configuration_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VMCreateWithTeepod", - "description": "The Compose Manifest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "deprecated": true, - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ] - } - }, - "/api/v1/cvms/from_cvm_configuration": { - "post": { - "tags": [ - "cvm", - "cvms-deployment", - "CVM Deployment (Legacy)" - ], - "summary": "Create CVM from config (legacy)", - "description": "Deprecated. Creates CVM from raw VM configuration payload.", - "operationId": "handle_create_cvm_with_vm_config_api_v1_cvms_from_cvm_configuration_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VMCreateWithTeepod", - "description": "The Compose Manifest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VM" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "deprecated": true, - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ] - } - }, - "/api/v1/cvms/provision/eliza": { - "post": { - "tags": [ - "cvm", - "cvms-deployment", - "CVM Deployment" - ], - "summary": "Provision Eliza app", - "description": "Validates Eliza configuration and caches it for 7 days. Returns compose_hash and KMS info for on-chain registration.", - "operationId": "handle_provision_cvm_for_eliza_api_v1_cvms_provision_eliza_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProvisionElizaRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Provision data with compose_hash for creation", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Invalid configuration" - }, - "401": { - "description": "Authentication required" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/provision": { - "post": { - "tags": [ - "cvm", - "cvms-deployment", - "CVM Deployment" - ], - "summary": "Provision DStack app", - "description": "Validates Docker Compose configuration and caches it for 7 days. Returns compose_hash and KMS info for on-chain registration before creation.", - "operationId": "handle_provision_cvm_api_v1_cvms_provision_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProvisionDstackAppRequestV2" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Provision data with compose_hash for creation", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Invalid Docker Compose configuration" - }, - "401": { - "description": "Authentication required" - }, - "422": { - "description": "Validation error" - } - } - } - }, - "/api/v1/cvms/workload": { - "post": { - "tags": [ - "cvm", - "cvms-deployment", - "CVM Deployment" - ], - "summary": "Create GPU workload CVM", - "description": "Creates a CVM for GPU workloads. Node is auto-selected from available GPU nodes.", - "operationId": "handle_create_cvm_for_workload_api_v1_cvms_workload_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateWorkloadTappRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Created CVM record", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VM" - } - } - } - }, - "400": { - "description": "Creation failed" - }, - "401": { - "description": "Authentication required" - }, - "409": { - "description": "CVM name already exists in workspace" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ] - } - }, - "/api/v1/cvms": { - "post": { - "tags": [ - "cvm", - "cvms-deployment", - "CVM Deployment" - ], - "summary": "Create CVM from provision", - "description": "Creates a CVM using cached provision data from /cvms/provision. Requires compose_hash from the provision response.", - "operationId": "handle_create_cvm_from_povision_api_v1_cvms_post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateTappRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Created CVM record with teepod info", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VM" - } - } - } - }, - "400": { - "description": "Invalid payload or provision data expired" - }, - "401": { - "description": "Authentication required" - }, - "422": { - "description": "Provision data not found" - } - } - }, - "get": { - "tags": [ - "cvm", - "cvms-management", - "CVM Management" - ], - "summary": "List CVMs", - "description": "Returns CVMs in current workspace. Admins can filter by user_id or teepod_id.", - "operationId": "handle_list_cvms_api_v1_cvms_get", - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ], - "parameters": [ - { - "name": "user_id", - "in": "query", - "required": false, - "schema": { - "anyOf": [ - { - "const": "0", - "type": "string" - }, - { - "type": "string", - "format": "hashid", - "description": "A hashed identifier that maps to an internal database ID", - "pattern": "^usr_.+", - "title": "HashedId[users]", - "examples": [ - "usr_0123abcd" - ] - } - ], - "description": "Filter by owner (admin only). Use '0' for unassigned.", - "title": "User Id", - "nullable": true - }, - "description": "Filter by owner (admin only). Use '0' for unassigned." - }, - { - "name": "teepod_id", - "in": "query", - "required": false, - "schema": { - "description": "Filter by node ID (admin only)", - "title": "Teepod Id", - "type": "integer", - "nullable": true - }, - "description": "Filter by node ID (admin only)" - } - ], - "responses": { - "200": { - "description": "List of CVM summaries", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/HostedCvm" - } - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/CVMInfo" - } - } - ], - "title": "Response Handle List Cvms Api V1 Cvms Get" - } - } - } - }, - "401": { - "description": "Authentication required" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/eliza": { - "post": { - "tags": [ - "cvm", - "cvms-deployment", - "CVM Deployment" - ], - "summary": "Create Eliza from provision", - "description": "Creates an Eliza CVM using cached provision data from /cvms/provision/eliza. Requires compose_hash from the provision response.", - "operationId": "handle_create_eliza_from_provision_api_v1_cvms_eliza_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateTappRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Created Eliza CVM record", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VM" - } - } - } - }, - "400": { - "description": "Invalid payload" - }, - "401": { - "description": "Authentication required" - }, - "422": { - "description": "Provision data not found or expired" - } - } - } - }, - "/api/v1/cvms/{cvm_id}/compose_file": { - "get": { - "tags": [ - "cvm", - "cvms-deployment", - "CVM Configuration" - ], - "summary": "Get raw compose file", - "description": "Returns the complete compose file as JSON or raw text based on query param.", - "operationId": "get_cvm_compose_file_api_v1_cvms__cvm_id__compose_file_get", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - }, - { - "name": "raw", - "in": "query", - "required": false, - "schema": { - "title": "Raw", - "type": "string", - "nullable": true - } - } - ], - "responses": { - "200": { - "description": "Compose file content", - "content": { - "application/json": { - "schema": {} - } - } - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM not found" - }, - "500": { - "description": "Failed to retrieve compose file" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - }, - "patch": { - "tags": [ - "cvm", - "cvms-deployment", - "CVM Configuration" - ], - "summary": "Trigger compose file update", - "description": "Applies a provisioned compose file update. Requires compose_hash from provision endpoint. Restarts the CVM with new configuration.", - "operationId": "trigger_cvm_compose_file_update_api_v1_cvms__cvm_id__compose_file_patch", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Body_trigger_cvm_compose_file_update_api_v1_cvms__cvm_id__compose_file_patch" - } - } - } - }, - "responses": { - "202": { - "description": "Update initiated", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Provision not found or invalid CVM" - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM not found" - }, - "503": { - "description": "Node under maintenance" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - }, - "post": { - "tags": [ - "cvm", - "cvms-deployment", - "CVM Configuration" - ], - "summary": "Submit compose file update", - "description": "Submit complete compose file with hash verification. Use when you have pre-computed compose_hash and want to skip provision step.", - "operationId": "submit_cvm_compose_file_update_api_v1_cvms__cvm_id__compose_file_post", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ComposeFileUpdateRequest", - "description": "Complete compose file with hash" - } - } - } - }, - "responses": { - "202": { - "description": "Update initiated", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Invalid CVM or hash mismatch" - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM not found" - }, - "422": { - "description": "Invalid Docker Compose syntax" - }, - "503": { - "description": "Node under maintenance" - } - } - } - }, - "/api/v1/cvms/{cvm_id}/compose_file/provision": { - "post": { - "tags": [ - "cvm", - "cvms-deployment", - "CVM Configuration" - ], - "summary": "Provision compose file update", - "description": "Validates new compose file and returns compose_hash for on-chain registration. Cache expires after 7 days.", - "operationId": "provision_for_cvm_compose_file_update_api_v1_cvms__cvm_id__compose_file_provision_post", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProvisionComposeFileUpdateRequest", - "description": "Updated compose configuration" - } - } - } - }, - "responses": { - "200": { - "description": "Provision response with compose_hash and KMS info", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ComposeFileProvisionResponse" - } - } - } - }, - "400": { - "description": "Empty Docker Compose file or invalid CVM" - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM not found" - }, - "422": { - "description": "Invalid Docker Compose syntax" - } - } - } - }, - "/api/v1/cvms/{cvm_id}/compose": { - "get": { - "tags": [ - "cvm", - "cvms-deployment", - "CVM Configuration (Legacy)" - ], - "summary": "Get compose with metadata (legacy)", - "description": "Deprecated. Returns compose file with env pubkey and salt.", - "operationId": "handle_get_cvm_compose_api_v1_cvms__cvm_id__compose_get", - "deprecated": true, - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CvmComposeFile" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - }, - "put": { - "tags": [ - "cvm", - "cvms-deployment", - "CVM Configuration (Legacy)" - ], - "summary": "Replace compose file (legacy)", - "description": "Deprecated. Replaces entire compose configuration and restarts CVM.", - "operationId": "handle_update_cvm_compose_api_v1_cvms__cvm_id__compose_put", - "deprecated": true, - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CvmUpgradePayload", - "description": "Complete upgrade payload" - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "202": { - "description": "Update initiated" - }, - "400": { - "description": "Empty Docker Compose or terms violation" - }, - "422": { - "description": "Invalid Docker Compose syntax" - }, - "503": { - "description": "Node under maintenance" - } - } - }, - "patch": { - "tags": [ - "cvm", - "cvms-deployment", - "CVM Configuration" - ], - "summary": "Patch compose file", - "description": "Partially updates compose file fields (docker_compose_file, pre_launch_script, env) without replacing unchanged parts.", - "operationId": "handle_patch_cvm_compose_api_v1_cvms__cvm_id__compose_patch", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ComposeFilePatchRequest", - "description": "Fields to update" - } - } - } - }, - "responses": { - "202": { - "description": "Update initiated", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Empty Docker Compose or terms violation" - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM not found" - }, - "422": { - "description": "Invalid Docker Compose syntax" - }, - "500": { - "description": "Failed to get current compose" - }, - "503": { - "description": "Node under maintenance or offline" - } - } - } - }, - "/api/v1/cvms/{cvm_id}/replicas": { - "post": { - "tags": [ - "cvm", - "cvms-deployment", - "CVM Deployment" - ], - "summary": "Replicate CVM", - "description": "Create a replica of the CVM on a target node. If request body is omitted, it replicates to the source node and reuses existing env.", - "operationId": "handle_replicate_cvm_api_v1_cvms__cvm_id__replicas_post", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "title": "Request", - "$ref": "#/components/schemas/teehouse__api__routes__cvms__deployment__ReplicateRequest", - "nullable": true - } - } - } - }, - "responses": { - "200": { - "description": "Replica CVM created", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Invalid target node, image mismatch, or invalid encrypted_env" - }, - "401": { - "description": "Not authenticated" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM or target node not found" - }, - "465": { - "description": "KMS allowlist rejection (contract-owned KMS)" - }, - "500": { - "description": "Replication failed" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/operations": { - "get": { - "tags": [ - "cvm", - "cvms-events", - "CVM Operations" - ], - "summary": "List CVM operations", - "description": "Returns operation records grouped by correlation_id. Only includes events with correlation_id (new format since 2024-01). Error messages are sanitized for non-admin users.", - "operationId": "get_cvm_operations_api_v1_cvms__cvm_id__operations_get", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - }, - { - "name": "cursor", - "in": "query", - "required": false, - "schema": { - "description": "Opaque cursor from previous response", - "title": "Cursor", - "type": "string", - "nullable": true - }, - "description": "Opaque cursor from previous response" - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "maximum": 500, - "minimum": 1, - "description": "Page size", - "default": 50, - "title": "Limit" - }, - "description": "Page size" - }, - { - "name": "start_time", - "in": "query", - "required": false, - "schema": { - "description": "Include operations started after this UTC time", - "title": "Start Time", - "type": "string", - "format": "date-time", - "nullable": true - }, - "description": "Include operations started after this UTC time" - }, - { - "name": "end_time", - "in": "query", - "required": false, - "schema": { - "description": "Include operations started before this UTC time", - "title": "End Time", - "type": "string", - "format": "date-time", - "nullable": true - }, - "description": "Include operations started before this UTC time" - }, - { - "name": "operation_types", - "in": "query", - "required": false, - "schema": { - "description": "Filter by operation types (e.g. compose_update, power_on)", - "title": "Operation Types", - "type": "array", - "items": { - "type": "string" - }, - "nullable": true - }, - "description": "Filter by operation types (e.g. compose_update, power_on)" - } - ], - "responses": { - "200": { - "description": "Paginated operation records", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaginatedCvmOperationsResponse" - } - } - } - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/docker-compose.yml": { - "get": { - "tags": [ - "cvm", - "cvms-compose-file", - "CVM Configuration" - ], - "summary": "Get Docker Compose file", - "description": "Returns the raw Docker Compose YAML content from the CVM configuration.", - "operationId": "handle_get_cvm_docker_compose_api_v1_cvms__cvm_id__docker_compose_yml_get", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "responses": { - "200": { - "description": "Docker Compose YAML content", - "content": { - "application/json": { - "schema": { - "type": "string", - "title": "Response Handle Get Cvm Docker Compose Api V1 Cvms Cvm Id Docker Compose Yml Get" - } - } - } - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/pre-launch-script": { - "get": { - "tags": [ - "cvm", - "cvms-compose-file", - "CVM Configuration" - ], - "summary": "Get pre-launch script", - "description": "Returns the shell script that runs before containers start.", - "operationId": "handle_get_cvm_prelaunch_script_api_v1_cvms__cvm_id__pre_launch_script_get", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "responses": { - "200": { - "description": "Pre-launch shell script content", - "content": { - "application/json": { - "schema": { - "type": "string", - "title": "Response Handle Get Cvm Prelaunch Script Api V1 Cvms Cvm Id Pre Launch Script Get" - } - } - } - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - }, - "patch": { - "tags": [ - "cvm", - "cvms-update-pre-launch-script", - "CVM Configuration" - ], - "summary": "Update pre-launch script", - "description": "Replaces the pre-launch script and restarts the CVM. For contract-owned KMS, requires two-phase flow with on-chain hash registration.", - "operationId": "update_cvm_pre_launch_script_api_v1_cvms__cvm_id__pre_launch_script_patch", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - }, - { - "name": "X-Compose-Hash", - "in": "header", - "required": false, - "schema": { - "description": "Compose hash from Phase 1 response", - "title": "X-Compose-Hash", - "type": "string", - "nullable": true - }, - "description": "Compose hash from Phase 1 response" - }, - { - "name": "X-Transaction-Hash", - "in": "header", - "required": false, - "schema": { - "description": "Transaction hash proving on-chain registration", - "title": "X-Transaction-Hash", - "type": "string", - "nullable": true - }, - "description": "Transaction hash proving on-chain registration" - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/Body_update_cvm_pre_launch_script_api_v1_cvms__cvm_id__pre_launch_script_patch" - } - } - } - }, - "responses": { - "202": { - "description": "Update initiated, track via correlation_id", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Invalid content type or empty body" - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM not found" - }, - "409": { - "description": "Another operation in progress" - }, - "465": { - "description": "Compose hash registration required (Phase 1)" - }, - "466": { - "description": "Compose hash invalid or expired" - }, - "467": { - "description": "Transaction verification failed" - }, - "468": { - "description": "Compose hash not allowed on-chain" - }, - "500": { - "description": "KMS configuration or RPC error" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/available-os-images": { - "get": { - "tags": [ - "cvm", - "cvms-patch-compose-file", - "CVM Configuration" - ], - "summary": "List available OS images", - "description": "Returns OS images this CVM can upgrade to, filtered by node availability, KMS allowlist, dev/prod upgrade rules, and GPU compatibility.", - "operationId": "get_available_os_images_api_v1_cvms__cvm_id__available_os_images_get", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "responses": { - "200": { - "description": "OS images grouped by version (newest first)", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/teehouse__api__routes__cvms__patch_compose_file__AvailableOSImage" - }, - "title": "Response Get Available Os Images Api V1 Cvms Cvm Id Available Os Images Get" - } - } - } - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/os-image": { - "patch": { - "tags": [ - "cvm", - "cvms-patch-compose-file", - "CVM Configuration" - ], - "summary": "Update OS image", - "description": "Upgrades the CVM to a different OS image. Shuts down, updates, and restarts. Takes several minutes. Track progress via correlation_id.", - "operationId": "update_cvm_os_image_api_v1_cvms__cvm_id__os_image_patch", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Body_update_cvm_os_image_api_v1_cvms__cvm_id__os_image_patch" - } - } - } - }, - "responses": { - "202": { - "description": "Upgrade initiated, returns correlation_id", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "OS image not available for this CVM" - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM not found" - }, - "409": { - "description": "Another operation in progress" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/envs": { - "patch": { - "tags": [ - "cvm", - "cvms-patch-compose-file", - "CVM Configuration" - ], - "summary": "Update environment variables", - "description": "Updates encrypted environment variables. If env_keys changes for contract-owned KMS, requires two-phase flow with on-chain hash registration.", - "operationId": "update_cvm_envs_api_v1_cvms__cvm_id__envs_patch", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Body_update_cvm_envs_api_v1_cvms__cvm_id__envs_patch" - } - } - } - }, - "responses": { - "202": { - "description": "Update initiated, returns correlation_id and allowed_envs_changed flag", - "content": { - "application/json": { - "schema": {} - } - } - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM not found" - }, - "409": { - "description": "Another operation in progress" - }, - "465": { - "description": "Compose hash registration required (env_keys changed, Phase 1)" - }, - "466": { - "description": "Compose hash invalid or expired" - }, - "467": { - "description": "Transaction verification failed" - }, - "468": { - "description": "Compose hash not allowed on-chain" - }, - "500": { - "description": "KMS configuration or RPC error" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/docker-compose": { - "patch": { - "tags": [ - "cvm", - "cvms-update-docker-compose", - "CVM Configuration" - ], - "summary": "Update Docker Compose file", - "description": "Replaces the docker-compose.yml and restarts the CVM. For contract-owned KMS, requires two-phase flow with on-chain hash registration.", - "operationId": "update_cvm_docker_compose_api_v1_cvms__cvm_id__docker_compose_patch", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - }, - { - "name": "X-Compose-Hash", - "in": "header", - "required": false, - "schema": { - "description": "Compose hash from Phase 1 response", - "title": "X-Compose-Hash", - "type": "string", - "nullable": true - }, - "description": "Compose hash from Phase 1 response" - }, - { - "name": "X-Transaction-Hash", - "in": "header", - "required": false, - "schema": { - "description": "Transaction hash proving on-chain registration", - "title": "X-Transaction-Hash", - "type": "string", - "nullable": true - }, - "description": "Transaction hash proving on-chain registration" - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/Body_update_cvm_docker_compose_api_v1_cvms__cvm_id__docker_compose_patch" - } - } - } - }, - "responses": { - "202": { - "description": "Update initiated, track via correlation_id", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Invalid content type or empty body" - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM not found" - }, - "409": { - "description": "Another operation in progress" - }, - "465": { - "description": "Compose hash registration required (Phase 1)" - }, - "466": { - "description": "Compose hash invalid or expired" - }, - "467": { - "description": "Transaction verification failed" - }, - "468": { - "description": "Compose hash not allowed on-chain" - }, - "500": { - "description": "KMS configuration or RPC error" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/revisions/{revision_id}/redeploy": { - "post": { - "tags": [ - "cvm", - "cvms-activate-revision", - "cvms" - ], - "summary": "Redeploy CVM from a specific revision", - "description": "Switch/rollback a CVM to a specified app revision (compose_hash).", - "operationId": "redeploy_cvm_revision_api_v1_cvms__cvm_id__revisions__revision_id__redeploy_post", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - }, - { - "name": "revision_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Revision Id" - } - }, - { - "name": "transaction_hash", - "in": "query", - "required": false, - "schema": { - "description": "Optional transaction hash proving on-chain compose hash registration", - "title": "Transaction Hash", - "type": "string", - "nullable": true - }, - "description": "Optional transaction hash proving on-chain compose hash registration" - } - ], - "responses": { - "202": { - "description": "Activation initiated", - "content": { - "application/json": { - "schema": {} - } - } - }, - "401": { - "description": "Not authenticated" - }, - "403": { - "description": "No workspace access" - }, - "404": { - "description": "CVM or revision not found" - }, - "409": { - "description": "Another operation is in progress" - }, - "465": { - "description": "Compose hash registration required (contract-owned KMS)" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/instance-ids": { - "patch": { - "tags": [ - "cvm", - "cvms-management", - "CVM Management" - ], - "summary": "Batch refresh CVM instance IDs", - "description": "Resolves and persists missing instance_id values. Admin can pass cross-workspace CVM IDs.", - "operationId": "handle_batch_refresh_cvm_instance_ids_api_v1_cvms_instance_ids_patch", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BatchInstanceIdRefreshRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BatchInstanceIdRefreshResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/paginated": { - "get": { - "tags": [ - "cvm", - "cvms-management", - "CVM Management" - ], - "summary": "List CVMs (paginated)", - "description": "Returns paginated CVMs in current workspace with total count.", - "operationId": "handle_list_cvms_paginated_api_v1_cvms_paginated_get", - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ], - "parameters": [ - { - "name": "user_id", - "in": "query", - "required": false, - "schema": { - "anyOf": [ - { - "const": "0", - "type": "string" - }, - { - "type": "string", - "format": "hashid", - "description": "A hashed identifier that maps to an internal database ID", - "pattern": "^usr_.+", - "title": "HashedId[users]", - "examples": [ - "usr_0123abcd" - ] - } - ], - "description": "Filter by owner (admin only). Use '0' for unassigned.", - "title": "User Id", - "nullable": true - }, - "description": "Filter by owner (admin only). Use '0' for unassigned." - }, - { - "name": "teepod_id", - "in": "query", - "required": false, - "schema": { - "description": "Filter by node ID (admin only)", - "title": "Teepod Id", - "type": "integer", - "nullable": true - }, - "description": "Filter by node ID (admin only)" - }, - { - "name": "page", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "minimum": 1, - "description": "Page number (1-indexed)", - "default": 1, - "title": "Page" - }, - "description": "Page number (1-indexed)" - }, - { - "name": "page_size", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "maximum": 100, - "minimum": 1, - "description": "Items per page (max 100)", - "default": 30, - "title": "Page Size" - }, - "description": "Items per page (max 100)" - } - ], - "responses": { - "200": { - "description": "Paginated CVM list with total count", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/PaginatedHostedCvms" - }, - { - "$ref": "#/components/schemas/PaginatedCvmInfos" - } - ], - "title": "Response Handle List Cvms Paginated Api V1 Cvms Paginated Get" - } - } - } - }, - "401": { - "description": "Authentication required" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/instance-id": { - "patch": { - "tags": [ - "cvm", - "cvms-management", - "CVM Management" - ], - "summary": "Refresh CVM instance ID", - "description": "Resolve and persist instance_id for a CVM. Default behavior only backfills missing values.", - "operationId": "handle_refresh_cvm_instance_id_api_v1_cvms__cvm_id__instance_id_patch", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InstanceIdRefreshRequest", - "default": { - "overwrite": false, - "dry_run": false - } - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InstanceIdRefreshResult" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}": { - "get": { - "tags": [ - "cvm", - "cvms-management", - "CVM Management" - ], - "summary": "Get CVM details", - "description": "Returns full CVM details including status, network info, and KMS configuration.", - "operationId": "handle_get_cvm_api_v1_cvms__cvm_id__get", - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ], - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "responses": { - "200": { - "description": "CVM details", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/teehouse__api__routes__cvms__management__CvmBasicInfo" - }, - { - "$ref": "#/components/schemas/CVMInfoDetail" - } - ], - "title": "Response Handle Get Cvm Api V1 Cvms Cvm Id Get" - } - } - } - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - }, - "delete": { - "tags": [ - "cvm", - "cvms-management", - "CVM Operations" - ], - "summary": "Delete CVM", - "description": "Stops and permanently deletes CVM. Data is not recoverable.", - "operationId": "handle_remove_cvm_api_v1_cvms__cvm_id__delete", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - }, - { - "name": "polling", - "in": "query", - "required": false, - "schema": { - "description": "Polling version for task routing", - "title": "Polling", - "enum": [ - "v1", - "v2" - ], - "type": "string", - "nullable": true - }, - "description": "Polling version for task routing" - } - ], - "responses": { - "204": { - "description": "Deletion initiated" - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/visibility": { - "patch": { - "tags": [ - "cvm", - "cvms-management", - "CVM Management" - ], - "summary": "Update visibility settings", - "description": "Sets public_sysinfo and public_logs flags. Restarts CVM to apply.", - "operationId": "handle_update_cvm_visibility_api_v1_cvms__cvm_id__visibility_patch", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Body_handle_update_cvm_visibility_api_v1_cvms__cvm_id__visibility_patch" - } - } - } - }, - "responses": { - "200": { - "description": "Updated CVM record", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VM" - } - } - } - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM not found" - }, - "409": { - "description": "Another operation in progress" - }, - "500": { - "description": "Failed to get VM info" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/stats": { - "get": { - "tags": [ - "cvm", - "cvms-management", - "CVM Status" - ], - "summary": "Get CVM system stats", - "description": "Returns live system metrics (CPU, memory, disk) from the running CVM.", - "operationId": "handle_get_cvm_stats_api_v1_cvms__cvm_id__stats_get", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "responses": { - "200": { - "description": "System stats (may be partial if CVM offline)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CvmSystemInfo" - } - } - } - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/composition": { - "get": { - "tags": [ - "cvm", - "cvms-management", - "CVM Status" - ], - "summary": "Get CVM composition (deprecated)", - "description": "Deprecated. Returns container composition and runtime config.", - "operationId": "handle_get_cvm_composition_api_v1_cvms__cvm_id__composition_get", - "deprecated": true, - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CvmComposition" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/attestation": { - "get": { - "tags": [ - "cvm", - "cvms-management", - "CVM Status" - ], - "summary": "Get CVM attestation", - "description": "Returns TEE attestation data including TCB info and app certificates.", - "operationId": "handle_get_cvm_attestation_api_v1_cvms__cvm_id__attestation_get", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "responses": { - "200": { - "description": "Attestation report (may have error if CVM offline)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CvmAttestation" - } - } - } - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/network": { - "get": { - "tags": [ - "cvm", - "cvms-management", - "CVM Status" - ], - "summary": "Get CVM network info", - "description": "Returns network status including internal IP, handshake time, and public URLs.", - "operationId": "handle_get_cvm_network_info_api_v1_cvms__cvm_id__network_get", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "responses": { - "200": { - "description": "Network info (may have error if offline)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CvmNetwork" - } - } - } - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "Access denied" - }, - "404": { - "description": "CVM not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/start": { - "post": { - "tags": [ - "cvm", - "cvms-management", - "CVM Operations" - ], - "summary": "Start CVM", - "description": "Powers on a stopped CVM. GPU allocation happens during start.", - "operationId": "handle_start_cvm_api_v1_cvms__cvm_id__start_post", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Body_handle_start_cvm_api_v1_cvms__cvm_id__start_post" - } - } - } - }, - "responses": { - "200": { - "description": "CVM record with starting status", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VM" - } - } - } - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM not found" - }, - "400": { - "description": "Insufficient balance" - }, - "409": { - "description": "Another operation in progress" - }, - "500": { - "description": "GPU allocation failed" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/shutdown": { - "post": { - "tags": [ - "cvm", - "cvms-management", - "CVM Operations" - ], - "summary": "Shutdown CVM", - "description": "Gracefully shuts down CVM (SIGTERM then SIGKILL after timeout). Triggers billing.", - "operationId": "handle_shutdown_cvm_api_v1_cvms__cvm_id__shutdown_post", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Body_handle_shutdown_cvm_api_v1_cvms__cvm_id__shutdown_post" - } - } - } - }, - "responses": { - "200": { - "description": "CVM record with shutting_down status", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VM" - } - } - } - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM managed by on-demand GPU rental" - }, - "404": { - "description": "CVM not found" - }, - "409": { - "description": "Another operation in progress" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/stop": { - "post": { - "tags": [ - "cvm", - "cvms-management", - "CVM Operations" - ], - "summary": "Force stop CVM", - "description": "Immediately stops CVM (like pulling power). Cancels any in-progress operation. Triggers billing.", - "operationId": "handle_stop_cvm_api_v1_cvms__cvm_id__stop_post", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Body_handle_stop_cvm_api_v1_cvms__cvm_id__stop_post" - } - } - } - }, - "responses": { - "200": { - "description": "CVM record with stopping status", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VM" - } - } - } - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM managed by on-demand GPU rental" - }, - "404": { - "description": "CVM not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/restart": { - "post": { - "tags": [ - "cvm", - "cvms-management", - "CVM Operations" - ], - "summary": "Restart CVM", - "description": "Stops and starts CVM. Use force=true to skip graceful shutdown.", - "operationId": "handle_restart_cvm_api_v1_cvms__cvm_id__restart_post", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Body_handle_restart_cvm_api_v1_cvms__cvm_id__restart_post" - } - } - } - }, - "responses": { - "200": { - "description": "CVM record with restarting status", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VM" - } - } - } - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM not found" - }, - "400": { - "description": "Insufficient balance" - }, - "409": { - "description": "Another operation in progress" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/operation-status": { - "get": { - "tags": [ - "cvm", - "cvms-management", - "CVM Operations" - ], - "summary": "Get operation status", - "description": "Returns current in-progress operation details including Celery task status.", - "operationId": "get_operation_status_api_v1_cvms__cvm_id__operation_status_get", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "responses": { - "200": { - "description": "Operation status (idle if none in progress)", - "content": { - "application/json": { - "schema": {} - } - } - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM not in workspace" - }, - "404": { - "description": "CVM not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/resources": { - "patch": { - "tags": [ - "cvm", - "cvms-management", - "CVM Operations" - ], - "summary": "Resize CVM resources", - "description": "Changes vCPU, memory, or disk size. Restarts CVM to apply. Triggers billing for new rate.", - "operationId": "handle_resize_cvm_api_v1_cvms__cvm_id__resources_patch", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - }, - { - "name": "polling", - "in": "query", - "required": false, - "schema": { - "description": "Polling version for task routing", - "title": "Polling", - "enum": [ - "v1", - "v2" - ], - "type": "string", - "nullable": true - }, - "description": "Polling version for task routing" - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CvmResizePayload" - } - } - } - }, - "responses": { - "202": { - "description": "Resize initiated", - "content": { - "application/json": { - "schema": {} - } - } - }, - "401": { - "description": "Authentication required" - }, - "403": { - "description": "CVM managed by on-demand GPU rental" - }, - "404": { - "description": "CVM not found" - }, - "409": { - "description": "Another operation in progress" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/name": { - "patch": { - "tags": [ - "cvm", - "cvms-management" - ], - "summary": "Handle Update Cvm Name", - "description": "Update CVM name with RFC 1123 validation and availability check", - "operationId": "handle_update_cvm_name_api_v1_cvms__cvm_id__name_patch", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Body_handle_update_cvm_name_api_v1_cvms__cvm_id__name_patch" - } - } - } - }, - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/listed": { - "patch": { - "tags": [ - "cvm", - "cvms-management" - ], - "summary": "Handle Update Cvm Listed", - "operationId": "handle_update_cvm_listed_api_v1_cvms__cvm_id__listed_patch", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Body_handle_update_cvm_listed_api_v1_cvms__cvm_id__listed_patch" - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VM" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/scheduled-delete": { - "patch": { - "tags": [ - "cvm", - "cvms-management" - ], - "summary": "Handle Update Cvm Scheduled Delete", - "description": "Update CVM scheduled delete time", - "operationId": "handle_update_cvm_scheduled_delete_api_v1_cvms__cvm_id__scheduled_delete_patch", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Body_handle_update_cvm_scheduled_delete_api_v1_cvms__cvm_id__scheduled_delete_patch" - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VM" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/batch-stop": { - "post": { - "tags": [ - "cvm", - "cvms-management", - "CVM Operations" - ], - "summary": "Batch stop CVMs", - "description": "Force stop multiple CVMs at once. Non-admin users can only stop CVMs in their current workspace. Admin users can stop any CVM. Max 50 per request.", - "operationId": "handle_batch_stop_cvms_api_v1_cvms_batch_stop_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BatchStopRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Batch stop summary", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BatchStopResponse" - } - } - } - }, - "401": { - "description": "Authentication required" - }, - "400": { - "description": "Invalid request (e.g. too many CVMs)" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/status/batch": { - "post": { - "tags": [ - "cvm", - "cvms-management" - ], - "summary": "Handle Batch Cvm Status", - "description": "Batch query CVM real-time status.\n\nGroups by teepod and queries in parallel, returns status updates with\ncomplete async operation information.", - "operationId": "handle_batch_cvm_status_api_v1_status_batch_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BatchStatusRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "$ref": "#/components/schemas/CvmStatus" - }, - "type": "object", - "title": "Response Handle Batch Cvm Status Api V1 Status Batch Post" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ] - } - }, - "/api/v1/cvms/{cvm_id}/state": { - "get": { - "tags": [ - "cvm", - "cvms-management" - ], - "summary": "Handle Get Cvm State", - "description": "Get CVM state. Supports two modes:\n\n1. Immediate mode (no target): Returns current state immediately\n2. SSE mode (with target): Streams state updates until status matches target or timeout\n\nExample:\n GET /cvms/{cvm_id}/state - Returns current state\n GET /cvms/{cvm_id}/state?target=running - Streams until status becomes 'running'\n\nSSE connection limit: 5 concurrent connections per user", - "operationId": "handle_get_cvm_state_api_v1_cvms__cvm_id__state_get", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - }, - { - "name": "target", - "in": "query", - "required": false, - "schema": { - "description": "Target status to wait for. If specified, returns SSE stream.", - "title": "Target", - "type": "string", - "nullable": true - }, - "description": "Target status to wait for. If specified, returns SSE stream." - }, - { - "name": "interval", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "maximum": 30, - "minimum": 5, - "description": "Polling interval in seconds (5-30)", - "default": 5, - "title": "Interval" - }, - "description": "Polling interval in seconds (5-30)" - }, - { - "name": "timeout", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "maximum": 600, - "minimum": 10, - "description": "Maximum wait time in seconds (10-600)", - "default": 300, - "title": "Timeout" - }, - "description": "Maximum wait time in seconds (10-600)" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/customize-domain-diagnose": { - "post": { - "tags": [ - "cvm", - "cvms-tools", - "CVM Tools" - ], - "summary": "Diagnose custom domain DNS", - "description": "Verify DNS records for custom domain configuration. Checks CNAME pointing to CVM, TXT records for app verification, and CAA records.", - "operationId": "diagnose_custom_domains_api_v1_cvms__cvm_id__customize_domain_diagnose_post", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DiagnoseDomainsRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DiagnosisResponse" - } - } - } - }, - "400": { - "description": "Invalid request or multiple CVMs with same name" - }, - "401": { - "description": "Not authenticated" - }, - "403": { - "description": "No access to this CVM" - }, - "404": { - "description": "CVM not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/cvms/{cvm_id}/user_config": { - "get": { - "tags": [ - "cvm", - "cvms-management", - "cvms-management" - ], - "summary": "Get CVM user config", - "description": "Returns the user_config stored in Teepod for this CVM, including injected SSH keys.", - "operationId": "get_cvm_user_config_api_v1_cvms__cvm_id__user_config_get", - "parameters": [ - { - "name": "cvm_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Cvm Id" - } - } - ], - "responses": { - "200": { - "description": "User config retrieved", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CvmUserConfig" - } - } - } - }, - "400": { - "description": "Invalid CVM identifier format, or multiple CVMs share the same name" - }, - "401": { - "description": "Not authenticated" - }, - "404": { - "description": "CVM not found or not accessible in this workspace" - }, - "502": { - "description": "Teepod returned an error or invalid user_config JSON" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/teepods": { - "get": { - "tags": [ - "teepod", - "teepods" - ], - "summary": "List teepods", - "description": "Return teepod nodes. Regular users see enabled nodes only; admins see all. Use enabled param to filter.", - "operationId": "list_teepods_api_v1_teepods_get", - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ], - "parameters": [ - { - "name": "enabled", - "in": "query", - "required": false, - "schema": { - "description": "Filter by enabled status (admin only)", - "title": "Enabled", - "type": "boolean", - "nullable": true - }, - "description": "Filter by enabled status (admin only)" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Teepod" - }, - "title": "Response List Teepods Api V1 Teepods Get" - } - } - } - }, - "401": { - "description": "Not authenticated" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/teepods/available": { - "get": { - "tags": [ - "teepod", - "teepods" - ], - "summary": "Get available teepods", - "description": "Return teepods available for CVM deployment with capacity, KMS list, and GPU availability.", - "operationId": "handle_get_available_teepods_api_v1_teepods_available_get", - "parameters": [ - { - "name": "v03x_only", - "in": "query", - "required": false, - "schema": { - "description": "Only return dstack v0.3.x nodes", - "title": "V03X Only", - "type": "string", - "nullable": true - }, - "description": "Only return dstack v0.3.x nodes" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TierCapacity" - } - } - } - }, - "401": { - "description": "Not authenticated" - }, - "403": { - "description": "No workspace access" - }, - "404": { - "description": "User or workspace not found" - }, - "500": { - "description": "Teepod query failed" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/teepods/{teepod_id}/images": { - "get": { - "tags": [ - "teepod", - "teepods" - ], - "summary": "List teepod images", - "description": "[DEPRECATED] Use /admin/os-images instead. Returns OS images available on this teepod.", - "operationId": "list_teepod_available_image_api_v1_teepods__teepod_id__images_get", - "deprecated": true, - "parameters": [ - { - "name": "teepod_id", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "title": "Teepod Id" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "404": { - "description": "Teepod not found" - }, - "500": { - "description": "Failed to fetch images from teepod" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/teepods/{teepod_id}/cvms": { - "get": { - "tags": [ - "teepod", - "teepods" - ], - "summary": "List hosted CVMs", - "description": "Admin only. Return all CVMs hosted on a teepod, including unmanaged ones from external DStack deployments.", - "operationId": "handle_list_hosted_cvms_api_v1_teepods__teepod_id__cvms_get", - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ], - "parameters": [ - { - "name": "teepod_id", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "title": "Teepod Id" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/HostedCvm" - }, - "title": "Response Handle List Hosted Cvms Api V1 Teepods Teepod Id Cvms Get" - } - } - } - }, - "401": { - "description": "Not authenticated" - }, - "403": { - "description": "Admin access required" - }, - "404": { - "description": "Teepod not found" - }, - "500": { - "description": "Failed to fetch CVMs from teepod" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/teepods/{teepod_id}/cvms/{app_id}/list": { - "post": { - "tags": [ - "teepod", - "teepods" - ], - "summary": "Bind and list CVM", - "description": "Admin only. Register an external CVM in the database and mark it as listed.", - "operationId": "handle_bind_cvm_api_v1_teepods__teepod_id__cvms__app_id__list_post", - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ], - "parameters": [ - { - "name": "teepod_id", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "title": "Teepod Id" - } - }, - { - "name": "app_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "App Id" - } - } - ], - "responses": { - "200": { - "description": "CVM bound and listed", - "content": { - "application/json": { - "schema": {} - } - } - }, - "401": { - "description": "Not authenticated" - }, - "403": { - "description": "Admin access required" - }, - "404": { - "description": "Teepod not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/kms": { - "get": { - "tags": [ - "kms", - "KMS" - ], - "summary": "List KMS instances", - "description": "Query available KMS instances with pagination. Filter by onchain status to find instances with blockchain integration.", - "operationId": "list_kms_api_v1_kms_get", - "parameters": [ - { - "name": "page", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "minimum": 1, - "description": "Page number (1-indexed)", - "default": 1, - "title": "Page" - }, - "description": "Page number (1-indexed)" - }, - { - "name": "page_size", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "maximum": 100, - "minimum": 1, - "description": "Items per page (1-100)", - "default": 20, - "title": "Page Size" - }, - "description": "Items per page (1-100)" - }, - { - "name": "is_onchain", - "in": "query", - "required": false, - "schema": { - "description": "Filter: true=onchain only, false=offchain only, omit=all", - "title": "Is Onchain", - "type": "boolean", - "nullable": true - }, - "description": "Filter: true=onchain only, false=offchain only, omit=all" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KmsListResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/kms/{kms_id}": { - "get": { - "tags": [ - "kms", - "KMS" - ], - "summary": "Get KMS details", - "description": "Retrieve KMS instance details by hashed ID or slug.", - "operationId": "get_kms_info_api_v1_kms__kms_id__get", - "parameters": [ - { - "name": "kms_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "description": "KMS ID (hashed) or slug", - "title": "Kms Id" - }, - "description": "KMS ID (hashed) or slug" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KMSInfo" - } - } - } - }, - "404": { - "description": "KMS not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/kms/{kms_id}/pubkey/{app_id}": { - "get": { - "tags": [ - "kms", - "KMS" - ], - "summary": "Get app encryption pubkey", - "description": "Retrieve the public key for encrypting environment variables before deployment.", - "operationId": "get_app_env_encrypt_pubkey_api_v1_kms__kms_id__pubkey__app_id__get", - "parameters": [ - { - "name": "app_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "description": "40-character hex string, with or without 0x prefix", - "title": "App Id" - }, - "description": "40-character hex string, with or without 0x prefix" - }, - { - "name": "kms_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "description": "KMS ID (hashed) or slug", - "title": "Kms Id" - }, - "description": "KMS ID (hashed) or slug" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Invalid app ID format" - }, - "404": { - "description": "KMS not found" - }, - "500": { - "description": "KMS connection or internal error" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/kms/phala/next_app_id": { - "get": { - "tags": [ - "kms", - "KMS" - ], - "summary": "Predict next app IDs", - "description": "Predict the next N app IDs that will be assigned to the team's wallet. Maximum 20 predictions allowed.", - "operationId": "get_next_app_id_api_v1_kms_phala_next_app_id_get", - "parameters": [ - { - "name": "counts", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "maximum": 20, - "minimum": 1, - "description": "Number of app IDs to predict (1-20)", - "default": 1, - "title": "Counts" - }, - "description": "Number of app IDs to predict (1-20)" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "401": { - "description": "Not authenticated" - }, - "403": { - "description": "No workspace access" - }, - "404": { - "description": "Workspace not found" - }, - "500": { - "description": "Team has no wallet or prediction failed" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/apps": { - "get": { - "tags": [ - "apps", - "apps-list", - "apps" - ], - "summary": "List apps", - "description": "Returns paginated app list with filtering. Response schema varies by API version.", - "operationId": "list_dstack_apps_api_v1_apps_get", - "parameters": [ - { - "name": "page", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "minimum": 1, - "description": "Page number (1-indexed)", - "default": 1, - "title": "Page" - }, - "description": "Page number (1-indexed)" - }, - { - "name": "page_size", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "maximum": 100, - "minimum": 1, - "description": "Items per page", - "default": 20, - "title": "Page Size" - }, - "description": "Items per page" - }, - { - "name": "search", - "in": "query", - "required": false, - "schema": { - "description": "Search name, app_id, vm_uuid, instance_id", - "title": "Search", - "type": "string", - "nullable": true - }, - "description": "Search name, app_id, vm_uuid, instance_id" - }, - { - "name": "status", - "in": "query", - "required": false, - "schema": { - "description": "CVM status filter", - "title": "Status", - "type": "array", - "items": { - "type": "string" - }, - "nullable": true - }, - "description": "CVM status filter" - }, - { - "name": "listed", - "in": "query", - "required": false, - "schema": { - "description": "Listed status filter", - "title": "Listed", - "type": "boolean", - "nullable": true - }, - "description": "Listed status filter" - }, - { - "name": "base_image", - "in": "query", - "required": false, - "schema": { - "description": "OS image name filter", - "title": "Base Image", - "type": "string", - "nullable": true - }, - "description": "OS image name filter" - }, - { - "name": "instance_type", - "in": "query", - "required": false, - "schema": { - "description": "Instance type filter", - "title": "Instance Type", - "type": "string", - "nullable": true - }, - "description": "Instance type filter" - }, - { - "name": "kms_slug", - "in": "query", - "required": false, - "schema": { - "description": "KMS slug filter", - "title": "Kms Slug", - "type": "string", - "nullable": true - }, - "description": "KMS slug filter" - }, - { - "name": "kms_type", - "in": "query", - "required": false, - "schema": { - "description": "KMS type filter", - "title": "Kms Type", - "type": "string", - "nullable": true - }, - "description": "KMS type filter" - }, - { - "name": "node", - "in": "query", - "required": false, - "schema": { - "description": "Node name filter (matches teepod or node name)", - "title": "Node", - "type": "string", - "nullable": true - }, - "description": "Node name filter (matches teepod or node name)" - }, - { - "name": "region", - "in": "query", - "required": false, - "schema": { - "description": "Region identifier filter", - "title": "Region", - "type": "string", - "nullable": true - }, - "description": "Region identifier filter" - } - ], - "responses": { - "200": { - "description": "Paginated app list", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/teehouse__api__routes__apps__v20251028__schemas__DstackAppListResponse" - }, - { - "$ref": "#/components/schemas/teehouse__api__routes__apps__v20260121__schemas__DstackAppListResponse" - } - ], - "title": "Response List Dstack Apps Api V1 Apps Get" - } - } - } - }, - "401": { - "description": "Not authenticated" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/apps/filter-options": { - "get": { - "tags": [ - "apps", - "apps-list", - "apps" - ], - "summary": "Get app filter options", - "description": "Returns distinct values for each filterable field based on user's apps.", - "operationId": "get_filter_options_api_v1_apps_filter_options_get", - "responses": { - "200": { - "description": "Available filter values", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FilterOptionsResponse" - } - } - } - }, - "401": { - "description": "Not authenticated" - } - } - } - }, - "/api/v1/apps/{app_id}": { - "get": { - "tags": [ - "apps", - "apps-detail", - "apps" - ], - "summary": "Get app details", - "description": "Returns app metadata and current CVM configuration. Response schema varies by API version.", - "operationId": "get_dstack_app_api_v1_apps__app_id__get", - "parameters": [ - { - "name": "app_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "description": "Hex app identifier", - "title": "App Id" - }, - "description": "Hex app identifier" - } - ], - "responses": { - "200": { - "description": "App details with CVM info", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/teehouse__api__routes__apps__v20251028__schemas__DstackAppFullResponse" - }, - { - "$ref": "#/components/schemas/DstackAppMinimalResponse" - }, - { - "$ref": "#/components/schemas/teehouse__api__routes__apps__v20260121__schemas__DstackAppFullResponse" - }, - { - "$ref": "#/components/schemas/DstackAppMinimalResponse" - } - ], - "title": "Response Get Dstack App Api V1 Apps App Id Get" - } - } - } - }, - "401": { - "description": "Not authenticated" - }, - "403": { - "description": "No workspace access" - }, - "404": { - "description": "App not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/apps/{app_id}/cvms": { - "get": { - "tags": [ - "apps", - "apps-cvms", - "apps" - ], - "summary": "List app CVMs", - "description": "Returns CVM instances for an app. Admins see all instances; users see only their own.", - "operationId": "handle_get_app_cvms_api_v1_apps__app_id__cvms_get", - "security": [ - { - "OAuth2AuthorizationCodeBearer": [] - }, - { - "APIKeyHeader": [] - } - ], - "parameters": [ - { - "name": "app_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "description": "Hex app identifier", - "title": "App Id" - }, - "description": "Hex app identifier" - } - ], - "responses": { - "200": { - "description": "List of CVM instances", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/HostedCvm" - } - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/CVMInfo" - } - } - ], - "title": "Response Handle Get App Cvms Api V1 Apps App Id Cvms Get" - } - } - } - }, - "401": { - "description": "Not authenticated" - }, - "403": { - "description": "No workspace access" - }, - "404": { - "description": "App not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/apps/{app_id}/cvms/{vm_uuid}/replicas": { - "post": { - "tags": [ - "apps", - "apps-cvms", - "apps" - ], - "summary": "Create CVM replica", - "description": "Clones a CVM to a target node. Uses source node if target not specified.", - "operationId": "handle_replicate_cvm_api_v1_apps__app_id__cvms__vm_uuid__replicas_post", - "parameters": [ - { - "name": "app_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "description": "Hex app identifier", - "title": "App Id" - }, - "description": "Hex app identifier" - }, - { - "name": "vm_uuid", - "in": "path", - "required": true, - "schema": { - "type": "string", - "description": "Source CVM UUID", - "title": "Vm Uuid" - }, - "description": "Source CVM UUID" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "title": "Request", - "$ref": "#/components/schemas/teehouse__api__routes__apps__schemas__ReplicateRequest", - "nullable": true - } - } - } - }, - "responses": { - "200": { - "description": "Replica CVM created", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VM" - } - } - } - }, - "400": { - "description": "App ID mismatch, no OS image, or invalid target node" - }, - "401": { - "description": "Not authenticated" - }, - "403": { - "description": "No workspace access" - }, - "404": { - "description": "CVM or target node not found" - }, - "500": { - "description": "Replication failed" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/apps/{app_id}/attestations": { - "get": { - "tags": [ - "apps", - "apps-attestations", - "apps" - ], - "summary": "Get app attestation data", - "description": "Returns TEE attestation quotes, event logs, and KMS configuration for running CVMs.", - "operationId": "handle_get_app_attestation_api_v1_apps__app_id__attestations_get", - "parameters": [ - { - "name": "app_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "description": "Hex app identifier", - "title": "App Id" - }, - "description": "Hex app identifier" - } - ], - "responses": { - "200": { - "description": "Attestation data with KMS info and instance quotes", - "content": { - "application/json": { - "schema": {} - } - } - }, - "404": { - "description": "App not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/apps/{app_id}/revisions": { - "get": { - "tags": [ - "apps", - "apps-revisions", - "apps" - ], - "summary": "List app revisions", - "description": "Returns deployment history with compose hashes, operation types, and user refs.", - "operationId": "get_app_revisions_api_v1_apps__app_id__revisions_get", - "parameters": [ - { - "name": "app_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "description": "Hex app identifier", - "title": "App Id" - }, - "description": "Hex app identifier" - }, - { - "name": "page", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "minimum": 1, - "description": "Page number (1-indexed)", - "default": 1, - "title": "Page" - }, - "description": "Page number (1-indexed)" - }, - { - "name": "page_size", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "maximum": 1000, - "minimum": 1, - "description": "Items per page", - "default": 50, - "title": "Page Size" - }, - "description": "Items per page" - } - ], - "responses": { - "200": { - "description": "Paginated revision list", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AppRevisionsResponse" - } - } - } - }, - "401": { - "description": "Not authenticated" - }, - "403": { - "description": "No workspace access" - }, - "404": { - "description": "App not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/apps/{app_id}/revisions/{revision_id}": { - "get": { - "tags": [ - "apps", - "apps-revisions", - "apps" - ], - "summary": "Get revision detail", - "description": "Returns full revision data including compose file, encrypted env, and user config.", - "operationId": "get_app_revision_detail_api_v1_apps__app_id__revisions__revision_id__get", - "parameters": [ - { - "name": "app_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "description": "Hex app identifier", - "title": "App Id" - }, - "description": "Hex app identifier" - }, - { - "name": "revision_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Revision Id" - } - }, - { - "name": "raw_compose_file", - "in": "query", - "required": false, - "schema": { - "type": "boolean", - "description": "Return compose_file as string instead of dict", - "default": false, - "title": "Raw Compose File" - }, - "description": "Return compose_file as string instead of dict" - } - ], - "responses": { - "200": { - "description": "Revision detail with compose file", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AppRevisionDetailResponse" - } - } - } - }, - "401": { - "description": "Not authenticated" - }, - "403": { - "description": "No workspace access" - }, - "404": { - "description": "App or revision not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/apps/{app_id}/revisions/{revision_id}/redeploy": { - "post": { - "tags": [ - "apps", - "apps-revisions", - "apps" - ], - "summary": "Redeploy app from a specific revision", - "description": "Redeploy a CVM to a specific revision. If the app has exactly one CVM, it will be redeployed by default. If the app has multiple CVMs, you must specify target vm_uuids in request body. This schedules async CVM update task(s).", - "operationId": "redeploy_app_revision_api_v1_apps__app_id__revisions__revision_id__redeploy_post", - "parameters": [ - { - "name": "app_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "description": "Hex app identifier", - "title": "App Id" - }, - "description": "Hex app identifier" - }, - { - "name": "revision_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Revision Id" - } - }, - { - "name": "transaction_hash", - "in": "query", - "required": false, - "schema": { - "description": "Optional transaction hash proving on-chain compose hash registration", - "title": "Transaction Hash", - "type": "string", - "nullable": true - }, - "description": "Optional transaction hash proving on-chain compose hash registration" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "description": "Optional target CVM selection. If the app has multiple CVMs, you must specify vm_uuids.", - "title": "Payload", - "$ref": "#/components/schemas/RedeployRevisionRequest", - "nullable": true - } - } - } - }, - "responses": { - "202": { - "description": "Activation initiated", - "content": { - "application/json": { - "schema": {} - } - } - }, - "401": { - "description": "Not authenticated" - }, - "403": { - "description": "No workspace access" - }, - "404": { - "description": "App or revision not found" - }, - "409": { - "description": "Another operation is in progress" - }, - "465": { - "description": "Compose hash registration required (contract-owned KMS)" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/apps/{app_id}/events": { - "get": { - "tags": [ - "apps", - "apps-events", - "apps" - ], - "summary": "Get app events", - "description": "**DEPRECATED**: Returns instance lifecycle events from ClickHouse. Will be removed.", - "operationId": "get_app_events_api_v1_apps__app_id__events_get", - "deprecated": true, - "parameters": [ - { - "name": "app_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "description": "Hex app identifier", - "title": "App Id" - }, - "description": "Hex app identifier" - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "maximum": 1000, - "minimum": 1, - "description": "Max events to return", - "default": 100, - "title": "Limit" - }, - "description": "Max events to return" - }, - { - "name": "event_type", - "in": "query", - "required": false, - "schema": { - "description": "Filter by event type", - "title": "Event Type", - "type": "string", - "nullable": true - }, - "description": "Filter by event type" - }, - { - "name": "instance_id", - "in": "query", - "required": false, - "schema": { - "description": "Filter by instance UUID", - "title": "Instance Id", - "type": "string", - "nullable": true - }, - "description": "Filter by instance UUID" - }, - { - "name": "operation_type", - "in": "query", - "required": false, - "schema": { - "description": "Filter by operation type", - "title": "Operation Type", - "type": "string", - "nullable": true - }, - "description": "Filter by operation type" - }, - { - "name": "start_date", - "in": "query", - "required": false, - "schema": { - "description": "Start date (ISO 8601)", - "title": "Start Date", - "type": "string", - "nullable": true - }, - "description": "Start date (ISO 8601)" - }, - { - "name": "end_date", - "in": "query", - "required": false, - "schema": { - "description": "End date (ISO 8601)", - "title": "End Date", - "type": "string", - "nullable": true - }, - "description": "End date (ISO 8601)" - } - ], - "responses": { - "200": { - "description": "Event list", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AppEventsResponse" - } - } - } - }, - "401": { - "description": "Not authenticated" - }, - "403": { - "description": "No workspace access" - }, - "404": { - "description": "App not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/apps/{app_id}/usage": { - "get": { - "tags": [ - "apps", - "apps-usage", - "apps" - ], - "summary": "Get app metered usage", - "description": "Returns billing usage records from ClickHouse. Defaults to 7-day window if dates not specified.", - "operationId": "get_app_usage_api_v1_apps__app_id__usage_get", - "parameters": [ - { - "name": "app_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "description": "Hex app identifier", - "title": "App Id" - }, - "description": "Hex app identifier" - }, - { - "name": "start_date", - "in": "query", - "required": false, - "schema": { - "description": "Start date (ISO 8601)", - "title": "Start Date", - "type": "string", - "format": "date-time", - "examples": [ - "2024-01-01T00:00:00Z" - ], - "nullable": true - }, - "description": "Start date (ISO 8601)" - }, - { - "name": "end_date", - "in": "query", - "required": false, - "schema": { - "description": "End date (ISO 8601)", - "title": "End Date", - "type": "string", - "format": "date-time", - "examples": [ - "2024-01-01T00:00:00Z" - ], - "nullable": true - }, - "description": "End date (ISO 8601)" - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "maximum": 5000, - "minimum": 1, - "description": "Max records to return", - "default": 500, - "title": "Limit" - }, - "description": "Max records to return" - }, - { - "name": "offset", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "minimum": 0, - "description": "Records to skip", - "default": 0, - "title": "Offset" - }, - "description": "Records to skip" - } - ], - "responses": { - "200": { - "description": "Usage records with cost breakdown", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AppUsageResponse" - } - } - } - }, - "400": { - "description": "end_date before start_date" - }, - "401": { - "description": "Not authenticated" - }, - "403": { - "description": "No workspace access" - }, - "404": { - "description": "App not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/redpill/connect": { - "post": { - "tags": [ - "redpill", - "Redpill" - ], - "summary": "Connect user to Redpill", - "description": "Creates a Redpill account for the user and allocates initial credits. Requires minimum 5 credits in the workspace account.", - "operationId": "connect_redpill_user_api_v1_redpill_connect_post", - "responses": { - "200": { - "description": "Connection successful", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Insufficient credits (minimum 5 required) or already connected" - }, - "401": { - "description": "Not authenticated" - } - } - } - }, - "/api/v1/redpill/api-keys": { - "get": { - "tags": [ - "redpill", - "Redpill" - ], - "summary": "List Redpill API keys", - "description": "Returns all API keys for the user's Redpill account. Keys are masked; full key is only shown at creation.", - "operationId": "list_redpill_api_keys_api_v1_redpill_api_keys_get", - "responses": { - "200": { - "description": "List of API keys with count", - "content": { - "application/json": { - "schema": {} - } - } - }, - "401": { - "description": "Not authenticated" - } - } - }, - "post": { - "tags": [ - "redpill", - "Redpill" - ], - "summary": "Create Redpill API key", - "description": "Generates a new API key for accessing Redpill LLM services.", - "operationId": "create_redpill_api_key_api_v1_redpill_api_keys_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RedpillApiKeyCreate" - } - } - } - }, - "responses": { - "200": { - "description": "API key created", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Failed to create API key" - }, - "401": { - "description": "Not authenticated" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/redpill/api-keys/{api_key_id}": { - "patch": { - "tags": [ - "redpill", - "Redpill" - ], - "summary": "Toggle Redpill API key", - "description": "Enables or disables a Redpill API key. Disabled keys reject requests.", - "operationId": "update_redpill_api_key_api_v1_redpill_api_keys__api_key_id__patch", - "parameters": [ - { - "name": "api_key_id", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "description": "Redpill API key ID", - "title": "Api Key Id" - }, - "description": "Redpill API key ID" - }, - { - "name": "active", - "in": "query", - "required": true, - "schema": { - "type": "boolean", - "description": "True to enable, false to disable", - "title": "Active" - }, - "description": "True to enable, false to disable" - } - ], - "responses": { - "200": { - "description": "API key updated", - "content": { - "application/json": { - "schema": {} - } - } - }, - "401": { - "description": "Not authenticated" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/redpill/models": { - "get": { - "tags": [ - "redpill", - "Redpill" - ], - "summary": "List available LLM models", - "description": "Returns all LLM models available through Redpill. No authentication required.", - "operationId": "list_models_api_v1_redpill_models_get", - "responses": { - "200": { - "description": "List of models with count", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Failed to fetch models from Redpill" - } - } - } - }, - "/api/v1/redpill/usage/daily": { - "get": { - "tags": [ - "redpill", - "Redpill" - ], - "summary": "Get daily usage statistics", - "description": "Returns aggregated daily usage data for the user's Redpill connection.", - "operationId": "get_daily_usage_api_v1_redpill_usage_daily_get", - "parameters": [ - { - "name": "key_id", - "in": "query", - "required": false, - "schema": { - "description": "Filter by API key ID", - "title": "Key Id", - "type": "integer", - "nullable": true - }, - "description": "Filter by API key ID" - }, - { - "name": "start_date", - "in": "query", - "required": false, - "schema": { - "description": "Start date (ISO 8601)", - "title": "Start Date", - "type": "string", - "nullable": true - }, - "description": "Start date (ISO 8601)" - }, - { - "name": "end_date", - "in": "query", - "required": false, - "schema": { - "description": "End date (ISO 8601)", - "title": "End Date", - "type": "string", - "nullable": true - }, - "description": "End date (ISO 8601)" - } - ], - "responses": { - "200": { - "description": "Daily usage data", - "content": { - "application/json": { - "schema": {} - } - } - }, - "401": { - "description": "Not authenticated" - }, - "404": { - "description": "Not connected to Redpill" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/redpill/usage/logs": { - "get": { - "tags": [ - "redpill", - "Redpill" - ], - "summary": "Get usage logs", - "description": "Returns paginated usage logs for the user's Redpill connection.", - "operationId": "get_usage_logs_api_v1_redpill_usage_logs_get", - "parameters": [ - { - "name": "key_id", - "in": "query", - "required": false, - "schema": { - "description": "Filter by API key ID", - "title": "Key Id", - "type": "integer", - "nullable": true - }, - "description": "Filter by API key ID" - }, - { - "name": "start_date", - "in": "query", - "required": false, - "schema": { - "description": "Start date (ISO 8601)", - "title": "Start Date", - "type": "string", - "nullable": true - }, - "description": "Start date (ISO 8601)" - }, - { - "name": "end_date", - "in": "query", - "required": false, - "schema": { - "description": "End date (ISO 8601)", - "title": "End Date", - "type": "string", - "nullable": true - }, - "description": "End date (ISO 8601)" - }, - { - "name": "page", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "minimum": 1, - "description": "Page number", - "default": 1, - "title": "Page" - }, - "description": "Page number" - }, - { - "name": "page_size", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "maximum": 100, - "minimum": 1, - "description": "Items per page", - "default": 20, - "title": "Page Size" - }, - "description": "Items per page" - } - ], - "responses": { - "200": { - "description": "Usage logs", - "content": { - "application/json": { - "schema": {} - } - } - }, - "401": { - "description": "Not authenticated" - }, - "404": { - "description": "Not connected to Redpill" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/redpill/logs/{api_key_id}": { - "get": { - "tags": [ - "redpill", - "Redpill" - ], - "summary": "Get API key usage logs", - "description": "Returns usage history for a specific Redpill API key, including model calls and token counts.", - "operationId": "list_api_key_logs_api_v1_redpill_logs__api_key_id__get", - "parameters": [ - { - "name": "api_key_id", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "description": "Redpill API key ID", - "title": "Api Key Id" - }, - "description": "Redpill API key ID" - } - ], - "responses": { - "200": { - "description": "List of usage logs with count", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Failed to fetch logs from Redpill" - }, - "401": { - "description": "Not authenticated" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/attestations/verify": { - "post": { - "tags": [ - "attestations", - "attestations", - "attestations" - ], - "summary": "Verify TEE quote", - "description": "Accepts quote as file upload, form hex, or JSON hex. 0x prefix handled automatically.", - "operationId": "handle_upload_and_verify_api_v1_attestations_verify_post", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/Body_handle_upload_and_verify_api_v1_attestations_verify_post" - } - } - } - }, - "responses": { - "200": { - "description": "Quote verified", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VerificationResponse" - } - } - } - }, - "400": { - "description": "Invalid quote format or verification failed" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/attestations/recent": { - "get": { - "tags": [ - "attestations", - "attestations", - "attestations" - ], - "summary": "List recent quotes", - "description": "Public endpoint. Returns recently uploaded quotes ordered by timestamp.", - "operationId": "handle_list_recent_api_v1_attestations_recent_get", - "parameters": [ - { - "name": "skip", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "minimum": 0, - "description": "Offset for pagination", - "default": 0, - "title": "Skip" - }, - "description": "Offset for pagination" - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "maximum": 100, - "minimum": 1, - "description": "Max results", - "default": 20, - "title": "Limit" - }, - "description": "Max results" - } - ], - "responses": { - "200": { - "description": "List of recent quotes", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/attestations/view/{checksum}": { - "get": { - "tags": [ - "attestations", - "attestations", - "attestations" - ], - "summary": "View quote details", - "description": "Public endpoint. Returns parsed quote data with verification status.", - "operationId": "handle_view_api_v1_attestations_view__checksum__get", - "parameters": [ - { - "name": "checksum", - "in": "path", - "required": true, - "schema": { - "type": "string", - "description": "Quote SHA256 checksum", - "title": "Checksum" - }, - "description": "Quote SHA256 checksum" - } - ], - "responses": { - "200": { - "description": "Quote details", - "content": { - "application/json": { - "schema": {} - } - } - }, - "404": { - "description": "Quote not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/attestations/collateral/{checksum}": { - "get": { - "tags": [ - "attestations", - "attestations", - "attestations" - ], - "summary": "Get quote collateral", - "description": "Returns TCB collateral data for quote verification. Cached for 24 hours.", - "operationId": "get_collateral_api_v1_attestations_collateral__checksum__get", - "parameters": [ - { - "name": "checksum", - "in": "path", - "required": true, - "schema": { - "type": "string", - "description": "Quote SHA256 checksum", - "title": "Checksum" - }, - "description": "Quote SHA256 checksum" - } - ], - "responses": { - "200": { - "description": "Collateral data", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "description": "Bad quote data" - }, - "404": { - "description": "Quote not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/attestations/raw/{checksum}": { - "get": { - "tags": [ - "attestations", - "attestations", - "attestations" - ], - "summary": "Download raw quote", - "description": "Returns raw quote bytes as binary file attachment.", - "operationId": "handle_get_raw_api_v1_attestations_raw__checksum__get", - "parameters": [ - { - "name": "checksum", - "in": "path", - "required": true, - "schema": { - "type": "string", - "description": "Quote SHA256 checksum", - "title": "Checksum" - }, - "description": "Quote SHA256 checksum" - } - ], - "responses": { - "200": { - "description": "Binary quote file", - "content": { - "application/json": { - "schema": {} - }, - "application/octet-stream": {} - } - }, - "404": { - "description": "Quote not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - }, - "head": { - "tags": [ - "attestations", - "attestations", - "attestations" - ], - "summary": "Check raw quote exists", - "description": "Returns headers without body. Use to check existence and get Content-Length.", - "operationId": "handle_check_raw_file_api_v1_attestations_raw__checksum__head", - "parameters": [ - { - "name": "checksum", - "in": "path", - "required": true, - "schema": { - "type": "string", - "description": "Quote SHA256 checksum", - "title": "Checksum" - }, - "description": "Quote SHA256 checksum" - } - ], - "responses": { - "200": { - "description": "Quote exists", - "content": { - "application/json": { - "schema": {} - } - } - }, - "404": { - "description": "Quote not found" - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/v1/attestations/ppids": { - "get": { - "tags": [ - "attestations", - "attestations" - ], - "summary": "List node PPIDs", - "description": "Public endpoint. Returns PPID list from nodes table (excluding deleted).", - "operationId": "handle_list_ppids_api_v1_attestations_ppids_get", - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - } - } - } - }, - "/api/v1/attestations/device_ids": { - "get": { - "tags": [ - "attestations", - "attestations" - ], - "summary": "List node device IDs", - "description": "Public endpoint. Returns device_id list from nodes table (excluding deleted).", - "operationId": "handle_list_device_ids_api_v1_attestations_device_ids_get", - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - } - } - } - }, - "/api/v1/attestations/nodes": { - "get": { - "tags": [ - "attestations", - "attestations" - ], - "summary": "List nodes", - "description": "Public endpoint. Returns NodeRef list derived from nodes table (excluding deleted).", - "operationId": "handle_list_nodes_api_v1_attestations_nodes_get", - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/NodeRef" - }, - "type": "array", - "title": "Response Handle List Nodes Api V1 Attestations Nodes Get" - } - } - } - } - } - } - }, - "/health": { - "get": { - "summary": "Health Check", - "operationId": "health_check_health_get", - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - } - } - } - } - }, - "components": { - "schemas": { - "AcmeFetchResult": { - "properties": { - "url": { - "type": "string", - "title": "Url", - "description": "ACME endpoint URL queried" - }, - "http_ok": { - "type": "boolean", - "title": "Http Ok", - "description": "True if HTTP 200 response received" - }, - "uri": { - "title": "Uri", - "description": "Account URI from response body", - "type": "string", - "nullable": true - }, - "status_code": { - "title": "Status Code", - "description": "HTTP status code returned", - "type": "integer", - "nullable": true - }, - "error": { - "title": "Error", - "description": "Error message if request failed", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "url", - "http_ok" - ], - "title": "AcmeFetchResult", - "description": "Result of an ACME account fetch attempt." - }, - "AppComposeV2": { - "properties": { - "allowed_envs": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Allowed Envs" - }, - "bash_script": { - "title": "Bash Script", - "type": "string", - "nullable": true - }, - "default_gateway_domain": { - "title": "Default Gateway Domain", - "type": "string", - "nullable": true - }, - "docker_compose_file": { - "title": "Docker Compose File", - "type": "string", - "nullable": true - }, - "init_script": { - "title": "Init Script", - "type": "string", - "nullable": true - }, - "kms_enabled": { - "type": "boolean", - "title": "Kms Enabled", - "default": true - }, - "local_key_provider_enabled": { - "type": "boolean", - "title": "Local Key Provider Enabled", - "default": false - }, - "manifest_version": { - "type": "integer", - "title": "Manifest Version", - "default": 2 - }, - "name": { - "type": "string", - "title": "Name" - }, - "no_instance_id": { - "type": "boolean", - "title": "No Instance Id", - "default": false - }, - "pre_launch_script": { - "title": "Pre Launch Script", - "type": "string", - "nullable": true - }, - "public_logs": { - "type": "boolean", - "title": "Public Logs", - "default": true - }, - "public_sysinfo": { - "type": "boolean", - "title": "Public Sysinfo", - "default": true - }, - "public_tcbinfo": { - "type": "boolean", - "title": "Public Tcbinfo", - "default": true - }, - "runner": { - "type": "string", - "title": "Runner", - "default": "docker-compose" - }, - "gateway_enabled": { - "type": "boolean", - "title": "Gateway Enabled", - "default": true - }, - "features": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Features", - "default": [ - "kms", - "tproxy-net" - ] - }, - "salt": { - "title": "Salt", - "type": "string", - "nullable": true - }, - "secure_time": { - "type": "boolean", - "title": "Secure Time", - "default": false - }, - "storage_fs": { - "anyOf": [ - { - "type": "string", - "const": "ext4" - }, - { - "type": "string", - "const": "zfs" - } - ], - "title": "Storage Fs", - "default": "zfs", - "nullable": true - }, - "tproxy_enabled": { - "type": "boolean", - "title": "Tproxy Enabled", - "default": true - } - }, - "type": "object", - "required": [ - "name" - ], - "title": "AppComposeV2" - }, - "AppEventsResponse": { - "properties": { - "events": { - "items": { - "$ref": "#/components/schemas/InstanceEventResponse" - }, - "type": "array", - "title": "Events", - "description": "Event records" - }, - "total": { - "type": "integer", - "title": "Total", - "description": "Number of events returned" - } - }, - "type": "object", - "required": [ - "events", - "total" - ], - "title": "AppEventsResponse", - "description": "Instance event list response." - }, - "AppRevisionDetailResponse": { - "properties": { - "revision_id": { - "type": "string", - "title": "Revision Id", - "description": "Revision record identifier (hashid of snowflake_id)" - }, - "app_id": { - "type": "string", - "title": "App Id", - "description": "Hex app identifier" - }, - "vm_uuid": { - "type": "string", - "title": "Vm Uuid", - "description": "CVM UUID" - }, - "compose_hash": { - "type": "string", - "title": "Compose Hash", - "description": "SHA-256 hash of compose file" - }, - "compose_file": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "string" - } - ], - "title": "Compose File", - "description": "Docker compose content (dict or raw string)", - "nullable": true - }, - "encrypted_env": { - "type": "string", - "title": "Encrypted Env", - "description": "Hex-encoded encrypted environment variables" - }, - "user_config": { - "type": "string", - "title": "User Config", - "description": "JSON user configuration string" - }, - "created_at": { - "type": "string", - "title": "Created At", - "description": "Revision timestamp (ISO 8601)" - }, - "trace_id": { - "title": "Trace Id", - "description": "Request trace ID for debugging", - "type": "string", - "nullable": true - }, - "operation_type": { - "type": "string", - "title": "Operation Type", - "description": "Operation: deploy, update, restart, etc." - }, - "triggered_by": { - "description": "User who triggered the operation", - "$ref": "#/components/schemas/UserRef", - "nullable": true - }, - "cvm": { - "description": "CVM reference", - "$ref": "#/components/schemas/CvmRef", - "nullable": true - }, - "workspace": { - "description": "Workspace reference", - "$ref": "#/components/schemas/WorkspaceRef", - "nullable": true - } - }, - "type": "object", - "required": [ - "revision_id", - "app_id", - "vm_uuid", - "compose_hash", - "compose_file", - "encrypted_env", - "user_config", - "created_at", - "trace_id", - "operation_type" - ], - "title": "AppRevisionDetailResponse", - "description": "Full revision detail with configuration data." - }, - "AppRevisionResponse": { - "properties": { - "revision_id": { - "type": "string", - "title": "Revision Id", - "description": "Revision record identifier (hashid of snowflake_id)" - }, - "app_id": { - "type": "string", - "title": "App Id", - "description": "Hex app identifier" - }, - "vm_uuid": { - "type": "string", - "title": "Vm Uuid", - "description": "CVM UUID" - }, - "compose_hash": { - "type": "string", - "title": "Compose Hash", - "description": "SHA-256 hash of compose file" - }, - "created_at": { - "type": "string", - "title": "Created At", - "description": "Revision timestamp (ISO 8601)" - }, - "trace_id": { - "title": "Trace Id", - "description": "Request trace ID for debugging", - "type": "string", - "nullable": true - }, - "operation_type": { - "type": "string", - "title": "Operation Type", - "description": "Operation: deploy, update, restart, etc." - }, - "triggered_by": { - "description": "User who triggered the operation", - "$ref": "#/components/schemas/UserRef", - "nullable": true - }, - "cvm": { - "description": "CVM reference", - "$ref": "#/components/schemas/CvmRef", - "nullable": true - }, - "workspace": { - "description": "Workspace reference", - "$ref": "#/components/schemas/WorkspaceRef", - "nullable": true - } - }, - "type": "object", - "required": [ - "revision_id", - "app_id", - "vm_uuid", - "compose_hash", - "created_at", - "trace_id", - "operation_type" - ], - "title": "AppRevisionResponse", - "description": "App deployment revision summary." - }, - "AppRevisionsResponse": { - "properties": { - "revisions": { - "items": { - "$ref": "#/components/schemas/AppRevisionResponse" - }, - "type": "array", - "title": "Revisions", - "description": "Revision records" - }, - "total": { - "type": "integer", - "title": "Total", - "description": "Total revision count" - }, - "page": { - "type": "integer", - "title": "Page", - "description": "Current page number" - }, - "page_size": { - "type": "integer", - "title": "Page Size", - "description": "Items per page" - }, - "total_pages": { - "type": "integer", - "title": "Total Pages", - "description": "Total page count" - } - }, - "type": "object", - "required": [ - "revisions", - "total", - "page", - "page_size", - "total_pages" - ], - "title": "AppRevisionsResponse", - "description": "Paginated revision list." - }, - "AppUsageResponse": { - "properties": { - "usage": { - "items": { - "$ref": "#/components/schemas/MeteredUsageResponse" - }, - "type": "array", - "title": "Usage", - "description": "Usage records" - }, - "total": { - "type": "integer", - "title": "Total", - "description": "Number of records returned" - }, - "total_cost": { - "type": "number", - "title": "Total Cost", - "description": "Sum of costs in USD" - } - }, - "type": "object", - "required": [ - "usage", - "total", - "total_cost" - ], - "title": "AppUsageResponse", - "description": "App usage response with cost summary." - }, - "AttestationKeyType": { - "type": "integer", - "enum": [ - 2, - 3 - ], - "title": "AttestationKeyType", - "description": "Attestation key type (subset used in SGX/TDX DCAP quotes)." - }, - "BatchInstanceIdRefreshRequest": { - "properties": { - "cvm_ids": { - "title": "Cvm Ids", - "description": "Optional CVM identifiers. Admin can pass cross-workspace IDs.", - "items": { - "type": "string" - }, - "type": "array", - "nullable": true - }, - "running_only": { - "type": "boolean", - "title": "Running Only", - "description": "Only process CVMs with status=running", - "default": true - }, - "missing_only": { - "type": "boolean", - "title": "Missing Only", - "description": "Only process CVMs with missing instance_id", - "default": true - }, - "overwrite": { - "type": "boolean", - "title": "Overwrite", - "description": "Overwrite existing instance_id when different", - "default": false - }, - "limit": { - "type": "integer", - "maximum": 500.0, - "minimum": 1.0, - "title": "Limit", - "description": "Max CVMs to process in one request", - "default": 100 - }, - "dry_run": { - "type": "boolean", - "title": "Dry Run", - "description": "Preview changes without persisting", - "default": false - } - }, - "type": "object", - "title": "BatchInstanceIdRefreshRequest" - }, - "BatchInstanceIdRefreshResponse": { - "properties": { - "total": { - "type": "integer", - "title": "Total" - }, - "scanned": { - "type": "integer", - "title": "Scanned" - }, - "updated": { - "type": "integer", - "title": "Updated" - }, - "unchanged": { - "type": "integer", - "title": "Unchanged" - }, - "skipped": { - "type": "integer", - "title": "Skipped" - }, - "conflicts": { - "type": "integer", - "title": "Conflicts" - }, - "errors": { - "type": "integer", - "title": "Errors" - }, - "items": { - "items": { - "$ref": "#/components/schemas/InstanceIdRefreshResult" - }, - "type": "array", - "title": "Items" - } - }, - "type": "object", - "required": [ - "total", - "scanned", - "updated", - "unchanged", - "skipped", - "conflicts", - "errors", - "items" - ], - "title": "BatchInstanceIdRefreshResponse" - }, - "BatchStatusRequest": { - "properties": { - "vm_uuids": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Vm Uuids" - } - }, - "type": "object", - "required": [ - "vm_uuids" - ], - "title": "BatchStatusRequest" - }, - "BatchStopErrorEntry": { - "properties": { - "cvm_id": { - "type": "string", - "title": "Cvm Id", - "description": "Hashed CVM ID" - }, - "error": { - "type": "string", - "title": "Error", - "description": "Error message" - } - }, - "type": "object", - "required": [ - "cvm_id", - "error" - ], - "title": "BatchStopErrorEntry", - "description": "Error detail for a single CVM in batch stop." - }, - "BatchStopRequest": { - "properties": { - "cvm_ids": { - "items": { - "type": "string" - }, - "type": "array", - "maxItems": 50, - "title": "Cvm Ids", - "description": "List of CVM hash IDs to stop" - } - }, - "type": "object", - "required": [ - "cvm_ids" - ], - "title": "BatchStopRequest", - "description": "Request to batch stop multiple CVMs." - }, - "BatchStopResponse": { - "properties": { - "total": { - "type": "integer", - "title": "Total", - "description": "Total CVMs requested" - }, - "stopped": { - "type": "integer", - "title": "Stopped", - "description": "CVMs successfully scheduled for stop" - }, - "skipped": { - "type": "integer", - "title": "Skipped", - "description": "CVMs skipped (in_progress, no vm_uuid, GPU rental managed)" - }, - "errors": { - "items": { - "$ref": "#/components/schemas/BatchStopErrorEntry" - }, - "type": "array", - "title": "Errors", - "description": "CVMs that failed to stop" - } - }, - "type": "object", - "required": [ - "total", - "stopped", - "skipped" - ], - "title": "BatchStopResponse", - "description": "Summary of batch stop operation." - }, - "BillingPeriod": { - "type": "string", - "enum": [ - "skip", - "hourly", - "monthly" - ], - "title": "BillingPeriod" - }, - "Body_api_verify_email_token_api_v1_auth_verify_email_token_post": { - "properties": { - "request": { - "$ref": "#/components/schemas/EmailTokenVerificationRequest" - }, - "site_key": { - "type": "string", - "title": "Site Key" - } - }, - "type": "object", - "required": [ - "request" - ], - "title": "Body_api_verify_email_token_api_v1_auth_verify_email_token_post" - }, - "Body_handle_restart_cvm_api_v1_cvms__cvm_id__restart_post": { - "properties": { - "force": { - "type": "boolean", - "title": "Force", - "description": "Skip graceful shutdown", - "default": false - }, - "polling": { - "title": "Polling", - "description": "Polling version for task routing", - "type": "string", - "enum": [ - "v1", - "v2" - ], - "nullable": true - } - }, - "type": "object", - "title": "Body_handle_restart_cvm_api_v1_cvms__cvm_id__restart_post" - }, - "Body_handle_shutdown_cvm_api_v1_cvms__cvm_id__shutdown_post": { - "properties": { - "polling": { - "title": "Polling", - "description": "Polling version for task routing", - "type": "string", - "enum": [ - "v1", - "v2" - ], - "nullable": true - } - }, - "type": "object", - "title": "Body_handle_shutdown_cvm_api_v1_cvms__cvm_id__shutdown_post" - }, - "Body_handle_start_cvm_api_v1_cvms__cvm_id__start_post": { - "properties": { - "polling": { - "title": "Polling", - "description": "Polling version for task routing", - "type": "string", - "enum": [ - "v1", - "v2" - ], - "nullable": true - } - }, - "type": "object", - "title": "Body_handle_start_cvm_api_v1_cvms__cvm_id__start_post" - }, - "Body_handle_stop_cvm_api_v1_cvms__cvm_id__stop_post": { - "properties": { - "polling": { - "title": "Polling", - "description": "Polling version for task routing", - "type": "string", - "enum": [ - "v1", - "v2" - ], - "nullable": true - } - }, - "type": "object", - "title": "Body_handle_stop_cvm_api_v1_cvms__cvm_id__stop_post" - }, - "Body_handle_update_cvm_listed_api_v1_cvms__cvm_id__listed_patch": { - "properties": { - "listed": { - "type": "boolean", - "title": "Listed" - } - }, - "type": "object", - "required": [ - "listed" - ], - "title": "Body_handle_update_cvm_listed_api_v1_cvms__cvm_id__listed_patch" - }, - "Body_handle_update_cvm_name_api_v1_cvms__cvm_id__name_patch": { - "properties": { - "name": { - "type": "string", - "title": "Name" - } - }, - "type": "object", - "required": [ - "name" - ], - "title": "Body_handle_update_cvm_name_api_v1_cvms__cvm_id__name_patch" - }, - "Body_handle_update_cvm_scheduled_delete_api_v1_cvms__cvm_id__scheduled_delete_patch": { - "properties": { - "scheduled_delete_at": { - "title": "Scheduled Delete At", - "type": "string", - "format": "date-time", - "nullable": true - } - }, - "type": "object", - "title": "Body_handle_update_cvm_scheduled_delete_api_v1_cvms__cvm_id__scheduled_delete_patch" - }, - "Body_handle_update_cvm_visibility_api_v1_cvms__cvm_id__visibility_patch": { - "properties": { - "public_sysinfo": { - "type": "boolean", - "title": "Public Sysinfo", - "description": "Expose system info publicly" - }, - "public_logs": { - "type": "boolean", - "title": "Public Logs", - "description": "Expose container logs publicly" - }, - "public_tcbinfo": { - "title": "Public Tcbinfo", - "description": "Expose TCB attestation info publicly", - "type": "boolean", - "nullable": true - }, - "polling": { - "title": "Polling", - "description": "Polling version for task routing", - "type": "string", - "enum": [ - "v1", - "v2" - ], - "nullable": true - } - }, - "type": "object", - "required": [ - "public_sysinfo", - "public_logs" - ], - "title": "Body_handle_update_cvm_visibility_api_v1_cvms__cvm_id__visibility_patch" - }, - "Body_handle_upload_and_verify_api_v1_attestations_verify_post": { - "properties": { - "file": { - "title": "File", - "type": "string", - "format": "binary", - "nullable": true - }, - "hex": { - "title": "Hex", - "type": "string", - "nullable": true - } - }, - "type": "object", - "title": "Body_handle_upload_and_verify_api_v1_attestations_verify_post" - }, - "Body_login_for_access_token_api_v1_auth_token_post": { - "properties": { - "grant_type": { - "title": "Grant Type", - "type": "string", - "pattern": "^password$", - "nullable": true - }, - "username": { - "type": "string", - "title": "Username" - }, - "password": { - "type": "string", - "title": "Password" - }, - "scope": { - "type": "string", - "title": "Scope", - "default": "" - }, - "client_id": { - "title": "Client Id", - "type": "string", - "nullable": true - }, - "client_secret": { - "title": "Client Secret", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "username", - "password" - ], - "title": "Body_login_for_access_token_api_v1_auth_token_post" - }, - "Body_login_with_cookie_api_v1_auth_login_post": { - "properties": { - "grant_type": { - "title": "Grant Type", - "type": "string", - "pattern": "^password$", - "nullable": true - }, - "username": { - "type": "string", - "title": "Username" - }, - "password": { - "type": "string", - "title": "Password" - }, - "scope": { - "type": "string", - "title": "Scope", - "default": "" - }, - "client_id": { - "title": "Client Id", - "type": "string", - "nullable": true - }, - "client_secret": { - "title": "Client Secret", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "username", - "password" - ], - "title": "Body_login_with_cookie_api_v1_auth_login_post" - }, - "Body_trigger_cvm_compose_file_update_api_v1_cvms__cvm_id__compose_file_patch": { - "properties": { - "compose_hash": { - "type": "string", - "title": "Compose Hash", - "description": "Hash from provision response" - }, - "encrypted_env": { - "title": "Encrypted Env", - "description": "New encrypted env blob (hex)", - "type": "string", - "nullable": true - }, - "env_keys": { - "title": "Env Keys", - "description": "Allowed env var names", - "items": { - "type": "string" - }, - "type": "array", - "nullable": true - }, - "update_env_vars": { - "title": "Update Env Vars", - "description": "Update allowed_envs list", - "default": false, - "type": "boolean", - "nullable": true - } - }, - "type": "object", - "required": [ - "compose_hash" - ], - "title": "Body_trigger_cvm_compose_file_update_api_v1_cvms__cvm_id__compose_file_patch" - }, - "Body_update_cvm_docker_compose_api_v1_cvms__cvm_id__docker_compose_patch": { - "properties": { - "file": { - "title": "File", - "description": "Docker Compose YAML file to upload", - "type": "string", - "format": "binary", - "nullable": true - } - }, - "type": "object", - "title": "Body_update_cvm_docker_compose_api_v1_cvms__cvm_id__docker_compose_patch" - }, - "Body_update_cvm_envs_api_v1_cvms__cvm_id__envs_patch": { - "properties": { - "encrypted_env": { - "type": "string", - "title": "Encrypted Env", - "description": "Encrypted env blob as hex string" - }, - "env_keys": { - "title": "Env Keys", - "description": "Allowed env var names. Changes trigger verification for contract-owned KMS.", - "items": { - "type": "string" - }, - "type": "array", - "nullable": true - }, - "compose_hash": { - "title": "Compose Hash", - "description": "Hash from Phase 1 response (Phase 2 only)", - "type": "string", - "nullable": true - }, - "transaction_hash": { - "title": "Transaction Hash", - "description": "Transaction hash proving on-chain registration (Phase 2 only)", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "encrypted_env" - ], - "title": "Body_update_cvm_envs_api_v1_cvms__cvm_id__envs_patch" - }, - "Body_update_cvm_os_image_api_v1_cvms__cvm_id__os_image_patch": { - "properties": { - "os_image_name": { - "type": "string", - "title": "Os Image Name", - "description": "Image name or slug from available-os-images" - } - }, - "type": "object", - "required": [ - "os_image_name" - ], - "title": "Body_update_cvm_os_image_api_v1_cvms__cvm_id__os_image_patch" - }, - "Body_update_cvm_pre_launch_script_api_v1_cvms__cvm_id__pre_launch_script_patch": { - "properties": { - "file": { - "title": "File", - "description": "Shell script file to upload", - "type": "string", - "format": "binary", - "nullable": true - } - }, - "type": "object", - "title": "Body_update_cvm_pre_launch_script_api_v1_cvms__cvm_id__pre_launch_script_patch" - }, - "CVMGatewayInfo": { - "properties": { - "base_domain": { - "title": "Base Domain", - "type": "string", - "nullable": true - }, - "cname": { - "title": "Cname", - "type": "string", - "nullable": true - } - }, - "type": "object", - "title": "CVMGatewayInfo" - }, - "CVMInfo": { - "properties": { - "id": { - "type": "string", - "pattern": "^cvm_.+", - "format": "hashid", - "title": "HashedId[cvms]", - "description": "A hashed identifier that maps to an internal database ID", - "examples": [ - "cvm_0123abcd" - ] - }, - "name": { - "type": "string", - "title": "Name" - }, - "app_id": { - "title": "App Id", - "type": "string", - "nullable": true - }, - "vm_uuid": { - "title": "Vm Uuid", - "type": "string", - "nullable": true - }, - "instance_id": { - "title": "Instance Id", - "type": "string", - "nullable": true - }, - "resource": { - "$ref": "#/components/schemas/CVMResourceInfo" - }, - "node_info": { - "$ref": "#/components/schemas/NodeRef", - "nullable": true - }, - "os": { - "$ref": "#/components/schemas/CVMOSInfo", - "nullable": true - }, - "kms_type": { - "$ref": "#/components/schemas/KmsType", - "nullable": true - }, - "kms_info": { - "$ref": "#/components/schemas/CVMKmsInfo", - "nullable": true - }, - "status": { - "type": "string", - "title": "Status" - }, - "progress": { - "$ref": "#/components/schemas/CVMProgressInfo", - "nullable": true - }, - "compose_hash": { - "title": "Compose Hash", - "type": "string", - "nullable": true - }, - "docker_compose_hash": { - "title": "Docker Compose Hash", - "type": "string", - "nullable": true - }, - "pre_launch_script_hash": { - "title": "Pre Launch Script Hash", - "type": "string", - "nullable": true - }, - "gateway": { - "$ref": "#/components/schemas/CVMGatewayInfo" - }, - "services": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Services" - }, - "endpoints": { - "title": "Endpoints", - "items": { - "$ref": "#/components/schemas/CvmNetworkUrls" - }, - "type": "array", - "nullable": true - }, - "public_logs": { - "type": "boolean", - "title": "Public Logs", - "default": false - }, - "public_sysinfo": { - "type": "boolean", - "title": "Public Sysinfo", - "default": false - }, - "public_tcbinfo": { - "type": "boolean", - "title": "Public Tcbinfo", - "default": true - }, - "gateway_enabled": { - "type": "boolean", - "title": "Gateway Enabled", - "default": false - }, - "secure_time": { - "type": "boolean", - "title": "Secure Time", - "default": false - }, - "storage_fs": { - "type": "string", - "title": "Storage Fs", - "default": "zfs" - }, - "workspace": { - "$ref": "#/components/schemas/WorkspaceRef", - "nullable": true - }, - "creator": { - "$ref": "#/components/schemas/UserRef", - "nullable": true - }, - "created_at": { - "title": "Created At", - "type": "string", - "format": "date-time", - "nullable": true - }, - "deleted_at": { - "title": "Deleted At", - "type": "string", - "format": "date-time", - "nullable": true - }, - "listed": { - "type": "boolean", - "title": "Listed", - "default": false - }, - "project_type": { - "title": "Project Type", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "id", - "name", - "resource", - "status", - "gateway" - ], - "title": "CVMInfo" - }, - "CVMInfoDetail": { - "properties": { - "id": { - "type": "string", - "pattern": "^cvm_.+", - "format": "hashid", - "title": "HashedId[cvms]", - "description": "A hashed identifier that maps to an internal database ID", - "examples": [ - "cvm_0123abcd" - ] - }, - "name": { - "type": "string", - "title": "Name" - }, - "app_id": { - "title": "App Id", - "type": "string", - "nullable": true - }, - "vm_uuid": { - "title": "Vm Uuid", - "type": "string", - "nullable": true - }, - "instance_id": { - "title": "Instance Id", - "type": "string", - "nullable": true - }, - "resource": { - "$ref": "#/components/schemas/CVMResourceInfo" - }, - "node_info": { - "$ref": "#/components/schemas/NodeRef", - "nullable": true - }, - "os": { - "$ref": "#/components/schemas/CVMOSInfo", - "nullable": true - }, - "kms_type": { - "$ref": "#/components/schemas/KmsType", - "nullable": true - }, - "kms_info": { - "$ref": "#/components/schemas/CVMKmsInfo", - "nullable": true - }, - "status": { - "type": "string", - "title": "Status" - }, - "progress": { - "$ref": "#/components/schemas/CVMProgressInfo", - "nullable": true - }, - "compose_hash": { - "title": "Compose Hash", - "type": "string", - "nullable": true - }, - "docker_compose_hash": { - "title": "Docker Compose Hash", - "type": "string", - "nullable": true - }, - "pre_launch_script_hash": { - "title": "Pre Launch Script Hash", - "type": "string", - "nullable": true - }, - "gateway": { - "$ref": "#/components/schemas/CVMGatewayInfo" - }, - "services": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Services" - }, - "endpoints": { - "title": "Endpoints", - "items": { - "$ref": "#/components/schemas/CvmNetworkUrls" - }, - "type": "array", - "nullable": true - }, - "public_logs": { - "type": "boolean", - "title": "Public Logs", - "default": false - }, - "public_sysinfo": { - "type": "boolean", - "title": "Public Sysinfo", - "default": false - }, - "public_tcbinfo": { - "type": "boolean", - "title": "Public Tcbinfo", - "default": true - }, - "gateway_enabled": { - "type": "boolean", - "title": "Gateway Enabled", - "default": false - }, - "secure_time": { - "type": "boolean", - "title": "Secure Time", - "default": false - }, - "storage_fs": { - "type": "string", - "title": "Storage Fs", - "default": "zfs" - }, - "workspace": { - "$ref": "#/components/schemas/WorkspaceRef", - "nullable": true - }, - "creator": { - "$ref": "#/components/schemas/UserRef", - "nullable": true - }, - "created_at": { - "title": "Created At", - "type": "string", - "format": "date-time", - "nullable": true - }, - "deleted_at": { - "title": "Deleted At", - "type": "string", - "format": "date-time", - "nullable": true - }, - "listed": { - "type": "boolean", - "title": "Listed", - "default": false - }, - "project_type": { - "title": "Project Type", - "type": "string", - "nullable": true - }, - "compose_file": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "string" - } - ], - "title": "Compose File", - "nullable": true - } - }, - "type": "object", - "required": [ - "id", - "name", - "resource", - "status", - "gateway" - ], - "title": "CVMInfoDetail" - }, - "CVMKmsInfo": { - "properties": { - "chain_id": { - "title": "Chain Id", - "type": "integer", - "nullable": true - }, - "dstack_kms_address": { - "title": "Dstack Kms Address", - "type": "string", - "nullable": true - }, - "dstack_app_address": { - "title": "Dstack App Address", - "type": "string", - "nullable": true - }, - "deployer_address": { - "title": "Deployer Address", - "type": "string", - "nullable": true - }, - "rpc_endpoint": { - "title": "Rpc Endpoint", - "type": "string", - "nullable": true - }, - "encrypted_env_pubkey": { - "title": "Encrypted Env Pubkey", - "type": "string", - "nullable": true - } - }, - "type": "object", - "title": "CVMKmsInfo" - }, - "CVMOSInfo": { - "properties": { - "name": { - "title": "Name", - "type": "string", - "nullable": true - }, - "version": { - "title": "Version", - "type": "string", - "nullable": true - }, - "is_dev": { - "title": "Is Dev", - "type": "boolean", - "nullable": true - }, - "os_image_hash": { - "title": "Os Image Hash", - "type": "string", - "nullable": true - } - }, - "type": "object", - "title": "CVMOSInfo" - }, - "CVMProgressInfo": { - "properties": { - "target": { - "title": "Target", - "type": "string", - "nullable": true - }, - "started_at": { - "title": "Started At", - "type": "string", - "format": "date-time", - "nullable": true - }, - "correlation_id": { - "title": "Correlation Id", - "type": "string", - "nullable": true - } - }, - "type": "object", - "title": "CVMProgressInfo" - }, - "CVMResourceInfo": { - "properties": { - "instance_type": { - "title": "Instance Type", - "type": "string", - "nullable": true - }, - "vcpu": { - "title": "Vcpu", - "type": "integer", - "nullable": true - }, - "memory_in_gb": { - "title": "Memory In Gb", - "type": "number", - "nullable": true - }, - "disk_in_gb": { - "title": "Disk In Gb", - "type": "integer", - "nullable": true - }, - "gpus": { - "title": "Gpus", - "type": "integer", - "nullable": true - }, - "compute_billing_price": { - "title": "Compute Billing Price", - "type": "string", - "format": "decimal", - "description": "A monetary value with precise decimal arithmetic", - "examples": [ - "19.99", - "123.456000" - ], - "nullable": true - }, - "billing_period": { - "$ref": "#/components/schemas/BillingPeriod", - "nullable": true - } - }, - "type": "object", - "title": "CVMResourceInfo" - }, - "CaaCheckResult": { - "properties": { - "caa_records": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Caa Records", - "description": "Raw CAA DNS records found" - }, - "accounturi": { - "title": "Accounturi", - "description": "Account URI extracted from CAA record", - "type": "string", - "nullable": true - }, - "acme_fetches": { - "items": { - "$ref": "#/components/schemas/AcmeFetchResult" - }, - "type": "array", - "title": "Acme Fetches", - "description": "ACME endpoint query attempts" - }, - "expected_uri": { - "title": "Expected Uri", - "description": "Expected URI from ACME account", - "type": "string", - "nullable": true - }, - "is_match": { - "type": "boolean", - "title": "Is Match", - "description": "True if CAA accounturi matches ACME account" - }, - "info_message": { - "title": "Info Message", - "description": "Additional context or guidance", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "caa_records", - "acme_fetches", - "is_match" - ], - "title": "CaaCheckResult", - "description": "CAA record check result (informational, not required for validation)." - }, - "Certificate": { - "properties": { - "subject": { - "$ref": "#/components/schemas/CertificateSubject" - }, - "issuer": { - "$ref": "#/components/schemas/CertificateIssuer" - }, - "serial_number": { - "type": "string", - "title": "Serial Number" - }, - "not_before": { - "type": "string", - "format": "date-time", - "title": "Not Before" - }, - "not_after": { - "type": "string", - "format": "date-time", - "title": "Not After" - }, - "version": { - "type": "string", - "title": "Version" - }, - "fingerprint": { - "type": "string", - "title": "Fingerprint" - }, - "signature_algorithm": { - "type": "string", - "title": "Signature Algorithm" - }, - "sans": { - "title": "Sans", - "items": { - "type": "string" - }, - "type": "array", - "nullable": true - }, - "is_ca": { - "type": "boolean", - "title": "Is Ca", - "default": false - }, - "position_in_chain": { - "title": "Position In Chain", - "type": "integer", - "nullable": true - }, - "quote": { - "title": "Quote", - "type": "string", - "nullable": true - }, - "app_id": { - "title": "App Id", - "type": "string", - "nullable": true - }, - "cert_usage": { - "title": "Cert Usage", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "subject", - "issuer", - "serial_number", - "not_before", - "not_after", - "version", - "fingerprint", - "signature_algorithm" - ], - "title": "Certificate" - }, - "CertificateIssuer": { - "properties": { - "common_name": { - "title": "Common Name", - "description": "Issuer common name", - "type": "string", - "nullable": true - }, - "organization": { - "title": "Organization", - "description": "Issuer organization", - "type": "string", - "nullable": true - }, - "country": { - "title": "Country", - "description": "Issuer country code", - "type": "string", - "nullable": true - } - }, - "type": "object", - "title": "CertificateIssuer" - }, - "CertificateSubject": { - "properties": { - "common_name": { - "title": "Common Name", - "description": "Certificate subject common name", - "type": "string", - "nullable": true - }, - "organization": { - "title": "Organization", - "description": "Organization name", - "type": "string", - "nullable": true - }, - "country": { - "title": "Country", - "description": "Country code", - "type": "string", - "nullable": true - }, - "state": { - "title": "State", - "description": "State or province", - "type": "string", - "nullable": true - }, - "locality": { - "title": "Locality", - "description": "Locality name", - "type": "string", - "nullable": true - } - }, - "type": "object", - "title": "CertificateSubject" - }, - "ChangeEmailPayload": { - "properties": { - "email": { - "type": "string", - "format": "email", - "title": "Email" - }, - "site_key": { - "title": "Site Key", - "type": "string", - "nullable": true - }, - "current_password": { - "title": "Current Password", - "type": "string", - "nullable": true - }, - "totp_code": { - "title": "Totp Code", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "email" - ], - "title": "ChangeEmailPayload", - "description": "Request payload for changing email address" - }, - "ComposeFilePatchRequest": { - "properties": { - "compose_manifest": { - "$ref": "#/components/schemas/ComposeManifestPatchRequest", - "nullable": true - }, - "encrypted_env": { - "title": "Encrypted Env", - "type": "string", - "nullable": true - }, - "env_keys": { - "title": "Env Keys", - "items": { - "type": "string" - }, - "type": "array", - "nullable": true - } - }, - "type": "object", - "title": "ComposeFilePatchRequest", - "description": "API request model for partially updating CVM compose files - matches CvmUpgradePayload structure" - }, - "ComposeFileProvisionResponse": { - "properties": { - "app_id": { - "type": "string", - "title": "App Id" - }, - "device_id": { - "title": "Device Id", - "type": "string", - "nullable": true - }, - "compose_hash": { - "type": "string", - "title": "Compose Hash" - }, - "kms_info": { - "$ref": "#/components/schemas/KMSInfo", - "nullable": true - } - }, - "type": "object", - "required": [ - "app_id", - "compose_hash" - ], - "title": "ComposeFileProvisionResponse", - "description": "API response model for compose file provision" - }, - "ComposeFileUpdateRequest": { - "properties": { - "compose_file": { - "$ref": "#/components/schemas/AppComposeV2" - }, - "compose_hash": { - "type": "string", - "title": "Compose Hash" - }, - "encrypted_env": { - "title": "Encrypted Env", - "type": "string", - "nullable": true - }, - "env_keys": { - "title": "Env Keys", - "items": { - "type": "string" - }, - "type": "array", - "nullable": true - } - }, - "type": "object", - "required": [ - "compose_file", - "compose_hash" - ], - "title": "ComposeFileUpdateRequest", - "description": "API request model for updating CVM compose files" - }, - "ComposeManifest": { - "properties": { - "bash_script": { - "title": "Bash Script", - "type": "string", - "nullable": true - }, - "default_gateway_domain": { - "title": "Default Gateway Domain", - "type": "string", - "nullable": true - }, - "docker_compose_file": { - "title": "Docker Compose File", - "type": "string", - "nullable": true - }, - "docker_config": { - "$ref": "#/components/schemas/DockerConfig", - "nullable": true - }, - "features": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Features", - "default": [ - "kms", - "tproxy-net" - ] - }, - "kms_enabled": { - "type": "boolean", - "title": "Kms Enabled", - "default": true - }, - "manifest_version": { - "type": "integer", - "title": "Manifest Version", - "default": 1 - }, - "name": { - "type": "string", - "title": "Name" - }, - "pre_launch_script": { - "title": "Pre Launch Script", - "type": "string", - "nullable": true - }, - "public_logs": { - "type": "boolean", - "title": "Public Logs", - "default": true - }, - "public_sysinfo": { - "type": "boolean", - "title": "Public Sysinfo", - "default": true - }, - "runner": { - "type": "string", - "title": "Runner", - "default": "docker-compose" - }, - "salt": { - "title": "Salt", - "type": "string", - "nullable": true - }, - "tproxy_enabled": { - "type": "boolean", - "title": "Tproxy Enabled", - "default": true - }, - "version": { - "type": "string", - "title": "Version", - "default": "1.0.0" - } - }, - "type": "object", - "required": [ - "name" - ], - "title": "ComposeManifest", - "description": "@see https://github.com/Dstack-TEE/dstack/blob/master/tdxctl/src/utils.rs#L77\n@see https://github.com/Dstack-TEE/dstack/blob/master/basefiles/app-compose.sh" - }, - "ComposeManifestPatchRequest": { - "properties": { - "docker_compose_file": { - "title": "Docker Compose File", - "type": "string", - "nullable": true - }, - "pre_launch_script": { - "title": "Pre Launch Script", - "type": "string", - "nullable": true - } - }, - "type": "object", - "title": "ComposeManifestPatchRequest", - "description": "Partial update for compose_manifest fields" - }, - "CreateTappRequest": { - "properties": { - "app_id": { - "type": "string", - "title": "App Id", - "description": "The calculated app ID from compose file." - }, - "compose_hash": { - "type": "string", - "title": "Compose Hash", - "description": "The compose hash of the app compose file." - }, - "encrypted_env": { - "title": "Encrypted Env", - "description": "The encrypted environment variables.", - "type": "string", - "nullable": true - }, - "kms_id": { - "title": "Kms Id", - "description": "The KMS ID.", - "type": "string", - "nullable": true - }, - "contract_address": { - "title": "Contract Address", - "description": "The contract address.", - "type": "string", - "nullable": true - }, - "deployer_address": { - "title": "Deployer Address", - "description": "The deployer address.", - "type": "string", - "nullable": true - }, - "env_keys": { - "title": "Env Keys", - "description": "The environment variables to use for the app.", - "items": { - "type": "string" - }, - "type": "array", - "nullable": true - } - }, - "type": "object", - "required": [ - "app_id", - "compose_hash" - ], - "title": "CreateTappRequest" - }, - "CreateWorkloadTappRequest": { - "properties": { - "name": { - "type": "string", - "title": "Name", - "description": "The name of the tapp." - }, - "instance_type": { - "type": "string", - "title": "Instance Type", - "description": "The instance_type of the tapp." - }, - "model_id": { - "type": "string", - "title": "Model Id", - "description": "The model_id of the tapp." - }, - "scheduled_delete_at": { - "title": "Scheduled Delete At", - "description": "The scheduled delete time of the tapp.", - "type": "string", - "format": "date-time", - "nullable": true - } - }, - "type": "object", - "required": [ - "name", - "instance_type", - "model_id" - ], - "title": "CreateWorkloadTappRequest" - }, - "Credit": { - "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "balance": { - "type": "number", - "title": "Balance" - }, - "granted_balance": { - "title": "Granted Balance", - "type": "number", - "nullable": true - } - }, - "type": "object", - "required": [ - "id", - "balance" - ], - "title": "Credit" - }, - "CvmAttestation": { - "properties": { - "is_online": { - "type": "boolean", - "title": "Is Online" - }, - "is_public": { - "type": "boolean", - "title": "Is Public", - "default": true - }, - "error": { - "title": "Error", - "type": "string", - "nullable": true - }, - "name": { - "title": "Name", - "type": "string", - "nullable": true - }, - "app_certificates": { - "title": "App Certificates", - "items": { - "$ref": "#/components/schemas/Certificate" - }, - "type": "array", - "nullable": true - }, - "tcb_info": { - "$ref": "#/components/schemas/TcbInfo", - "nullable": true - }, - "compose_file": { - "title": "Compose File", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "is_online" - ], - "title": "CvmAttestation", - "description": "Model representing CVM attestation information" - }, - "CvmComposeFile": { - "properties": { - "compose_file": { - "$ref": "#/components/schemas/ComposeManifest" - }, - "env_pubkey": { - "type": "string", - "title": "Env Pubkey" - }, - "salt": { - "title": "Salt", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "compose_file", - "env_pubkey" - ], - "title": "CvmComposeFile", - "description": "Model representing CVM compose file information" - }, - "CvmComposition": { - "properties": { - "is_online": { - "type": "boolean", - "title": "Is Online" - }, - "is_public": { - "type": "boolean", - "title": "Is Public", - "default": true - }, - "error": { - "title": "Error", - "type": "string", - "nullable": true - }, - "docker_compose_file": { - "title": "Docker Compose File", - "type": "string", - "nullable": true - }, - "manifest_version": { - "title": "Manifest Version", - "type": "integer", - "nullable": true - }, - "version": { - "title": "Version", - "type": "string", - "nullable": true - }, - "runner": { - "title": "Runner", - "type": "string", - "nullable": true - }, - "features": { - "title": "Features", - "items": { - "type": "string" - }, - "type": "array", - "nullable": true - }, - "containers": { - "title": "Containers", - "items": { - "$ref": "#/components/schemas/ExtendedContainer" - }, - "type": "array", - "nullable": true - } - }, - "type": "object", - "required": [ - "is_online" - ], - "title": "CvmComposition", - "description": "Model representing CVM container list information" - }, - "CvmNetwork": { - "properties": { - "is_online": { - "type": "boolean", - "title": "Is Online" - }, - "is_public": { - "type": "boolean", - "title": "Is Public", - "default": true - }, - "error": { - "title": "Error", - "type": "string", - "nullable": true - }, - "internal_ip": { - "title": "Internal Ip", - "type": "string", - "nullable": true - }, - "latest_handshake": { - "title": "Latest Handshake", - "type": "string", - "format": "date-time", - "nullable": true - }, - "public_urls": { - "title": "Public Urls", - "items": { - "$ref": "#/components/schemas/CvmNetworkUrls" - }, - "type": "array", - "nullable": true - } - }, - "type": "object", - "required": [ - "is_online" - ], - "title": "CvmNetwork", - "description": "Model representing CVM network information" - }, - "CvmNetworkUrls": { - "properties": { - "app": { - "type": "string", - "title": "App" - }, - "instance": { - "type": "string", - "title": "Instance" - } - }, - "type": "object", - "required": [ - "app", - "instance" - ], - "title": "CvmNetworkUrls", - "description": "Model representing public URLs for a CVM port" - }, - "CvmNode": { - "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "name": { - "type": "string", - "title": "Name" - }, - "region_identifier": { - "title": "Region Identifier", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "id", - "name" - ], - "title": "CvmNode" - }, - "CvmOperationResponse": { - "properties": { - "correlation_id": { - "type": "string", - "title": "Correlation Id", - "description": "Unique ID linking all events in this operation" - }, - "operation_type": { - "type": "string", - "title": "Operation Type", - "description": "Type: compose_update, power_on, resize, etc." - }, - "target_state": { - "type": "string", - "title": "Target State", - "description": "Expected CVM state after completion" - }, - "triggered_by": { - "type": "integer", - "title": "Triggered By", - "description": "User ID who initiated the operation" - }, - "triggered_by_username": { - "title": "Triggered By Username", - "description": "Username if available", - "type": "string", - "nullable": true - }, - "triggered_by_email": { - "title": "Triggered By Email", - "description": "Email if available", - "type": "string", - "nullable": true - }, - "started_at": { - "type": "string", - "format": "date-time", - "title": "Started At", - "description": "UTC timestamp of first event" - }, - "completed_at": { - "title": "Completed At", - "description": "UTC timestamp of last event", - "type": "string", - "format": "date-time", - "nullable": true - }, - "duration_ms": { - "title": "Duration Ms", - "description": "Total duration from start to completion", - "type": "integer", - "nullable": true - }, - "status": { - "type": "string", - "title": "Status", - "description": "Current status: completed, in_progress, or failed" - }, - "error_message": { - "title": "Error Message", - "description": "Failure reason (sanitized for non-admins)", - "type": "string", - "nullable": true - }, - "sub_operations": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Sub Operations", - "description": "Ordered list of sub-operation types" - }, - "events": { - "items": { - "$ref": "#/components/schemas/OperationEventDetail" - }, - "type": "array", - "title": "Events", - "description": "Chronological event timeline" - }, - "instance_name": { - "type": "string", - "title": "Instance Name", - "description": "CVM name at operation time" - }, - "compose_hash": { - "title": "Compose Hash", - "description": "Hash identifying compose configuration", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "correlation_id", - "operation_type", - "target_state", - "triggered_by", - "started_at", - "status", - "sub_operations", - "events", - "instance_name" - ], - "title": "CvmOperationResponse", - "description": "Aggregated operation record grouped by correlation_id." - }, - "CvmRef": { - "properties": { - "object_type": { - "type": "string", - "const": "cvm", - "title": "Object Type", - "description": "Fixed value 'cvm'", - "default": "cvm" - }, - "vm_uuid": { - "type": "string", - "title": "Vm Uuid", - "description": "CVM instance UUID" - }, - "app_id": { - "title": "App Id", - "description": "Deterministic app identifier from manifest", - "type": "string", - "nullable": true - }, - "name": { - "title": "Name", - "description": "User-assigned CVM name", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "vm_uuid" - ], - "title": "CvmRef", - "description": "Minimal CVM reference for embedding in responses." - }, - "CvmResizePayload": { - "properties": { - "vcpu": { - "title": "Vcpu", - "type": "integer", - "nullable": true - }, - "memory": { - "title": "Memory", - "type": "integer", - "nullable": true - }, - "disk_size": { - "title": "Disk Size", - "type": "integer", - "nullable": true - }, - "allow_restart": { - "title": "Allow Restart", - "type": "integer", - "nullable": true - }, - "instance_type": { - "title": "Instance Type", - "type": "string", - "nullable": true - } - }, - "type": "object", - "title": "CvmResizePayload" - }, - "CvmStatus": { - "properties": { - "vm_uuid": { - "type": "string", - "title": "Vm Uuid" - }, - "status": { - "type": "string", - "title": "Status" - }, - "uptime": { - "title": "Uptime", - "type": "string", - "nullable": true - }, - "in_progress": { - "type": "boolean", - "title": "In Progress", - "default": false - }, - "boot_progress": { - "title": "Boot Progress", - "type": "string", - "nullable": true - }, - "boot_error": { - "title": "Boot Error", - "type": "string", - "nullable": true - }, - "operation_type": { - "title": "Operation Type", - "type": "string", - "nullable": true - }, - "operation_started_at": { - "title": "Operation Started At", - "type": "string", - "format": "date-time", - "nullable": true - }, - "correlation_id": { - "title": "Correlation Id", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "vm_uuid", - "status" - ], - "title": "CvmStatus", - "description": "CVM status information for API response.\n\nThis schema is used for both internal status determination and API responses.\nContains current state, progress information, and async operation tracking." - }, - "CvmSystemInfo": { - "properties": { - "is_online": { - "type": "boolean", - "title": "Is Online" - }, - "is_public": { - "type": "boolean", - "title": "Is Public", - "default": true - }, - "error": { - "title": "Error", - "type": "string", - "nullable": true - }, - "sysinfo": { - "$ref": "#/components/schemas/SystemInfo", - "nullable": true - }, - "status": { - "title": "Status", - "type": "string", - "nullable": true - }, - "in_progress": { - "type": "boolean", - "title": "In Progress", - "default": false - }, - "boot_progress": { - "title": "Boot Progress", - "type": "string", - "nullable": true - }, - "boot_error": { - "title": "Boot Error", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "is_online" - ], - "title": "CvmSystemInfo" - }, - "CvmUpgradePayload": { - "properties": { - "id": { - "title": "Id", - "type": "string", - "nullable": true - }, - "compose_manifest": { - "$ref": "#/components/schemas/AppComposeV2" - }, - "encrypted_env": { - "title": "Encrypted Env", - "type": "string", - "nullable": true - }, - "user_config": { - "title": "User Config", - "type": "string", - "nullable": true - }, - "update_ports": { - "type": "boolean", - "title": "Update Ports", - "default": false - }, - "ports": { - "title": "Ports", - "items": { - "$ref": "#/components/schemas/PortMapping" - }, - "type": "array", - "nullable": true - }, - "allow_restart": { - "title": "Allow Restart", - "type": "integer", - "nullable": true - }, - "env_keys": { - "title": "Env Keys", - "items": { - "type": "string" - }, - "type": "array", - "nullable": true - } - }, - "type": "object", - "required": [ - "compose_manifest" - ], - "title": "CvmUpgradePayload" - }, - "CvmUserConfig": { - "properties": { - "hostname": { - "title": "Hostname", - "description": "CVM hostname", - "type": "string", - "nullable": true - }, - "ssh_authorized_keys": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Ssh Authorized Keys", - "description": "SSH public keys injected at launch" - }, - "default_gateway_domain": { - "title": "Default Gateway Domain", - "description": "Default gateway domain", - "type": "string", - "nullable": true - } - }, - "type": "object", - "title": "CvmUserConfig" - }, - "DeviceAuthorizeRequest": { - "properties": { - "user_code": { - "type": "string", - "title": "User Code", - "description": "Verification code from CLI (e.g., XXXX-XXXX)" - }, - "workspace_slug": { - "title": "Workspace Slug", - "description": "Workspace to bind the token to", - "type": "string", - "nullable": true - }, - "totp_code": { - "title": "Totp Code", - "description": "2FA code if user has TOTP enabled", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "user_code" - ], - "title": "DeviceAuthorizeRequest", - "description": "Request body for user approval of a device authorization." - }, - "DeviceCodeRequest": { - "properties": { - "client_id": { - "type": "string", - "title": "Client Id", - "description": "OAuth client identifier", - "default": "phala-cli" - }, - "scope": { - "type": "string", - "title": "Scope", - "description": "Space-separated list of requested permissions", - "default": "user:profile cvms:* nodes:*" - } - }, - "type": "object", - "title": "DeviceCodeRequest", - "description": "Request body for initiating device authorization flow (RFC 8628)." - }, - "DeviceCodeResponse": { - "properties": { - "device_code": { - "type": "string", - "title": "Device Code", - "description": "Opaque code for CLI polling" - }, - "user_code": { - "type": "string", - "title": "User Code", - "description": "Short code user enters in browser (e.g., XXXX-XXXX)" - }, - "verification_uri": { - "type": "string", - "title": "Verification Uri", - "description": "URL where user enters the code" - }, - "verification_uri_complete": { - "type": "string", - "title": "Verification Uri Complete", - "description": "URL with code pre-filled" - }, - "expires_in": { - "type": "integer", - "title": "Expires In", - "description": "Seconds until codes expire" - }, - "interval": { - "type": "integer", - "title": "Interval", - "description": "Minimum polling interval in seconds" - } - }, - "type": "object", - "required": [ - "device_code", - "user_code", - "verification_uri", - "verification_uri_complete", - "expires_in", - "interval" - ], - "title": "DeviceCodeResponse", - "description": "Response containing codes for device authorization flow." - }, - "DeviceTokenRequest": { - "properties": { - "device_code": { - "type": "string", - "title": "Device Code", - "description": "Device code from /device/code response" - }, - "grant_type": { - "type": "string", - "title": "Grant Type", - "description": "OAuth grant type (must be device_code)", - "default": "urn:ietf:params:oauth:grant-type:device_code" - } - }, - "type": "object", - "required": [ - "device_code" - ], - "title": "DeviceTokenRequest", - "description": "Request body for polling device authorization status." - }, - "DeviceTokenResponse": { - "properties": { - "access_token": { - "type": "string", - "title": "Access Token", - "description": "API token for CLI authentication" - }, - "token_type": { - "type": "string", - "title": "Token Type", - "description": "Token type (always 'bearer')", - "default": "bearer" - }, - "expires_in": { - "type": "integer", - "title": "Expires In", - "description": "Token lifetime in seconds (90 days)", - "default": 7776000 - } - }, - "type": "object", - "required": [ - "access_token" - ], - "title": "DeviceTokenResponse", - "description": "Response containing the issued access token." - }, - "DiagnoseDomainsRequest": { - "properties": { - "domains": { - "items": { - "$ref": "#/components/schemas/DomainCheckRequest" - }, - "type": "array", - "title": "Domains", - "description": "List of domain and port pairs to check" - } - }, - "type": "object", - "required": [ - "domains" - ], - "title": "DiagnoseDomainsRequest", - "description": "Request for diagnosing custom domain DNS configuration." - }, - "DiagnosisResponse": { - "properties": { - "results": { - "items": { - "$ref": "#/components/schemas/DomainDiagnosisResult" - }, - "type": "array", - "title": "Results", - "description": "Diagnosis results in request order" - } - }, - "type": "object", - "required": [ - "results" - ], - "title": "DiagnosisResponse", - "description": "Response containing diagnosis results for all requested domains." - }, - "DiskInfo": { - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "mount_point": { - "type": "string", - "title": "Mount Point" - }, - "total_size": { - "type": "integer", - "title": "Total Size" - }, - "free_size": { - "type": "integer", - "title": "Free Size" - } - }, - "type": "object", - "required": [ - "name", - "mount_point", - "total_size", - "free_size" - ], - "title": "DiskInfo" - }, - "DnsRecordResult": { - "properties": { - "record_type": { - "type": "string", - "title": "Record Type", - "description": "Record type: CNAME or TXT" - }, - "query_name": { - "type": "string", - "title": "Query Name", - "description": "Domain name queried" - }, - "expected_value": { - "type": "string", - "title": "Expected Value", - "description": "Expected record value" - }, - "actual_value": { - "title": "Actual Value", - "description": "Actual value found, null if missing", - "type": "string", - "nullable": true - }, - "is_valid": { - "type": "boolean", - "title": "Is Valid", - "description": "True if actual matches expected" - }, - "is_deprecated": { - "type": "boolean", - "title": "Is Deprecated", - "description": "True if this record format is deprecated", - "default": false - }, - "warning_message": { - "title": "Warning Message", - "description": "Deprecation or migration warning", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "record_type", - "query_name", - "expected_value", - "is_valid" - ], - "title": "DnsRecordResult", - "description": "DNS record check result." - }, - "DockerConfig": { - "properties": { - "password": { - "title": "Password", - "default": "", - "type": "string", - "nullable": true - }, - "registry": { - "title": "Registry", - "type": "string", - "nullable": true - }, - "username": { - "title": "Username", - "default": "", - "type": "string", - "nullable": true - } - }, - "type": "object", - "title": "DockerConfig" - }, - "DomainCheckRequest": { - "properties": { - "domain": { - "type": "string", - "title": "Domain", - "description": "Domain name to diagnose (e.g., app.example.com)" - }, - "port": { - "type": "integer", - "title": "Port", - "description": "Port number the domain routes to" - } - }, - "type": "object", - "required": [ - "domain", - "port" - ], - "title": "DomainCheckRequest", - "description": "Single domain check entry." - }, - "DomainDiagnosisResult": { - "properties": { - "domain": { - "type": "string", - "title": "Domain", - "description": "Domain name checked" - }, - "port": { - "type": "integer", - "title": "Port", - "description": "Port number checked" - }, - "records": { - "items": { - "$ref": "#/components/schemas/DnsRecordResult" - }, - "type": "array", - "title": "Records", - "description": "DNS record check results" - }, - "is_valid": { - "type": "boolean", - "title": "Is Valid", - "description": "True if all required records (CNAME, TXT) are correct" - }, - "caa_check": { - "description": "CAA record check (informational only)", - "$ref": "#/components/schemas/CaaCheckResult", - "nullable": true - } - }, - "type": "object", - "required": [ - "domain", - "port", - "records", - "is_valid" - ], - "title": "DomainDiagnosisResult", - "description": "Diagnosis result for a single domain." - }, - "DstackAppMinimalResponse": { - "properties": { - "id": { - "title": "Id", - "nullable": true - }, - "app_id": { - "type": "string", - "title": "App Id" - }, - "name": { - "title": "Name", - "nullable": true - }, - "app_provision_type": { - "title": "App Provision Type", - "nullable": true - }, - "app_icon_url": { - "title": "App Icon Url", - "nullable": true - }, - "created_at": { - "title": "Created At", - "nullable": true - }, - "kms_type": { - "title": "Kms Type", - "nullable": true - }, - "profile": { - "title": "Profile", - "nullable": true - }, - "current_cvm": { - "title": "Current Cvm", - "nullable": true - }, - "cvms": { - "title": "Cvms", - "nullable": true - }, - "cvm_count": { - "title": "Cvm Count", - "nullable": true - } - }, - "type": "object", - "required": [ - "app_id" - ], - "title": "DstackAppMinimalResponse" - }, - "EmailTokenVerificationRequest": { - "properties": { - "token": { - "type": "string", - "title": "Token" - } - }, - "type": "object", - "required": [ - "token" - ], - "title": "EmailTokenVerificationRequest" - }, - "EmailVerificationPayload": { - "properties": { - "email": { - "title": "Email", - "type": "string", - "format": "email", - "nullable": true - }, - "site_key": { - "title": "Site Key", - "type": "string", - "nullable": true - } - }, - "type": "object", - "title": "EmailVerificationPayload", - "description": "Request payload for email verification" - }, - "EventLog": { - "properties": { - "imr": { - "type": "integer", - "title": "Imr" - }, - "event_type": { - "type": "integer", - "title": "Event Type" - }, - "digest": { - "type": "string", - "title": "Digest" - }, - "event": { - "type": "string", - "title": "Event" - }, - "event_payload": { - "type": "string", - "title": "Event Payload" - } - }, - "type": "object", - "required": [ - "imr", - "event_type", - "digest", - "event", - "event_payload" - ], - "title": "EventLog" - }, - "ExtendedContainer": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "names": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Names" - }, - "image": { - "type": "string", - "title": "Image" - }, - "image_id": { - "type": "string", - "title": "Image Id" - }, - "command": { - "title": "Command", - "type": "string", - "nullable": true - }, - "created": { - "type": "integer", - "title": "Created" - }, - "state": { - "type": "string", - "title": "State" - }, - "status": { - "type": "string", - "title": "Status" - }, - "log_endpoint": { - "title": "Log Endpoint", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "id", - "names", - "image", - "image_id", - "created", - "state", - "status" - ], - "title": "ExtendedContainer", - "description": "Extended Container with the public log endpoint if any." - }, - "FilterOptionsResponse": { - "properties": { - "statuses": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Statuses", - "description": "Distinct CVM status values" - }, - "image_versions": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Image Versions", - "description": "Distinct OS image names" - }, - "instance_types": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Instance Types", - "description": "Distinct instance type identifiers" - }, - "kms_slugs": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Kms Slugs", - "description": "Distinct KMS slug values" - }, - "kms_types": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Kms Types", - "description": "Distinct KMS type values" - }, - "regions": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Regions", - "description": "Distinct region identifiers" - }, - "nodes": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Nodes", - "description": "Distinct node names (union of teepod and node names)" - } - }, - "type": "object", - "required": [ - "statuses", - "image_versions", - "instance_types", - "kms_slugs", - "kms_types", - "regions", - "nodes" - ], - "title": "FilterOptionsResponse", - "description": "Available filter values for app list queries." - }, - "GpuAvailability": { - "properties": { - "has_reserved_gpus": { - "type": "boolean", - "title": "Has Reserved Gpus", - "description": "Whether team has reserved GPU access", - "default": false - }, - "reserved_gpu_count": { - "type": "integer", - "title": "Reserved Gpu Count", - "description": "Number of reserved GPUs available to use", - "default": 0 - }, - "has_public_gpus": { - "type": "boolean", - "title": "Has Public Gpus", - "description": "Whether there are public GPUs available", - "default": false - }, - "public_gpu_count": { - "type": "integer", - "title": "Public Gpu Count", - "description": "Number of public GPUs available", - "default": 0 - } - }, - "type": "object", - "title": "GpuAvailability", - "description": "GPU availability information for the current team" - }, - "GpuConfig": { - "properties": { - "gpus": { - "items": { - "$ref": "#/components/schemas/GpuSpec" - }, - "type": "array", - "title": "Gpus" - }, - "attach_mode": { - "anyOf": [ - { - "type": "string", - "enum": [ - "listed", - "all" - ] - }, - { - "type": "string" - } - ], - "title": "Attach Mode", - "default": "listed" - } - }, - "type": "object", - "required": [ - "gpus" - ], - "title": "GpuConfig" - }, - "GpuSpec": { - "properties": { - "slot": { - "type": "string", - "title": "Slot" - }, - "product_id": { - "title": "Product Id", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "slot" - ], - "title": "GpuSpec" - }, - "HTTPValidationError": { - "properties": { - "detail": { - "items": { - "$ref": "#/components/schemas/ValidationError" - }, - "type": "array", - "title": "Detail" - } - }, - "type": "object", - "title": "HTTPValidationError" - }, - "HostedCvm": { - "properties": { - "hosted": { - "$ref": "#/components/schemas/VmInfo" - }, - "name": { - "type": "string", - "title": "Name" - }, - "managed_user": { - "$ref": "#/components/schemas/ManagedUser", - "nullable": true - }, - "node": { - "$ref": "#/components/schemas/CvmNode", - "nullable": true - }, - "listed": { - "type": "boolean", - "title": "Listed", - "default": false - }, - "status": { - "type": "string", - "title": "Status" - }, - "in_progress": { - "type": "boolean", - "title": "In Progress", - "default": false - }, - "dapp_dashboard_url": { - "title": "Dapp Dashboard Url", - "type": "string", - "nullable": true - }, - "syslog_endpoint": { - "title": "Syslog Endpoint", - "type": "string", - "nullable": true - }, - "allow_upgrade": { - "type": "boolean", - "title": "Allow Upgrade", - "default": false - }, - "project_id": { - "title": "HashedId[projects]", - "type": "string", - "pattern": "^prj_.+", - "format": "hashid", - "description": "A hashed identifier that maps to an internal database ID", - "examples": [ - "prj_0123abcd" - ], - "nullable": true - }, - "project_type": { - "title": "Project Type", - "type": "string", - "nullable": true - }, - "billing_period": { - "title": "Billing Period", - "type": "string", - "nullable": true - }, - "kms_info": { - "$ref": "#/components/schemas/KMSInfo", - "nullable": true - }, - "contract_address": { - "title": "Contract Address", - "type": "string", - "nullable": true - }, - "deployer_address": { - "title": "Deployer Address", - "type": "string", - "nullable": true - }, - "vcpu": { - "title": "Vcpu", - "type": "integer", - "nullable": true - }, - "memory": { - "title": "Memory", - "type": "integer", - "nullable": true - }, - "disk_size": { - "title": "Disk Size", - "type": "integer", - "nullable": true - }, - "gateway_domain": { - "title": "Gateway Domain", - "type": "string", - "nullable": true - }, - "public_urls": { - "items": { - "$ref": "#/components/schemas/CvmNetworkUrls" - }, - "type": "array", - "title": "Public Urls" - } - }, - "type": "object", - "required": [ - "hosted", - "name", - "status", - "public_urls" - ], - "title": "HostedCvm" - }, - "InstanceEventResponse": { - "properties": { - "message_id": { - "type": "string", - "title": "Message Id", - "description": "Unique event identifier" - }, - "correlation_id": { - "title": "Correlation Id", - "description": "Request correlation ID", - "type": "string", - "nullable": true - }, - "event_type": { - "type": "string", - "title": "Event Type", - "description": "Event type: created, started, stopped, etc." - }, - "operation_type": { - "title": "Operation Type", - "description": "Operation that triggered the event", - "type": "string", - "nullable": true - }, - "target_state": { - "title": "Target State", - "description": "Intended state after operation", - "type": "string", - "nullable": true - }, - "operation_payload": { - "title": "Operation Payload", - "description": "JSON operation parameters", - "type": "string", - "nullable": true - }, - "triggered_by": { - "title": "Triggered By", - "description": "User ID who triggered the event", - "type": "integer", - "nullable": true - }, - "instance_id": { - "type": "string", - "title": "Instance Id", - "description": "CVM instance UUID" - }, - "timestamp": { - "type": "string", - "title": "Timestamp", - "description": "Event timestamp (ISO 8601)" - }, - "priority": { - "title": "Priority", - "description": "Event priority level", - "type": "string", - "nullable": true - }, - "instance_name": { - "title": "Instance Name", - "description": "CVM display name", - "type": "string", - "nullable": true - }, - "state": { - "title": "State", - "description": "CVM state at event time", - "type": "string", - "nullable": true - }, - "instance_type": { - "title": "Instance Type", - "description": "Instance type identifier", - "type": "string", - "nullable": true - }, - "project_id": { - "title": "Project Id", - "description": "Project database ID", - "type": "integer", - "nullable": true - }, - "team_id": { - "title": "Team Id", - "description": "Team database ID", - "type": "integer", - "nullable": true - }, - "user_id": { - "title": "User Id", - "description": "Owner user ID", - "type": "integer", - "nullable": true - } - }, - "type": "object", - "required": [ - "message_id", - "correlation_id", - "event_type", - "operation_type", - "target_state", - "operation_payload", - "triggered_by", - "instance_id", - "timestamp", - "priority", - "instance_name", - "state", - "instance_type", - "project_id", - "team_id", - "user_id" - ], - "title": "InstanceEventResponse", - "description": "CVM instance lifecycle event." - }, - "InstanceIdRefreshRequest": { - "properties": { - "overwrite": { - "type": "boolean", - "title": "Overwrite", - "description": "Overwrite existing instance_id when different", - "default": false - }, - "dry_run": { - "type": "boolean", - "title": "Dry Run", - "description": "Preview changes without persisting", - "default": false - } - }, - "type": "object", - "title": "InstanceIdRefreshRequest" - }, - "InstanceIdRefreshResult": { - "properties": { - "cvm_id": { - "type": "integer", - "title": "Cvm Id" - }, - "identifier": { - "type": "string", - "title": "Identifier" - }, - "status": { - "type": "string", - "enum": [ - "updated", - "unchanged", - "skipped", - "conflict", - "error" - ], - "title": "Status" - }, - "old_instance_id": { - "title": "Old Instance Id", - "type": "string", - "nullable": true - }, - "new_instance_id": { - "title": "New Instance Id", - "type": "string", - "nullable": true - }, - "source": { - "type": "string", - "enum": [ - "teepod_state", - "teepod_info", - "gateway", - "none" - ], - "title": "Source", - "default": "none" - }, - "verified_with_gateway": { - "type": "boolean", - "title": "Verified With Gateway", - "default": false - }, - "reason": { - "title": "Reason", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "cvm_id", - "identifier", - "status" - ], - "title": "InstanceIdRefreshResult" - }, - "KMSInfo": { - "properties": { - "id": { - "type": "string", - "pattern": "^kms_.+", - "format": "hashid", - "title": "HashedId[kms]", - "description": "Hashed KMS identifier (kms_xxxxx)", - "examples": [ - "kms_0123abcd" - ] - }, - "slug": { - "title": "Slug", - "description": "Human-readable KMS name", - "type": "string", - "nullable": true - }, - "url": { - "type": "string", - "title": "Url", - "description": "KMS endpoint URL" - }, - "version": { - "type": "string", - "title": "Version", - "description": "KMS software version" - }, - "chain_id": { - "title": "Chain Id", - "description": "Blockchain chain ID if onchain", - "type": "integer", - "nullable": true - }, - "kms_contract_address": { - "title": "Kms Contract Address", - "description": "Smart contract address if onchain", - "type": "string", - "nullable": true - }, - "gateway_app_id": { - "title": "Gateway App Id", - "description": "Gateway application ID", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "id", - "url", - "version" - ], - "title": "KMSInfo", - "description": "KMS instance information." - }, - "KmsListResponse": { - "properties": { - "items": { - "items": { - "$ref": "#/components/schemas/KMSInfo" - }, - "type": "array", - "title": "Items" - }, - "total": { - "type": "integer", - "title": "Total" - }, - "page": { - "type": "integer", - "title": "Page" - }, - "page_size": { - "type": "integer", - "title": "Page Size" - }, - "pages": { - "type": "integer", - "title": "Pages" - } - }, - "type": "object", - "required": [ - "items", - "total", - "page", - "page_size", - "pages" - ], - "title": "KmsListResponse", - "description": "Paginated KMS list response." - }, - "KmsType": { - "type": "string", - "enum": [ - "phala", - "ethereum", - "base", - "legacy" - ], - "title": "KmsType" - }, - "KmsWithSupportedOSImage": { - "properties": { - "id": { - "type": "string", - "pattern": "^kms_.+", - "format": "hashid", - "title": "HashedId[kms]", - "description": "Hashed KMS identifier (kms_xxxxx)", - "examples": [ - "kms_0123abcd" - ] - }, - "slug": { - "title": "Slug", - "description": "Human-readable KMS name", - "type": "string", - "nullable": true - }, - "url": { - "type": "string", - "title": "Url", - "description": "KMS endpoint URL" - }, - "version": { - "type": "string", - "title": "Version", - "description": "KMS software version" - }, - "chain_id": { - "title": "Chain Id", - "description": "Blockchain chain ID if onchain", - "type": "integer", - "nullable": true - }, - "kms_contract_address": { - "title": "Kms Contract Address", - "description": "Smart contract address if onchain", - "type": "string", - "nullable": true - }, - "gateway_app_id": { - "title": "Gateway App Id", - "description": "Gateway application ID", - "type": "string", - "nullable": true - }, - "supported_os_images": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Supported Os Images" - } - }, - "type": "object", - "required": [ - "id", - "url", - "version" - ], - "title": "KmsWithSupportedOSImage" - }, - "LoginRequest": { - "properties": { - "username": { - "type": "string", - "title": "Username" - }, - "password": { - "type": "string", - "title": "Password" - }, - "totp_code": { - "title": "Totp Code", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "username", - "password" - ], - "title": "LoginRequest" - }, - "MachineInfo": { - "properties": { - "vcpu": { - "type": "integer", - "title": "Vcpu", - "description": "Virtual CPU count" - }, - "memory": { - "type": "integer", - "title": "Memory", - "description": "Memory in MB" - }, - "disk_size": { - "type": "integer", - "title": "Disk Size", - "description": "Disk size in GB" - }, - "gpu_count": { - "type": "integer", - "title": "Gpu Count", - "description": "GPU count (0 if none)" - } - }, - "type": "object", - "required": [ - "vcpu", - "memory", - "disk_size", - "gpu_count" - ], - "title": "MachineInfo", - "description": "CVM hardware configuration." - }, - "ManagedUser": { - "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "username": { - "type": "string", - "title": "Username" - } - }, - "type": "object", - "required": [ - "id", - "username" - ], - "title": "ManagedUser" - }, - "MeteredUsageResponse": { - "properties": { - "instance_id": { - "type": "string", - "title": "Instance Id", - "description": "CVM instance UUID" - }, - "project_id": { - "type": "integer", - "title": "Project Id", - "description": "Project database ID" - }, - "team_id": { - "type": "integer", - "title": "Team Id", - "description": "Team database ID" - }, - "timestamp": { - "type": "string", - "title": "Timestamp", - "description": "Record timestamp (ISO 8601)" - }, - "event_type": { - "type": "string", - "title": "Event Type", - "description": "Usage event type" - }, - "cost": { - "type": "number", - "title": "Cost", - "description": "Cost in USD" - }, - "details": { - "title": "Details", - "description": "JSON usage details", - "type": "string", - "nullable": true - }, - "usage_type": { - "type": "string", - "title": "Usage Type", - "description": "Billing category: compute, storage, etc." - }, - "billing_start": { - "type": "string", - "title": "Billing Start", - "description": "Billing period start (date)" - }, - "billing_end": { - "type": "string", - "title": "Billing End", - "description": "Billing period end (date)" - }, - "duration_minutes": { - "type": "number", - "title": "Duration Minutes", - "description": "Usage duration in minutes" - }, - "billing_key": { - "type": "string", - "title": "Billing Key", - "description": "Unique billing record key" - }, - "billing_hour": { - "type": "string", - "title": "Billing Hour", - "description": "Billing hour bucket" - }, - "billing_day": { - "type": "string", - "title": "Billing Day", - "description": "Billing day bucket" - } - }, - "type": "object", - "required": [ - "instance_id", - "project_id", - "team_id", - "timestamp", - "event_type", - "cost", - "details", - "usage_type", - "billing_start", - "billing_end", - "duration_minutes", - "billing_key", - "billing_hour", - "billing_day" - ], - "title": "MeteredUsageResponse", - "description": "Single metered usage record." - }, - "NodeRef": { - "properties": { - "object_type": { - "type": "string", - "const": "node", - "title": "Object Type", - "description": "Fixed value 'node'", - "default": "node" - }, - "id": { - "title": "Id", - "description": "Teepod numeric ID", - "type": "integer", - "nullable": true - }, - "name": { - "title": "Name", - "description": "Node display name", - "type": "string", - "nullable": true - }, - "region": { - "title": "Region", - "description": "Region identifier", - "type": "string", - "nullable": true - }, - "device_id": { - "title": "Device Id", - "description": "Device ID", - "type": "string", - "nullable": true - }, - "ppid": { - "title": "Ppid", - "description": "PPID", - "type": "string", - "nullable": true - }, - "status": { - "description": "Node status", - "$ref": "#/components/schemas/TeepodStatus", - "nullable": true - }, - "version": { - "title": "Version", - "description": "Teepod version", - "type": "string", - "nullable": true - } - }, - "type": "object", - "title": "NodeRef", - "description": "Minimal node/teepod reference for embedding in responses." - }, - "OSImageVariant": { - "properties": { - "name": { - "type": "string", - "title": "Name", - "description": "Human-readable image name (e.g. dstack-0.5.5)" - }, - "slug": { - "type": "string", - "title": "Slug", - "description": "Unique identifier for API calls (e.g. dstack-0.5.5-e18f5407)" - }, - "os_image_hash": { - "title": "Os Image Hash", - "description": "SHA256 hash of the OS image", - "type": "string", - "nullable": true - }, - "is_current": { - "type": "boolean", - "title": "Is Current", - "description": "True if this is the currently running image", - "default": false - } - }, - "type": "object", - "required": [ - "name", - "slug" - ], - "title": "OSImageVariant", - "description": "Single OS image variant (production or development build)." - }, - "OperationEventDetail": { - "properties": { - "event_type": { - "type": "string", - "title": "Event Type", - "description": "Event type identifier (e.g. instance.power_on.start)" - }, - "timestamp": { - "type": "string", - "format": "date-time", - "title": "Timestamp", - "description": "UTC timestamp when event occurred" - }, - "state": { - "type": "string", - "title": "State", - "description": "CVM state at event time (e.g. running, stopped)" - } - }, - "type": "object", - "required": [ - "event_type", - "timestamp", - "state" - ], - "title": "OperationEventDetail", - "description": "Single atomic event within an operation." - }, - "PaginatedCvmInfos": { - "properties": { - "items": { - "items": { - "$ref": "#/components/schemas/CVMInfo" - }, - "type": "array", - "title": "Items" - }, - "total": { - "type": "integer", - "title": "Total" - }, - "page": { - "type": "integer", - "title": "Page" - }, - "page_size": { - "type": "integer", - "title": "Page Size" - }, - "pages": { - "type": "integer", - "title": "Pages" - } - }, - "type": "object", - "required": [ - "items", - "total", - "page", - "page_size", - "pages" - ], - "title": "PaginatedCvmInfos" - }, - "PaginatedCvmOperationsResponse": { - "properties": { - "items": { - "items": { - "$ref": "#/components/schemas/CvmOperationResponse" - }, - "type": "array", - "title": "Items", - "description": "Operations ordered by started_at DESC" - }, - "next_cursor": { - "title": "Next Cursor", - "description": "Opaque cursor for next page, null if last page", - "type": "string", - "nullable": true - }, - "total": { - "type": "integer", - "title": "Total", - "description": "Approximate total count (not exact for performance)" - } - }, - "type": "object", - "required": [ - "items", - "total" - ], - "title": "PaginatedCvmOperationsResponse", - "description": "Cursor-paginated list of CVM operations." - }, - "PaginatedHostedCvms": { - "properties": { - "items": { - "items": { - "$ref": "#/components/schemas/HostedCvm" - }, - "type": "array", - "title": "Items" - }, - "total": { - "type": "integer", - "title": "Total" - }, - "page": { - "type": "integer", - "title": "Page" - }, - "page_size": { - "type": "integer", - "title": "Page Size" - }, - "pages": { - "type": "integer", - "title": "Pages" - } - }, - "type": "object", - "required": [ - "items", - "total", - "page", - "page_size", - "pages" - ], - "title": "PaginatedHostedCvms", - "description": "Paginated response for CVM list endpoints" - }, - "PasswordResetRequest": { - "properties": { - "email": { - "type": "string", - "format": "email", - "title": "Email" - }, - "site_key": { - "title": "Site Key", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "email" - ], - "title": "PasswordResetRequest" - }, - "PortMapping": { - "properties": { - "protocol": { - "type": "string", - "title": "Protocol" - }, - "host_port": { - "type": "integer", - "title": "Host Port" - }, - "vm_port": { - "type": "integer", - "title": "Vm Port" - }, - "host_address": { - "title": "Host Address", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "protocol", - "host_port", - "vm_port" - ], - "title": "PortMapping" - }, - "ProfileGetResponse": { - "properties": { - "display_name": { - "title": "Display Name", - "type": "string", - "nullable": true - }, - "avatar_url": { - "title": "Avatar Url", - "type": "string", - "nullable": true - }, - "description": { - "title": "Description", - "type": "string", - "nullable": true - }, - "custom_domain": { - "title": "Custom Domain", - "type": "string", - "nullable": true - } - }, - "type": "object", - "title": "ProfileGetResponse", - "description": "Response model for entity profile - only public display data." - }, - "ProvisionComposeFileUpdateRequest": { - "properties": { - "allowed_envs": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Allowed Envs" - }, - "bash_script": { - "title": "Bash Script", - "type": "string", - "nullable": true - }, - "default_gateway_domain": { - "title": "Default Gateway Domain", - "type": "string", - "nullable": true - }, - "docker_compose_file": { - "title": "Docker Compose File", - "type": "string", - "nullable": true - }, - "init_script": { - "title": "Init Script", - "type": "string", - "nullable": true - }, - "kms_enabled": { - "type": "boolean", - "title": "Kms Enabled", - "default": true - }, - "local_key_provider_enabled": { - "type": "boolean", - "title": "Local Key Provider Enabled", - "default": false - }, - "manifest_version": { - "type": "integer", - "title": "Manifest Version", - "default": 2 - }, - "name": { - "type": "string", - "title": "Name" - }, - "no_instance_id": { - "type": "boolean", - "title": "No Instance Id", - "default": false - }, - "pre_launch_script": { - "title": "Pre Launch Script", - "type": "string", - "nullable": true - }, - "public_logs": { - "type": "boolean", - "title": "Public Logs", - "default": true - }, - "public_sysinfo": { - "type": "boolean", - "title": "Public Sysinfo", - "default": true - }, - "public_tcbinfo": { - "type": "boolean", - "title": "Public Tcbinfo", - "default": true - }, - "runner": { - "type": "string", - "title": "Runner", - "default": "docker-compose" - }, - "gateway_enabled": { - "type": "boolean", - "title": "Gateway Enabled", - "default": true - }, - "features": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Features", - "default": [ - "kms", - "tproxy-net" - ] - }, - "salt": { - "title": "Salt", - "type": "string", - "nullable": true - }, - "secure_time": { - "type": "boolean", - "title": "Secure Time", - "default": false - }, - "storage_fs": { - "anyOf": [ - { - "type": "string", - "const": "ext4" - }, - { - "type": "string", - "const": "zfs" - } - ], - "title": "Storage Fs", - "default": "zfs", - "nullable": true - }, - "tproxy_enabled": { - "type": "boolean", - "title": "Tproxy Enabled", - "default": true - }, - "update_env_vars": { - "title": "Update Env Vars", - "description": "Whether to also update allowed_envs", - "default": false, - "type": "boolean", - "nullable": true - } - }, - "type": "object", - "required": [ - "name" - ], - "title": "ProvisionComposeFileUpdateRequest", - "description": "Request model for provisioning compose file updates." - }, - "ProvisionDstackAppRequestV2": { - "properties": { - "compose_file": { - "$ref": "#/components/schemas/AppComposeV2" - }, - "name": { - "type": "string", - "title": "Name", - "description": "CVM name (used as hostname): 5-63 chars, must start with letter, can contain letters/numbers/hyphens" - }, - "instance_type": { - "title": "Instance Type", - "type": "string", - "nullable": true - }, - "vcpu": { - "title": "Vcpu", - "type": "integer", - "nullable": true - }, - "memory": { - "title": "Memory", - "type": "integer", - "nullable": true - }, - "disk_size": { - "title": "Disk Size", - "type": "integer", - "nullable": true - }, - "image": { - "title": "Image", - "type": "string", - "nullable": true - }, - "prefer_dev": { - "title": "Prefer Dev", - "description": "Prefer dev OS image (True) or non-dev OS image (False). When None, auto-selects based on image name or defaults to dev.", - "type": "boolean", - "nullable": true - }, - "teepod_id": { - "title": "Teepod Id", - "type": "integer", - "nullable": true - }, - "region": { - "title": "Region", - "type": "string", - "nullable": true - }, - "listed": { - "type": "boolean", - "title": "Listed", - "default": true - }, - "kms_id": { - "title": "Kms Id", - "type": "string", - "nullable": true - }, - "kms": { - "default": "phala", - "$ref": "#/components/schemas/KmsType", - "nullable": true - }, - "nonce": { - "title": "Nonce", - "description": "Optional nonce for deterministic app_id generation. When provided, app_id must also be provided. System will verify: app_id == get_create_address(team_wallet, nonce)", - "type": "integer", - "nullable": true - }, - "app_id": { - "title": "App Id", - "description": "Optional app_id for manual specification. Required when nonce is provided. Only works with PHALA KMS.", - "type": "string", - "nullable": true - }, - "env_keys": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Env Keys" - }, - "ports": { - "title": "Ports", - "items": { - "$ref": "#/components/schemas/PortMapping" - }, - "type": "array", - "nullable": true - }, - "encrypted_env": { - "title": "Encrypted Env", - "type": "string", - "nullable": true - }, - "user_config": { - "title": "User Config", - "type": "string", - "nullable": true - }, - "hugepages": { - "type": "boolean", - "title": "Hugepages", - "default": false - }, - "pin_numa": { - "type": "boolean", - "title": "Pin Numa", - "default": false - }, - "gpus": { - "$ref": "#/components/schemas/GpuConfig", - "nullable": true - }, - "kms_urls": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Kms Urls" - }, - "gateway_urls": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Gateway Urls" - }, - "experimental_vpc_server_app_id": { - "title": "Experimental Vpc Server App Id", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "compose_file", - "name" - ], - "title": "ProvisionDstackAppRequestV2", - "description": "Request for provisioning a DStack app with automatic resource matching.\n\nMost fields are optional and will be automatically determined by the resource\nmatching logic in preflight_dstack_app. Only compose_file and name are required." - }, - "ProvisionElizaRequest": { - "properties": { - "name": { - "type": "string", - "title": "Name", - "description": "The name of the tapp." - }, - "characterfile": { - "type": "string", - "title": "Characterfile", - "description": "The characterfile to use for the a16z/eliza." - }, - "env_keys": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Env Keys", - "description": "The environment variables to use for the a16z/eliza." - }, - "teepod_id": { - "title": "Teepod Id", - "description": "The Teepod ID to use for the a16z/eliza. If not provided, it will auto select an available one.", - "type": "integer", - "nullable": true - }, - "image": { - "title": "Image", - "description": "The image to use for the a16z/eliza. If not provided, it will use the latest image.", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "name", - "characterfile", - "env_keys" - ], - "title": "ProvisionElizaRequest" - }, - "PublicCVM": { - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "status": { - "type": "string", - "title": "Status" - }, - "app_id": { - "type": "string", - "title": "App Id" - }, - "vm_uuid": { - "title": "Vm Uuid", - "type": "string", - "nullable": true - }, - "instance_id": { - "title": "Instance Id", - "type": "string", - "nullable": true - }, - "base_image": { - "title": "Base Image", - "readOnly": true, - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "name", - "status", - "app_id", - "base_image" - ], - "title": "PublicCVM" - }, - "Quote": { - "properties": { - "header": { - "$ref": "#/components/schemas/QuoteHeader" - }, - "cert_data": { - "title": "Cert Data", - "type": "string", - "nullable": true - }, - "body": { - "$ref": "#/components/schemas/QuoteBody" - }, - "verified": { - "title": "Verified", - "default": false, - "type": "boolean", - "nullable": true - } - }, - "type": "object", - "required": [ - "header", - "cert_data", - "body" - ], - "title": "Quote" - }, - "QuoteBody": { - "properties": { - "tee_tcb_svn": { - "type": "string", - "title": "Tee Tcb Svn" - }, - "mrseam": { - "type": "string", - "format": "binary", - "title": "Mrseam" - }, - "mrsignerseam": { - "type": "string", - "format": "binary", - "title": "Mrsignerseam" - }, - "seamattributes": { - "type": "string", - "format": "binary", - "title": "Seamattributes" - }, - "tdattributes": { - "type": "string", - "format": "binary", - "title": "Tdattributes" - }, - "xfam": { - "type": "string", - "format": "binary", - "title": "Xfam" - }, - "mrtd": { - "type": "string", - "format": "binary", - "title": "Mrtd" - }, - "mrconfig": { - "type": "string", - "format": "binary", - "title": "Mrconfig" - }, - "mrowner": { - "type": "string", - "format": "binary", - "title": "Mrowner" - }, - "mrownerconfig": { - "type": "string", - "format": "binary", - "title": "Mrownerconfig" - }, - "rtmr0": { - "type": "string", - "format": "binary", - "title": "Rtmr0" - }, - "rtmr1": { - "type": "string", - "format": "binary", - "title": "Rtmr1" - }, - "rtmr2": { - "type": "string", - "format": "binary", - "title": "Rtmr2" - }, - "rtmr3": { - "type": "string", - "format": "binary", - "title": "Rtmr3" - }, - "reportdata": { - "type": "string", - "format": "binary", - "title": "Reportdata" - } - }, - "type": "object", - "required": [ - "tee_tcb_svn", - "mrseam", - "mrsignerseam", - "seamattributes", - "tdattributes", - "xfam", - "mrtd", - "mrconfig", - "mrowner", - "mrownerconfig", - "rtmr0", - "rtmr1", - "rtmr2", - "rtmr3", - "reportdata" - ], - "title": "QuoteBody" - }, - "QuoteCollateralV3": { - "properties": { - "pck_crl_issuer_chain": { - "type": "string", - "title": "Pck Crl Issuer Chain" - }, - "root_ca_crl": { - "title": "Root Ca Crl", - "type": "string", - "nullable": true - }, - "pck_crl": { - "type": "string", - "title": "Pck Crl" - }, - "tcb_info_issuer_chain": { - "type": "string", - "title": "Tcb Info Issuer Chain" - }, - "tcb_info": { - "type": "string", - "title": "Tcb Info" - }, - "tcb_info_signature": { - "type": "string", - "title": "Tcb Info Signature" - }, - "qe_identity_issuer_chain": { - "type": "string", - "title": "Qe Identity Issuer Chain" - }, - "qe_identity": { - "type": "string", - "title": "Qe Identity" - }, - "qe_identity_signature": { - "type": "string", - "title": "Qe Identity Signature" - } - }, - "type": "object", - "required": [ - "pck_crl_issuer_chain", - "root_ca_crl", - "pck_crl", - "tcb_info_issuer_chain", - "tcb_info", - "tcb_info_signature", - "qe_identity_issuer_chain", - "qe_identity", - "qe_identity_signature" - ], - "title": "QuoteCollateralV3" - }, - "QuoteHeader": { - "properties": { - "version": { - "type": "integer", - "title": "Version" - }, - "ak_type": { - "$ref": "#/components/schemas/AttestationKeyType" - }, - "tee_type": { - "$ref": "#/components/schemas/TeeType" - }, - "qe_vendor": { - "type": "string", - "format": "binary", - "title": "Qe Vendor" - }, - "user_data": { - "type": "string", - "format": "binary", - "title": "User Data" - } - }, - "type": "object", - "required": [ - "version", - "ak_type", - "tee_type", - "qe_vendor", - "user_data" - ], - "title": "QuoteHeader" - }, - "RedeployRevisionRequest": { - "properties": { - "vm_uuids": { - "title": "Vm Uuids", - "items": { - "type": "string" - }, - "type": "array", - "nullable": true - } - }, - "type": "object", - "title": "RedeployRevisionRequest" - }, - "RedpillApiKeyCreate": { - "properties": { - "name": { - "title": "Name", - "description": "Display name for the API key", - "default": "Redpill API Key", - "type": "string", - "nullable": true - } - }, - "type": "object", - "title": "RedpillApiKeyCreate", - "description": "Request body for creating a Redpill API key." - }, - "RegisterPayload": { - "properties": { - "username": { - "type": "string", - "title": "Username" - }, - "email": { - "type": "string", - "format": "email", - "title": "Email" - }, - "password": { - "type": "string", - "title": "Password" - }, - "invite_code": { - "title": "Invite Code", - "type": "string", - "nullable": true - }, - "site_key": { - "title": "Site Key", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "username", - "email", - "password" - ], - "title": "RegisterPayload" - }, - "ResetPasswordWithToken": { - "properties": { - "token": { - "type": "string", - "title": "Token" - }, - "password": { - "type": "string", - "title": "Password" - }, - "site_key": { - "title": "Site Key", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "token", - "password" - ], - "title": "ResetPasswordWithToken", - "description": "Request model for resetting password with token." - }, - "ResourceThreshold": { - "properties": { - "max_instances": { - "title": "Max Instances", - "type": "integer", - "nullable": true - }, - "max_vcpu": { - "title": "Max Vcpu", - "type": "integer", - "nullable": true - }, - "max_memory": { - "title": "Max Memory", - "type": "integer", - "nullable": true - }, - "max_disk": { - "title": "Max Disk", - "type": "integer", - "nullable": true - }, - "max_memory_each": { - "title": "Max Memory Each", - "type": "integer", - "nullable": true - }, - "max_disk_each": { - "title": "Max Disk Each", - "type": "integer", - "nullable": true - } - }, - "type": "object", - "required": [ - "max_instances", - "max_vcpu", - "max_memory", - "max_disk" - ], - "title": "ResourceThreshold", - "description": "Resource threshold for VM creation." - }, - "SessionResponse": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "jti": { - "type": "string", - "title": "Jti" - }, - "user_agent": { - "title": "User Agent", - "type": "string", - "nullable": true - }, - "device_info": { - "title": "Device Info", - "type": "string", - "nullable": true - }, - "created_at": { - "type": "string", - "format": "date-time", - "title": "Created At" - }, - "last_seen_at": { - "type": "string", - "format": "date-time", - "title": "Last Seen At" - }, - "is_current": { - "type": "boolean", - "title": "Is Current" - }, - "revoked": { - "type": "boolean", - "title": "Revoked" - }, - "revoked_at": { - "title": "Revoked At", - "type": "string", - "format": "date-time", - "nullable": true - }, - "device_kind": { - "type": "string", - "enum": [ - "Mobile", - "Desktop", - "Unknown" - ], - "title": "Device Kind", - "description": "Get device kind (Mobile/Desktop) based on user agent.", - "readOnly": true - }, - "device_os": { - "type": "string", - "title": "Device Os", - "description": "Expose detected operating system as a computed field.", - "readOnly": true - }, - "device_label": { - "type": "string", - "title": "Device Label", - "description": "Generate a user-friendly device label, including OS.", - "readOnly": true - } - }, - "type": "object", - "required": [ - "id", - "jti", - "created_at", - "last_seen_at", - "is_current", - "revoked", - "device_kind", - "device_os", - "device_label" - ], - "title": "SessionResponse", - "description": "API response model for user sessions with sanitized device info." - }, - "SessionsListResponse": { - "properties": { - "sessions": { - "items": { - "$ref": "#/components/schemas/SessionResponse" - }, - "type": "array", - "title": "Sessions" - }, - "total": { - "type": "integer", - "title": "Total" - } - }, - "type": "object", - "required": [ - "sessions", - "total" - ], - "title": "SessionsListResponse", - "description": "Response for listing user sessions." - }, - "StepUpVerifyRequest": { - "properties": { - "current_password": { - "title": "Current Password", - "type": "string", - "nullable": true - }, - "totp_code": { - "title": "Totp Code", - "type": "string", - "nullable": true - } - }, - "type": "object", - "title": "StepUpVerifyRequest", - "description": "Generic step-up verification request.\n\nAccepts either current_password (for users without 2FA) or totp_code (for users with 2FA).\nOn success, server will issue a short-lived cookie used by sensitive endpoints." - }, - "SystemInfo": { - "properties": { - "os_name": { - "type": "string", - "title": "Os Name" - }, - "os_version": { - "type": "string", - "title": "Os Version" - }, - "kernel_version": { - "type": "string", - "title": "Kernel Version" - }, - "cpu_model": { - "type": "string", - "title": "Cpu Model" - }, - "num_cpus": { - "type": "integer", - "title": "Num Cpus" - }, - "total_memory": { - "type": "integer", - "title": "Total Memory" - }, - "available_memory": { - "type": "integer", - "title": "Available Memory" - }, - "used_memory": { - "type": "integer", - "title": "Used Memory" - }, - "free_memory": { - "type": "integer", - "title": "Free Memory" - }, - "total_swap": { - "type": "integer", - "title": "Total Swap" - }, - "used_swap": { - "type": "integer", - "title": "Used Swap" - }, - "free_swap": { - "type": "integer", - "title": "Free Swap" - }, - "uptime": { - "type": "integer", - "title": "Uptime" - }, - "loadavg_one": { - "type": "integer", - "title": "Loadavg One" - }, - "loadavg_five": { - "type": "integer", - "title": "Loadavg Five" - }, - "loadavg_fifteen": { - "type": "integer", - "title": "Loadavg Fifteen" - }, - "disks": { - "items": { - "$ref": "#/components/schemas/DiskInfo" - }, - "type": "array", - "title": "Disks" - } - }, - "type": "object", - "required": [ - "os_name", - "os_version", - "kernel_version", - "cpu_model", - "num_cpus", - "total_memory", - "available_memory", - "used_memory", - "free_memory", - "total_swap", - "used_swap", - "free_swap", - "uptime", - "loadavg_one", - "loadavg_five", - "loadavg_fifteen", - "disks" - ], - "title": "SystemInfo" - }, - "TcbInfo": { - "properties": { - "mrtd": { - "type": "string", - "title": "Mrtd" - }, - "rootfs_hash": { - "title": "Rootfs Hash", - "type": "string", - "nullable": true - }, - "rtmr0": { - "type": "string", - "title": "Rtmr0" - }, - "rtmr1": { - "type": "string", - "title": "Rtmr1" - }, - "rtmr2": { - "type": "string", - "title": "Rtmr2" - }, - "rtmr3": { - "type": "string", - "title": "Rtmr3" - }, - "event_log": { - "items": { - "$ref": "#/components/schemas/EventLog" - }, - "type": "array", - "title": "Event Log" - }, - "app_compose": { - "type": "string", - "title": "App Compose" - } - }, - "type": "object", - "required": [ - "mrtd", - "rtmr0", - "rtmr1", - "rtmr2", - "rtmr3", - "event_log", - "app_compose" - ], - "title": "TcbInfo" - }, - "TeamTier": { - "type": "string", - "enum": [ - "PRO", - "ENTERPRISE", - "LEVEL_1", - "LEVEL_2" - ], - "title": "TeamTier" - }, - "TeeType": { - "type": "integer", - "enum": [ - 0, - 129 - ], - "title": "TeeType", - "description": "TEE type values used by Intel DCAP quote header." - }, - "Teepod": { - "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "name": { - "type": "string", - "title": "Name" - }, - "endpoint": { - "type": "string", - "title": "Endpoint" - }, - "kms_url": { - "type": "string", - "title": "Kms Url" - }, - "kms_version": { - "title": "Kms Version", - "type": "string", - "nullable": true - }, - "tproxy_url": { - "type": "string", - "title": "Tproxy Url" - }, - "tproxy_base_domain": { - "title": "Tproxy Base Domain", - "type": "string", - "nullable": true - }, - "tproxy_port": { - "title": "Tproxy Port", - "type": "integer", - "nullable": true - }, - "tproxy_tappd_port": { - "title": "Tproxy Tappd Port", - "type": "integer", - "nullable": true - }, - "teepod_version": { - "title": "Teepod Version", - "type": "string", - "nullable": true - }, - "status": { - "$ref": "#/components/schemas/TeepodStatus" - }, - "enabled": { - "type": "boolean", - "title": "Enabled" - }, - "last_ping_at": { - "title": "Last Ping At", - "type": "string", - "format": "date-time", - "nullable": true - }, - "created_at": { - "type": "string", - "format": "date-time", - "title": "Created At" - }, - "region_identifier": { - "title": "Region Identifier", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "id", - "name", - "endpoint", - "kms_url", - "tproxy_url", - "status", - "enabled", - "created_at" - ], - "title": "Teepod" - }, - "TeepodCapacity": { - "properties": { - "teepod_id": { - "type": "integer", - "title": "Teepod Id" - }, - "name": { - "type": "string", - "title": "Name" - }, - "listed": { - "type": "boolean", - "title": "Listed" - }, - "resource_score": { - "type": "number", - "title": "Resource Score" - }, - "remaining_vcpu": { - "type": "number", - "title": "Remaining Vcpu" - }, - "remaining_memory": { - "type": "number", - "title": "Remaining Memory" - }, - "remaining_cvm_slots": { - "type": "integer", - "title": "Remaining Cvm Slots" - }, - "remaining_disk": { - "title": "Remaining Disk", - "type": "number", - "nullable": true - }, - "images": { - "items": { - "$ref": "#/components/schemas/teehouse__api__routes__cvms__preflight__AvailableOSImage" - }, - "type": "array", - "title": "Images" - }, - "dedicated_for_team_id": { - "title": "Dedicated For Team Id", - "type": "integer", - "nullable": true - }, - "support_onchain_kms": { - "type": "boolean", - "title": "Support Onchain Kms", - "default": false - }, - "fmspc": { - "title": "Fmspc", - "type": "string", - "nullable": true - }, - "device_id": { - "title": "Device Id", - "type": "string", - "nullable": true - }, - "region_identifier": { - "title": "Region Identifier", - "type": "string", - "nullable": true - }, - "default_kms": { - "title": "Default Kms", - "type": "string", - "nullable": true - }, - "kms_list": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Kms List", - "default": [] - } - }, - "type": "object", - "required": [ - "teepod_id", - "name", - "listed", - "resource_score", - "remaining_vcpu", - "remaining_memory", - "remaining_cvm_slots", - "images" - ], - "title": "TeepodCapacity", - "description": "Represents a teepod (remain) capacity" - }, - "TeepodMeta": { - "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "name": { - "type": "string", - "title": "Name" - } - }, - "type": "object", - "required": [ - "id", - "name" - ], - "title": "TeepodMeta" - }, - "TeepodStatus": { - "type": "string", - "enum": [ - "ONLINE", - "OFFLINE", - "MAINTENANCE" - ], - "title": "TeepodStatus" - }, - "TierCapacity": { - "properties": { - "tier": { - "$ref": "#/components/schemas/TeamTier" - }, - "capacity": { - "$ref": "#/components/schemas/ResourceThreshold" - }, - "nodes": { - "items": { - "$ref": "#/components/schemas/TeepodCapacity" - }, - "type": "array", - "title": "Nodes" - }, - "kms_list": { - "items": { - "$ref": "#/components/schemas/KmsWithSupportedOSImage" - }, - "type": "array", - "title": "Kms List" - }, - "gpu_availability": { - "$ref": "#/components/schemas/GpuAvailability" - } - }, - "type": "object", - "required": [ - "tier", - "capacity", - "nodes", - "kms_list" - ], - "title": "TierCapacity" - }, - "TwoFactorDisableRequest": { - "properties": { - "verification_code": { - "type": "string", - "title": "Verification Code" - } - }, - "type": "object", - "required": [ - "verification_code" - ], - "title": "TwoFactorDisableRequest" - }, - "TwoFactorPageVerifyRequest": { - "properties": { - "code": { - "type": "string", - "title": "Code" - } - }, - "type": "object", - "required": [ - "code" - ], - "title": "TwoFactorPageVerifyRequest" - }, - "TwoFactorRegenerateRequest": { - "properties": { - "verification_code": { - "type": "string", - "title": "Verification Code" - } - }, - "type": "object", - "required": [ - "verification_code" - ], - "title": "TwoFactorRegenerateRequest" - }, - "TwoFactorSetupRequest": { - "properties": { - "totp_code": { - "type": "string", - "title": "Totp Code" - } - }, - "type": "object", - "required": [ - "totp_code" - ], - "title": "TwoFactorSetupRequest" - }, - "TwoFactorVerificationRequest": { - "properties": { - "code": { - "type": "string", - "title": "Code" - } - }, - "type": "object", - "required": [ - "code" - ], - "title": "TwoFactorVerificationRequest" - }, - "UpdatePasswordRequest": { - "properties": { - "password": { - "type": "string", - "title": "Password" - }, - "current_password": { - "title": "Current Password", - "type": "string", - "nullable": true - }, - "totp_code": { - "title": "Totp Code", - "type": "string", - "nullable": true - }, - "site_key": { - "title": "Site Key", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "password" - ], - "title": "UpdatePasswordRequest" - }, - "UpdateUsernameRequest": { - "properties": { - "username": { - "type": "string", - "title": "Username" - }, - "current_password": { - "title": "Current Password", - "type": "string", - "nullable": true - }, - "totp_code": { - "title": "Totp Code", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "username" - ], - "title": "UpdateUsernameRequest" - }, - "User": { - "properties": { - "username": { - "type": "string", - "title": "Username" - }, - "id": { - "type": "integer", - "title": "Id" - }, - "role": { - "type": "string", - "title": "Role" - }, - "created_at": { - "type": "string", - "format": "date-time", - "title": "Created At" - }, - "credit": { - "$ref": "#/components/schemas/Credit", - "nullable": true - } - }, - "type": "object", - "required": [ - "username", - "id", - "role", - "created_at" - ], - "title": "User" - }, - "UserRef": { - "properties": { - "object_type": { - "type": "string", - "const": "user", - "title": "Object Type", - "description": "Fixed value 'user'", - "default": "user" - }, - "id": { - "title": "HashedId[users]", - "description": "A hashed identifier that maps to an internal database ID", - "type": "string", - "pattern": "^usr_.+", - "format": "hashid", - "examples": [ - "usr_0123abcd" - ], - "nullable": true - }, - "username": { - "title": "Username", - "description": "Display username", - "type": "string", - "nullable": true - }, - "avatar_url": { - "title": "Avatar Url", - "description": "Gravatar or OAuth provider avatar URL", - "type": "string", - "nullable": true - } - }, - "type": "object", - "title": "UserRef", - "description": "Minimal user reference for embedding in responses." - }, - "VM": { - "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "name": { - "type": "string", - "title": "Name" - }, - "status": { - "type": "string", - "title": "Status" - }, - "teepod_id": { - "type": "integer", - "title": "Teepod Id" - }, - "teepod": { - "$ref": "#/components/schemas/TeepodMeta", - "nullable": true - }, - "user_id": { - "title": "User Id", - "type": "integer", - "nullable": true - }, - "app_id": { - "type": "string", - "title": "App Id" - }, - "vm_uuid": { - "title": "Vm Uuid", - "type": "string", - "nullable": true - }, - "instance_id": { - "title": "Instance Id", - "type": "string", - "nullable": true - }, - "app_url": { - "title": "App Url", - "type": "string", - "nullable": true - }, - "base_image": { - "title": "Base Image", - "type": "string", - "nullable": true - }, - "vcpu": { - "type": "integer", - "title": "Vcpu" - }, - "memory": { - "type": "integer", - "title": "Memory" - }, - "disk_size": { - "type": "integer", - "title": "Disk Size" - }, - "manifest_version": { - "title": "Manifest Version", - "type": "integer", - "nullable": true - }, - "version": { - "title": "Version", - "type": "string", - "nullable": true - }, - "runner": { - "title": "Runner", - "type": "string", - "nullable": true - }, - "docker_compose_file": { - "title": "Docker Compose File", - "type": "string", - "nullable": true - }, - "features": { - "title": "Features", - "items": { - "type": "string" - }, - "type": "array", - "nullable": true - }, - "created_at": { - "type": "string", - "format": "date-time", - "title": "Created At" - }, - "encrypted_env_pubkey": { - "title": "Encrypted Env Pubkey", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "id", - "name", - "status", - "teepod_id", - "app_id", - "vcpu", - "memory", - "disk_size", - "created_at" - ], - "title": "VM" - }, - "VMCreateWithTeepod": { - "properties": { - "user_id": { - "title": "User Id", - "type": "integer", - "nullable": true - }, - "name": { - "type": "string", - "maxLength": 20, - "minLength": 4, - "title": "Name" - }, - "image": { - "type": "string", - "title": "Image" - }, - "vcpu": { - "type": "integer", - "title": "Vcpu" - }, - "memory": { - "type": "integer", - "title": "Memory" - }, - "disk_size": { - "type": "integer", - "title": "Disk Size" - }, - "compose_manifest": { - "$ref": "#/components/schemas/ComposeManifest" - }, - "ports": { - "title": "Ports", - "items": { - "$ref": "#/components/schemas/PortMapping" - }, - "type": "array", - "nullable": true - }, - "encrypted_env": { - "title": "Encrypted Env", - "type": "string", - "nullable": true - }, - "app_id_salt": { - "title": "App Id Salt", - "type": "string", - "nullable": true - }, - "teepod_id": { - "type": "integer", - "title": "Teepod Id" - }, - "listed": { - "type": "boolean", - "title": "Listed", - "default": false - }, - "instance_type": { - "title": "Instance Type", - "type": "string", - "nullable": true - }, - "env_keys": { - "title": "Env Keys", - "items": { - "type": "string" - }, - "type": "array", - "nullable": true - } - }, - "type": "object", - "required": [ - "name", - "image", - "vcpu", - "memory", - "disk_size", - "compose_manifest", - "teepod_id" - ], - "title": "VMCreateWithTeepod" - }, - "ValidationError": { - "properties": { - "loc": { - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ] - }, - "type": "array", - "title": "Location" - }, - "msg": { - "type": "string", - "title": "Message" - }, - "type": { - "type": "string", - "title": "Error Type" - } - }, - "type": "object", - "required": [ - "loc", - "msg", - "type" - ], - "title": "ValidationError" - }, - "VerificationResponse": { - "properties": { - "id": { - "type": "string", - "title": "Id", - "description": "Quote checksum identifier" - }, - "success": { - "type": "boolean", - "title": "Success", - "description": "Verification passed" - }, - "proof_of_cloud": { - "type": "boolean", - "title": "Proof Of Cloud", - "description": "Quote from Phala Cloud TEE" - }, - "quote": { - "description": "Parsed quote structure", - "$ref": "#/components/schemas/Quote", - "nullable": true - }, - "checksum": { - "title": "Checksum", - "description": "SHA256 of quote bytes", - "type": "string", - "nullable": true - }, - "can_download": { - "title": "Can Download", - "description": "Raw quote downloadable", - "type": "boolean", - "nullable": true - }, - "uploaded_at": { - "title": "Uploaded At", - "description": "ISO8601 upload timestamp", - "type": "string", - "nullable": true - }, - "quote_collateral": { - "description": "TCB collateral data", - "$ref": "#/components/schemas/QuoteCollateralV3", - "nullable": true - } - }, - "type": "object", - "required": [ - "id", - "success", - "proof_of_cloud" - ], - "title": "VerificationResponse", - "description": "Quote verification result." - }, - "VerifyAndLinkOAuthRequest": { - "properties": { - "link_token": { - "type": "string", - "title": "Link Token" - }, - "password": { - "title": "Password", - "type": "string", - "nullable": true - }, - "totp_code": { - "title": "Totp Code", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "link_token" - ], - "title": "VerifyAndLinkOAuthRequest", - "description": "Request to verify password/2FA and link OAuth account during Link-on-Login flow." - }, - "VmConfiguration": { - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "image": { - "type": "string", - "title": "Image" - }, - "compose_file": { - "$ref": "#/components/schemas/AppComposeV2", - "nullable": true - }, - "vcpu": { - "type": "integer", - "title": "Vcpu" - }, - "memory": { - "type": "integer", - "title": "Memory" - }, - "disk_size": { - "type": "integer", - "title": "Disk Size" - }, - "ports": { - "title": "Ports", - "items": { - "$ref": "#/components/schemas/PortMapping" - }, - "type": "array", - "nullable": true - }, - "encrypted_env": { - "title": "Encrypted Env", - "type": "string", - "nullable": true - }, - "app_id": { - "title": "App Id", - "type": "string", - "nullable": true - }, - "user_config": { - "title": "User Config", - "type": "string", - "nullable": true - }, - "hugepages": { - "type": "boolean", - "title": "Hugepages", - "default": false - }, - "pin_numa": { - "type": "boolean", - "title": "Pin Numa", - "default": false - }, - "gpus": { - "default": { - "gpus": [], - "attach_mode": "listed" - }, - "$ref": "#/components/schemas/GpuConfig", - "nullable": true - }, - "kms_urls": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Kms Urls", - "default": [] - }, - "gateway_urls": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Gateway Urls", - "default": [] - } - }, - "type": "object", - "required": [ - "name", - "image", - "vcpu", - "memory", - "disk_size" - ], - "title": "VmConfiguration", - "description": "Mapping from Teepod RPC's VmConfiguration." - }, - "VmInfo": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "name": { - "type": "string", - "title": "Name" - }, - "status": { - "type": "string", - "title": "Status" - }, - "uptime": { - "type": "string", - "title": "Uptime" - }, - "app_url": { - "title": "App Url", - "type": "string", - "nullable": true - }, - "app_id": { - "type": "string", - "title": "App Id" - }, - "instance_id": { - "title": "Instance Id", - "type": "string", - "nullable": true - }, - "configuration": { - "$ref": "#/components/schemas/VmConfiguration", - "nullable": true - }, - "exited_at": { - "title": "Exited At", - "type": "string", - "nullable": true - }, - "boot_progress": { - "title": "Boot Progress", - "type": "string", - "nullable": true - }, - "boot_error": { - "title": "Boot Error", - "type": "string", - "nullable": true - }, - "shutdown_progress": { - "title": "Shutdown Progress", - "type": "string", - "nullable": true - }, - "image_version": { - "title": "Image Version", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "id", - "name", - "status", - "uptime", - "app_id" - ], - "title": "VmInfo", - "description": "Mapping from Teepod RPC's VmInfo." - }, - "WorkspaceRef": { - "properties": { - "object_type": { - "type": "string", - "const": "workspace", - "title": "Object Type", - "description": "Fixed value 'workspace'", - "default": "workspace" - }, - "id": { - "type": "string", - "pattern": "^wks_.+", - "format": "hashid", - "title": "HashedId[teams]", - "description": "Hashed workspace ID", - "examples": [ - "wks_0123abcd" - ] - }, - "name": { - "type": "string", - "title": "Name", - "description": "Workspace display name" - }, - "slug": { - "title": "Slug", - "description": "URL-safe workspace identifier", - "type": "string", - "nullable": true - }, - "avatar_url": { - "title": "Avatar Url", - "description": "Workspace avatar URL from profile", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "id", - "name" - ], - "title": "WorkspaceRef", - "description": "Minimal workspace reference for embedding in responses." - }, - "WrappedChangeEmailRequest": { - "properties": { - "request": { - "$ref": "#/components/schemas/ChangeEmailPayload" - }, - "site_key": { - "title": "Site Key", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "request" - ], - "title": "WrappedChangeEmailRequest", - "description": "Wrapped request format from frontend API route" - }, - "WrappedEmailVerificationRequest": { - "properties": { - "request": { - "$ref": "#/components/schemas/EmailVerificationPayload" - }, - "site_key": { - "title": "Site Key", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "request" - ], - "title": "WrappedEmailVerificationRequest", - "description": "Wrapped request format from frontend API route" - }, - "teehouse__api__routes__apps__schemas__ReplicateRequest": { - "properties": { - "teepod_id": { - "title": "Teepod Id", - "description": "Target node ID (deprecated, use node_id)", - "type": "integer", - "nullable": true - }, - "node_id": { - "title": "Node Id", - "description": "Target node ID for replica", - "type": "integer", - "nullable": true - }, - "encrypted_env": { - "title": "Encrypted Env", - "description": "Hex-encoded encrypted environment", - "type": "string", - "nullable": true - } - }, - "type": "object", - "title": "ReplicateRequest", - "description": "CVM replication request parameters." - }, - "teehouse__api__routes__apps__v20251028__schemas__CvmBasicInfo": { - "properties": { - "vm_uuid": { - "title": "Vm Uuid", - "type": "string", - "nullable": true - }, - "app_id": { - "type": "string", - "title": "App Id" - }, - "name": { - "type": "string", - "title": "Name", - "default": "" - }, - "status": { - "type": "string", - "title": "Status" - }, - "vcpu": { - "type": "integer", - "title": "Vcpu" - }, - "memory": { - "type": "integer", - "title": "Memory" - }, - "disk_size": { - "type": "integer", - "title": "Disk Size" - }, - "teepod_id": { - "type": "integer", - "title": "Teepod Id" - }, - "teepod_name": { - "type": "string", - "title": "Teepod Name" - }, - "region_identifier": { - "title": "Region Identifier", - "type": "string", - "nullable": true - }, - "kms_type": { - "title": "Kms Type", - "type": "string", - "nullable": true - }, - "instance_type": { - "title": "Instance Type", - "type": "string", - "nullable": true - }, - "listed": { - "title": "Listed", - "type": "boolean", - "nullable": true - }, - "base_image": { - "title": "Base Image", - "type": "string", - "nullable": true - }, - "kms_slug": { - "title": "Kms Slug", - "type": "string", - "nullable": true - }, - "kms_id": { - "title": "Kms Id", - "type": "string", - "nullable": true - }, - "instance_id": { - "title": "Instance Id", - "type": "string", - "nullable": true - }, - "machine_info": { - "$ref": "#/components/schemas/MachineInfo", - "nullable": true - }, - "updated_at": { - "title": "Updated At", - "type": "string", - "format": "date-time", - "nullable": true - } - }, - "type": "object", - "required": [ - "vm_uuid", - "app_id", - "status", - "vcpu", - "memory", - "disk_size", - "teepod_id", - "teepod_name", - "region_identifier", - "kms_type", - "instance_type" - ], - "title": "CvmBasicInfo" - }, - "teehouse__api__routes__apps__v20251028__schemas__DstackAppFullResponse": { - "properties": { - "id": { - "type": "string", - "pattern": "^prj_.+", - "format": "hashid", - "title": "HashedId[projects]", - "description": "A hashed identifier that maps to an internal database ID", - "examples": [ - "prj_0123abcd" - ] - }, - "name": { - "type": "string", - "title": "Name" - }, - "app_id": { - "type": "string", - "title": "App Id" - }, - "app_provision_type": { - "title": "App Provision Type", - "type": "string", - "nullable": true - }, - "app_icon_url": { - "title": "App Icon Url", - "type": "string", - "nullable": true - }, - "created_at": { - "type": "string", - "title": "Created At" - }, - "kms_type": { - "type": "string", - "title": "Kms Type" - }, - "profile": { - "$ref": "#/components/schemas/ProfileGetResponse", - "nullable": true - }, - "current_cvm": { - "$ref": "#/components/schemas/teehouse__api__routes__apps__v20251028__schemas__CvmBasicInfo", - "nullable": true - }, - "cvms": { - "items": { - "$ref": "#/components/schemas/teehouse__api__routes__apps__v20251028__schemas__CvmBasicInfo" - }, - "type": "array", - "title": "Cvms" - }, - "cvm_count": { - "type": "integer", - "title": "Cvm Count", - "default": 0 - }, - "team_slug": { - "title": "Team Slug", - "type": "string", - "nullable": true - }, - "team_name": { - "title": "Team Name", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "id", - "name", - "app_id", - "created_at", - "kms_type" - ], - "title": "DstackAppFullResponse" - }, - "teehouse__api__routes__apps__v20251028__schemas__DstackAppListResponse": { - "properties": { - "dstack_apps": { - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/teehouse__api__routes__apps__v20251028__schemas__DstackAppFullResponse" - }, - { - "$ref": "#/components/schemas/DstackAppMinimalResponse" - } - ] - }, - "type": "array", - "title": "Dstack Apps" - }, - "page": { - "type": "integer", - "title": "Page" - }, - "page_size": { - "type": "integer", - "title": "Page Size" - }, - "total": { - "type": "integer", - "title": "Total" - }, - "total_pages": { - "type": "integer", - "title": "Total Pages" - } - }, - "type": "object", - "required": [ - "dstack_apps", - "page", - "page_size", - "total", - "total_pages" - ], - "title": "DstackAppListResponse" - }, - "teehouse__api__routes__apps__v20260121__schemas__DstackAppFullResponse": { - "properties": { - "id": { - "type": "string", - "pattern": "^prj_.+", - "format": "hashid", - "title": "HashedId[projects]", - "description": "A hashed identifier that maps to an internal database ID", - "examples": [ - "prj_0123abcd" - ] - }, - "name": { - "type": "string", - "title": "Name" - }, - "app_id": { - "type": "string", - "title": "App Id" - }, - "app_provision_type": { - "title": "App Provision Type", - "type": "string", - "nullable": true - }, - "app_icon_url": { - "title": "App Icon Url", - "type": "string", - "nullable": true - }, - "created_at": { - "type": "string", - "title": "Created At" - }, - "kms_type": { - "type": "string", - "title": "Kms Type" - }, - "profile": { - "$ref": "#/components/schemas/ProfileGetResponse", - "nullable": true - }, - "current_cvm": { - "$ref": "#/components/schemas/CVMInfo", - "nullable": true - }, - "cvms": { - "items": { - "$ref": "#/components/schemas/CVMInfo" - }, - "type": "array", - "title": "Cvms" - }, - "cvm_count": { - "type": "integer", - "title": "Cvm Count", - "default": 0 - } - }, - "type": "object", - "required": [ - "id", - "name", - "app_id", - "created_at", - "kms_type" - ], - "title": "DstackAppFullResponse" - }, - "teehouse__api__routes__apps__v20260121__schemas__DstackAppListResponse": { - "properties": { - "dstack_apps": { - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/teehouse__api__routes__apps__v20260121__schemas__DstackAppFullResponse" - }, - { - "$ref": "#/components/schemas/DstackAppMinimalResponse" - } - ] - }, - "type": "array", - "title": "Dstack Apps" - }, - "page": { - "type": "integer", - "title": "Page" - }, - "page_size": { - "type": "integer", - "title": "Page Size" - }, - "total": { - "type": "integer", - "title": "Total" - }, - "total_pages": { - "type": "integer", - "title": "Total Pages" - } - }, - "type": "object", - "required": [ - "dstack_apps", - "page", - "page_size", - "total", - "total_pages" - ], - "title": "DstackAppListResponse" - }, - "teehouse__api__routes__cvms__deployment__ReplicateRequest": { - "properties": { - "teepod_id": { - "title": "Teepod Id", - "description": "Target node ID (deprecated, use node_id)", - "type": "integer", - "nullable": true - }, - "node_id": { - "title": "Node Id", - "description": "Target node ID for the replica", - "type": "integer", - "nullable": true - }, - "encrypted_env": { - "title": "Encrypted Env", - "description": "New encrypted env blob (hex)", - "type": "string", - "nullable": true - } - }, - "type": "object", - "title": "ReplicateRequest", - "description": "Request model for CVM replication (currently disabled)." - }, - "teehouse__api__routes__cvms__management__CvmBasicInfo": { - "properties": { - "id": { - "type": "integer", - "title": "Id", - "description": "Internal CVM database ID" - }, - "teepod_id": { - "title": "Teepod Id", - "description": "Node ID (admin only)", - "type": "integer", - "nullable": true - }, - "teepod": { - "description": "Node metadata", - "$ref": "#/components/schemas/CvmNode", - "nullable": true - }, - "name": { - "type": "string", - "title": "Name", - "description": "RFC 1123 compliant CVM name" - }, - "status": { - "type": "string", - "title": "Status", - "description": "Current status: running, stopped, starting, etc." - }, - "in_progress": { - "type": "boolean", - "title": "In Progress", - "description": "True if an operation is currently executing", - "default": false - }, - "app_id": { - "type": "string", - "title": "App Id", - "description": "Unique application identifier" - }, - "vm_uuid": { - "title": "Vm Uuid", - "description": "VM instance UUID on the node", - "type": "string", - "nullable": true - }, - "instance_id": { - "title": "Instance Id", - "description": "Public instance identifier", - "type": "string", - "nullable": true - }, - "vcpu": { - "type": "integer", - "title": "Vcpu", - "description": "Allocated vCPU count" - }, - "memory": { - "type": "integer", - "title": "Memory", - "description": "Allocated memory in MB" - }, - "disk_size": { - "type": "integer", - "title": "Disk Size", - "description": "Allocated disk size in GB" - }, - "base_image": { - "title": "Base Image", - "description": "OS image name", - "type": "string", - "nullable": true - }, - "encrypted_env_pubkey": { - "title": "Encrypted Env Pubkey", - "description": "Public key for encrypting env vars", - "type": "string", - "nullable": true - }, - "listed": { - "type": "boolean", - "title": "Listed", - "description": "True if publicly listed", - "default": false - }, - "project_id": { - "title": "Project Id", - "description": "A hashed identifier that maps to an internal database ID", - "type": "string", - "format": "hashid", - "examples": [ - "0123abcd" - ], - "nullable": true - }, - "project_type": { - "title": "Project Type", - "description": "Project provision type", - "type": "string", - "nullable": true - }, - "instance_type": { - "title": "Instance Type", - "description": "Instance type identifier", - "type": "string", - "nullable": true - }, - "public_sysinfo": { - "title": "Public Sysinfo", - "description": "Expose system info publicly", - "type": "boolean", - "nullable": true - }, - "public_logs": { - "title": "Public Logs", - "description": "Expose logs publicly", - "type": "boolean", - "nullable": true - }, - "dapp_dashboard_url": { - "title": "Dapp Dashboard Url", - "description": "DApp dashboard URL if applicable", - "type": "string", - "nullable": true - }, - "syslog_endpoint": { - "title": "Syslog Endpoint", - "description": "Syslog streaming endpoint", - "type": "string", - "nullable": true - }, - "kms_info": { - "description": "KMS configuration", - "$ref": "#/components/schemas/KMSInfo", - "nullable": true - }, - "contract_address": { - "title": "Contract Address", - "description": "On-chain contract address", - "type": "string", - "nullable": true - }, - "deployer_address": { - "title": "Deployer Address", - "description": "Deployer wallet address", - "type": "string", - "nullable": true - }, - "scheduled_delete_at": { - "title": "Scheduled Delete At", - "description": "Auto-delete timestamp (UTC)", - "type": "string", - "format": "date-time", - "nullable": true - }, - "public_urls": { - "title": "Public Urls", - "description": "Exposed service URLs", - "items": { - "$ref": "#/components/schemas/CvmNetworkUrls" - }, - "type": "array", - "nullable": true - }, - "gateway_domain": { - "title": "Gateway Domain", - "description": "Gateway base domain", - "type": "string", - "nullable": true - } - }, - "type": "object", - "required": [ - "id", - "name", - "status", - "app_id", - "vcpu", - "memory", - "disk_size" - ], - "title": "CvmBasicInfo", - "description": "Detailed CVM information returned by GET /cvms/{cvm_id}." - }, - "teehouse__api__routes__cvms__patch_compose_file__AvailableOSImage": { - "properties": { - "version": { - "anyOf": [ - { - "prefixItems": [ - { - "type": "integer" - }, - { - "type": "integer" - }, - { - "type": "integer" - }, - { - "type": "integer" - } - ], - "type": "array", - "maxItems": 4, - "minItems": 4 - }, - { - "prefixItems": [ - { - "type": "integer" - }, - { - "type": "integer" - }, - { - "type": "integer" - } - ], - "type": "array", - "maxItems": 3, - "minItems": 3 - } - ], - "title": "Version", - "description": "Semantic version as tuple (major, minor, patch[, build])" - }, - "prod": { - "description": "Production build (stable)", - "$ref": "#/components/schemas/OSImageVariant", - "nullable": true - }, - "dev": { - "description": "Development build (testing)", - "$ref": "#/components/schemas/OSImageVariant", - "nullable": true - } - }, - "type": "object", - "required": [ - "version" - ], - "title": "AvailableOSImage", - "description": "OS image version with production and development variants." - }, - "teehouse__api__routes__cvms__preflight__AvailableOSImage": { - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "slug": { - "type": "string", - "title": "Slug" - }, - "is_dev": { - "type": "boolean", - "title": "Is Dev" - }, - "version": { - "anyOf": [ - { - "prefixItems": [ - { - "type": "integer" - }, - { - "type": "integer" - }, - { - "type": "integer" - }, - { - "type": "integer" - } - ], - "type": "array", - "maxItems": 4, - "minItems": 4 - }, - { - "prefixItems": [ - { - "type": "integer" - }, - { - "type": "integer" - }, - { - "type": "integer" - } - ], - "type": "array", - "maxItems": 3, - "minItems": 3 - } - ], - "title": "Version" - }, - "os_image_hash": { - "title": "Os Image Hash", - "type": "string", - "nullable": true - }, - "requires_gpu": { - "type": "boolean", - "title": "Requires Gpu", - "default": false - } - }, - "type": "object", - "required": [ - "name", - "slug", - "is_dev", - "version" - ], - "title": "AvailableOSImage" - } - }, - "securitySchemes": { - "OAuth2AuthorizationCodeBearer": { - "type": "oauth2", - "flows": { - "authorizationCode": { - "scopes": {}, - "authorizationUrl": "", - "tokenUrl": "token" - } - } - }, - "APIKeyHeader": { - "type": "apiKey", - "in": "header", - "name": "X-API-Key" - } - } - }, - "tags": [ - { - "name": "auth", - "description": "User authentication and authorization for Phala Cloud" - }, - { - "name": "users", - "description": "Manage user profiles and account settings in Phala Cloud" - }, - { - "name": "cvm", - "description": "Confidential computing instance management in Phala Network" - }, - { - "name": "teepod", - "description": "Trusted Execution Environment (TEE) workload deployment and management" - }, - { - "name": "credits", - "description": "Phala Cloud credits and usage billing management" - }, - { - "name": "tokens", - "description": "API token management for Phala Cloud services" - }, - { - "name": "projects", - "description": "Project management and listing for Phala Cloud" - } - ] -} From 67cd5e54050b27c92901342b3daeb6abe27b419e Mon Sep 17 00:00:00 2001 From: Leechael Yim Date: Wed, 18 Mar 2026 22:19:44 +0800 Subject: [PATCH 02/12] fix: use replace directive with CI Go SDK checkout The Go SDK module path (github.com/Phala-Network/phala-cloud/sdks/go) doesn't match the repo directory structure (go/ not sdks/go/), so go mod download can't resolve it. Use a local replace directive and checkout the SDK in CI workflows. --- .github/workflows/release.yml | 12 ++++++++++++ .github/workflows/test.yml | 12 ++++++++++++ go.mod | 6 +++--- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b953118..2d9f035 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,6 +19,18 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with: fetch-depth: 0 + - name: Checkout Go SDK (for replace directive) + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + with: + repository: Phala-Network/phala-cloud + path: go + sparse-checkout: go + sparse-checkout-cone-mode: true + - name: Flatten Go SDK directory + run: | + mv go/go go-sdk-tmp + rm -rf go + mv go-sdk-tmp go - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 with: go-version-file: "go.mod" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b47fd2e..1f9eda8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,6 +18,18 @@ jobs: - terraform-provider-phala steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + - name: Checkout Go SDK (for replace directive) + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + with: + repository: Phala-Network/phala-cloud + path: go + sparse-checkout: go + sparse-checkout-cone-mode: true + - name: Flatten Go SDK directory + run: | + mv go/go go-sdk-tmp + rm -rf go + mv go-sdk-tmp go - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 with: go-version-file: "go.mod" diff --git a/go.mod b/go.mod index 4c86601..08360c2 100644 --- a/go.mod +++ b/go.mod @@ -3,12 +3,10 @@ module github.com/Phala-Network/terraform-provider-phala go 1.25.0 require ( - github.com/Phala-Network/phala-cloud/sdks/go v0.0.0-00010101000000-000000000000 + github.com/Phala-Network/phala-cloud/sdks/go v0.0.0 github.com/hashicorp/terraform-plugin-framework v1.16.1 ) -replace github.com/Phala-Network/phala-cloud/sdks/go => ../go - require ( github.com/fatih/color v1.15.0 // indirect github.com/golang/protobuf v1.5.4 // indirect @@ -33,3 +31,5 @@ require ( google.golang.org/grpc v1.75.1 // indirect google.golang.org/protobuf v1.36.9 // indirect ) + +replace github.com/Phala-Network/phala-cloud/sdks/go => ../go From 6bb2005f4749a75cbb9bcf01b584f448abf8ce57 Mon Sep 17 00:00:00 2001 From: Leechael Yim Date: Wed, 18 Mar 2026 22:25:16 +0800 Subject: [PATCH 03/12] feat: use Go SDK structured errors for Terraform diagnostics Add diagnosticFromAPIError() helper that extracts structured error details (error_code, suggestions, links) from Go SDK's APIError into Terraform-friendly diagnostic messages. Update ProvisionCVM, commitAndCreate, and env update error paths in resource_app.go. --- internal/provider/cvm_helpers.go | 13 +++++++++++++ internal/provider/resource_app.go | 17 ++++++++++------- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/internal/provider/cvm_helpers.go b/internal/provider/cvm_helpers.go index c76bf21..3a6add5 100644 --- a/internal/provider/cvm_helpers.go +++ b/internal/provider/cvm_helpers.go @@ -592,3 +592,16 @@ func isRetryable(err error) bool { } return apiErr.IsRetryable() } + +// diagnosticFromAPIError extracts structured diagnostic info from an API error. +// Returns (summary, detail) suitable for resp.Diagnostics.AddError(). +func diagnosticFromAPIError(fallbackSummary string, err error) (string, string) { + apiErr, ok := err.(*phala.APIError) + if !ok { + return fallbackSummary, err.Error() + } + if apiErr.IsStructured() { + return fmt.Sprintf("[%s] %s", apiErr.ErrorCode, apiErr.Message), apiErr.FormatError() + } + return fallbackSummary, apiErr.Error() +} diff --git a/internal/provider/resource_app.go b/internal/provider/resource_app.go index 6a512c9..caba119 100644 --- a/internal/provider/resource_app.go +++ b/internal/provider/resource_app.go @@ -199,7 +199,8 @@ func (r *appResource) Create(ctx context.Context, req resource.CreateRequest, re provResp, err := r.client.ProvisionCVM(ctx, provReq) if err != nil { - resp.Diagnostics.AddError("Failed to provision app", err.Error()) + summary, detail := diagnosticFromAPIError("Failed to provision app", err) + resp.Diagnostics.AddError(summary, detail) return } if provResp.ComposeHash == "" { @@ -229,7 +230,8 @@ func (r *appResource) Create(ctx context.Context, req resource.CreateRequest, re createResp, err := commitAndCreate(ctx, r.client, provResp, envCfg.EffectiveEncrypted, envCfg.HasEffectiveEncrypted, envCfg.EffectiveEnvKeys) if err != nil { - resp.Diagnostics.AddError("Failed to create initial app CVM", err.Error()) + summary, detail := diagnosticFromAPIError("Failed to create initial app CVM", err) + resp.Diagnostics.AddError(summary, detail) return } @@ -462,14 +464,15 @@ func (r *appResource) Update(ctx context.Context, req resource.UpdateRequest, re } if err := r.patchEnvsAcrossReplicas(ctx, cvms, primaryCVMID, envReq); err != nil { apiErr, ok := err.(*phala.APIError) - if ok && apiErr.StatusCode == 465 { - resp.Diagnostics.AddError( - "Encrypted env update requires on-chain verification", - "API returned HTTP 465 (compose hash registration required). Register compose_hash on-chain and retry with env_compose_hash and env_transaction_hash.", + if ok && apiErr.IsComposePrecondition() { + summary, detail := diagnosticFromAPIError( + "Encrypted env update requires on-chain verification", err, ) + resp.Diagnostics.AddError(summary, detail) return } - resp.Diagnostics.AddError("Failed to update app encrypted env", err.Error()) + summary, detail := diagnosticFromAPIError("Failed to update app encrypted env", err) + resp.Diagnostics.AddError(summary, detail) return } } From 17ad859b1a95c74fd54511f478cd68ae4de27b7e Mon Sep 17 00:00:00 2001 From: Leechael Yim Date: Wed, 18 Mar 2026 22:26:04 +0800 Subject: [PATCH 04/12] fix(ci): place Go SDK at ../go to match replace directive --- .github/workflows/release.yml | 10 +++------- .github/workflows/test.yml | 10 +++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2d9f035..334e493 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,18 +19,14 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with: fetch-depth: 0 - - name: Checkout Go SDK (for replace directive) + - name: Checkout Go SDK (for replace directive ../go) uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with: repository: Phala-Network/phala-cloud - path: go + path: phala-cloud sparse-checkout: go sparse-checkout-cone-mode: true - - name: Flatten Go SDK directory - run: | - mv go/go go-sdk-tmp - rm -rf go - mv go-sdk-tmp go + - run: mv phala-cloud/go ../go && rm -rf phala-cloud - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 with: go-version-file: "go.mod" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1f9eda8..03cdd9a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,18 +18,14 @@ jobs: - terraform-provider-phala steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - - name: Checkout Go SDK (for replace directive) + - name: Checkout Go SDK (for replace directive ../go) uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with: repository: Phala-Network/phala-cloud - path: go + path: phala-cloud sparse-checkout: go sparse-checkout-cone-mode: true - - name: Flatten Go SDK directory - run: | - mv go/go go-sdk-tmp - rm -rf go - mv go-sdk-tmp go + - run: mv phala-cloud/go ../go && rm -rf phala-cloud - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 with: go-version-file: "go.mod" From 992daca0ac758d800b5b89db34c2b687d01724da Mon Sep 17 00:00:00 2001 From: Leechael Yim Date: Wed, 18 Mar 2026 22:43:15 +0800 Subject: [PATCH 05/12] fix: CI checkout SDK branch, fix missing compose fields and diagnostics - CI: checkout refactor/terraform-use-go-sdk branch of phala-cloud for SDK type enhancements - buildProvisionReq: add missing public_logs, public_sysinfo, public_tcbinfo, secure_time to ComposeFile during provisioning - diagnosticFromAPIError: remove dependency on IsStructured/FormatError methods not yet on SDK main --- .github/workflows/release.yml | 1 + .github/workflows/test.yml | 1 + internal/provider/cvm_helpers.go | 4 ++-- internal/provider/resource_shared.go | 12 ++++++++++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 334e493..a9c00ba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,6 +23,7 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with: repository: Phala-Network/phala-cloud + ref: refactor/terraform-use-go-sdk path: phala-cloud sparse-checkout: go sparse-checkout-cone-mode: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 03cdd9a..9ab35eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,6 +22,7 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with: repository: Phala-Network/phala-cloud + ref: refactor/terraform-use-go-sdk path: phala-cloud sparse-checkout: go sparse-checkout-cone-mode: true diff --git a/internal/provider/cvm_helpers.go b/internal/provider/cvm_helpers.go index 3a6add5..b7f2cc9 100644 --- a/internal/provider/cvm_helpers.go +++ b/internal/provider/cvm_helpers.go @@ -600,8 +600,8 @@ func diagnosticFromAPIError(fallbackSummary string, err error) (string, string) if !ok { return fallbackSummary, err.Error() } - if apiErr.IsStructured() { - return fmt.Sprintf("[%s] %s", apiErr.ErrorCode, apiErr.Message), apiErr.FormatError() + if apiErr.ErrorCode != "" { + return fmt.Sprintf("[%s] %s", apiErr.ErrorCode, apiErr.Message), apiErr.Error() } return fallbackSummary, apiErr.Error() } diff --git a/internal/provider/resource_shared.go b/internal/provider/resource_shared.go index e95f4e3..50ee1c3 100644 --- a/internal/provider/resource_shared.go +++ b/internal/provider/resource_shared.go @@ -321,6 +321,18 @@ func buildProvisionReq(f provisionFields) (*phala.ProvisionCVMRequest, error) { joined := strings.Join(keys, ",") cf.EnvKeys = &joined } + if v, ok := f.ComposeFile["public_logs"].(bool); ok { + cf.PublicLogs = &v + } + if v, ok := f.ComposeFile["public_sysinfo"].(bool); ok { + cf.PublicSysinfo = &v + } + if v, ok := f.ComposeFile["public_tcbinfo"].(bool); ok { + cf.PublicTcbinfo = &v + } + if v, ok := f.ComposeFile["secure_time"].(bool); ok { + cf.SecureTime = &v + } req.ComposeFile = cf } From acd85526488a30815f6cd91d47058849d3a36865 Mon Sep 17 00:00:00 2001 From: Leechael Yim Date: Thu, 19 Mar 2026 04:37:54 +0800 Subject: [PATCH 06/12] fix: pass region to provision request and prevent Listed drift - buildProvisionReq: set Region on ProvisionCVMRequest instead of discarding it, so CVMs deploy to the user-specified region - populateState: only update Listed from API when explicitly true, preventing spurious RequiresReplace drift when API omits the field --- internal/provider/resource_app.go | 8 +++++++- internal/provider/resource_shared.go | 6 ++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/internal/provider/resource_app.go b/internal/provider/resource_app.go index caba119..9d7f8d8 100644 --- a/internal/provider/resource_app.go +++ b/internal/provider/resource_app.go @@ -960,7 +960,13 @@ func (r *appResource) populateState( state.StorageFS = nullableString(storageFSVal) state.Status = nullableString(primary.Status) state.Endpoint = nullableString(cvmInfoEndpoint(primary)) - state.Listed = types.BoolValue(primary.Listed) + // Listed is a bool (not pointer) in the SDK — false could mean "API + // omitted the field" or "API returned false". Only overwrite state + // when the API explicitly says true; otherwise keep existing state to + // avoid spurious RequiresReplace drift. + if primary.Listed { + state.Listed = types.BoolValue(true) + } if primaryID != "" { state.PrimaryCVMID = types.StringValue(primaryID) if state.DockerCompose.IsNull() || state.DockerCompose.IsUnknown() { diff --git a/internal/provider/resource_shared.go b/internal/provider/resource_shared.go index 50ee1c3..7615459 100644 --- a/internal/provider/resource_shared.go +++ b/internal/provider/resource_shared.go @@ -337,10 +337,8 @@ func buildProvisionReq(f provisionFields) (*phala.ProvisionCVMRequest, error) { } if !f.Region.IsNull() && !f.Region.IsUnknown() { - // Region is passed as a hint; SDK ProvisionCVMRequest doesn't have this field. - // The Terraform provider ignores it at provision time since region selection - // is typically done via TeepodID. - _ = f.Region.ValueString() + region := f.Region.ValueString() + req.Region = ®ion } if f.HasNodeID { teepodID := int(f.NodeID) From 0ddcb68864fc7b67c373920e279f48814e306292 Mon Sep 17 00:00:00 2001 From: Leechael Yim Date: Thu, 19 Mar 2026 04:40:56 +0800 Subject: [PATCH 07/12] fix(ci): clean stale ../go before moving SDK checkout --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a9c00ba..a4522bc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,7 @@ jobs: path: phala-cloud sparse-checkout: go sparse-checkout-cone-mode: true - - run: mv phala-cloud/go ../go && rm -rf phala-cloud + - run: rm -rf ../go && mv phala-cloud/go ../go && rm -rf phala-cloud - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 with: go-version-file: "go.mod" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9ab35eb..be60c2e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: path: phala-cloud sparse-checkout: go sparse-checkout-cone-mode: true - - run: mv phala-cloud/go ../go && rm -rf phala-cloud + - run: rm -rf ../go && mv phala-cloud/go ../go && rm -rf phala-cloud - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 with: go-version-file: "go.mod" From b7b4581efda96f5d2f27915952803ca7932f0279 Mon Sep 17 00:00:00 2001 From: Leechael Yim Date: Thu, 19 Mar 2026 05:09:02 +0800 Subject: [PATCH 08/12] fix: use app-scoped replicate, fix gofmt and StringOrNumber compat - Use ReplicateAppCVM (POST /apps/{appID}/cvms/{vmUUID}/replicas) instead of ReplicateCVM to maintain correct app association - Fix trailing newline in provider.go (gofmt) - Handle CreditsInfo fields changed to *StringOrNumber in SDK --- internal/provider/cvm_helpers.go | 11 +++++++++++ internal/provider/data_source_account.go | 6 +++--- internal/provider/provider.go | 1 - internal/provider/resource_app.go | 7 +++---- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/internal/provider/cvm_helpers.go b/internal/provider/cvm_helpers.go index b7f2cc9..a38f9e1 100644 --- a/internal/provider/cvm_helpers.go +++ b/internal/provider/cvm_helpers.go @@ -230,6 +230,17 @@ func nullableStringPtr(v *string) types.String { return types.StringValue(strings.TrimSpace(*v)) } +func nullableStringOrNumber(v *phala.StringOrNumber) types.String { + if v == nil { + return types.StringNull() + } + s := strings.TrimSpace(v.String()) + if s == "" { + return types.StringNull() + } + return types.StringValue(s) +} + func waitTimeout(v types.Int64) time.Duration { if v.IsNull() || v.IsUnknown() || v.ValueInt64() <= 0 { return 10 * time.Minute diff --git a/internal/provider/data_source_account.go b/internal/provider/data_source_account.go index 423aad7..56b34fe 100644 --- a/internal/provider/data_source_account.go +++ b/internal/provider/data_source_account.go @@ -156,10 +156,10 @@ func (d *accountDataSource) Read(ctx context.Context, _ datasource.ReadRequest, WorkspaceTier: nullableString(me.Workspace.Tier), WorkspaceRole: nullableString(me.Workspace.Role), - CreditBalance: nullableStringPtr(me.Credits.Balance), - CreditGrantedBalance: nullableStringPtr(me.Credits.GrantedBalance), + CreditBalance: nullableStringOrNumber(me.Credits.Balance), + CreditGrantedBalance: nullableStringOrNumber(me.Credits.GrantedBalance), CreditIsPostPaid: nullableBool(me.Credits.IsPostPaid), - CreditOutstandingAmount: nullableStringPtr(me.Credits.OutstandingAmount), + CreditOutstandingAmount: nullableStringOrNumber(me.Credits.OutstandingAmount), } resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) diff --git a/internal/provider/provider.go b/internal/provider/provider.go index c2afb6b..7ebe293 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -170,4 +170,3 @@ func nonEmpty(values ...string) string { } return "" } - diff --git a/internal/provider/resource_app.go b/internal/provider/resource_app.go index 9d7f8d8..ee7a06e 100644 --- a/internal/provider/resource_app.go +++ b/internal/provider/resource_app.go @@ -684,10 +684,9 @@ func (r *appResource) reconcileReplicas( return fmt.Errorf("unable to determine source vm_uuid for app replica creation") } - replicatePath := appPath(appID) + "/cvms/" + url.PathEscape(source) + "/replicas" - _ = replicatePath - // Use the SDK's ReplicateCVM method which sends POST /cvms/{id}/replicas. - if _, err := r.client.ReplicateCVM(ctx, source, &phala.ReplicateCVMOptions{}); err != nil { + // Use the app-scoped endpoint to ensure the replica is associated with this app. + rawAppID := strings.TrimPrefix(appID, "app_") + if _, err := r.client.ReplicateAppCVM(ctx, rawAppID, source, &phala.ReplicateCVMOptions{}); err != nil { return err } From a76ae12b0c2eb85dc83172c01882b9474ff47db9 Mon Sep 17 00:00:00 2001 From: Leechael Yim Date: Thu, 19 Mar 2026 05:13:48 +0800 Subject: [PATCH 09/12] fix: revert StringOrNumber to *string to match committed SDK types --- internal/provider/cvm_helpers.go | 11 ----------- internal/provider/data_source_account.go | 6 +++--- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/internal/provider/cvm_helpers.go b/internal/provider/cvm_helpers.go index a38f9e1..b7f2cc9 100644 --- a/internal/provider/cvm_helpers.go +++ b/internal/provider/cvm_helpers.go @@ -230,17 +230,6 @@ func nullableStringPtr(v *string) types.String { return types.StringValue(strings.TrimSpace(*v)) } -func nullableStringOrNumber(v *phala.StringOrNumber) types.String { - if v == nil { - return types.StringNull() - } - s := strings.TrimSpace(v.String()) - if s == "" { - return types.StringNull() - } - return types.StringValue(s) -} - func waitTimeout(v types.Int64) time.Duration { if v.IsNull() || v.IsUnknown() || v.ValueInt64() <= 0 { return 10 * time.Minute diff --git a/internal/provider/data_source_account.go b/internal/provider/data_source_account.go index 56b34fe..423aad7 100644 --- a/internal/provider/data_source_account.go +++ b/internal/provider/data_source_account.go @@ -156,10 +156,10 @@ func (d *accountDataSource) Read(ctx context.Context, _ datasource.ReadRequest, WorkspaceTier: nullableString(me.Workspace.Tier), WorkspaceRole: nullableString(me.Workspace.Role), - CreditBalance: nullableStringOrNumber(me.Credits.Balance), - CreditGrantedBalance: nullableStringOrNumber(me.Credits.GrantedBalance), + CreditBalance: nullableStringPtr(me.Credits.Balance), + CreditGrantedBalance: nullableStringPtr(me.Credits.GrantedBalance), CreditIsPostPaid: nullableBool(me.Credits.IsPostPaid), - CreditOutstandingAmount: nullableStringOrNumber(me.Credits.OutstandingAmount), + CreditOutstandingAmount: nullableStringPtr(me.Credits.OutstandingAmount), } resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) From 47dcd9981a7ea17b83fd230a77ca3b54965cf96a Mon Sep 17 00:00:00 2001 From: Leechael Yim Date: Thu, 19 Mar 2026 06:57:40 +0800 Subject: [PATCH 10/12] refactor: use go sdk env helpers --- go.mod | 18 +++++--- go.sum | 68 +++++++++++++++++----------- internal/provider/cvm_helpers.go | 61 ++----------------------- internal/provider/resource_app.go | 5 +- internal/provider/resource_shared.go | 7 +-- 5 files changed, 61 insertions(+), 98 deletions(-) diff --git a/go.mod b/go.mod index 08360c2..30f272c 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,11 @@ require ( ) require ( - github.com/fatih/color v1.15.0 // indirect + github.com/Dstack-TEE/dstack/sdk/go v0.0.0-20260318210907-bad8c975c30e // indirect + github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect + github.com/ethereum/go-ethereum v1.17.1 // indirect + github.com/fatih/color v1.16.0 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/go-plugin v1.7.0 // indirect @@ -18,18 +22,20 @@ require ( github.com/hashicorp/terraform-registry-address v0.4.0 // indirect github.com/hashicorp/terraform-svchost v0.1.1 // indirect github.com/hashicorp/yamux v0.1.2 // indirect + github.com/holiman/uint256 v1.3.2 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/oklog/run v1.1.0 // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - golang.org/x/net v0.43.0 // indirect + golang.org/x/crypto v0.49.0 // indirect + golang.org/x/net v0.51.0 // indirect golang.org/x/sys v0.42.0 // indirect - golang.org/x/text v0.28.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 // indirect - google.golang.org/grpc v1.75.1 // indirect - google.golang.org/protobuf v1.36.9 // indirect + golang.org/x/text v0.35.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect + google.golang.org/grpc v1.77.0 // indirect + google.golang.org/protobuf v1.36.11 // indirect ) replace github.com/Phala-Network/phala-cloud/sdks/go => ../go diff --git a/go.sum b/go.sum index 6311a91..ac7b9f6 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,24 @@ +github.com/Dstack-TEE/dstack/sdk/go v0.0.0-20260318210907-bad8c975c30e h1:Ci04RC8GOLdt6fxQHS4bhGlK87Lqx0eHJztGTncD2fQ= +github.com/Dstack-TEE/dstack/sdk/go v0.0.0-20260318210907-bad8c975c30e/go.mod h1:KvaSdZnBZzvbvCZbDF/3EVMpa7FNyRV8ENKPHG/crrI= +github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6 h1:1zYrtlhrZ6/b6SAjLSfKzWtdgqK0U+HtH/VcBWh1BaU= +github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6/go.mod h1:ioLG6R+5bUSO1oeGSDxOV3FADARuMoytZCSX6MEMQkI= github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/FBatYVw= github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= +github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= +github.com/ethereum/go-ethereum v1.17.1 h1:IjlQDjgxg2uL+GzPRkygGULPMLzcYWncEI7wbaizvho= +github.com/ethereum/go-ethereum v1.17.1/go.mod h1:7UWOVHL7K3b8RfVRea022btnzLCaanwHtBuH1jUCH/I= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= @@ -35,6 +47,8 @@ github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= github.com/hashicorp/yamux v0.1.2 h1:XtB8kyFOyHXYVFnwT5C3+Bdo8gArse7j2AQ0DA0Uey8= github.com/hashicorp/yamux v0.1.2/go.mod h1:C+zze2n6e/7wshOZep2A70/aQU6QBRWJO/G6FT1wIns= +github.com/holiman/uint256 v1.3.2 h1:a9EgMPSC1AAaj1SZL5zIQD3WbwTuHrMGOerLjGmM/TA= +github.com/holiman/uint256 v1.3.2/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/jhump/protoreflect v1.17.0 h1:qOEr613fac2lOuTgWN4tPAtLL7fUSbuJL5X5XumQh94= github.com/jhump/protoreflect v1.17.0/go.mod h1:h9+vUUL38jiBzck8ck+6G/aeMX8Z4QUY/NiJPwPNi+8= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -55,26 +69,28 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= -go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= -go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ= -go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I= -go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE= -go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E= -go.opentelemetry.io/otel/sdk v1.37.0 h1:ItB0QUqnjesGRvNcmAcU0LyvkVyGJ2xftD29bWdDvKI= -go.opentelemetry.io/otel/sdk v1.37.0/go.mod h1:VredYzxUvuo2q3WRcDnKDjbdvmO0sCzOvVAiY+yUkAg= -go.opentelemetry.io/otel/sdk/metric v1.37.0 h1:90lI228XrB9jCMuSdA0673aubgRobVZFhbjxHHspCPc= -go.opentelemetry.io/otel/sdk/metric v1.37.0/go.mod h1:cNen4ZWfiD37l5NhS+Keb5RXVWZWpRE+9WyVCpbo5ps= -go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4= -go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0= -golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= -golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= +go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= +go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= +go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= +go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= +go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM= +go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA= +go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= +go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4= +golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA= +golang.org/x/net v0.51.0 h1:94R/GTO7mt3/4wIKpcR5gkGmRLOuE/2hNGeWq/GBIFo= +golang.org/x/net v0.51.0/go.mod h1:aamm+2QF5ogm02fjy5Bb7CQ0WMt1/WVM7FtyaTLlA9Y= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -84,16 +100,16 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= -golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= +golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8= +golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA= gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 h1:pFyd6EwwL2TqFf8emdthzeX+gZE1ElRq3iM8pui4KBY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= -google.golang.org/grpc v1.75.1 h1:/ODCNEuf9VghjgO3rqLcfg8fiOP0nSluljWFlDxELLI= -google.golang.org/grpc v1.75.1/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ= -google.golang.org/protobuf v1.36.9 h1:w2gp2mA27hUeUzj9Ex9FBjsBm40zfaDtEWow293U7Iw= -google.golang.org/protobuf v1.36.9/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b h1:Mv8VFug0MP9e5vUxfBcE3vUkV6CImK3cMNMIDFjmzxU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= +google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= +google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/provider/cvm_helpers.go b/internal/provider/cvm_helpers.go index b7f2cc9..e7a3be2 100644 --- a/internal/provider/cvm_helpers.go +++ b/internal/provider/cvm_helpers.go @@ -2,10 +2,6 @@ package provider import ( "context" - "crypto/aes" - "crypto/cipher" - "crypto/ecdh" - "crypto/rand" "encoding/base64" "encoding/hex" "encoding/json" @@ -472,72 +468,21 @@ func encryptEnvMap(env map[string]string, publicKeyBase64 string) (string, error return "", fmt.Errorf("invalid env encryption key length: expected 32 bytes, got %d", len(pubkeyBytes)) } - curve := ecdh.X25519() - remotePub, err := curve.NewPublicKey(pubkeyBytes) - if err != nil { - return "", fmt.Errorf("parse env encryption key: %w", err) - } - ephemeralPriv, err := curve.GenerateKey(rand.Reader) - if err != nil { - return "", fmt.Errorf("generate ephemeral key: %w", err) - } - - sharedSecret, err := ephemeralPriv.ECDH(remotePub) - if err != nil { - return "", fmt.Errorf("derive shared secret: %w", err) - } - if len(sharedSecret) < 32 { - return "", fmt.Errorf("invalid shared secret length: %d", len(sharedSecret)) - } - - block, err := aes.NewCipher(sharedSecret[:32]) - if err != nil { - return "", fmt.Errorf("create AES cipher: %w", err) - } - aead, err := cipher.NewGCM(block) - if err != nil { - return "", fmt.Errorf("create AES-GCM cipher: %w", err) - } - nonce := make([]byte, aead.NonceSize()) - if _, err := rand.Read(nonce); err != nil { - return "", fmt.Errorf("generate nonce: %w", err) - } - - type envVar struct { - Key string `json:"key"` - Value string `json:"value"` - } - keys := make([]string, 0, len(env)) for key := range env { keys = append(keys, key) } sort.Strings(keys) - envVars := make([]envVar, 0, len(keys)) + envVars := make([]phala.EnvVar, 0, len(keys)) for _, key := range keys { - envVars = append(envVars, envVar{ + envVars = append(envVars, phala.EnvVar{ Key: key, Value: env[key], }) } - plaintext, err := json.Marshal(map[string][]envVar{ - "env": envVars, - }) - if err != nil { - return "", fmt.Errorf("marshal env payload: %w", err) - } - - ephemeralPub := ephemeralPriv.PublicKey().Bytes() - ciphertext := aead.Seal(nil, nonce, plaintext, nil) - - out := make([]byte, 0, len(ephemeralPub)+len(nonce)+len(ciphertext)) - out = append(out, ephemeralPub...) - out = append(out, nonce...) - out = append(out, ciphertext...) - - return hex.EncodeToString(out), nil + return phala.EncryptEnvVars(envVars, hex.EncodeToString(pubkeyBytes)) } func decodeEnvPublicKey(v string) ([]byte, error) { diff --git a/internal/provider/resource_app.go b/internal/provider/resource_app.go index ee7a06e..5066202 100644 --- a/internal/provider/resource_app.go +++ b/internal/provider/resource_app.go @@ -1512,10 +1512,9 @@ func buildUpdateEnvsRequest(payload map[string]any) *phala.UpdateEnvsRequest { if v, ok := payload["env_keys"]; ok { switch keys := v.(type) { case []string: - joined := strings.Join(keys, ",") - req.EnvKeys = &joined + req.EnvKeys = keys case string: - req.EnvKeys = &keys + req.EnvKeys = []string{keys} } } if v, ok := payload["compose_hash"].(string); ok && v != "" { diff --git a/internal/provider/resource_shared.go b/internal/provider/resource_shared.go index 7615459..e1af350 100644 --- a/internal/provider/resource_shared.go +++ b/internal/provider/resource_shared.go @@ -315,11 +315,8 @@ func buildProvisionReq(f provisionFields) (*phala.ProvisionCVMRequest, error) { if v, ok := f.ComposeFile["encrypted_env"].(string); ok { cf.EncryptedEnv = &v } - if v, ok := f.ComposeFile["env_keys"].(string); ok { - cf.EnvKeys = &v - } else if keys, ok := f.ComposeFile["allowed_envs"].([]string); ok && len(keys) > 0 { - joined := strings.Join(keys, ",") - cf.EnvKeys = &joined + if keys, ok := f.ComposeFile["allowed_envs"].([]string); ok && len(keys) > 0 { + cf.AllowedEnvs = keys } if v, ok := f.ComposeFile["public_logs"].(bool); ok { cf.PublicLogs = &v From eb50297dfbf1e2627748392ad56f91810d794786 Mon Sep 17 00:00:00 2001 From: Leechael Yim Date: Fri, 10 Apr 2026 16:49:31 +0800 Subject: [PATCH 11/12] chore: add prek pre-commit config for gofmt/vet/test hooks --- .pre-commit-config.yaml | 52 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..fb543a2 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,52 @@ +# Prek (pre-commit) configuration for terraform-provider-phala. +# Install: prek install +# Run all: prek run --all-files +# Docs: https://prek.j178.dev + +fail_fast: true + +repos: + # ── Basic file hygiene ──────────────────────────────────────────────── + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: trailing-whitespace + exclude: \.(md|mdx)$ + - id: end-of-file-fixer + - id: check-yaml + args: [--allow-multiple-documents] + - id: check-json + - id: mixed-line-ending + args: [--fix=lf] + + # ── Local hooks ─────────────────────────────────────────────────────── + # Mirrors `make ci` (fmt-check → vet → test) from the Makefile so any + # regression caught by CI is also caught on commit. `build-release` is + # intentionally skipped — it's slow and CI is the source of truth for + # packaged output. + - repo: local + hooks: + - id: gofmt + name: gofmt + entry: bash -c 'out="$(gofmt -l $(find . -name "*.go" -not -path "./vendor/*"))"; if [ -n "$out" ]; then echo "Files need gofmt:"; echo "$out"; exit 1; fi' + language: system + files: \.go$ + pass_filenames: false + priority: 10 + + - id: govet + name: go vet + entry: bash -c 'go vet ./...' + language: system + files: \.go$ + pass_filenames: false + priority: 20 + + - id: gotest + name: go test + entry: bash -c 'go test ./...' + language: system + files: \.go$ + pass_filenames: false + require_serial: true + priority: 30 From 7476657d296fd3c5a72a9f34fa3514e31de9b870 Mon Sep 17 00:00:00 2001 From: Leechael Yim Date: Fri, 10 Apr 2026 17:31:02 +0800 Subject: [PATCH 12/12] fix(ci): point SDK checkout ref at main after merge The refactor/terraform-use-go-sdk branch was merged into Phala-Network/phala-cloud main and deleted, causing the sparse checkout step to fail with a 404. --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a4522bc..2ff068e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with: repository: Phala-Network/phala-cloud - ref: refactor/terraform-use-go-sdk + ref: main path: phala-cloud sparse-checkout: go sparse-checkout-cone-mode: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index be60c2e..337725c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with: repository: Phala-Network/phala-cloud - ref: refactor/terraform-use-go-sdk + ref: main path: phala-cloud sparse-checkout: go sparse-checkout-cone-mode: true