Files
sdk/model_knowledge_file_search_out.go

193 lines
5.5 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 KnowledgeFileSearchOut type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &KnowledgeFileSearchOut{}
// KnowledgeFileSearchOut struct for KnowledgeFileSearchOut
type KnowledgeFileSearchOut struct {
// Degraded is true when a leg failed — the query could not be embedded, or the full-text index could not be read — and Passages are what the other leg found.
Degraded *bool `json:"degraded,omitempty"`
// Passages are the matching passages, best first, at most Limit.
Passages []KnowledgeCitedPassage `json:"passages,omitempty"`
AdditionalProperties map[string]interface{}
}
type _KnowledgeFileSearchOut KnowledgeFileSearchOut
// NewKnowledgeFileSearchOut instantiates a new KnowledgeFileSearchOut 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 NewKnowledgeFileSearchOut() *KnowledgeFileSearchOut {
this := KnowledgeFileSearchOut{}
return &this
}
// NewKnowledgeFileSearchOutWithDefaults instantiates a new KnowledgeFileSearchOut 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 NewKnowledgeFileSearchOutWithDefaults() *KnowledgeFileSearchOut {
this := KnowledgeFileSearchOut{}
return &this
}
// GetDegraded returns the Degraded field value if set, zero value otherwise.
func (o *KnowledgeFileSearchOut) GetDegraded() bool {
if o == nil || IsNil(o.Degraded) {
var ret bool
return ret
}
return *o.Degraded
}
// GetDegradedOk returns a tuple with the Degraded field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KnowledgeFileSearchOut) GetDegradedOk() (*bool, bool) {
if o == nil || IsNil(o.Degraded) {
return nil, false
}
return o.Degraded, true
}
// HasDegraded returns a boolean if a field has been set.
func (o *KnowledgeFileSearchOut) HasDegraded() bool {
if o != nil && !IsNil(o.Degraded) {
return true
}
return false
}
// SetDegraded gets a reference to the given bool and assigns it to the Degraded field.
func (o *KnowledgeFileSearchOut) SetDegraded(v bool) {
o.Degraded = &v
}
// GetPassages returns the Passages field value if set, zero value otherwise.
func (o *KnowledgeFileSearchOut) GetPassages() []KnowledgeCitedPassage {
if o == nil || IsNil(o.Passages) {
var ret []KnowledgeCitedPassage
return ret
}
return o.Passages
}
// GetPassagesOk returns a tuple with the Passages field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KnowledgeFileSearchOut) GetPassagesOk() ([]KnowledgeCitedPassage, bool) {
if o == nil || IsNil(o.Passages) {
return nil, false
}
return o.Passages, true
}
// HasPassages returns a boolean if a field has been set.
func (o *KnowledgeFileSearchOut) HasPassages() bool {
if o != nil && !IsNil(o.Passages) {
return true
}
return false
}
// SetPassages gets a reference to the given []KnowledgeCitedPassage and assigns it to the Passages field.
func (o *KnowledgeFileSearchOut) SetPassages(v []KnowledgeCitedPassage) {
o.Passages = v
}
func (o KnowledgeFileSearchOut) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o KnowledgeFileSearchOut) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Degraded) {
toSerialize["degraded"] = o.Degraded
}
if !IsNil(o.Passages) {
toSerialize["passages"] = o.Passages
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *KnowledgeFileSearchOut) UnmarshalJSON(data []byte) (err error) {
varKnowledgeFileSearchOut := _KnowledgeFileSearchOut{}
err = json.Unmarshal(data, &varKnowledgeFileSearchOut)
if err != nil {
return err
}
*o = KnowledgeFileSearchOut(varKnowledgeFileSearchOut)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "degraded")
delete(additionalProperties, "passages")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableKnowledgeFileSearchOut struct {
value *KnowledgeFileSearchOut
isSet bool
}
func (v NullableKnowledgeFileSearchOut) Get() *KnowledgeFileSearchOut {
return v.value
}
func (v *NullableKnowledgeFileSearchOut) Set(val *KnowledgeFileSearchOut) {
v.value = val
v.isSet = true
}
func (v NullableKnowledgeFileSearchOut) IsSet() bool {
return v.isSet
}
func (v *NullableKnowledgeFileSearchOut) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableKnowledgeFileSearchOut(val *KnowledgeFileSearchOut) *NullableKnowledgeFileSearchOut {
return &NullableKnowledgeFileSearchOut{value: val, isSet: true}
}
func (v NullableKnowledgeFileSearchOut) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableKnowledgeFileSearchOut) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}