mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
7.2 KiB
Go
269 lines
7.2 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 KnowledgeRetrieveIn type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &KnowledgeRetrieveIn{}
|
|
|
|
// KnowledgeRetrieveIn struct for KnowledgeRetrieveIn
|
|
type KnowledgeRetrieveIn struct {
|
|
// Files are the files the question is about — the files a chat message references. Empty asks the whole workspace. The graph may still reach files beyond them.
|
|
Files []string `json:"files,omitempty"`
|
|
// Limit bounds the passages drilled out of the chosen sections. Default 8, maximum 24. The graph adds up to four more.
|
|
Limit *int64 `json:"limit,omitempty"`
|
|
// Project restricts retrieval to files indexed under one project scope.
|
|
Project *string `json:"project,omitempty"`
|
|
// Query is the question to answer. Required.
|
|
Query *string `json:"query,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _KnowledgeRetrieveIn KnowledgeRetrieveIn
|
|
|
|
// NewKnowledgeRetrieveIn instantiates a new KnowledgeRetrieveIn 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 NewKnowledgeRetrieveIn() *KnowledgeRetrieveIn {
|
|
this := KnowledgeRetrieveIn{}
|
|
return &this
|
|
}
|
|
|
|
// NewKnowledgeRetrieveInWithDefaults instantiates a new KnowledgeRetrieveIn 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 NewKnowledgeRetrieveInWithDefaults() *KnowledgeRetrieveIn {
|
|
this := KnowledgeRetrieveIn{}
|
|
return &this
|
|
}
|
|
|
|
// GetFiles returns the Files field value if set, zero value otherwise.
|
|
func (o *KnowledgeRetrieveIn) GetFiles() []string {
|
|
if o == nil || IsNil(o.Files) {
|
|
var ret []string
|
|
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 *KnowledgeRetrieveIn) GetFilesOk() ([]string, 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 *KnowledgeRetrieveIn) HasFiles() bool {
|
|
if o != nil && !IsNil(o.Files) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFiles gets a reference to the given []string and assigns it to the Files field.
|
|
func (o *KnowledgeRetrieveIn) SetFiles(v []string) {
|
|
o.Files = v
|
|
}
|
|
|
|
// GetLimit returns the Limit field value if set, zero value otherwise.
|
|
func (o *KnowledgeRetrieveIn) GetLimit() int64 {
|
|
if o == nil || IsNil(o.Limit) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Limit
|
|
}
|
|
|
|
// GetLimitOk returns a tuple with the Limit field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *KnowledgeRetrieveIn) GetLimitOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Limit) {
|
|
return nil, false
|
|
}
|
|
return o.Limit, true
|
|
}
|
|
|
|
// HasLimit returns a boolean if a field has been set.
|
|
func (o *KnowledgeRetrieveIn) HasLimit() bool {
|
|
if o != nil && !IsNil(o.Limit) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLimit gets a reference to the given int64 and assigns it to the Limit field.
|
|
func (o *KnowledgeRetrieveIn) SetLimit(v int64) {
|
|
o.Limit = &v
|
|
}
|
|
|
|
// GetProject returns the Project field value if set, zero value otherwise.
|
|
func (o *KnowledgeRetrieveIn) GetProject() string {
|
|
if o == nil || IsNil(o.Project) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Project
|
|
}
|
|
|
|
// GetProjectOk returns a tuple with the Project field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *KnowledgeRetrieveIn) GetProjectOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Project) {
|
|
return nil, false
|
|
}
|
|
return o.Project, true
|
|
}
|
|
|
|
// HasProject returns a boolean if a field has been set.
|
|
func (o *KnowledgeRetrieveIn) HasProject() bool {
|
|
if o != nil && !IsNil(o.Project) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetProject gets a reference to the given string and assigns it to the Project field.
|
|
func (o *KnowledgeRetrieveIn) SetProject(v string) {
|
|
o.Project = &v
|
|
}
|
|
|
|
// GetQuery returns the Query field value if set, zero value otherwise.
|
|
func (o *KnowledgeRetrieveIn) GetQuery() string {
|
|
if o == nil || IsNil(o.Query) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Query
|
|
}
|
|
|
|
// GetQueryOk returns a tuple with the Query field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *KnowledgeRetrieveIn) GetQueryOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Query) {
|
|
return nil, false
|
|
}
|
|
return o.Query, true
|
|
}
|
|
|
|
// HasQuery returns a boolean if a field has been set.
|
|
func (o *KnowledgeRetrieveIn) HasQuery() bool {
|
|
if o != nil && !IsNil(o.Query) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetQuery gets a reference to the given string and assigns it to the Query field.
|
|
func (o *KnowledgeRetrieveIn) SetQuery(v string) {
|
|
o.Query = &v
|
|
}
|
|
|
|
func (o KnowledgeRetrieveIn) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o KnowledgeRetrieveIn) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Files) {
|
|
toSerialize["files"] = o.Files
|
|
}
|
|
if !IsNil(o.Limit) {
|
|
toSerialize["limit"] = o.Limit
|
|
}
|
|
if !IsNil(o.Project) {
|
|
toSerialize["project"] = o.Project
|
|
}
|
|
if !IsNil(o.Query) {
|
|
toSerialize["query"] = o.Query
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *KnowledgeRetrieveIn) UnmarshalJSON(data []byte) (err error) {
|
|
varKnowledgeRetrieveIn := _KnowledgeRetrieveIn{}
|
|
|
|
err = json.Unmarshal(data, &varKnowledgeRetrieveIn)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = KnowledgeRetrieveIn(varKnowledgeRetrieveIn)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "files")
|
|
delete(additionalProperties, "limit")
|
|
delete(additionalProperties, "project")
|
|
delete(additionalProperties, "query")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableKnowledgeRetrieveIn struct {
|
|
value *KnowledgeRetrieveIn
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableKnowledgeRetrieveIn) Get() *KnowledgeRetrieveIn {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableKnowledgeRetrieveIn) Set(val *KnowledgeRetrieveIn) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableKnowledgeRetrieveIn) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableKnowledgeRetrieveIn) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableKnowledgeRetrieveIn(val *KnowledgeRetrieveIn) *NullableKnowledgeRetrieveIn {
|
|
return &NullableKnowledgeRetrieveIn{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableKnowledgeRetrieveIn) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableKnowledgeRetrieveIn) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|