Files
sdk/model_code_repo_tree.go

193 lines
4.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 CodeRepoTree type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CodeRepoTree{}
// CodeRepoTree struct for CodeRepoTree
type CodeRepoTree struct {
// Files are the repo's indexed files in path order, each with its language and how many symbols it defines. Never null.
Files []CodeTreeEntry `json:"files,omitempty"`
// Repo echoes the repository that was walked.
Repo *string `json:"repo,omitempty"`
AdditionalProperties map[string]interface{}
}
type _CodeRepoTree CodeRepoTree
// NewCodeRepoTree instantiates a new CodeRepoTree 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 NewCodeRepoTree() *CodeRepoTree {
this := CodeRepoTree{}
return &this
}
// NewCodeRepoTreeWithDefaults instantiates a new CodeRepoTree 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 NewCodeRepoTreeWithDefaults() *CodeRepoTree {
this := CodeRepoTree{}
return &this
}
// GetFiles returns the Files field value if set, zero value otherwise.
func (o *CodeRepoTree) GetFiles() []CodeTreeEntry {
if o == nil || IsNil(o.Files) {
var ret []CodeTreeEntry
return ret
}
return o.Files
}
// GetFilesOk returns a tuple with the Files field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CodeRepoTree) GetFilesOk() ([]CodeTreeEntry, bool) {
if o == nil || IsNil(o.Files) {
return nil, false
}
return o.Files, true
}
// HasFiles returns a boolean if a field has been set.
func (o *CodeRepoTree) HasFiles() bool {
if o != nil && !IsNil(o.Files) {
return true
}
return false
}
// SetFiles gets a reference to the given []CodeTreeEntry and assigns it to the Files field.
func (o *CodeRepoTree) SetFiles(v []CodeTreeEntry) {
o.Files = v
}
// GetRepo returns the Repo field value if set, zero value otherwise.
func (o *CodeRepoTree) GetRepo() string {
if o == nil || IsNil(o.Repo) {
var ret string
return ret
}
return *o.Repo
}
// GetRepoOk returns a tuple with the Repo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CodeRepoTree) GetRepoOk() (*string, bool) {
if o == nil || IsNil(o.Repo) {
return nil, false
}
return o.Repo, true
}
// HasRepo returns a boolean if a field has been set.
func (o *CodeRepoTree) HasRepo() bool {
if o != nil && !IsNil(o.Repo) {
return true
}
return false
}
// SetRepo gets a reference to the given string and assigns it to the Repo field.
func (o *CodeRepoTree) SetRepo(v string) {
o.Repo = &v
}
func (o CodeRepoTree) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CodeRepoTree) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Files) {
toSerialize["files"] = o.Files
}
if !IsNil(o.Repo) {
toSerialize["repo"] = o.Repo
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *CodeRepoTree) UnmarshalJSON(data []byte) (err error) {
varCodeRepoTree := _CodeRepoTree{}
err = json.Unmarshal(data, &varCodeRepoTree)
if err != nil {
return err
}
*o = CodeRepoTree(varCodeRepoTree)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "files")
delete(additionalProperties, "repo")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableCodeRepoTree struct {
value *CodeRepoTree
isSet bool
}
func (v NullableCodeRepoTree) Get() *CodeRepoTree {
return v.value
}
func (v *NullableCodeRepoTree) Set(val *CodeRepoTree) {
v.value = val
v.isSet = true
}
func (v NullableCodeRepoTree) IsSet() bool {
return v.isSet
}
func (v *NullableCodeRepoTree) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCodeRepoTree(val *CodeRepoTree) *NullableCodeRepoTree {
return &NullableCodeRepoTree{value: val, isSet: true}
}
func (v NullableCodeRepoTree) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCodeRepoTree) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}