Files
sdk/model_agent_coding_tree.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 AgentCodingTree type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AgentCodingTree{}
// AgentCodingTree struct for AgentCodingTree
type AgentCodingTree struct {
// Entries are the directory's immediate children, directories first.
Entries []AgentCodingEntry `json:"entries,omitempty"`
// Ref is the branch this was read at: the run's own once the forge holds it, its base until then.
Ref *string `json:"ref,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AgentCodingTree AgentCodingTree
// NewAgentCodingTree instantiates a new AgentCodingTree 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 NewAgentCodingTree() *AgentCodingTree {
this := AgentCodingTree{}
return &this
}
// NewAgentCodingTreeWithDefaults instantiates a new AgentCodingTree 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 NewAgentCodingTreeWithDefaults() *AgentCodingTree {
this := AgentCodingTree{}
return &this
}
// GetEntries returns the Entries field value if set, zero value otherwise.
func (o *AgentCodingTree) GetEntries() []AgentCodingEntry {
if o == nil || IsNil(o.Entries) {
var ret []AgentCodingEntry
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 *AgentCodingTree) GetEntriesOk() ([]AgentCodingEntry, 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 *AgentCodingTree) HasEntries() bool {
if o != nil && !IsNil(o.Entries) {
return true
}
return false
}
// SetEntries gets a reference to the given []AgentCodingEntry and assigns it to the Entries field.
func (o *AgentCodingTree) SetEntries(v []AgentCodingEntry) {
o.Entries = v
}
// GetRef returns the Ref field value if set, zero value otherwise.
func (o *AgentCodingTree) GetRef() string {
if o == nil || IsNil(o.Ref) {
var ret string
return ret
}
return *o.Ref
}
// GetRefOk returns a tuple with the Ref field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentCodingTree) GetRefOk() (*string, bool) {
if o == nil || IsNil(o.Ref) {
return nil, false
}
return o.Ref, true
}
// HasRef returns a boolean if a field has been set.
func (o *AgentCodingTree) HasRef() bool {
if o != nil && !IsNil(o.Ref) {
return true
}
return false
}
// SetRef gets a reference to the given string and assigns it to the Ref field.
func (o *AgentCodingTree) SetRef(v string) {
o.Ref = &v
}
func (o AgentCodingTree) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AgentCodingTree) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Entries) {
toSerialize["entries"] = o.Entries
}
if !IsNil(o.Ref) {
toSerialize["ref"] = o.Ref
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AgentCodingTree) UnmarshalJSON(data []byte) (err error) {
varAgentCodingTree := _AgentCodingTree{}
err = json.Unmarshal(data, &varAgentCodingTree)
if err != nil {
return err
}
*o = AgentCodingTree(varAgentCodingTree)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "entries")
delete(additionalProperties, "ref")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAgentCodingTree struct {
value *AgentCodingTree
isSet bool
}
func (v NullableAgentCodingTree) Get() *AgentCodingTree {
return v.value
}
func (v *NullableAgentCodingTree) Set(val *AgentCodingTree) {
v.value = val
v.isSet = true
}
func (v NullableAgentCodingTree) IsSet() bool {
return v.isSet
}
func (v *NullableAgentCodingTree) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAgentCodingTree(val *AgentCodingTree) *NullableAgentCodingTree {
return &NullableAgentCodingTree{value: val, isSet: true}
}
func (v NullableAgentCodingTree) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAgentCodingTree) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}