mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
345 lines
9.1 KiB
Go
345 lines
9.1 KiB
Go
/*
|
|
Hanzo Cloud API
|
|
|
|
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
|
|
|
API version: v1
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package hanzoai
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// checks if the SandboxExecRequest type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &SandboxExecRequest{}
|
|
|
|
// SandboxExecRequest struct for SandboxExecRequest
|
|
type SandboxExecRequest struct {
|
|
// Argv is the command as an argument vector, which is the honest form: it cannot be word-split by accident. Send this OR Command, not both.
|
|
Argv []string `json:"argv,omitempty"`
|
|
// Command is a shell line, for a caller that holds one. It is a convenience over Argv and is the only input that ever reaches a shell.
|
|
Command *string `json:"command,omitempty"`
|
|
// Dir is the working directory to run in. Empty runs in the class's own workdir — /mnt/data for exec, /work for dev.
|
|
Dir *string `json:"dir,omitempty"`
|
|
// ID is the sandbox to run in, from the path.
|
|
Id *string `json:"id,omitempty"`
|
|
// Stdin is fed to the command on its standard input.
|
|
Stdin *string `json:"stdin,omitempty"`
|
|
// TimeoutSec bounds the run in seconds. Zero takes the default.
|
|
TimeoutSec *int64 `json:"timeoutSec,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _SandboxExecRequest SandboxExecRequest
|
|
|
|
// NewSandboxExecRequest instantiates a new SandboxExecRequest 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 NewSandboxExecRequest() *SandboxExecRequest {
|
|
this := SandboxExecRequest{}
|
|
return &this
|
|
}
|
|
|
|
// NewSandboxExecRequestWithDefaults instantiates a new SandboxExecRequest 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 NewSandboxExecRequestWithDefaults() *SandboxExecRequest {
|
|
this := SandboxExecRequest{}
|
|
return &this
|
|
}
|
|
|
|
// GetArgv returns the Argv field value if set, zero value otherwise.
|
|
func (o *SandboxExecRequest) GetArgv() []string {
|
|
if o == nil || IsNil(o.Argv) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Argv
|
|
}
|
|
|
|
// GetArgvOk returns a tuple with the Argv field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *SandboxExecRequest) GetArgvOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Argv) {
|
|
return nil, false
|
|
}
|
|
return o.Argv, true
|
|
}
|
|
|
|
// HasArgv returns a boolean if a field has been set.
|
|
func (o *SandboxExecRequest) HasArgv() bool {
|
|
if o != nil && !IsNil(o.Argv) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetArgv gets a reference to the given []string and assigns it to the Argv field.
|
|
func (o *SandboxExecRequest) SetArgv(v []string) {
|
|
o.Argv = v
|
|
}
|
|
|
|
// GetCommand returns the Command field value if set, zero value otherwise.
|
|
func (o *SandboxExecRequest) GetCommand() string {
|
|
if o == nil || IsNil(o.Command) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Command
|
|
}
|
|
|
|
// GetCommandOk returns a tuple with the Command field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *SandboxExecRequest) GetCommandOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Command) {
|
|
return nil, false
|
|
}
|
|
return o.Command, true
|
|
}
|
|
|
|
// HasCommand returns a boolean if a field has been set.
|
|
func (o *SandboxExecRequest) HasCommand() bool {
|
|
if o != nil && !IsNil(o.Command) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCommand gets a reference to the given string and assigns it to the Command field.
|
|
func (o *SandboxExecRequest) SetCommand(v string) {
|
|
o.Command = &v
|
|
}
|
|
|
|
// GetDir returns the Dir field value if set, zero value otherwise.
|
|
func (o *SandboxExecRequest) GetDir() string {
|
|
if o == nil || IsNil(o.Dir) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Dir
|
|
}
|
|
|
|
// GetDirOk returns a tuple with the Dir field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *SandboxExecRequest) GetDirOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Dir) {
|
|
return nil, false
|
|
}
|
|
return o.Dir, true
|
|
}
|
|
|
|
// HasDir returns a boolean if a field has been set.
|
|
func (o *SandboxExecRequest) HasDir() bool {
|
|
if o != nil && !IsNil(o.Dir) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDir gets a reference to the given string and assigns it to the Dir field.
|
|
func (o *SandboxExecRequest) SetDir(v string) {
|
|
o.Dir = &v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *SandboxExecRequest) GetId() string {
|
|
if o == nil || IsNil(o.Id) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Id
|
|
}
|
|
|
|
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *SandboxExecRequest) GetIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Id) {
|
|
return nil, false
|
|
}
|
|
return o.Id, true
|
|
}
|
|
|
|
// HasId returns a boolean if a field has been set.
|
|
func (o *SandboxExecRequest) HasId() bool {
|
|
if o != nil && !IsNil(o.Id) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetId gets a reference to the given string and assigns it to the Id field.
|
|
func (o *SandboxExecRequest) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetStdin returns the Stdin field value if set, zero value otherwise.
|
|
func (o *SandboxExecRequest) GetStdin() string {
|
|
if o == nil || IsNil(o.Stdin) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Stdin
|
|
}
|
|
|
|
// GetStdinOk returns a tuple with the Stdin field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *SandboxExecRequest) GetStdinOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Stdin) {
|
|
return nil, false
|
|
}
|
|
return o.Stdin, true
|
|
}
|
|
|
|
// HasStdin returns a boolean if a field has been set.
|
|
func (o *SandboxExecRequest) HasStdin() bool {
|
|
if o != nil && !IsNil(o.Stdin) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStdin gets a reference to the given string and assigns it to the Stdin field.
|
|
func (o *SandboxExecRequest) SetStdin(v string) {
|
|
o.Stdin = &v
|
|
}
|
|
|
|
// GetTimeoutSec returns the TimeoutSec field value if set, zero value otherwise.
|
|
func (o *SandboxExecRequest) GetTimeoutSec() int64 {
|
|
if o == nil || IsNil(o.TimeoutSec) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.TimeoutSec
|
|
}
|
|
|
|
// GetTimeoutSecOk returns a tuple with the TimeoutSec field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *SandboxExecRequest) GetTimeoutSecOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.TimeoutSec) {
|
|
return nil, false
|
|
}
|
|
return o.TimeoutSec, true
|
|
}
|
|
|
|
// HasTimeoutSec returns a boolean if a field has been set.
|
|
func (o *SandboxExecRequest) HasTimeoutSec() bool {
|
|
if o != nil && !IsNil(o.TimeoutSec) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTimeoutSec gets a reference to the given int64 and assigns it to the TimeoutSec field.
|
|
func (o *SandboxExecRequest) SetTimeoutSec(v int64) {
|
|
o.TimeoutSec = &v
|
|
}
|
|
|
|
func (o SandboxExecRequest) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o SandboxExecRequest) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Argv) {
|
|
toSerialize["argv"] = o.Argv
|
|
}
|
|
if !IsNil(o.Command) {
|
|
toSerialize["command"] = o.Command
|
|
}
|
|
if !IsNil(o.Dir) {
|
|
toSerialize["dir"] = o.Dir
|
|
}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Stdin) {
|
|
toSerialize["stdin"] = o.Stdin
|
|
}
|
|
if !IsNil(o.TimeoutSec) {
|
|
toSerialize["timeoutSec"] = o.TimeoutSec
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *SandboxExecRequest) UnmarshalJSON(data []byte) (err error) {
|
|
varSandboxExecRequest := _SandboxExecRequest{}
|
|
|
|
err = json.Unmarshal(data, &varSandboxExecRequest)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = SandboxExecRequest(varSandboxExecRequest)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "argv")
|
|
delete(additionalProperties, "command")
|
|
delete(additionalProperties, "dir")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "stdin")
|
|
delete(additionalProperties, "timeoutSec")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableSandboxExecRequest struct {
|
|
value *SandboxExecRequest
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableSandboxExecRequest) Get() *SandboxExecRequest {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableSandboxExecRequest) Set(val *SandboxExecRequest) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableSandboxExecRequest) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableSandboxExecRequest) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableSandboxExecRequest(val *SandboxExecRequest) *NullableSandboxExecRequest {
|
|
return &NullableSandboxExecRequest{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableSandboxExecRequest) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableSandboxExecRequest) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|