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 OpenaiEmbedding type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &OpenaiEmbedding{}
|
|
|
|
// OpenaiEmbedding struct for OpenaiEmbedding
|
|
type OpenaiEmbedding struct {
|
|
Embedding []float32 `json:"embedding,omitempty"`
|
|
Index *int32 `json:"index,omitempty"`
|
|
Object *string `json:"object,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _OpenaiEmbedding OpenaiEmbedding
|
|
|
|
// NewOpenaiEmbedding instantiates a new OpenaiEmbedding 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 NewOpenaiEmbedding() *OpenaiEmbedding {
|
|
this := OpenaiEmbedding{}
|
|
return &this
|
|
}
|
|
|
|
// NewOpenaiEmbeddingWithDefaults instantiates a new OpenaiEmbedding 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 NewOpenaiEmbeddingWithDefaults() *OpenaiEmbedding {
|
|
this := OpenaiEmbedding{}
|
|
return &this
|
|
}
|
|
|
|
// GetEmbedding returns the Embedding field value if set, zero value otherwise.
|
|
func (o *OpenaiEmbedding) GetEmbedding() []float32 {
|
|
if o == nil || IsNil(o.Embedding) {
|
|
var ret []float32
|
|
return ret
|
|
}
|
|
return o.Embedding
|
|
}
|
|
|
|
// GetEmbeddingOk returns a tuple with the Embedding field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiEmbedding) GetEmbeddingOk() ([]float32, bool) {
|
|
if o == nil || IsNil(o.Embedding) {
|
|
return nil, false
|
|
}
|
|
return o.Embedding, true
|
|
}
|
|
|
|
// HasEmbedding returns a boolean if a field has been set.
|
|
func (o *OpenaiEmbedding) HasEmbedding() bool {
|
|
if o != nil && !IsNil(o.Embedding) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEmbedding gets a reference to the given []float32 and assigns it to the Embedding field.
|
|
func (o *OpenaiEmbedding) SetEmbedding(v []float32) {
|
|
o.Embedding = v
|
|
}
|
|
|
|
// GetIndex returns the Index field value if set, zero value otherwise.
|
|
func (o *OpenaiEmbedding) 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 *OpenaiEmbedding) 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 *OpenaiEmbedding) 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 *OpenaiEmbedding) SetIndex(v int32) {
|
|
o.Index = &v
|
|
}
|
|
|
|
// GetObject returns the Object field value if set, zero value otherwise.
|
|
func (o *OpenaiEmbedding) GetObject() string {
|
|
if o == nil || IsNil(o.Object) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Object
|
|
}
|
|
|
|
// GetObjectOk returns a tuple with the Object field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiEmbedding) GetObjectOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Object) {
|
|
return nil, false
|
|
}
|
|
return o.Object, true
|
|
}
|
|
|
|
// HasObject returns a boolean if a field has been set.
|
|
func (o *OpenaiEmbedding) HasObject() bool {
|
|
if o != nil && !IsNil(o.Object) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetObject gets a reference to the given string and assigns it to the Object field.
|
|
func (o *OpenaiEmbedding) SetObject(v string) {
|
|
o.Object = &v
|
|
}
|
|
|
|
func (o OpenaiEmbedding) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o OpenaiEmbedding) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Embedding) {
|
|
toSerialize["embedding"] = o.Embedding
|
|
}
|
|
if !IsNil(o.Index) {
|
|
toSerialize["index"] = o.Index
|
|
}
|
|
if !IsNil(o.Object) {
|
|
toSerialize["object"] = o.Object
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *OpenaiEmbedding) UnmarshalJSON(data []byte) (err error) {
|
|
varOpenaiEmbedding := _OpenaiEmbedding{}
|
|
|
|
err = json.Unmarshal(data, &varOpenaiEmbedding)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = OpenaiEmbedding(varOpenaiEmbedding)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "embedding")
|
|
delete(additionalProperties, "index")
|
|
delete(additionalProperties, "object")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableOpenaiEmbedding struct {
|
|
value *OpenaiEmbedding
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableOpenaiEmbedding) Get() *OpenaiEmbedding {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableOpenaiEmbedding) Set(val *OpenaiEmbedding) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableOpenaiEmbedding) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableOpenaiEmbedding) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableOpenaiEmbedding(val *OpenaiEmbedding) *NullableOpenaiEmbedding {
|
|
return &NullableOpenaiEmbedding{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableOpenaiEmbedding) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableOpenaiEmbedding) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|