mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
6.0 KiB
Go
231 lines
6.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 CodeTreeEntry type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &CodeTreeEntry{}
|
|
|
|
// CodeTreeEntry struct for CodeTreeEntry
|
|
type CodeTreeEntry struct {
|
|
// Lang is the language the indexer parsed the file as (\"go\", \"python\", …), or empty when it recognised none — in which case Symbols is 0 because nothing was extracted, not because the file declares nothing.
|
|
Lang *string `json:"lang,omitempty"`
|
|
// Path is the file, relative to the repo root. The list is ordered by it, so a reader can see module layout without sorting.
|
|
Path *string `json:"path,omitempty"`
|
|
// Symbols is how many top-level declarations the file defines. A file with none is still listed: the file set is the authority here and the counts decorate it.
|
|
Symbols *int64 `json:"symbols,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _CodeTreeEntry CodeTreeEntry
|
|
|
|
// NewCodeTreeEntry instantiates a new CodeTreeEntry 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 NewCodeTreeEntry() *CodeTreeEntry {
|
|
this := CodeTreeEntry{}
|
|
return &this
|
|
}
|
|
|
|
// NewCodeTreeEntryWithDefaults instantiates a new CodeTreeEntry 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 NewCodeTreeEntryWithDefaults() *CodeTreeEntry {
|
|
this := CodeTreeEntry{}
|
|
return &this
|
|
}
|
|
|
|
// GetLang returns the Lang field value if set, zero value otherwise.
|
|
func (o *CodeTreeEntry) GetLang() string {
|
|
if o == nil || IsNil(o.Lang) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Lang
|
|
}
|
|
|
|
// GetLangOk returns a tuple with the Lang field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CodeTreeEntry) GetLangOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Lang) {
|
|
return nil, false
|
|
}
|
|
return o.Lang, true
|
|
}
|
|
|
|
// HasLang returns a boolean if a field has been set.
|
|
func (o *CodeTreeEntry) HasLang() bool {
|
|
if o != nil && !IsNil(o.Lang) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLang gets a reference to the given string and assigns it to the Lang field.
|
|
func (o *CodeTreeEntry) SetLang(v string) {
|
|
o.Lang = &v
|
|
}
|
|
|
|
// GetPath returns the Path field value if set, zero value otherwise.
|
|
func (o *CodeTreeEntry) 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 *CodeTreeEntry) 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 *CodeTreeEntry) 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 *CodeTreeEntry) SetPath(v string) {
|
|
o.Path = &v
|
|
}
|
|
|
|
// GetSymbols returns the Symbols field value if set, zero value otherwise.
|
|
func (o *CodeTreeEntry) GetSymbols() int64 {
|
|
if o == nil || IsNil(o.Symbols) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Symbols
|
|
}
|
|
|
|
// GetSymbolsOk returns a tuple with the Symbols field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CodeTreeEntry) GetSymbolsOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Symbols) {
|
|
return nil, false
|
|
}
|
|
return o.Symbols, true
|
|
}
|
|
|
|
// HasSymbols returns a boolean if a field has been set.
|
|
func (o *CodeTreeEntry) HasSymbols() bool {
|
|
if o != nil && !IsNil(o.Symbols) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSymbols gets a reference to the given int64 and assigns it to the Symbols field.
|
|
func (o *CodeTreeEntry) SetSymbols(v int64) {
|
|
o.Symbols = &v
|
|
}
|
|
|
|
func (o CodeTreeEntry) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o CodeTreeEntry) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Lang) {
|
|
toSerialize["lang"] = o.Lang
|
|
}
|
|
if !IsNil(o.Path) {
|
|
toSerialize["path"] = o.Path
|
|
}
|
|
if !IsNil(o.Symbols) {
|
|
toSerialize["symbols"] = o.Symbols
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *CodeTreeEntry) UnmarshalJSON(data []byte) (err error) {
|
|
varCodeTreeEntry := _CodeTreeEntry{}
|
|
|
|
err = json.Unmarshal(data, &varCodeTreeEntry)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = CodeTreeEntry(varCodeTreeEntry)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "lang")
|
|
delete(additionalProperties, "path")
|
|
delete(additionalProperties, "symbols")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableCodeTreeEntry struct {
|
|
value *CodeTreeEntry
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableCodeTreeEntry) Get() *CodeTreeEntry {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableCodeTreeEntry) Set(val *CodeTreeEntry) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableCodeTreeEntry) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableCodeTreeEntry) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableCodeTreeEntry(val *CodeTreeEntry) *NullableCodeTreeEntry {
|
|
return &NullableCodeTreeEntry{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableCodeTreeEntry) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableCodeTreeEntry) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|