Files
sdk/model_openai_chat_completion_response_format.go

191 lines
6.0 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 OpenaiChatCompletionResponseFormat type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &OpenaiChatCompletionResponseFormat{}
// OpenaiChatCompletionResponseFormat struct for OpenaiChatCompletionResponseFormat
type OpenaiChatCompletionResponseFormat struct {
JsonSchema *OpenaiChatCompletionResponseFormatJSONSchema `json:"json_schema,omitempty"`
Type *string `json:"type,omitempty"`
AdditionalProperties map[string]interface{}
}
type _OpenaiChatCompletionResponseFormat OpenaiChatCompletionResponseFormat
// NewOpenaiChatCompletionResponseFormat instantiates a new OpenaiChatCompletionResponseFormat 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 NewOpenaiChatCompletionResponseFormat() *OpenaiChatCompletionResponseFormat {
this := OpenaiChatCompletionResponseFormat{}
return &this
}
// NewOpenaiChatCompletionResponseFormatWithDefaults instantiates a new OpenaiChatCompletionResponseFormat 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 NewOpenaiChatCompletionResponseFormatWithDefaults() *OpenaiChatCompletionResponseFormat {
this := OpenaiChatCompletionResponseFormat{}
return &this
}
// GetJsonSchema returns the JsonSchema field value if set, zero value otherwise.
func (o *OpenaiChatCompletionResponseFormat) GetJsonSchema() OpenaiChatCompletionResponseFormatJSONSchema {
if o == nil || IsNil(o.JsonSchema) {
var ret OpenaiChatCompletionResponseFormatJSONSchema
return ret
}
return *o.JsonSchema
}
// GetJsonSchemaOk returns a tuple with the JsonSchema field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiChatCompletionResponseFormat) GetJsonSchemaOk() (*OpenaiChatCompletionResponseFormatJSONSchema, bool) {
if o == nil || IsNil(o.JsonSchema) {
return nil, false
}
return o.JsonSchema, true
}
// HasJsonSchema returns a boolean if a field has been set.
func (o *OpenaiChatCompletionResponseFormat) HasJsonSchema() bool {
if o != nil && !IsNil(o.JsonSchema) {
return true
}
return false
}
// SetJsonSchema gets a reference to the given OpenaiChatCompletionResponseFormatJSONSchema and assigns it to the JsonSchema field.
func (o *OpenaiChatCompletionResponseFormat) SetJsonSchema(v OpenaiChatCompletionResponseFormatJSONSchema) {
o.JsonSchema = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *OpenaiChatCompletionResponseFormat) GetType() string {
if o == nil || IsNil(o.Type) {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiChatCompletionResponseFormat) GetTypeOk() (*string, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *OpenaiChatCompletionResponseFormat) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *OpenaiChatCompletionResponseFormat) SetType(v string) {
o.Type = &v
}
func (o OpenaiChatCompletionResponseFormat) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o OpenaiChatCompletionResponseFormat) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.JsonSchema) {
toSerialize["json_schema"] = o.JsonSchema
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *OpenaiChatCompletionResponseFormat) UnmarshalJSON(data []byte) (err error) {
varOpenaiChatCompletionResponseFormat := _OpenaiChatCompletionResponseFormat{}
err = json.Unmarshal(data, &varOpenaiChatCompletionResponseFormat)
if err != nil {
return err
}
*o = OpenaiChatCompletionResponseFormat(varOpenaiChatCompletionResponseFormat)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "json_schema")
delete(additionalProperties, "type")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableOpenaiChatCompletionResponseFormat struct {
value *OpenaiChatCompletionResponseFormat
isSet bool
}
func (v NullableOpenaiChatCompletionResponseFormat) Get() *OpenaiChatCompletionResponseFormat {
return v.value
}
func (v *NullableOpenaiChatCompletionResponseFormat) Set(val *OpenaiChatCompletionResponseFormat) {
v.value = val
v.isSet = true
}
func (v NullableOpenaiChatCompletionResponseFormat) IsSet() bool {
return v.isSet
}
func (v *NullableOpenaiChatCompletionResponseFormat) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableOpenaiChatCompletionResponseFormat(val *OpenaiChatCompletionResponseFormat) *NullableOpenaiChatCompletionResponseFormat {
return &NullableOpenaiChatCompletionResponseFormat{value: val, isSet: true}
}
func (v NullableOpenaiChatCompletionResponseFormat) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableOpenaiChatCompletionResponseFormat) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}