Files
sdk/model_openai_audio_response.go

339 lines
9.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 OpenaiAudioResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &OpenaiAudioResponse{}
// OpenaiAudioResponse struct for OpenaiAudioResponse
type OpenaiAudioResponse struct {
Duration *float32 `json:"duration,omitempty"`
Language *string `json:"language,omitempty"`
Segments []OpenaiAudioResponseSegmentsInner `json:"segments,omitempty"`
Task *string `json:"task,omitempty"`
Text *string `json:"text,omitempty"`
Words []OpenaiAudioResponseWordsInner `json:"words,omitempty"`
AdditionalProperties map[string]interface{}
}
type _OpenaiAudioResponse OpenaiAudioResponse
// NewOpenaiAudioResponse instantiates a new OpenaiAudioResponse 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 NewOpenaiAudioResponse() *OpenaiAudioResponse {
this := OpenaiAudioResponse{}
return &this
}
// NewOpenaiAudioResponseWithDefaults instantiates a new OpenaiAudioResponse 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 NewOpenaiAudioResponseWithDefaults() *OpenaiAudioResponse {
this := OpenaiAudioResponse{}
return &this
}
// GetDuration returns the Duration field value if set, zero value otherwise.
func (o *OpenaiAudioResponse) GetDuration() float32 {
if o == nil || IsNil(o.Duration) {
var ret float32
return ret
}
return *o.Duration
}
// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiAudioResponse) GetDurationOk() (*float32, bool) {
if o == nil || IsNil(o.Duration) {
return nil, false
}
return o.Duration, true
}
// HasDuration returns a boolean if a field has been set.
func (o *OpenaiAudioResponse) HasDuration() bool {
if o != nil && !IsNil(o.Duration) {
return true
}
return false
}
// SetDuration gets a reference to the given float32 and assigns it to the Duration field.
func (o *OpenaiAudioResponse) SetDuration(v float32) {
o.Duration = &v
}
// GetLanguage returns the Language field value if set, zero value otherwise.
func (o *OpenaiAudioResponse) GetLanguage() string {
if o == nil || IsNil(o.Language) {
var ret string
return ret
}
return *o.Language
}
// GetLanguageOk returns a tuple with the Language field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiAudioResponse) GetLanguageOk() (*string, bool) {
if o == nil || IsNil(o.Language) {
return nil, false
}
return o.Language, true
}
// HasLanguage returns a boolean if a field has been set.
func (o *OpenaiAudioResponse) HasLanguage() bool {
if o != nil && !IsNil(o.Language) {
return true
}
return false
}
// SetLanguage gets a reference to the given string and assigns it to the Language field.
func (o *OpenaiAudioResponse) SetLanguage(v string) {
o.Language = &v
}
// GetSegments returns the Segments field value if set, zero value otherwise.
func (o *OpenaiAudioResponse) GetSegments() []OpenaiAudioResponseSegmentsInner {
if o == nil || IsNil(o.Segments) {
var ret []OpenaiAudioResponseSegmentsInner
return ret
}
return o.Segments
}
// GetSegmentsOk returns a tuple with the Segments field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiAudioResponse) GetSegmentsOk() ([]OpenaiAudioResponseSegmentsInner, bool) {
if o == nil || IsNil(o.Segments) {
return nil, false
}
return o.Segments, true
}
// HasSegments returns a boolean if a field has been set.
func (o *OpenaiAudioResponse) HasSegments() bool {
if o != nil && !IsNil(o.Segments) {
return true
}
return false
}
// SetSegments gets a reference to the given []OpenaiAudioResponseSegmentsInner and assigns it to the Segments field.
func (o *OpenaiAudioResponse) SetSegments(v []OpenaiAudioResponseSegmentsInner) {
o.Segments = v
}
// GetTask returns the Task field value if set, zero value otherwise.
func (o *OpenaiAudioResponse) GetTask() string {
if o == nil || IsNil(o.Task) {
var ret string
return ret
}
return *o.Task
}
// GetTaskOk returns a tuple with the Task field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiAudioResponse) GetTaskOk() (*string, bool) {
if o == nil || IsNil(o.Task) {
return nil, false
}
return o.Task, true
}
// HasTask returns a boolean if a field has been set.
func (o *OpenaiAudioResponse) HasTask() bool {
if o != nil && !IsNil(o.Task) {
return true
}
return false
}
// SetTask gets a reference to the given string and assigns it to the Task field.
func (o *OpenaiAudioResponse) SetTask(v string) {
o.Task = &v
}
// GetText returns the Text field value if set, zero value otherwise.
func (o *OpenaiAudioResponse) GetText() string {
if o == nil || IsNil(o.Text) {
var ret string
return ret
}
return *o.Text
}
// GetTextOk returns a tuple with the Text field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiAudioResponse) GetTextOk() (*string, bool) {
if o == nil || IsNil(o.Text) {
return nil, false
}
return o.Text, true
}
// HasText returns a boolean if a field has been set.
func (o *OpenaiAudioResponse) HasText() bool {
if o != nil && !IsNil(o.Text) {
return true
}
return false
}
// SetText gets a reference to the given string and assigns it to the Text field.
func (o *OpenaiAudioResponse) SetText(v string) {
o.Text = &v
}
// GetWords returns the Words field value if set, zero value otherwise.
func (o *OpenaiAudioResponse) GetWords() []OpenaiAudioResponseWordsInner {
if o == nil || IsNil(o.Words) {
var ret []OpenaiAudioResponseWordsInner
return ret
}
return o.Words
}
// GetWordsOk returns a tuple with the Words field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiAudioResponse) GetWordsOk() ([]OpenaiAudioResponseWordsInner, bool) {
if o == nil || IsNil(o.Words) {
return nil, false
}
return o.Words, true
}
// HasWords returns a boolean if a field has been set.
func (o *OpenaiAudioResponse) HasWords() bool {
if o != nil && !IsNil(o.Words) {
return true
}
return false
}
// SetWords gets a reference to the given []OpenaiAudioResponseWordsInner and assigns it to the Words field.
func (o *OpenaiAudioResponse) SetWords(v []OpenaiAudioResponseWordsInner) {
o.Words = v
}
func (o OpenaiAudioResponse) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o OpenaiAudioResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Duration) {
toSerialize["duration"] = o.Duration
}
if !IsNil(o.Language) {
toSerialize["language"] = o.Language
}
if !IsNil(o.Segments) {
toSerialize["segments"] = o.Segments
}
if !IsNil(o.Task) {
toSerialize["task"] = o.Task
}
if !IsNil(o.Text) {
toSerialize["text"] = o.Text
}
if !IsNil(o.Words) {
toSerialize["words"] = o.Words
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *OpenaiAudioResponse) UnmarshalJSON(data []byte) (err error) {
varOpenaiAudioResponse := _OpenaiAudioResponse{}
err = json.Unmarshal(data, &varOpenaiAudioResponse)
if err != nil {
return err
}
*o = OpenaiAudioResponse(varOpenaiAudioResponse)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "duration")
delete(additionalProperties, "language")
delete(additionalProperties, "segments")
delete(additionalProperties, "task")
delete(additionalProperties, "text")
delete(additionalProperties, "words")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableOpenaiAudioResponse struct {
value *OpenaiAudioResponse
isSet bool
}
func (v NullableOpenaiAudioResponse) Get() *OpenaiAudioResponse {
return v.value
}
func (v *NullableOpenaiAudioResponse) Set(val *OpenaiAudioResponse) {
v.value = val
v.isSet = true
}
func (v NullableOpenaiAudioResponse) IsSet() bool {
return v.isSet
}
func (v *NullableOpenaiAudioResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableOpenaiAudioResponse(val *OpenaiAudioResponse) *NullableOpenaiAudioResponse {
return &NullableOpenaiAudioResponse{value: val, isSet: true}
}
func (v NullableOpenaiAudioResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableOpenaiAudioResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}