Files
sdk/model_vector_score.go

191 lines
4.6 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 VectorScore type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &VectorScore{}
// VectorScore struct for VectorScore
type VectorScore struct {
Score *float32 `json:"score,omitempty"`
Vector *string `json:"vector,omitempty"`
AdditionalProperties map[string]interface{}
}
type _VectorScore VectorScore
// NewVectorScore instantiates a new VectorScore 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 NewVectorScore() *VectorScore {
this := VectorScore{}
return &this
}
// NewVectorScoreWithDefaults instantiates a new VectorScore 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 NewVectorScoreWithDefaults() *VectorScore {
this := VectorScore{}
return &this
}
// GetScore returns the Score field value if set, zero value otherwise.
func (o *VectorScore) GetScore() float32 {
if o == nil || IsNil(o.Score) {
var ret float32
return ret
}
return *o.Score
}
// GetScoreOk returns a tuple with the Score field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VectorScore) GetScoreOk() (*float32, bool) {
if o == nil || IsNil(o.Score) {
return nil, false
}
return o.Score, true
}
// HasScore returns a boolean if a field has been set.
func (o *VectorScore) HasScore() bool {
if o != nil && !IsNil(o.Score) {
return true
}
return false
}
// SetScore gets a reference to the given float32 and assigns it to the Score field.
func (o *VectorScore) SetScore(v float32) {
o.Score = &v
}
// GetVector returns the Vector field value if set, zero value otherwise.
func (o *VectorScore) GetVector() string {
if o == nil || IsNil(o.Vector) {
var ret string
return ret
}
return *o.Vector
}
// GetVectorOk returns a tuple with the Vector field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VectorScore) GetVectorOk() (*string, bool) {
if o == nil || IsNil(o.Vector) {
return nil, false
}
return o.Vector, true
}
// HasVector returns a boolean if a field has been set.
func (o *VectorScore) HasVector() bool {
if o != nil && !IsNil(o.Vector) {
return true
}
return false
}
// SetVector gets a reference to the given string and assigns it to the Vector field.
func (o *VectorScore) SetVector(v string) {
o.Vector = &v
}
func (o VectorScore) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o VectorScore) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Score) {
toSerialize["score"] = o.Score
}
if !IsNil(o.Vector) {
toSerialize["vector"] = o.Vector
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *VectorScore) UnmarshalJSON(data []byte) (err error) {
varVectorScore := _VectorScore{}
err = json.Unmarshal(data, &varVectorScore)
if err != nil {
return err
}
*o = VectorScore(varVectorScore)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "score")
delete(additionalProperties, "vector")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableVectorScore struct {
value *VectorScore
isSet bool
}
func (v NullableVectorScore) Get() *VectorScore {
return v.value
}
func (v *NullableVectorScore) Set(val *VectorScore) {
v.value = val
v.isSet = true
}
func (v NullableVectorScore) IsSet() bool {
return v.isSet
}
func (v *NullableVectorScore) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableVectorScore(val *VectorScore) *NullableVectorScore {
return &NullableVectorScore{value: val, isSet: true}
}
func (v NullableVectorScore) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableVectorScore) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}