Files
sdk/model_git_tree_json.go

155 lines
3.8 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 GitTreeJSON type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GitTreeJSON{}
// GitTreeJSON struct for GitTreeJSON
type GitTreeJSON struct {
// Entries are the immediate children, directories before files.
Entries []GitTreeEntryJSON `json:"entries,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GitTreeJSON GitTreeJSON
// NewGitTreeJSON instantiates a new GitTreeJSON 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 NewGitTreeJSON() *GitTreeJSON {
this := GitTreeJSON{}
return &this
}
// NewGitTreeJSONWithDefaults instantiates a new GitTreeJSON 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 NewGitTreeJSONWithDefaults() *GitTreeJSON {
this := GitTreeJSON{}
return &this
}
// GetEntries returns the Entries field value if set, zero value otherwise.
func (o *GitTreeJSON) GetEntries() []GitTreeEntryJSON {
if o == nil || IsNil(o.Entries) {
var ret []GitTreeEntryJSON
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 *GitTreeJSON) GetEntriesOk() ([]GitTreeEntryJSON, 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 *GitTreeJSON) HasEntries() bool {
if o != nil && !IsNil(o.Entries) {
return true
}
return false
}
// SetEntries gets a reference to the given []GitTreeEntryJSON and assigns it to the Entries field.
func (o *GitTreeJSON) SetEntries(v []GitTreeEntryJSON) {
o.Entries = v
}
func (o GitTreeJSON) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GitTreeJSON) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Entries) {
toSerialize["entries"] = o.Entries
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GitTreeJSON) UnmarshalJSON(data []byte) (err error) {
varGitTreeJSON := _GitTreeJSON{}
err = json.Unmarshal(data, &varGitTreeJSON)
if err != nil {
return err
}
*o = GitTreeJSON(varGitTreeJSON)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "entries")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGitTreeJSON struct {
value *GitTreeJSON
isSet bool
}
func (v NullableGitTreeJSON) Get() *GitTreeJSON {
return v.value
}
func (v *NullableGitTreeJSON) Set(val *GitTreeJSON) {
v.value = val
v.isSet = true
}
func (v NullableGitTreeJSON) IsSet() bool {
return v.isSet
}
func (v *NullableGitTreeJSON) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGitTreeJSON(val *GitTreeJSON) *NullableGitTreeJSON {
return &NullableGitTreeJSON{value: val, isSet: true}
}
func (v NullableGitTreeJSON) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGitTreeJSON) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}