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 KnowledgeFileSearchIn type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &KnowledgeFileSearchIn{}
|
|
|
|
// KnowledgeFileSearchIn struct for KnowledgeFileSearchIn
|
|
type KnowledgeFileSearchIn struct {
|
|
// Files restricts the search to these file ids. Empty searches every file the org holds.
|
|
Files []string `json:"files,omitempty"`
|
|
// Limit bounds the passages returned. Default 8, maximum 50.
|
|
Limit *int64 `json:"limit,omitempty"`
|
|
// Project restricts the search to files indexed under one project scope.
|
|
Project *string `json:"project,omitempty"`
|
|
// Query is the question or phrase. Required.
|
|
Query *string `json:"query,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _KnowledgeFileSearchIn KnowledgeFileSearchIn
|
|
|
|
// NewKnowledgeFileSearchIn instantiates a new KnowledgeFileSearchIn 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 NewKnowledgeFileSearchIn() *KnowledgeFileSearchIn {
|
|
this := KnowledgeFileSearchIn{}
|
|
return &this
|
|
}
|
|
|
|
// NewKnowledgeFileSearchInWithDefaults instantiates a new KnowledgeFileSearchIn 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 NewKnowledgeFileSearchInWithDefaults() *KnowledgeFileSearchIn {
|
|
this := KnowledgeFileSearchIn{}
|
|
return &this
|
|
}
|
|
|
|
// GetFiles returns the Files field value if set, zero value otherwise.
|
|
func (o *KnowledgeFileSearchIn) 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 *KnowledgeFileSearchIn) 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 *KnowledgeFileSearchIn) 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 *KnowledgeFileSearchIn) SetFiles(v []string) {
|
|
o.Files = v
|
|
}
|
|
|
|
// GetLimit returns the Limit field value if set, zero value otherwise.
|
|
func (o *KnowledgeFileSearchIn) 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 *KnowledgeFileSearchIn) 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 *KnowledgeFileSearchIn) 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 *KnowledgeFileSearchIn) SetLimit(v int64) {
|
|
o.Limit = &v
|
|
}
|
|
|
|
// GetProject returns the Project field value if set, zero value otherwise.
|
|
func (o *KnowledgeFileSearchIn) 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 *KnowledgeFileSearchIn) 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 *KnowledgeFileSearchIn) 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 *KnowledgeFileSearchIn) SetProject(v string) {
|
|
o.Project = &v
|
|
}
|
|
|
|
// GetQuery returns the Query field value if set, zero value otherwise.
|
|
func (o *KnowledgeFileSearchIn) 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 *KnowledgeFileSearchIn) 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 *KnowledgeFileSearchIn) 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 *KnowledgeFileSearchIn) SetQuery(v string) {
|
|
o.Query = &v
|
|
}
|
|
|
|
func (o KnowledgeFileSearchIn) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o KnowledgeFileSearchIn) 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 *KnowledgeFileSearchIn) UnmarshalJSON(data []byte) (err error) {
|
|
varKnowledgeFileSearchIn := _KnowledgeFileSearchIn{}
|
|
|
|
err = json.Unmarshal(data, &varKnowledgeFileSearchIn)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = KnowledgeFileSearchIn(varKnowledgeFileSearchIn)
|
|
|
|
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 NullableKnowledgeFileSearchIn struct {
|
|
value *KnowledgeFileSearchIn
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableKnowledgeFileSearchIn) Get() *KnowledgeFileSearchIn {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableKnowledgeFileSearchIn) Set(val *KnowledgeFileSearchIn) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableKnowledgeFileSearchIn) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableKnowledgeFileSearchIn) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableKnowledgeFileSearchIn(val *KnowledgeFileSearchIn) *NullableKnowledgeFileSearchIn {
|
|
return &NullableKnowledgeFileSearchIn{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableKnowledgeFileSearchIn) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableKnowledgeFileSearchIn) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|