mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
524 lines
13 KiB
Go
524 lines
13 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 Memory type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &Memory{}
|
|
|
|
// Memory struct for Memory
|
|
type Memory struct {
|
|
Content *string `json:"content,omitempty"`
|
|
CreatedTime *string `json:"createdTime,omitempty"`
|
|
Dimension *int32 `json:"dimension,omitempty"`
|
|
Embedding []float32 `json:"embedding,omitempty"`
|
|
Kind *string `json:"kind,omitempty"`
|
|
Metadata map[string]string `json:"metadata,omitempty"`
|
|
Name *string `json:"name,omitempty"`
|
|
Owner *string `json:"owner,omitempty"`
|
|
Score *float32 `json:"score,omitempty"`
|
|
UpdatedTime *string `json:"updatedTime,omitempty"`
|
|
UserId *string `json:"userId,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _Memory Memory
|
|
|
|
// NewMemory instantiates a new Memory 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 NewMemory() *Memory {
|
|
this := Memory{}
|
|
return &this
|
|
}
|
|
|
|
// NewMemoryWithDefaults instantiates a new Memory 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 NewMemoryWithDefaults() *Memory {
|
|
this := Memory{}
|
|
return &this
|
|
}
|
|
|
|
// GetContent returns the Content field value if set, zero value otherwise.
|
|
func (o *Memory) GetContent() string {
|
|
if o == nil || IsNil(o.Content) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Content
|
|
}
|
|
|
|
// GetContentOk returns a tuple with the Content field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Memory) GetContentOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Content) {
|
|
return nil, false
|
|
}
|
|
return o.Content, true
|
|
}
|
|
|
|
// HasContent returns a boolean if a field has been set.
|
|
func (o *Memory) HasContent() bool {
|
|
if o != nil && !IsNil(o.Content) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetContent gets a reference to the given string and assigns it to the Content field.
|
|
func (o *Memory) SetContent(v string) {
|
|
o.Content = &v
|
|
}
|
|
|
|
// GetCreatedTime returns the CreatedTime field value if set, zero value otherwise.
|
|
func (o *Memory) 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 *Memory) 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 *Memory) 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 *Memory) SetCreatedTime(v string) {
|
|
o.CreatedTime = &v
|
|
}
|
|
|
|
// GetDimension returns the Dimension field value if set, zero value otherwise.
|
|
func (o *Memory) 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 *Memory) 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 *Memory) 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 *Memory) SetDimension(v int32) {
|
|
o.Dimension = &v
|
|
}
|
|
|
|
// GetEmbedding returns the Embedding field value if set, zero value otherwise.
|
|
func (o *Memory) 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 *Memory) 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 *Memory) 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 *Memory) SetEmbedding(v []float32) {
|
|
o.Embedding = v
|
|
}
|
|
|
|
// GetKind returns the Kind field value if set, zero value otherwise.
|
|
func (o *Memory) GetKind() string {
|
|
if o == nil || IsNil(o.Kind) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Kind
|
|
}
|
|
|
|
// GetKindOk returns a tuple with the Kind field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Memory) GetKindOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Kind) {
|
|
return nil, false
|
|
}
|
|
return o.Kind, true
|
|
}
|
|
|
|
// HasKind returns a boolean if a field has been set.
|
|
func (o *Memory) HasKind() bool {
|
|
if o != nil && !IsNil(o.Kind) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetKind gets a reference to the given string and assigns it to the Kind field.
|
|
func (o *Memory) SetKind(v string) {
|
|
o.Kind = &v
|
|
}
|
|
|
|
// GetMetadata returns the Metadata field value if set, zero value otherwise.
|
|
func (o *Memory) GetMetadata() map[string]string {
|
|
if o == nil || IsNil(o.Metadata) {
|
|
var ret map[string]string
|
|
return ret
|
|
}
|
|
return o.Metadata
|
|
}
|
|
|
|
// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Memory) GetMetadataOk() (map[string]string, bool) {
|
|
if o == nil || IsNil(o.Metadata) {
|
|
return map[string]string{}, false
|
|
}
|
|
return o.Metadata, true
|
|
}
|
|
|
|
// HasMetadata returns a boolean if a field has been set.
|
|
func (o *Memory) HasMetadata() bool {
|
|
if o != nil && !IsNil(o.Metadata) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field.
|
|
func (o *Memory) SetMetadata(v map[string]string) {
|
|
o.Metadata = v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *Memory) 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 *Memory) 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 *Memory) 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 *Memory) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetOwner returns the Owner field value if set, zero value otherwise.
|
|
func (o *Memory) 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 *Memory) 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 *Memory) 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 *Memory) SetOwner(v string) {
|
|
o.Owner = &v
|
|
}
|
|
|
|
// GetScore returns the Score field value if set, zero value otherwise.
|
|
func (o *Memory) 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 *Memory) 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 *Memory) 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 *Memory) SetScore(v float32) {
|
|
o.Score = &v
|
|
}
|
|
|
|
// GetUpdatedTime returns the UpdatedTime field value if set, zero value otherwise.
|
|
func (o *Memory) GetUpdatedTime() string {
|
|
if o == nil || IsNil(o.UpdatedTime) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.UpdatedTime
|
|
}
|
|
|
|
// GetUpdatedTimeOk returns a tuple with the UpdatedTime field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Memory) GetUpdatedTimeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.UpdatedTime) {
|
|
return nil, false
|
|
}
|
|
return o.UpdatedTime, true
|
|
}
|
|
|
|
// HasUpdatedTime returns a boolean if a field has been set.
|
|
func (o *Memory) HasUpdatedTime() bool {
|
|
if o != nil && !IsNil(o.UpdatedTime) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUpdatedTime gets a reference to the given string and assigns it to the UpdatedTime field.
|
|
func (o *Memory) SetUpdatedTime(v string) {
|
|
o.UpdatedTime = &v
|
|
}
|
|
|
|
// GetUserId returns the UserId field value if set, zero value otherwise.
|
|
func (o *Memory) GetUserId() string {
|
|
if o == nil || IsNil(o.UserId) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.UserId
|
|
}
|
|
|
|
// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Memory) GetUserIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.UserId) {
|
|
return nil, false
|
|
}
|
|
return o.UserId, true
|
|
}
|
|
|
|
// HasUserId returns a boolean if a field has been set.
|
|
func (o *Memory) HasUserId() bool {
|
|
if o != nil && !IsNil(o.UserId) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUserId gets a reference to the given string and assigns it to the UserId field.
|
|
func (o *Memory) SetUserId(v string) {
|
|
o.UserId = &v
|
|
}
|
|
|
|
func (o Memory) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o Memory) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Content) {
|
|
toSerialize["content"] = o.Content
|
|
}
|
|
if !IsNil(o.CreatedTime) {
|
|
toSerialize["createdTime"] = o.CreatedTime
|
|
}
|
|
if !IsNil(o.Dimension) {
|
|
toSerialize["dimension"] = o.Dimension
|
|
}
|
|
if !IsNil(o.Embedding) {
|
|
toSerialize["embedding"] = o.Embedding
|
|
}
|
|
if !IsNil(o.Kind) {
|
|
toSerialize["kind"] = o.Kind
|
|
}
|
|
if !IsNil(o.Metadata) {
|
|
toSerialize["metadata"] = o.Metadata
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Owner) {
|
|
toSerialize["owner"] = o.Owner
|
|
}
|
|
if !IsNil(o.Score) {
|
|
toSerialize["score"] = o.Score
|
|
}
|
|
if !IsNil(o.UpdatedTime) {
|
|
toSerialize["updatedTime"] = o.UpdatedTime
|
|
}
|
|
if !IsNil(o.UserId) {
|
|
toSerialize["userId"] = o.UserId
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *Memory) UnmarshalJSON(data []byte) (err error) {
|
|
varMemory := _Memory{}
|
|
|
|
err = json.Unmarshal(data, &varMemory)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = Memory(varMemory)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "content")
|
|
delete(additionalProperties, "createdTime")
|
|
delete(additionalProperties, "dimension")
|
|
delete(additionalProperties, "embedding")
|
|
delete(additionalProperties, "kind")
|
|
delete(additionalProperties, "metadata")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "owner")
|
|
delete(additionalProperties, "score")
|
|
delete(additionalProperties, "updatedTime")
|
|
delete(additionalProperties, "userId")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableMemory struct {
|
|
value *Memory
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableMemory) Get() *Memory {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableMemory) Set(val *Memory) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableMemory) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableMemory) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableMemory(val *Memory) *NullableMemory {
|
|
return &NullableMemory{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableMemory) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableMemory) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|