Files
sdk/model_vector.go

672 lines
16 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 Vector type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Vector{}
// Vector struct for Vector
type Vector struct {
CreatedTime *string `json:"createdTime,omitempty"`
Currency *string `json:"currency,omitempty"`
Data []float32 `json:"data,omitempty"`
Dimension *int32 `json:"dimension,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
File *string `json:"file,omitempty"`
Index *int32 `json:"index,omitempty"`
Name *string `json:"name,omitempty"`
Owner *string `json:"owner,omitempty"`
Price *float32 `json:"price,omitempty"`
Provider *string `json:"provider,omitempty"`
Score *float32 `json:"score,omitempty"`
Store *string `json:"store,omitempty"`
Text *string `json:"text,omitempty"`
TokenCount *int32 `json:"tokenCount,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Vector Vector
// NewVector instantiates a new Vector 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 NewVector() *Vector {
this := Vector{}
return &this
}
// NewVectorWithDefaults instantiates a new Vector 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 NewVectorWithDefaults() *Vector {
this := Vector{}
return &this
}
// GetCreatedTime returns the CreatedTime field value if set, zero value otherwise.
func (o *Vector) GetCreatedTime() string {
if o == nil || IsNil(o.CreatedTime) {
var ret string
return ret
}
return *o.CreatedTime
}
// GetCreatedTimeOk returns a tuple with the CreatedTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Vector) GetCreatedTimeOk() (*string, bool) {
if o == nil || IsNil(o.CreatedTime) {
return nil, false
}
return o.CreatedTime, true
}
// HasCreatedTime returns a boolean if a field has been set.
func (o *Vector) HasCreatedTime() bool {
if o != nil && !IsNil(o.CreatedTime) {
return true
}
return false
}
// SetCreatedTime gets a reference to the given string and assigns it to the CreatedTime field.
func (o *Vector) SetCreatedTime(v string) {
o.CreatedTime = &v
}
// GetCurrency returns the Currency field value if set, zero value otherwise.
func (o *Vector) GetCurrency() string {
if o == nil || IsNil(o.Currency) {
var ret string
return ret
}
return *o.Currency
}
// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Vector) GetCurrencyOk() (*string, bool) {
if o == nil || IsNil(o.Currency) {
return nil, false
}
return o.Currency, true
}
// HasCurrency returns a boolean if a field has been set.
func (o *Vector) HasCurrency() bool {
if o != nil && !IsNil(o.Currency) {
return true
}
return false
}
// SetCurrency gets a reference to the given string and assigns it to the Currency field.
func (o *Vector) SetCurrency(v string) {
o.Currency = &v
}
// GetData returns the Data field value if set, zero value otherwise.
func (o *Vector) GetData() []float32 {
if o == nil || IsNil(o.Data) {
var ret []float32
return ret
}
return o.Data
}
// GetDataOk returns a tuple with the Data field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Vector) GetDataOk() ([]float32, bool) {
if o == nil || IsNil(o.Data) {
return nil, false
}
return o.Data, true
}
// HasData returns a boolean if a field has been set.
func (o *Vector) HasData() bool {
if o != nil && !IsNil(o.Data) {
return true
}
return false
}
// SetData gets a reference to the given []float32 and assigns it to the Data field.
func (o *Vector) SetData(v []float32) {
o.Data = v
}
// GetDimension returns the Dimension field value if set, zero value otherwise.
func (o *Vector) GetDimension() int32 {
if o == nil || IsNil(o.Dimension) {
var ret int32
return ret
}
return *o.Dimension
}
// GetDimensionOk returns a tuple with the Dimension field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Vector) GetDimensionOk() (*int32, bool) {
if o == nil || IsNil(o.Dimension) {
return nil, false
}
return o.Dimension, true
}
// HasDimension returns a boolean if a field has been set.
func (o *Vector) HasDimension() bool {
if o != nil && !IsNil(o.Dimension) {
return true
}
return false
}
// SetDimension gets a reference to the given int32 and assigns it to the Dimension field.
func (o *Vector) SetDimension(v int32) {
o.Dimension = &v
}
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
func (o *Vector) GetDisplayName() string {
if o == nil || IsNil(o.DisplayName) {
var ret string
return ret
}
return *o.DisplayName
}
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Vector) GetDisplayNameOk() (*string, bool) {
if o == nil || IsNil(o.DisplayName) {
return nil, false
}
return o.DisplayName, true
}
// HasDisplayName returns a boolean if a field has been set.
func (o *Vector) HasDisplayName() bool {
if o != nil && !IsNil(o.DisplayName) {
return true
}
return false
}
// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
func (o *Vector) SetDisplayName(v string) {
o.DisplayName = &v
}
// GetFile returns the File field value if set, zero value otherwise.
func (o *Vector) GetFile() string {
if o == nil || IsNil(o.File) {
var ret string
return ret
}
return *o.File
}
// GetFileOk returns a tuple with the File field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Vector) GetFileOk() (*string, bool) {
if o == nil || IsNil(o.File) {
return nil, false
}
return o.File, true
}
// HasFile returns a boolean if a field has been set.
func (o *Vector) HasFile() bool {
if o != nil && !IsNil(o.File) {
return true
}
return false
}
// SetFile gets a reference to the given string and assigns it to the File field.
func (o *Vector) SetFile(v string) {
o.File = &v
}
// GetIndex returns the Index field value if set, zero value otherwise.
func (o *Vector) 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 *Vector) 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 *Vector) 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 *Vector) SetIndex(v int32) {
o.Index = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *Vector) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Vector) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *Vector) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *Vector) SetName(v string) {
o.Name = &v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *Vector) GetOwner() string {
if o == nil || IsNil(o.Owner) {
var ret string
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Vector) GetOwnerOk() (*string, bool) {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *Vector) HasOwner() bool {
if o != nil && !IsNil(o.Owner) {
return true
}
return false
}
// SetOwner gets a reference to the given string and assigns it to the Owner field.
func (o *Vector) SetOwner(v string) {
o.Owner = &v
}
// GetPrice returns the Price field value if set, zero value otherwise.
func (o *Vector) GetPrice() float32 {
if o == nil || IsNil(o.Price) {
var ret float32
return ret
}
return *o.Price
}
// GetPriceOk returns a tuple with the Price field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Vector) GetPriceOk() (*float32, bool) {
if o == nil || IsNil(o.Price) {
return nil, false
}
return o.Price, true
}
// HasPrice returns a boolean if a field has been set.
func (o *Vector) HasPrice() bool {
if o != nil && !IsNil(o.Price) {
return true
}
return false
}
// SetPrice gets a reference to the given float32 and assigns it to the Price field.
func (o *Vector) SetPrice(v float32) {
o.Price = &v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *Vector) GetProvider() string {
if o == nil || IsNil(o.Provider) {
var ret string
return ret
}
return *o.Provider
}
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Vector) GetProviderOk() (*string, bool) {
if o == nil || IsNil(o.Provider) {
return nil, false
}
return o.Provider, true
}
// HasProvider returns a boolean if a field has been set.
func (o *Vector) HasProvider() bool {
if o != nil && !IsNil(o.Provider) {
return true
}
return false
}
// SetProvider gets a reference to the given string and assigns it to the Provider field.
func (o *Vector) SetProvider(v string) {
o.Provider = &v
}
// GetScore returns the Score field value if set, zero value otherwise.
func (o *Vector) 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 *Vector) 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 *Vector) 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 *Vector) SetScore(v float32) {
o.Score = &v
}
// GetStore returns the Store field value if set, zero value otherwise.
func (o *Vector) GetStore() string {
if o == nil || IsNil(o.Store) {
var ret string
return ret
}
return *o.Store
}
// GetStoreOk returns a tuple with the Store field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Vector) GetStoreOk() (*string, bool) {
if o == nil || IsNil(o.Store) {
return nil, false
}
return o.Store, true
}
// HasStore returns a boolean if a field has been set.
func (o *Vector) HasStore() bool {
if o != nil && !IsNil(o.Store) {
return true
}
return false
}
// SetStore gets a reference to the given string and assigns it to the Store field.
func (o *Vector) SetStore(v string) {
o.Store = &v
}
// GetText returns the Text field value if set, zero value otherwise.
func (o *Vector) GetText() string {
if o == nil || IsNil(o.Text) {
var ret string
return ret
}
return *o.Text
}
// GetTextOk returns a tuple with the Text field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Vector) GetTextOk() (*string, bool) {
if o == nil || IsNil(o.Text) {
return nil, false
}
return o.Text, true
}
// HasText returns a boolean if a field has been set.
func (o *Vector) HasText() bool {
if o != nil && !IsNil(o.Text) {
return true
}
return false
}
// SetText gets a reference to the given string and assigns it to the Text field.
func (o *Vector) SetText(v string) {
o.Text = &v
}
// GetTokenCount returns the TokenCount field value if set, zero value otherwise.
func (o *Vector) GetTokenCount() int32 {
if o == nil || IsNil(o.TokenCount) {
var ret int32
return ret
}
return *o.TokenCount
}
// GetTokenCountOk returns a tuple with the TokenCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Vector) GetTokenCountOk() (*int32, bool) {
if o == nil || IsNil(o.TokenCount) {
return nil, false
}
return o.TokenCount, true
}
// HasTokenCount returns a boolean if a field has been set.
func (o *Vector) HasTokenCount() bool {
if o != nil && !IsNil(o.TokenCount) {
return true
}
return false
}
// SetTokenCount gets a reference to the given int32 and assigns it to the TokenCount field.
func (o *Vector) SetTokenCount(v int32) {
o.TokenCount = &v
}
func (o Vector) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Vector) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CreatedTime) {
toSerialize["createdTime"] = o.CreatedTime
}
if !IsNil(o.Currency) {
toSerialize["currency"] = o.Currency
}
if !IsNil(o.Data) {
toSerialize["data"] = o.Data
}
if !IsNil(o.Dimension) {
toSerialize["dimension"] = o.Dimension
}
if !IsNil(o.DisplayName) {
toSerialize["displayName"] = o.DisplayName
}
if !IsNil(o.File) {
toSerialize["file"] = o.File
}
if !IsNil(o.Index) {
toSerialize["index"] = o.Index
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
if !IsNil(o.Price) {
toSerialize["price"] = o.Price
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
if !IsNil(o.Score) {
toSerialize["score"] = o.Score
}
if !IsNil(o.Store) {
toSerialize["store"] = o.Store
}
if !IsNil(o.Text) {
toSerialize["text"] = o.Text
}
if !IsNil(o.TokenCount) {
toSerialize["tokenCount"] = o.TokenCount
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Vector) UnmarshalJSON(data []byte) (err error) {
varVector := _Vector{}
err = json.Unmarshal(data, &varVector)
if err != nil {
return err
}
*o = Vector(varVector)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "createdTime")
delete(additionalProperties, "currency")
delete(additionalProperties, "data")
delete(additionalProperties, "dimension")
delete(additionalProperties, "displayName")
delete(additionalProperties, "file")
delete(additionalProperties, "index")
delete(additionalProperties, "name")
delete(additionalProperties, "owner")
delete(additionalProperties, "price")
delete(additionalProperties, "provider")
delete(additionalProperties, "score")
delete(additionalProperties, "store")
delete(additionalProperties, "text")
delete(additionalProperties, "tokenCount")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableVector struct {
value *Vector
isSet bool
}
func (v NullableVector) Get() *Vector {
return v.value
}
func (v *NullableVector) Set(val *Vector) {
v.value = val
v.isSet = true
}
func (v NullableVector) IsSet() bool {
return v.isSet
}
func (v *NullableVector) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableVector(val *Vector) *NullableVector {
return &NullableVector{value: val, isSet: true}
}
func (v NullableVector) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableVector) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}