Files
sdk/model_openai_embedding_request.go

303 lines
8.3 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 OpenaiEmbeddingRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &OpenaiEmbeddingRequest{}
// OpenaiEmbeddingRequest struct for OpenaiEmbeddingRequest
type OpenaiEmbeddingRequest struct {
Dimensions *int32 `json:"dimensions,omitempty"`
EncodingFormat *string `json:"encoding_format,omitempty"`
Input interface{} `json:"input,omitempty"`
Model *string `json:"model,omitempty"`
User *string `json:"user,omitempty"`
AdditionalProperties map[string]interface{}
}
type _OpenaiEmbeddingRequest OpenaiEmbeddingRequest
// NewOpenaiEmbeddingRequest instantiates a new OpenaiEmbeddingRequest 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 NewOpenaiEmbeddingRequest() *OpenaiEmbeddingRequest {
this := OpenaiEmbeddingRequest{}
return &this
}
// NewOpenaiEmbeddingRequestWithDefaults instantiates a new OpenaiEmbeddingRequest 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 NewOpenaiEmbeddingRequestWithDefaults() *OpenaiEmbeddingRequest {
this := OpenaiEmbeddingRequest{}
return &this
}
// GetDimensions returns the Dimensions field value if set, zero value otherwise.
func (o *OpenaiEmbeddingRequest) GetDimensions() int32 {
if o == nil || IsNil(o.Dimensions) {
var ret int32
return ret
}
return *o.Dimensions
}
// GetDimensionsOk returns a tuple with the Dimensions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiEmbeddingRequest) GetDimensionsOk() (*int32, bool) {
if o == nil || IsNil(o.Dimensions) {
return nil, false
}
return o.Dimensions, true
}
// HasDimensions returns a boolean if a field has been set.
func (o *OpenaiEmbeddingRequest) HasDimensions() bool {
if o != nil && !IsNil(o.Dimensions) {
return true
}
return false
}
// SetDimensions gets a reference to the given int32 and assigns it to the Dimensions field.
func (o *OpenaiEmbeddingRequest) SetDimensions(v int32) {
o.Dimensions = &v
}
// GetEncodingFormat returns the EncodingFormat field value if set, zero value otherwise.
func (o *OpenaiEmbeddingRequest) GetEncodingFormat() string {
if o == nil || IsNil(o.EncodingFormat) {
var ret string
return ret
}
return *o.EncodingFormat
}
// GetEncodingFormatOk returns a tuple with the EncodingFormat field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiEmbeddingRequest) GetEncodingFormatOk() (*string, bool) {
if o == nil || IsNil(o.EncodingFormat) {
return nil, false
}
return o.EncodingFormat, true
}
// HasEncodingFormat returns a boolean if a field has been set.
func (o *OpenaiEmbeddingRequest) HasEncodingFormat() bool {
if o != nil && !IsNil(o.EncodingFormat) {
return true
}
return false
}
// SetEncodingFormat gets a reference to the given string and assigns it to the EncodingFormat field.
func (o *OpenaiEmbeddingRequest) SetEncodingFormat(v string) {
o.EncodingFormat = &v
}
// GetInput returns the Input field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *OpenaiEmbeddingRequest) GetInput() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Input
}
// GetInputOk returns a tuple with the Input field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *OpenaiEmbeddingRequest) GetInputOk() (*interface{}, bool) {
if o == nil || IsNil(o.Input) {
return nil, false
}
return &o.Input, true
}
// HasInput returns a boolean if a field has been set.
func (o *OpenaiEmbeddingRequest) HasInput() bool {
if o != nil && !IsNil(o.Input) {
return true
}
return false
}
// SetInput gets a reference to the given interface{} and assigns it to the Input field.
func (o *OpenaiEmbeddingRequest) SetInput(v interface{}) {
o.Input = v
}
// GetModel returns the Model field value if set, zero value otherwise.
func (o *OpenaiEmbeddingRequest) 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 *OpenaiEmbeddingRequest) 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 *OpenaiEmbeddingRequest) 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 *OpenaiEmbeddingRequest) SetModel(v string) {
o.Model = &v
}
// GetUser returns the User field value if set, zero value otherwise.
func (o *OpenaiEmbeddingRequest) GetUser() string {
if o == nil || IsNil(o.User) {
var ret string
return ret
}
return *o.User
}
// GetUserOk returns a tuple with the User field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiEmbeddingRequest) GetUserOk() (*string, bool) {
if o == nil || IsNil(o.User) {
return nil, false
}
return o.User, true
}
// HasUser returns a boolean if a field has been set.
func (o *OpenaiEmbeddingRequest) HasUser() bool {
if o != nil && !IsNil(o.User) {
return true
}
return false
}
// SetUser gets a reference to the given string and assigns it to the User field.
func (o *OpenaiEmbeddingRequest) SetUser(v string) {
o.User = &v
}
func (o OpenaiEmbeddingRequest) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o OpenaiEmbeddingRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Dimensions) {
toSerialize["dimensions"] = o.Dimensions
}
if !IsNil(o.EncodingFormat) {
toSerialize["encoding_format"] = o.EncodingFormat
}
if o.Input != nil {
toSerialize["input"] = o.Input
}
if !IsNil(o.Model) {
toSerialize["model"] = o.Model
}
if !IsNil(o.User) {
toSerialize["user"] = o.User
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *OpenaiEmbeddingRequest) UnmarshalJSON(data []byte) (err error) {
varOpenaiEmbeddingRequest := _OpenaiEmbeddingRequest{}
err = json.Unmarshal(data, &varOpenaiEmbeddingRequest)
if err != nil {
return err
}
*o = OpenaiEmbeddingRequest(varOpenaiEmbeddingRequest)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "dimensions")
delete(additionalProperties, "encoding_format")
delete(additionalProperties, "input")
delete(additionalProperties, "model")
delete(additionalProperties, "user")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableOpenaiEmbeddingRequest struct {
value *OpenaiEmbeddingRequest
isSet bool
}
func (v NullableOpenaiEmbeddingRequest) Get() *OpenaiEmbeddingRequest {
return v.value
}
func (v *NullableOpenaiEmbeddingRequest) Set(val *OpenaiEmbeddingRequest) {
v.value = val
v.isSet = true
}
func (v NullableOpenaiEmbeddingRequest) IsSet() bool {
return v.isSet
}
func (v *NullableOpenaiEmbeddingRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableOpenaiEmbeddingRequest(val *OpenaiEmbeddingRequest) *NullableOpenaiEmbeddingRequest {
return &NullableOpenaiEmbeddingRequest{value: val, isSet: true}
}
func (v NullableOpenaiEmbeddingRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableOpenaiEmbeddingRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}