Files
sdk/model_ai_chat.go

231 lines
5.5 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 AiChat type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AiChat{}
// AiChat struct for AiChat
type AiChat struct {
// Answer is the model's reply.
Answer *string `json:"answer,omitempty"`
// Model is the model asked: the caller's, or the default when it named none.
Model *string `json:"model,omitempty"`
// Receipt says which model served the reply and who paid for it.
Receipt *AiReceipt `json:"receipt,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AiChat AiChat
// NewAiChat instantiates a new AiChat 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 NewAiChat() *AiChat {
this := AiChat{}
return &this
}
// NewAiChatWithDefaults instantiates a new AiChat 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 NewAiChatWithDefaults() *AiChat {
this := AiChat{}
return &this
}
// GetAnswer returns the Answer field value if set, zero value otherwise.
func (o *AiChat) GetAnswer() string {
if o == nil || IsNil(o.Answer) {
var ret string
return ret
}
return *o.Answer
}
// GetAnswerOk returns a tuple with the Answer field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiChat) GetAnswerOk() (*string, bool) {
if o == nil || IsNil(o.Answer) {
return nil, false
}
return o.Answer, true
}
// HasAnswer returns a boolean if a field has been set.
func (o *AiChat) HasAnswer() bool {
if o != nil && !IsNil(o.Answer) {
return true
}
return false
}
// SetAnswer gets a reference to the given string and assigns it to the Answer field.
func (o *AiChat) SetAnswer(v string) {
o.Answer = &v
}
// GetModel returns the Model field value if set, zero value otherwise.
func (o *AiChat) 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 *AiChat) 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 *AiChat) 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 *AiChat) SetModel(v string) {
o.Model = &v
}
// GetReceipt returns the Receipt field value if set, zero value otherwise.
func (o *AiChat) GetReceipt() AiReceipt {
if o == nil || IsNil(o.Receipt) {
var ret AiReceipt
return ret
}
return *o.Receipt
}
// GetReceiptOk returns a tuple with the Receipt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiChat) GetReceiptOk() (*AiReceipt, bool) {
if o == nil || IsNil(o.Receipt) {
return nil, false
}
return o.Receipt, true
}
// HasReceipt returns a boolean if a field has been set.
func (o *AiChat) HasReceipt() bool {
if o != nil && !IsNil(o.Receipt) {
return true
}
return false
}
// SetReceipt gets a reference to the given AiReceipt and assigns it to the Receipt field.
func (o *AiChat) SetReceipt(v AiReceipt) {
o.Receipt = &v
}
func (o AiChat) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AiChat) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Answer) {
toSerialize["answer"] = o.Answer
}
if !IsNil(o.Model) {
toSerialize["model"] = o.Model
}
if !IsNil(o.Receipt) {
toSerialize["receipt"] = o.Receipt
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AiChat) UnmarshalJSON(data []byte) (err error) {
varAiChat := _AiChat{}
err = json.Unmarshal(data, &varAiChat)
if err != nil {
return err
}
*o = AiChat(varAiChat)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "answer")
delete(additionalProperties, "model")
delete(additionalProperties, "receipt")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAiChat struct {
value *AiChat
isSet bool
}
func (v NullableAiChat) Get() *AiChat {
return v.value
}
func (v *NullableAiChat) Set(val *AiChat) {
v.value = val
v.isSet = true
}
func (v NullableAiChat) IsSet() bool {
return v.isSet
}
func (v *NullableAiChat) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAiChat(val *AiChat) *NullableAiChat {
return &NullableAiChat{value: val, isSet: true}
}
func (v NullableAiChat) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAiChat) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}