mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
7.1 KiB
Go
269 lines
7.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 SandboxBlob type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &SandboxBlob{}
|
|
|
|
// SandboxBlob struct for SandboxBlob
|
|
type SandboxBlob struct {
|
|
// Data is the file's bytes, verbatim, base64 on the wire. Empty for a directory and for an empty file alike; Dir is what tells those apart.
|
|
Data *string `json:"data,omitempty"`
|
|
// Dir says which of the two answers this is: true and the path is a directory, so read Entries; false and it is a file, so read Data. Nothing else distinguishes them — an empty file and an empty directory look alike here.
|
|
Dir *bool `json:"dir,omitempty"`
|
|
// Entries is a directory's contents as bare NAMES, not paths — one level, no recursion, dotfiles included, \".\" and \"..\" excluded (`ls -1A`). Empty for a file, and for an empty directory.
|
|
Entries []string `json:"entries,omitempty"`
|
|
// Path is the RESOLVED absolute path that was read — the caller's relative path joined onto the sandbox's working directory (Leased.Workdir), so it names the same file for a reader who does not know the class.
|
|
Path *string `json:"path,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _SandboxBlob SandboxBlob
|
|
|
|
// NewSandboxBlob instantiates a new SandboxBlob 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 NewSandboxBlob() *SandboxBlob {
|
|
this := SandboxBlob{}
|
|
return &this
|
|
}
|
|
|
|
// NewSandboxBlobWithDefaults instantiates a new SandboxBlob 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 NewSandboxBlobWithDefaults() *SandboxBlob {
|
|
this := SandboxBlob{}
|
|
return &this
|
|
}
|
|
|
|
// GetData returns the Data field value if set, zero value otherwise.
|
|
func (o *SandboxBlob) GetData() string {
|
|
if o == nil || IsNil(o.Data) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Data
|
|
}
|
|
|
|
// GetDataOk returns a tuple with the Data field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *SandboxBlob) GetDataOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Data) {
|
|
return nil, false
|
|
}
|
|
return o.Data, true
|
|
}
|
|
|
|
// HasData returns a boolean if a field has been set.
|
|
func (o *SandboxBlob) HasData() bool {
|
|
if o != nil && !IsNil(o.Data) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetData gets a reference to the given string and assigns it to the Data field.
|
|
func (o *SandboxBlob) SetData(v string) {
|
|
o.Data = &v
|
|
}
|
|
|
|
// GetDir returns the Dir field value if set, zero value otherwise.
|
|
func (o *SandboxBlob) GetDir() bool {
|
|
if o == nil || IsNil(o.Dir) {
|
|
var ret bool
|
|
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 *SandboxBlob) GetDirOk() (*bool, 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 *SandboxBlob) HasDir() bool {
|
|
if o != nil && !IsNil(o.Dir) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDir gets a reference to the given bool and assigns it to the Dir field.
|
|
func (o *SandboxBlob) SetDir(v bool) {
|
|
o.Dir = &v
|
|
}
|
|
|
|
// GetEntries returns the Entries field value if set, zero value otherwise.
|
|
func (o *SandboxBlob) GetEntries() []string {
|
|
if o == nil || IsNil(o.Entries) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Entries
|
|
}
|
|
|
|
// GetEntriesOk returns a tuple with the Entries field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *SandboxBlob) GetEntriesOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Entries) {
|
|
return nil, false
|
|
}
|
|
return o.Entries, true
|
|
}
|
|
|
|
// HasEntries returns a boolean if a field has been set.
|
|
func (o *SandboxBlob) HasEntries() bool {
|
|
if o != nil && !IsNil(o.Entries) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEntries gets a reference to the given []string and assigns it to the Entries field.
|
|
func (o *SandboxBlob) SetEntries(v []string) {
|
|
o.Entries = v
|
|
}
|
|
|
|
// GetPath returns the Path field value if set, zero value otherwise.
|
|
func (o *SandboxBlob) 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 *SandboxBlob) 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 *SandboxBlob) 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 *SandboxBlob) SetPath(v string) {
|
|
o.Path = &v
|
|
}
|
|
|
|
func (o SandboxBlob) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o SandboxBlob) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Data) {
|
|
toSerialize["data"] = o.Data
|
|
}
|
|
if !IsNil(o.Dir) {
|
|
toSerialize["dir"] = o.Dir
|
|
}
|
|
if !IsNil(o.Entries) {
|
|
toSerialize["entries"] = o.Entries
|
|
}
|
|
if !IsNil(o.Path) {
|
|
toSerialize["path"] = o.Path
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *SandboxBlob) UnmarshalJSON(data []byte) (err error) {
|
|
varSandboxBlob := _SandboxBlob{}
|
|
|
|
err = json.Unmarshal(data, &varSandboxBlob)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = SandboxBlob(varSandboxBlob)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "data")
|
|
delete(additionalProperties, "dir")
|
|
delete(additionalProperties, "entries")
|
|
delete(additionalProperties, "path")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableSandboxBlob struct {
|
|
value *SandboxBlob
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableSandboxBlob) Get() *SandboxBlob {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableSandboxBlob) Set(val *SandboxBlob) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableSandboxBlob) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableSandboxBlob) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableSandboxBlob(val *SandboxBlob) *NullableSandboxBlob {
|
|
return &NullableSandboxBlob{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableSandboxBlob) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableSandboxBlob) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|