mirror of
https://github.com/hanzoai/runtime.git
synced 2026-10-30 18:23:13 +00:00
- Add main Dockerfile for production builds - Add Dockerfile.runtime for secure code execution - Add Dockerfile.runtime.fixed with improved configuration - Include .dockerignore for build optimization - Add integration documentation and publishing guides - Update API and CLI components for better runtime support - Enhance sandbox and container management features
438 lines
9.3 KiB
Go
Generated
438 lines
9.3 KiB
Go
Generated
/*
|
|
Runtime
|
|
|
|
Runtime AI platform API Docs
|
|
|
|
API version: 1.0
|
|
Contact: [email protected]
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package apiclient
|
|
|
|
import (
|
|
"bytes"
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
// checks if the CreateRunner type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &CreateRunner{}
|
|
|
|
// CreateRunner struct for CreateRunner
|
|
type CreateRunner struct {
|
|
Domain string `json:"domain"`
|
|
ApiUrl string `json:"apiUrl"`
|
|
ApiKey string `json:"apiKey"`
|
|
Cpu float32 `json:"cpu"`
|
|
Memory float32 `json:"memory"`
|
|
Disk float32 `json:"disk"`
|
|
Gpu float32 `json:"gpu"`
|
|
GpuType string `json:"gpuType"`
|
|
Class string `json:"class"`
|
|
Capacity float32 `json:"capacity"`
|
|
Region string `json:"region"`
|
|
}
|
|
|
|
type _CreateRunner CreateRunner
|
|
|
|
// NewCreateRunner instantiates a new CreateRunner object
|
|
// This constructor will assign default values to properties that have it defined,
|
|
// and makes sure properties required by API are set, but the set of arguments
|
|
// will change when the set of required properties is changed
|
|
func NewCreateRunner(domain string, apiUrl string, apiKey string, cpu float32, memory float32, disk float32, gpu float32, gpuType string, class string, capacity float32, region string) *CreateRunner {
|
|
this := CreateRunner{}
|
|
this.Domain = domain
|
|
this.ApiUrl = apiUrl
|
|
this.ApiKey = apiKey
|
|
this.Cpu = cpu
|
|
this.Memory = memory
|
|
this.Disk = disk
|
|
this.Gpu = gpu
|
|
this.GpuType = gpuType
|
|
this.Class = class
|
|
this.Capacity = capacity
|
|
this.Region = region
|
|
return &this
|
|
}
|
|
|
|
// NewCreateRunnerWithDefaults instantiates a new CreateRunner object
|
|
// This constructor will only assign default values to properties that have it defined,
|
|
// but it doesn't guarantee that properties required by API are set
|
|
func NewCreateRunnerWithDefaults() *CreateRunner {
|
|
this := CreateRunner{}
|
|
return &this
|
|
}
|
|
|
|
// GetDomain returns the Domain field value
|
|
func (o *CreateRunner) GetDomain() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Domain
|
|
}
|
|
|
|
// GetDomainOk returns a tuple with the Domain field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateRunner) GetDomainOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Domain, true
|
|
}
|
|
|
|
// SetDomain sets field value
|
|
func (o *CreateRunner) SetDomain(v string) {
|
|
o.Domain = v
|
|
}
|
|
|
|
// GetApiUrl returns the ApiUrl field value
|
|
func (o *CreateRunner) GetApiUrl() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.ApiUrl
|
|
}
|
|
|
|
// GetApiUrlOk returns a tuple with the ApiUrl field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateRunner) GetApiUrlOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.ApiUrl, true
|
|
}
|
|
|
|
// SetApiUrl sets field value
|
|
func (o *CreateRunner) SetApiUrl(v string) {
|
|
o.ApiUrl = v
|
|
}
|
|
|
|
// GetApiKey returns the ApiKey field value
|
|
func (o *CreateRunner) GetApiKey() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.ApiKey
|
|
}
|
|
|
|
// GetApiKeyOk returns a tuple with the ApiKey field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateRunner) GetApiKeyOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.ApiKey, true
|
|
}
|
|
|
|
// SetApiKey sets field value
|
|
func (o *CreateRunner) SetApiKey(v string) {
|
|
o.ApiKey = v
|
|
}
|
|
|
|
// GetCpu returns the Cpu field value
|
|
func (o *CreateRunner) GetCpu() float32 {
|
|
if o == nil {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
|
|
return o.Cpu
|
|
}
|
|
|
|
// GetCpuOk returns a tuple with the Cpu field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateRunner) GetCpuOk() (*float32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Cpu, true
|
|
}
|
|
|
|
// SetCpu sets field value
|
|
func (o *CreateRunner) SetCpu(v float32) {
|
|
o.Cpu = v
|
|
}
|
|
|
|
// GetMemory returns the Memory field value
|
|
func (o *CreateRunner) GetMemory() float32 {
|
|
if o == nil {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
|
|
return o.Memory
|
|
}
|
|
|
|
// GetMemoryOk returns a tuple with the Memory field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateRunner) GetMemoryOk() (*float32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Memory, true
|
|
}
|
|
|
|
// SetMemory sets field value
|
|
func (o *CreateRunner) SetMemory(v float32) {
|
|
o.Memory = v
|
|
}
|
|
|
|
// GetDisk returns the Disk field value
|
|
func (o *CreateRunner) GetDisk() float32 {
|
|
if o == nil {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
|
|
return o.Disk
|
|
}
|
|
|
|
// GetDiskOk returns a tuple with the Disk field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateRunner) GetDiskOk() (*float32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Disk, true
|
|
}
|
|
|
|
// SetDisk sets field value
|
|
func (o *CreateRunner) SetDisk(v float32) {
|
|
o.Disk = v
|
|
}
|
|
|
|
// GetGpu returns the Gpu field value
|
|
func (o *CreateRunner) GetGpu() float32 {
|
|
if o == nil {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
|
|
return o.Gpu
|
|
}
|
|
|
|
// GetGpuOk returns a tuple with the Gpu field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateRunner) GetGpuOk() (*float32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Gpu, true
|
|
}
|
|
|
|
// SetGpu sets field value
|
|
func (o *CreateRunner) SetGpu(v float32) {
|
|
o.Gpu = v
|
|
}
|
|
|
|
// GetGpuType returns the GpuType field value
|
|
func (o *CreateRunner) GetGpuType() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.GpuType
|
|
}
|
|
|
|
// GetGpuTypeOk returns a tuple with the GpuType field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateRunner) GetGpuTypeOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.GpuType, true
|
|
}
|
|
|
|
// SetGpuType sets field value
|
|
func (o *CreateRunner) SetGpuType(v string) {
|
|
o.GpuType = v
|
|
}
|
|
|
|
// GetClass returns the Class field value
|
|
func (o *CreateRunner) GetClass() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Class
|
|
}
|
|
|
|
// GetClassOk returns a tuple with the Class field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateRunner) GetClassOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Class, true
|
|
}
|
|
|
|
// SetClass sets field value
|
|
func (o *CreateRunner) SetClass(v string) {
|
|
o.Class = v
|
|
}
|
|
|
|
// GetCapacity returns the Capacity field value
|
|
func (o *CreateRunner) GetCapacity() float32 {
|
|
if o == nil {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
|
|
return o.Capacity
|
|
}
|
|
|
|
// GetCapacityOk returns a tuple with the Capacity field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateRunner) GetCapacityOk() (*float32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Capacity, true
|
|
}
|
|
|
|
// SetCapacity sets field value
|
|
func (o *CreateRunner) SetCapacity(v float32) {
|
|
o.Capacity = v
|
|
}
|
|
|
|
// GetRegion returns the Region field value
|
|
func (o *CreateRunner) GetRegion() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Region
|
|
}
|
|
|
|
// GetRegionOk returns a tuple with the Region field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateRunner) GetRegionOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Region, true
|
|
}
|
|
|
|
// SetRegion sets field value
|
|
func (o *CreateRunner) SetRegion(v string) {
|
|
o.Region = v
|
|
}
|
|
|
|
func (o CreateRunner) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o CreateRunner) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
toSerialize["domain"] = o.Domain
|
|
toSerialize["apiUrl"] = o.ApiUrl
|
|
toSerialize["apiKey"] = o.ApiKey
|
|
toSerialize["cpu"] = o.Cpu
|
|
toSerialize["memory"] = o.Memory
|
|
toSerialize["disk"] = o.Disk
|
|
toSerialize["gpu"] = o.Gpu
|
|
toSerialize["gpuType"] = o.GpuType
|
|
toSerialize["class"] = o.Class
|
|
toSerialize["capacity"] = o.Capacity
|
|
toSerialize["region"] = o.Region
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *CreateRunner) UnmarshalJSON(data []byte) (err error) {
|
|
// This validates that all required properties are included in the JSON object
|
|
// by unmarshalling the object into a generic map with string keys and checking
|
|
// that every required field exists as a key in the generic map.
|
|
requiredProperties := []string{
|
|
"domain",
|
|
"apiUrl",
|
|
"apiKey",
|
|
"cpu",
|
|
"memory",
|
|
"disk",
|
|
"gpu",
|
|
"gpuType",
|
|
"class",
|
|
"capacity",
|
|
"region",
|
|
}
|
|
|
|
allProperties := make(map[string]interface{})
|
|
|
|
err = json.Unmarshal(data, &allProperties)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
for _, requiredProperty := range requiredProperties {
|
|
if _, exists := allProperties[requiredProperty]; !exists {
|
|
return fmt.Errorf("no value given for required property %v", requiredProperty)
|
|
}
|
|
}
|
|
|
|
varCreateRunner := _CreateRunner{}
|
|
|
|
decoder := json.NewDecoder(bytes.NewReader(data))
|
|
decoder.DisallowUnknownFields()
|
|
err = decoder.Decode(&varCreateRunner)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = CreateRunner(varCreateRunner)
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableCreateRunner struct {
|
|
value *CreateRunner
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableCreateRunner) Get() *CreateRunner {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableCreateRunner) Set(val *CreateRunner) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableCreateRunner) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableCreateRunner) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableCreateRunner(val *CreateRunner) *NullableCreateRunner {
|
|
return &NullableCreateRunner{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableCreateRunner) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableCreateRunner) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|