mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
459 lines
12 KiB
Go
459 lines
12 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 CodeIndexResult type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &CodeIndexResult{}
|
|
|
|
// CodeIndexResult struct for CodeIndexResult
|
|
type CodeIndexResult struct {
|
|
// Chunks is how many AST-boundary chunks the repo holds after this pass.
|
|
Chunks *int64 `json:"chunks,omitempty"`
|
|
// Files is how many files the repo holds after this pass.
|
|
Files *int64 `json:"files,omitempty"`
|
|
// Indexed is how many files were parsed and written on this pass.
|
|
Indexed *int64 `json:"indexed,omitempty"`
|
|
// Pruned is how many stored files were deleted because prune was set and they were absent from the request.
|
|
Pruned *int64 `json:"pruned,omitempty"`
|
|
// Repo is the repository that was indexed.
|
|
Repo *string `json:"repo,omitempty"`
|
|
// Semantic reports whether the semantic tier was available for this pass. When false the index is lexical + symbolic only and hybrid search still works.
|
|
Semantic *bool `json:"semantic,omitempty"`
|
|
// Skipped is how many files were unchanged by content hash and left alone.
|
|
Skipped *int64 `json:"skipped,omitempty"`
|
|
// Symbols is how many symbol definitions the repo holds after this pass.
|
|
Symbols *int64 `json:"symbols,omitempty"`
|
|
// Vectors is how many of those chunks carry an embedding.
|
|
Vectors *int64 `json:"vectors,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _CodeIndexResult CodeIndexResult
|
|
|
|
// NewCodeIndexResult instantiates a new CodeIndexResult 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 NewCodeIndexResult() *CodeIndexResult {
|
|
this := CodeIndexResult{}
|
|
return &this
|
|
}
|
|
|
|
// NewCodeIndexResultWithDefaults instantiates a new CodeIndexResult 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 NewCodeIndexResultWithDefaults() *CodeIndexResult {
|
|
this := CodeIndexResult{}
|
|
return &this
|
|
}
|
|
|
|
// GetChunks returns the Chunks field value if set, zero value otherwise.
|
|
func (o *CodeIndexResult) GetChunks() int64 {
|
|
if o == nil || IsNil(o.Chunks) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Chunks
|
|
}
|
|
|
|
// GetChunksOk returns a tuple with the Chunks field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CodeIndexResult) GetChunksOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Chunks) {
|
|
return nil, false
|
|
}
|
|
return o.Chunks, true
|
|
}
|
|
|
|
// HasChunks returns a boolean if a field has been set.
|
|
func (o *CodeIndexResult) HasChunks() bool {
|
|
if o != nil && !IsNil(o.Chunks) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetChunks gets a reference to the given int64 and assigns it to the Chunks field.
|
|
func (o *CodeIndexResult) SetChunks(v int64) {
|
|
o.Chunks = &v
|
|
}
|
|
|
|
// GetFiles returns the Files field value if set, zero value otherwise.
|
|
func (o *CodeIndexResult) GetFiles() int64 {
|
|
if o == nil || IsNil(o.Files) {
|
|
var ret int64
|
|
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 *CodeIndexResult) GetFilesOk() (*int64, 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 *CodeIndexResult) HasFiles() bool {
|
|
if o != nil && !IsNil(o.Files) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFiles gets a reference to the given int64 and assigns it to the Files field.
|
|
func (o *CodeIndexResult) SetFiles(v int64) {
|
|
o.Files = &v
|
|
}
|
|
|
|
// GetIndexed returns the Indexed field value if set, zero value otherwise.
|
|
func (o *CodeIndexResult) GetIndexed() int64 {
|
|
if o == nil || IsNil(o.Indexed) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Indexed
|
|
}
|
|
|
|
// GetIndexedOk returns a tuple with the Indexed field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CodeIndexResult) GetIndexedOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Indexed) {
|
|
return nil, false
|
|
}
|
|
return o.Indexed, true
|
|
}
|
|
|
|
// HasIndexed returns a boolean if a field has been set.
|
|
func (o *CodeIndexResult) HasIndexed() bool {
|
|
if o != nil && !IsNil(o.Indexed) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetIndexed gets a reference to the given int64 and assigns it to the Indexed field.
|
|
func (o *CodeIndexResult) SetIndexed(v int64) {
|
|
o.Indexed = &v
|
|
}
|
|
|
|
// GetPruned returns the Pruned field value if set, zero value otherwise.
|
|
func (o *CodeIndexResult) GetPruned() int64 {
|
|
if o == nil || IsNil(o.Pruned) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Pruned
|
|
}
|
|
|
|
// GetPrunedOk returns a tuple with the Pruned field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CodeIndexResult) GetPrunedOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Pruned) {
|
|
return nil, false
|
|
}
|
|
return o.Pruned, true
|
|
}
|
|
|
|
// HasPruned returns a boolean if a field has been set.
|
|
func (o *CodeIndexResult) HasPruned() bool {
|
|
if o != nil && !IsNil(o.Pruned) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPruned gets a reference to the given int64 and assigns it to the Pruned field.
|
|
func (o *CodeIndexResult) SetPruned(v int64) {
|
|
o.Pruned = &v
|
|
}
|
|
|
|
// GetRepo returns the Repo field value if set, zero value otherwise.
|
|
func (o *CodeIndexResult) 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 *CodeIndexResult) 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 *CodeIndexResult) 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 *CodeIndexResult) SetRepo(v string) {
|
|
o.Repo = &v
|
|
}
|
|
|
|
// GetSemantic returns the Semantic field value if set, zero value otherwise.
|
|
func (o *CodeIndexResult) GetSemantic() bool {
|
|
if o == nil || IsNil(o.Semantic) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Semantic
|
|
}
|
|
|
|
// GetSemanticOk returns a tuple with the Semantic field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CodeIndexResult) GetSemanticOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Semantic) {
|
|
return nil, false
|
|
}
|
|
return o.Semantic, true
|
|
}
|
|
|
|
// HasSemantic returns a boolean if a field has been set.
|
|
func (o *CodeIndexResult) HasSemantic() bool {
|
|
if o != nil && !IsNil(o.Semantic) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSemantic gets a reference to the given bool and assigns it to the Semantic field.
|
|
func (o *CodeIndexResult) SetSemantic(v bool) {
|
|
o.Semantic = &v
|
|
}
|
|
|
|
// GetSkipped returns the Skipped field value if set, zero value otherwise.
|
|
func (o *CodeIndexResult) GetSkipped() int64 {
|
|
if o == nil || IsNil(o.Skipped) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Skipped
|
|
}
|
|
|
|
// GetSkippedOk returns a tuple with the Skipped field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CodeIndexResult) GetSkippedOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Skipped) {
|
|
return nil, false
|
|
}
|
|
return o.Skipped, true
|
|
}
|
|
|
|
// HasSkipped returns a boolean if a field has been set.
|
|
func (o *CodeIndexResult) HasSkipped() bool {
|
|
if o != nil && !IsNil(o.Skipped) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSkipped gets a reference to the given int64 and assigns it to the Skipped field.
|
|
func (o *CodeIndexResult) SetSkipped(v int64) {
|
|
o.Skipped = &v
|
|
}
|
|
|
|
// GetSymbols returns the Symbols field value if set, zero value otherwise.
|
|
func (o *CodeIndexResult) 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 *CodeIndexResult) 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 *CodeIndexResult) 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 *CodeIndexResult) SetSymbols(v int64) {
|
|
o.Symbols = &v
|
|
}
|
|
|
|
// GetVectors returns the Vectors field value if set, zero value otherwise.
|
|
func (o *CodeIndexResult) GetVectors() int64 {
|
|
if o == nil || IsNil(o.Vectors) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Vectors
|
|
}
|
|
|
|
// GetVectorsOk returns a tuple with the Vectors field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CodeIndexResult) GetVectorsOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Vectors) {
|
|
return nil, false
|
|
}
|
|
return o.Vectors, true
|
|
}
|
|
|
|
// HasVectors returns a boolean if a field has been set.
|
|
func (o *CodeIndexResult) HasVectors() bool {
|
|
if o != nil && !IsNil(o.Vectors) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetVectors gets a reference to the given int64 and assigns it to the Vectors field.
|
|
func (o *CodeIndexResult) SetVectors(v int64) {
|
|
o.Vectors = &v
|
|
}
|
|
|
|
func (o CodeIndexResult) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o CodeIndexResult) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Chunks) {
|
|
toSerialize["chunks"] = o.Chunks
|
|
}
|
|
if !IsNil(o.Files) {
|
|
toSerialize["files"] = o.Files
|
|
}
|
|
if !IsNil(o.Indexed) {
|
|
toSerialize["indexed"] = o.Indexed
|
|
}
|
|
if !IsNil(o.Pruned) {
|
|
toSerialize["pruned"] = o.Pruned
|
|
}
|
|
if !IsNil(o.Repo) {
|
|
toSerialize["repo"] = o.Repo
|
|
}
|
|
if !IsNil(o.Semantic) {
|
|
toSerialize["semantic"] = o.Semantic
|
|
}
|
|
if !IsNil(o.Skipped) {
|
|
toSerialize["skipped"] = o.Skipped
|
|
}
|
|
if !IsNil(o.Symbols) {
|
|
toSerialize["symbols"] = o.Symbols
|
|
}
|
|
if !IsNil(o.Vectors) {
|
|
toSerialize["vectors"] = o.Vectors
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *CodeIndexResult) UnmarshalJSON(data []byte) (err error) {
|
|
varCodeIndexResult := _CodeIndexResult{}
|
|
|
|
err = json.Unmarshal(data, &varCodeIndexResult)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = CodeIndexResult(varCodeIndexResult)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "chunks")
|
|
delete(additionalProperties, "files")
|
|
delete(additionalProperties, "indexed")
|
|
delete(additionalProperties, "pruned")
|
|
delete(additionalProperties, "repo")
|
|
delete(additionalProperties, "semantic")
|
|
delete(additionalProperties, "skipped")
|
|
delete(additionalProperties, "symbols")
|
|
delete(additionalProperties, "vectors")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableCodeIndexResult struct {
|
|
value *CodeIndexResult
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableCodeIndexResult) Get() *CodeIndexResult {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableCodeIndexResult) Set(val *CodeIndexResult) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableCodeIndexResult) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableCodeIndexResult) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableCodeIndexResult(val *CodeIndexResult) *NullableCodeIndexResult {
|
|
return &NullableCodeIndexResult{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableCodeIndexResult) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableCodeIndexResult) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|