Files
sdk/model_sandbox_wrote.go

193 lines
5.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 SandboxWrote type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SandboxWrote{}
// SandboxWrote struct for SandboxWrote
type SandboxWrote struct {
// Bytes is how many bytes the file now holds. A write REPLACES the file, so this is its whole length and not an amount appended, and 0 is a legitimate answer: a WriteIn with no Data truncates the file to nothing.
Bytes *int64 `json:"bytes,omitempty"`
// Path is where the bytes actually landed: the caller's path resolved against the sandbox's working directory (Leased.Workdir), which is what a later read or a shell line inside the sandbox has to name.
Path *string `json:"path,omitempty"`
AdditionalProperties map[string]interface{}
}
type _SandboxWrote SandboxWrote
// NewSandboxWrote instantiates a new SandboxWrote 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 NewSandboxWrote() *SandboxWrote {
this := SandboxWrote{}
return &this
}
// NewSandboxWroteWithDefaults instantiates a new SandboxWrote 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 NewSandboxWroteWithDefaults() *SandboxWrote {
this := SandboxWrote{}
return &this
}
// GetBytes returns the Bytes field value if set, zero value otherwise.
func (o *SandboxWrote) GetBytes() int64 {
if o == nil || IsNil(o.Bytes) {
var ret int64
return ret
}
return *o.Bytes
}
// GetBytesOk returns a tuple with the Bytes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxWrote) GetBytesOk() (*int64, bool) {
if o == nil || IsNil(o.Bytes) {
return nil, false
}
return o.Bytes, true
}
// HasBytes returns a boolean if a field has been set.
func (o *SandboxWrote) HasBytes() bool {
if o != nil && !IsNil(o.Bytes) {
return true
}
return false
}
// SetBytes gets a reference to the given int64 and assigns it to the Bytes field.
func (o *SandboxWrote) SetBytes(v int64) {
o.Bytes = &v
}
// GetPath returns the Path field value if set, zero value otherwise.
func (o *SandboxWrote) GetPath() string {
if o == nil || IsNil(o.Path) {
var ret string
return ret
}
return *o.Path
}
// GetPathOk returns a tuple with the Path field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxWrote) GetPathOk() (*string, bool) {
if o == nil || IsNil(o.Path) {
return nil, false
}
return o.Path, true
}
// HasPath returns a boolean if a field has been set.
func (o *SandboxWrote) HasPath() bool {
if o != nil && !IsNil(o.Path) {
return true
}
return false
}
// SetPath gets a reference to the given string and assigns it to the Path field.
func (o *SandboxWrote) SetPath(v string) {
o.Path = &v
}
func (o SandboxWrote) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SandboxWrote) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Bytes) {
toSerialize["bytes"] = o.Bytes
}
if !IsNil(o.Path) {
toSerialize["path"] = o.Path
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *SandboxWrote) UnmarshalJSON(data []byte) (err error) {
varSandboxWrote := _SandboxWrote{}
err = json.Unmarshal(data, &varSandboxWrote)
if err != nil {
return err
}
*o = SandboxWrote(varSandboxWrote)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "bytes")
delete(additionalProperties, "path")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableSandboxWrote struct {
value *SandboxWrote
isSet bool
}
func (v NullableSandboxWrote) Get() *SandboxWrote {
return v.value
}
func (v *NullableSandboxWrote) Set(val *SandboxWrote) {
v.value = val
v.isSet = true
}
func (v NullableSandboxWrote) IsSet() bool {
return v.isSet
}
func (v *NullableSandboxWrote) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSandboxWrote(val *SandboxWrote) *NullableSandboxWrote {
return &NullableSandboxWrote{value: val, isSet: true}
}
func (v NullableSandboxWrote) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSandboxWrote) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}