Files
sdk/model_openai_stream_options.go

154 lines
4.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 OpenaiStreamOptions type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &OpenaiStreamOptions{}
// OpenaiStreamOptions struct for OpenaiStreamOptions
type OpenaiStreamOptions struct {
IncludeUsage *bool `json:"include_usage,omitempty"`
AdditionalProperties map[string]interface{}
}
type _OpenaiStreamOptions OpenaiStreamOptions
// NewOpenaiStreamOptions instantiates a new OpenaiStreamOptions 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 NewOpenaiStreamOptions() *OpenaiStreamOptions {
this := OpenaiStreamOptions{}
return &this
}
// NewOpenaiStreamOptionsWithDefaults instantiates a new OpenaiStreamOptions 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 NewOpenaiStreamOptionsWithDefaults() *OpenaiStreamOptions {
this := OpenaiStreamOptions{}
return &this
}
// GetIncludeUsage returns the IncludeUsage field value if set, zero value otherwise.
func (o *OpenaiStreamOptions) GetIncludeUsage() bool {
if o == nil || IsNil(o.IncludeUsage) {
var ret bool
return ret
}
return *o.IncludeUsage
}
// GetIncludeUsageOk returns a tuple with the IncludeUsage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiStreamOptions) GetIncludeUsageOk() (*bool, bool) {
if o == nil || IsNil(o.IncludeUsage) {
return nil, false
}
return o.IncludeUsage, true
}
// HasIncludeUsage returns a boolean if a field has been set.
func (o *OpenaiStreamOptions) HasIncludeUsage() bool {
if o != nil && !IsNil(o.IncludeUsage) {
return true
}
return false
}
// SetIncludeUsage gets a reference to the given bool and assigns it to the IncludeUsage field.
func (o *OpenaiStreamOptions) SetIncludeUsage(v bool) {
o.IncludeUsage = &v
}
func (o OpenaiStreamOptions) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o OpenaiStreamOptions) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.IncludeUsage) {
toSerialize["include_usage"] = o.IncludeUsage
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *OpenaiStreamOptions) UnmarshalJSON(data []byte) (err error) {
varOpenaiStreamOptions := _OpenaiStreamOptions{}
err = json.Unmarshal(data, &varOpenaiStreamOptions)
if err != nil {
return err
}
*o = OpenaiStreamOptions(varOpenaiStreamOptions)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "include_usage")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableOpenaiStreamOptions struct {
value *OpenaiStreamOptions
isSet bool
}
func (v NullableOpenaiStreamOptions) Get() *OpenaiStreamOptions {
return v.value
}
func (v *NullableOpenaiStreamOptions) Set(val *OpenaiStreamOptions) {
v.value = val
v.isSet = true
}
func (v NullableOpenaiStreamOptions) IsSet() bool {
return v.isSet
}
func (v *NullableOpenaiStreamOptions) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableOpenaiStreamOptions(val *OpenaiStreamOptions) *NullableOpenaiStreamOptions {
return &NullableOpenaiStreamOptions{value: val, isSet: true}
}
func (v NullableOpenaiStreamOptions) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableOpenaiStreamOptions) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}