mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
7.3 KiB
Go
269 lines
7.3 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 ExecCodeResult type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ExecCodeResult{}
|
|
|
|
// ExecCodeResult struct for ExecCodeResult
|
|
type ExecCodeResult struct {
|
|
// Files are what this run CREATED OR CHANGED, decided by mtime against a marker taken before the program started — so it is the run's output, not a listing of the directory. Fetch each from GET /v1/exec/download/{session}/{id}.
|
|
Files []ExecCodeFile `json:"files,omitempty"`
|
|
// SessionID is the sandbox this run used — the one that was passed in, or the fresh one that was leased. Pass it to the next run to keep the filesystem.
|
|
SessionId *string `json:"session_id,omitempty"`
|
|
// Stderr is what the program wrote to standard error, INCLUDING a compiler's diagnostics and the trace of a program that exited non-zero. Its presence is not a failed call.
|
|
Stderr *string `json:"stderr,omitempty"`
|
|
// Stdout is what the program wrote to standard output.
|
|
Stdout *string `json:"stdout,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _ExecCodeResult ExecCodeResult
|
|
|
|
// NewExecCodeResult instantiates a new ExecCodeResult 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 NewExecCodeResult() *ExecCodeResult {
|
|
this := ExecCodeResult{}
|
|
return &this
|
|
}
|
|
|
|
// NewExecCodeResultWithDefaults instantiates a new ExecCodeResult 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 NewExecCodeResultWithDefaults() *ExecCodeResult {
|
|
this := ExecCodeResult{}
|
|
return &this
|
|
}
|
|
|
|
// GetFiles returns the Files field value if set, zero value otherwise.
|
|
func (o *ExecCodeResult) GetFiles() []ExecCodeFile {
|
|
if o == nil || IsNil(o.Files) {
|
|
var ret []ExecCodeFile
|
|
return ret
|
|
}
|
|
return o.Files
|
|
}
|
|
|
|
// GetFilesOk returns a tuple with the Files field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ExecCodeResult) GetFilesOk() ([]ExecCodeFile, bool) {
|
|
if o == nil || IsNil(o.Files) {
|
|
return nil, false
|
|
}
|
|
return o.Files, true
|
|
}
|
|
|
|
// HasFiles returns a boolean if a field has been set.
|
|
func (o *ExecCodeResult) HasFiles() bool {
|
|
if o != nil && !IsNil(o.Files) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFiles gets a reference to the given []ExecCodeFile and assigns it to the Files field.
|
|
func (o *ExecCodeResult) SetFiles(v []ExecCodeFile) {
|
|
o.Files = v
|
|
}
|
|
|
|
// GetSessionId returns the SessionId field value if set, zero value otherwise.
|
|
func (o *ExecCodeResult) GetSessionId() string {
|
|
if o == nil || IsNil(o.SessionId) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.SessionId
|
|
}
|
|
|
|
// GetSessionIdOk returns a tuple with the SessionId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ExecCodeResult) GetSessionIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.SessionId) {
|
|
return nil, false
|
|
}
|
|
return o.SessionId, true
|
|
}
|
|
|
|
// HasSessionId returns a boolean if a field has been set.
|
|
func (o *ExecCodeResult) HasSessionId() bool {
|
|
if o != nil && !IsNil(o.SessionId) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSessionId gets a reference to the given string and assigns it to the SessionId field.
|
|
func (o *ExecCodeResult) SetSessionId(v string) {
|
|
o.SessionId = &v
|
|
}
|
|
|
|
// GetStderr returns the Stderr field value if set, zero value otherwise.
|
|
func (o *ExecCodeResult) GetStderr() string {
|
|
if o == nil || IsNil(o.Stderr) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Stderr
|
|
}
|
|
|
|
// GetStderrOk returns a tuple with the Stderr field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ExecCodeResult) GetStderrOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Stderr) {
|
|
return nil, false
|
|
}
|
|
return o.Stderr, true
|
|
}
|
|
|
|
// HasStderr returns a boolean if a field has been set.
|
|
func (o *ExecCodeResult) HasStderr() bool {
|
|
if o != nil && !IsNil(o.Stderr) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStderr gets a reference to the given string and assigns it to the Stderr field.
|
|
func (o *ExecCodeResult) SetStderr(v string) {
|
|
o.Stderr = &v
|
|
}
|
|
|
|
// GetStdout returns the Stdout field value if set, zero value otherwise.
|
|
func (o *ExecCodeResult) GetStdout() string {
|
|
if o == nil || IsNil(o.Stdout) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Stdout
|
|
}
|
|
|
|
// GetStdoutOk returns a tuple with the Stdout field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ExecCodeResult) GetStdoutOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Stdout) {
|
|
return nil, false
|
|
}
|
|
return o.Stdout, true
|
|
}
|
|
|
|
// HasStdout returns a boolean if a field has been set.
|
|
func (o *ExecCodeResult) HasStdout() bool {
|
|
if o != nil && !IsNil(o.Stdout) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStdout gets a reference to the given string and assigns it to the Stdout field.
|
|
func (o *ExecCodeResult) SetStdout(v string) {
|
|
o.Stdout = &v
|
|
}
|
|
|
|
func (o ExecCodeResult) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ExecCodeResult) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Files) {
|
|
toSerialize["files"] = o.Files
|
|
}
|
|
if !IsNil(o.SessionId) {
|
|
toSerialize["session_id"] = o.SessionId
|
|
}
|
|
if !IsNil(o.Stderr) {
|
|
toSerialize["stderr"] = o.Stderr
|
|
}
|
|
if !IsNil(o.Stdout) {
|
|
toSerialize["stdout"] = o.Stdout
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ExecCodeResult) UnmarshalJSON(data []byte) (err error) {
|
|
varExecCodeResult := _ExecCodeResult{}
|
|
|
|
err = json.Unmarshal(data, &varExecCodeResult)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ExecCodeResult(varExecCodeResult)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "files")
|
|
delete(additionalProperties, "session_id")
|
|
delete(additionalProperties, "stderr")
|
|
delete(additionalProperties, "stdout")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableExecCodeResult struct {
|
|
value *ExecCodeResult
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableExecCodeResult) Get() *ExecCodeResult {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableExecCodeResult) Set(val *ExecCodeResult) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableExecCodeResult) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableExecCodeResult) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableExecCodeResult(val *ExecCodeResult) *NullableExecCodeResult {
|
|
return &NullableExecCodeResult{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableExecCodeResult) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableExecCodeResult) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|