Files
sdk/model_sandbox_exec_result.go

231 lines
6.4 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 SandboxExecResult type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SandboxExecResult{}
// SandboxExecResult struct for SandboxExecResult
type SandboxExecResult struct {
// ExitCode is the command's own exit status. A non-zero one is a SUCCESSFUL call carrying a failed command — the HTTP status stays 200, because \"the command failed\" and \"the call failed\" are different facts and a caller has to be able to tell them apart.
ExitCode *int64 `json:"exitCode,omitempty"`
// Stderr is everything it wrote to standard error. It is populated on a successful run too — plenty of tools report progress there — so it is not a signal that anything went wrong; ExitCode is.
Stderr *string `json:"stderr,omitempty"`
// Stdout is everything the command wrote to standard output, as text.
Stdout *string `json:"stdout,omitempty"`
AdditionalProperties map[string]interface{}
}
type _SandboxExecResult SandboxExecResult
// NewSandboxExecResult instantiates a new SandboxExecResult 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 NewSandboxExecResult() *SandboxExecResult {
this := SandboxExecResult{}
return &this
}
// NewSandboxExecResultWithDefaults instantiates a new SandboxExecResult 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 NewSandboxExecResultWithDefaults() *SandboxExecResult {
this := SandboxExecResult{}
return &this
}
// GetExitCode returns the ExitCode field value if set, zero value otherwise.
func (o *SandboxExecResult) GetExitCode() int64 {
if o == nil || IsNil(o.ExitCode) {
var ret int64
return ret
}
return *o.ExitCode
}
// GetExitCodeOk returns a tuple with the ExitCode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxExecResult) GetExitCodeOk() (*int64, bool) {
if o == nil || IsNil(o.ExitCode) {
return nil, false
}
return o.ExitCode, true
}
// HasExitCode returns a boolean if a field has been set.
func (o *SandboxExecResult) HasExitCode() bool {
if o != nil && !IsNil(o.ExitCode) {
return true
}
return false
}
// SetExitCode gets a reference to the given int64 and assigns it to the ExitCode field.
func (o *SandboxExecResult) SetExitCode(v int64) {
o.ExitCode = &v
}
// GetStderr returns the Stderr field value if set, zero value otherwise.
func (o *SandboxExecResult) 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 *SandboxExecResult) 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 *SandboxExecResult) 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 *SandboxExecResult) SetStderr(v string) {
o.Stderr = &v
}
// GetStdout returns the Stdout field value if set, zero value otherwise.
func (o *SandboxExecResult) 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 *SandboxExecResult) 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 *SandboxExecResult) 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 *SandboxExecResult) SetStdout(v string) {
o.Stdout = &v
}
func (o SandboxExecResult) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SandboxExecResult) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ExitCode) {
toSerialize["exitCode"] = o.ExitCode
}
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 *SandboxExecResult) UnmarshalJSON(data []byte) (err error) {
varSandboxExecResult := _SandboxExecResult{}
err = json.Unmarshal(data, &varSandboxExecResult)
if err != nil {
return err
}
*o = SandboxExecResult(varSandboxExecResult)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "exitCode")
delete(additionalProperties, "stderr")
delete(additionalProperties, "stdout")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableSandboxExecResult struct {
value *SandboxExecResult
isSet bool
}
func (v NullableSandboxExecResult) Get() *SandboxExecResult {
return v.value
}
func (v *NullableSandboxExecResult) Set(val *SandboxExecResult) {
v.value = val
v.isSet = true
}
func (v NullableSandboxExecResult) IsSet() bool {
return v.isSet
}
func (v *NullableSandboxExecResult) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSandboxExecResult(val *SandboxExecResult) *NullableSandboxExecResult {
return &NullableSandboxExecResult{value: val, isSet: true}
}
func (v NullableSandboxExecResult) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSandboxExecResult) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}