mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
228 lines
5.8 KiB
Go
228 lines
5.8 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 AiRankedDoc type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AiRankedDoc{}
|
|
|
|
// AiRankedDoc struct for AiRankedDoc
|
|
type AiRankedDoc struct {
|
|
Document *AiRankedText `json:"document,omitempty"`
|
|
Index *int32 `json:"index,omitempty"`
|
|
RelevanceScore *float32 `json:"relevance_score,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AiRankedDoc AiRankedDoc
|
|
|
|
// NewAiRankedDoc instantiates a new AiRankedDoc 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 NewAiRankedDoc() *AiRankedDoc {
|
|
this := AiRankedDoc{}
|
|
return &this
|
|
}
|
|
|
|
// NewAiRankedDocWithDefaults instantiates a new AiRankedDoc 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 NewAiRankedDocWithDefaults() *AiRankedDoc {
|
|
this := AiRankedDoc{}
|
|
return &this
|
|
}
|
|
|
|
// GetDocument returns the Document field value if set, zero value otherwise.
|
|
func (o *AiRankedDoc) GetDocument() AiRankedText {
|
|
if o == nil || IsNil(o.Document) {
|
|
var ret AiRankedText
|
|
return ret
|
|
}
|
|
return *o.Document
|
|
}
|
|
|
|
// GetDocumentOk returns a tuple with the Document field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiRankedDoc) GetDocumentOk() (*AiRankedText, bool) {
|
|
if o == nil || IsNil(o.Document) {
|
|
return nil, false
|
|
}
|
|
return o.Document, true
|
|
}
|
|
|
|
// HasDocument returns a boolean if a field has been set.
|
|
func (o *AiRankedDoc) HasDocument() bool {
|
|
if o != nil && !IsNil(o.Document) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDocument gets a reference to the given AiRankedText and assigns it to the Document field.
|
|
func (o *AiRankedDoc) SetDocument(v AiRankedText) {
|
|
o.Document = &v
|
|
}
|
|
|
|
// GetIndex returns the Index field value if set, zero value otherwise.
|
|
func (o *AiRankedDoc) GetIndex() int32 {
|
|
if o == nil || IsNil(o.Index) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.Index
|
|
}
|
|
|
|
// GetIndexOk returns a tuple with the Index field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiRankedDoc) GetIndexOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.Index) {
|
|
return nil, false
|
|
}
|
|
return o.Index, true
|
|
}
|
|
|
|
// HasIndex returns a boolean if a field has been set.
|
|
func (o *AiRankedDoc) HasIndex() bool {
|
|
if o != nil && !IsNil(o.Index) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetIndex gets a reference to the given int32 and assigns it to the Index field.
|
|
func (o *AiRankedDoc) SetIndex(v int32) {
|
|
o.Index = &v
|
|
}
|
|
|
|
// GetRelevanceScore returns the RelevanceScore field value if set, zero value otherwise.
|
|
func (o *AiRankedDoc) GetRelevanceScore() float32 {
|
|
if o == nil || IsNil(o.RelevanceScore) {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
return *o.RelevanceScore
|
|
}
|
|
|
|
// GetRelevanceScoreOk returns a tuple with the RelevanceScore field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiRankedDoc) GetRelevanceScoreOk() (*float32, bool) {
|
|
if o == nil || IsNil(o.RelevanceScore) {
|
|
return nil, false
|
|
}
|
|
return o.RelevanceScore, true
|
|
}
|
|
|
|
// HasRelevanceScore returns a boolean if a field has been set.
|
|
func (o *AiRankedDoc) HasRelevanceScore() bool {
|
|
if o != nil && !IsNil(o.RelevanceScore) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRelevanceScore gets a reference to the given float32 and assigns it to the RelevanceScore field.
|
|
func (o *AiRankedDoc) SetRelevanceScore(v float32) {
|
|
o.RelevanceScore = &v
|
|
}
|
|
|
|
func (o AiRankedDoc) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AiRankedDoc) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Document) {
|
|
toSerialize["document"] = o.Document
|
|
}
|
|
if !IsNil(o.Index) {
|
|
toSerialize["index"] = o.Index
|
|
}
|
|
if !IsNil(o.RelevanceScore) {
|
|
toSerialize["relevance_score"] = o.RelevanceScore
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AiRankedDoc) UnmarshalJSON(data []byte) (err error) {
|
|
varAiRankedDoc := _AiRankedDoc{}
|
|
|
|
err = json.Unmarshal(data, &varAiRankedDoc)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AiRankedDoc(varAiRankedDoc)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "document")
|
|
delete(additionalProperties, "index")
|
|
delete(additionalProperties, "relevance_score")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAiRankedDoc struct {
|
|
value *AiRankedDoc
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAiRankedDoc) Get() *AiRankedDoc {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAiRankedDoc) Set(val *AiRankedDoc) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAiRankedDoc) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAiRankedDoc) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAiRankedDoc(val *AiRankedDoc) *NullableAiRankedDoc {
|
|
return &NullableAiRankedDoc{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAiRankedDoc) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAiRankedDoc) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|