Files
sdk/model_knowledge_search_in.go

269 lines
7.1 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 KnowledgeSearchIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &KnowledgeSearchIn{}
// KnowledgeSearchIn struct for KnowledgeSearchIn
type KnowledgeSearchIn struct {
// DocTypes restricts retrieval to a subset of the indexed knowledge doctypes (kb.page, kb.memory, kb.source). An empty or foreign list reads all of them.
Doctypes []string `json:"doctypes,omitempty"`
// Limit bounds the hits returned. Default 10, maximum 50.
Limit *int64 `json:"limit,omitempty"`
// Project narrows retrieval to one project scope.
Project *string `json:"project,omitempty"`
// Query is the natural-language question. Required.
Query *string `json:"query,omitempty"`
AdditionalProperties map[string]interface{}
}
type _KnowledgeSearchIn KnowledgeSearchIn
// NewKnowledgeSearchIn instantiates a new KnowledgeSearchIn 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 NewKnowledgeSearchIn() *KnowledgeSearchIn {
this := KnowledgeSearchIn{}
return &this
}
// NewKnowledgeSearchInWithDefaults instantiates a new KnowledgeSearchIn 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 NewKnowledgeSearchInWithDefaults() *KnowledgeSearchIn {
this := KnowledgeSearchIn{}
return &this
}
// GetDoctypes returns the Doctypes field value if set, zero value otherwise.
func (o *KnowledgeSearchIn) GetDoctypes() []string {
if o == nil || IsNil(o.Doctypes) {
var ret []string
return ret
}
return o.Doctypes
}
// GetDoctypesOk returns a tuple with the Doctypes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KnowledgeSearchIn) GetDoctypesOk() ([]string, bool) {
if o == nil || IsNil(o.Doctypes) {
return nil, false
}
return o.Doctypes, true
}
// HasDoctypes returns a boolean if a field has been set.
func (o *KnowledgeSearchIn) HasDoctypes() bool {
if o != nil && !IsNil(o.Doctypes) {
return true
}
return false
}
// SetDoctypes gets a reference to the given []string and assigns it to the Doctypes field.
func (o *KnowledgeSearchIn) SetDoctypes(v []string) {
o.Doctypes = v
}
// GetLimit returns the Limit field value if set, zero value otherwise.
func (o *KnowledgeSearchIn) 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 *KnowledgeSearchIn) 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 *KnowledgeSearchIn) 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 *KnowledgeSearchIn) SetLimit(v int64) {
o.Limit = &v
}
// GetProject returns the Project field value if set, zero value otherwise.
func (o *KnowledgeSearchIn) 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 *KnowledgeSearchIn) 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 *KnowledgeSearchIn) 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 *KnowledgeSearchIn) SetProject(v string) {
o.Project = &v
}
// GetQuery returns the Query field value if set, zero value otherwise.
func (o *KnowledgeSearchIn) 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 *KnowledgeSearchIn) 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 *KnowledgeSearchIn) 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 *KnowledgeSearchIn) SetQuery(v string) {
o.Query = &v
}
func (o KnowledgeSearchIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o KnowledgeSearchIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Doctypes) {
toSerialize["doctypes"] = o.Doctypes
}
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 *KnowledgeSearchIn) UnmarshalJSON(data []byte) (err error) {
varKnowledgeSearchIn := _KnowledgeSearchIn{}
err = json.Unmarshal(data, &varKnowledgeSearchIn)
if err != nil {
return err
}
*o = KnowledgeSearchIn(varKnowledgeSearchIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "doctypes")
delete(additionalProperties, "limit")
delete(additionalProperties, "project")
delete(additionalProperties, "query")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableKnowledgeSearchIn struct {
value *KnowledgeSearchIn
isSet bool
}
func (v NullableKnowledgeSearchIn) Get() *KnowledgeSearchIn {
return v.value
}
func (v *NullableKnowledgeSearchIn) Set(val *KnowledgeSearchIn) {
v.value = val
v.isSet = true
}
func (v NullableKnowledgeSearchIn) IsSet() bool {
return v.isSet
}
func (v *NullableKnowledgeSearchIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableKnowledgeSearchIn(val *KnowledgeSearchIn) *NullableKnowledgeSearchIn {
return &NullableKnowledgeSearchIn{value: val, isSet: true}
}
func (v NullableKnowledgeSearchIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableKnowledgeSearchIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}