Files
sdk/model_openai_embedding_response.go

265 lines
7.1 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 OpenaiEmbeddingResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &OpenaiEmbeddingResponse{}
// OpenaiEmbeddingResponse struct for OpenaiEmbeddingResponse
type OpenaiEmbeddingResponse struct {
Data []OpenaiEmbedding `json:"data,omitempty"`
Model *string `json:"model,omitempty"`
Object *string `json:"object,omitempty"`
Usage *OpenaiUsage `json:"usage,omitempty"`
AdditionalProperties map[string]interface{}
}
type _OpenaiEmbeddingResponse OpenaiEmbeddingResponse
// NewOpenaiEmbeddingResponse instantiates a new OpenaiEmbeddingResponse 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 NewOpenaiEmbeddingResponse() *OpenaiEmbeddingResponse {
this := OpenaiEmbeddingResponse{}
return &this
}
// NewOpenaiEmbeddingResponseWithDefaults instantiates a new OpenaiEmbeddingResponse 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 NewOpenaiEmbeddingResponseWithDefaults() *OpenaiEmbeddingResponse {
this := OpenaiEmbeddingResponse{}
return &this
}
// GetData returns the Data field value if set, zero value otherwise.
func (o *OpenaiEmbeddingResponse) GetData() []OpenaiEmbedding {
if o == nil || IsNil(o.Data) {
var ret []OpenaiEmbedding
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 *OpenaiEmbeddingResponse) GetDataOk() ([]OpenaiEmbedding, 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 *OpenaiEmbeddingResponse) HasData() bool {
if o != nil && !IsNil(o.Data) {
return true
}
return false
}
// SetData gets a reference to the given []OpenaiEmbedding and assigns it to the Data field.
func (o *OpenaiEmbeddingResponse) SetData(v []OpenaiEmbedding) {
o.Data = v
}
// GetModel returns the Model field value if set, zero value otherwise.
func (o *OpenaiEmbeddingResponse) GetModel() string {
if o == nil || IsNil(o.Model) {
var ret string
return ret
}
return *o.Model
}
// GetModelOk returns a tuple with the Model field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiEmbeddingResponse) GetModelOk() (*string, bool) {
if o == nil || IsNil(o.Model) {
return nil, false
}
return o.Model, true
}
// HasModel returns a boolean if a field has been set.
func (o *OpenaiEmbeddingResponse) HasModel() bool {
if o != nil && !IsNil(o.Model) {
return true
}
return false
}
// SetModel gets a reference to the given string and assigns it to the Model field.
func (o *OpenaiEmbeddingResponse) SetModel(v string) {
o.Model = &v
}
// GetObject returns the Object field value if set, zero value otherwise.
func (o *OpenaiEmbeddingResponse) 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 *OpenaiEmbeddingResponse) 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 *OpenaiEmbeddingResponse) 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 *OpenaiEmbeddingResponse) SetObject(v string) {
o.Object = &v
}
// GetUsage returns the Usage field value if set, zero value otherwise.
func (o *OpenaiEmbeddingResponse) GetUsage() OpenaiUsage {
if o == nil || IsNil(o.Usage) {
var ret OpenaiUsage
return ret
}
return *o.Usage
}
// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiEmbeddingResponse) GetUsageOk() (*OpenaiUsage, bool) {
if o == nil || IsNil(o.Usage) {
return nil, false
}
return o.Usage, true
}
// HasUsage returns a boolean if a field has been set.
func (o *OpenaiEmbeddingResponse) HasUsage() bool {
if o != nil && !IsNil(o.Usage) {
return true
}
return false
}
// SetUsage gets a reference to the given OpenaiUsage and assigns it to the Usage field.
func (o *OpenaiEmbeddingResponse) SetUsage(v OpenaiUsage) {
o.Usage = &v
}
func (o OpenaiEmbeddingResponse) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o OpenaiEmbeddingResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Data) {
toSerialize["data"] = o.Data
}
if !IsNil(o.Model) {
toSerialize["model"] = o.Model
}
if !IsNil(o.Object) {
toSerialize["object"] = o.Object
}
if !IsNil(o.Usage) {
toSerialize["usage"] = o.Usage
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *OpenaiEmbeddingResponse) UnmarshalJSON(data []byte) (err error) {
varOpenaiEmbeddingResponse := _OpenaiEmbeddingResponse{}
err = json.Unmarshal(data, &varOpenaiEmbeddingResponse)
if err != nil {
return err
}
*o = OpenaiEmbeddingResponse(varOpenaiEmbeddingResponse)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "data")
delete(additionalProperties, "model")
delete(additionalProperties, "object")
delete(additionalProperties, "usage")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableOpenaiEmbeddingResponse struct {
value *OpenaiEmbeddingResponse
isSet bool
}
func (v NullableOpenaiEmbeddingResponse) Get() *OpenaiEmbeddingResponse {
return v.value
}
func (v *NullableOpenaiEmbeddingResponse) Set(val *OpenaiEmbeddingResponse) {
v.value = val
v.isSet = true
}
func (v NullableOpenaiEmbeddingResponse) IsSet() bool {
return v.isSet
}
func (v *NullableOpenaiEmbeddingResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableOpenaiEmbeddingResponse(val *OpenaiEmbeddingResponse) *NullableOpenaiEmbeddingResponse {
return &NullableOpenaiEmbeddingResponse{value: val, isSet: true}
}
func (v NullableOpenaiEmbeddingResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableOpenaiEmbeddingResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}