Files
sdk/model_sandbox_stopped.go

155 lines
4.0 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 SandboxStopped type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SandboxStopped{}
// SandboxStopped struct for SandboxStopped
type SandboxStopped struct {
// Stopped counts the commands that were still running and were interrupted. Zero says the sandbox was idle, not that the stop failed — see above.
Stopped *int64 `json:"stopped,omitempty"`
AdditionalProperties map[string]interface{}
}
type _SandboxStopped SandboxStopped
// NewSandboxStopped instantiates a new SandboxStopped 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 NewSandboxStopped() *SandboxStopped {
this := SandboxStopped{}
return &this
}
// NewSandboxStoppedWithDefaults instantiates a new SandboxStopped 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 NewSandboxStoppedWithDefaults() *SandboxStopped {
this := SandboxStopped{}
return &this
}
// GetStopped returns the Stopped field value if set, zero value otherwise.
func (o *SandboxStopped) GetStopped() int64 {
if o == nil || IsNil(o.Stopped) {
var ret int64
return ret
}
return *o.Stopped
}
// GetStoppedOk returns a tuple with the Stopped field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxStopped) GetStoppedOk() (*int64, bool) {
if o == nil || IsNil(o.Stopped) {
return nil, false
}
return o.Stopped, true
}
// HasStopped returns a boolean if a field has been set.
func (o *SandboxStopped) HasStopped() bool {
if o != nil && !IsNil(o.Stopped) {
return true
}
return false
}
// SetStopped gets a reference to the given int64 and assigns it to the Stopped field.
func (o *SandboxStopped) SetStopped(v int64) {
o.Stopped = &v
}
func (o SandboxStopped) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SandboxStopped) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Stopped) {
toSerialize["stopped"] = o.Stopped
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *SandboxStopped) UnmarshalJSON(data []byte) (err error) {
varSandboxStopped := _SandboxStopped{}
err = json.Unmarshal(data, &varSandboxStopped)
if err != nil {
return err
}
*o = SandboxStopped(varSandboxStopped)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "stopped")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableSandboxStopped struct {
value *SandboxStopped
isSet bool
}
func (v NullableSandboxStopped) Get() *SandboxStopped {
return v.value
}
func (v *NullableSandboxStopped) Set(val *SandboxStopped) {
v.value = val
v.isSet = true
}
func (v NullableSandboxStopped) IsSet() bool {
return v.isSet
}
func (v *NullableSandboxStopped) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSandboxStopped(val *SandboxStopped) *NullableSandboxStopped {
return &NullableSandboxStopped{value: val, isSet: true}
}
func (v NullableSandboxStopped) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSandboxStopped) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}