Files
sdk/model_label.go

487 lines
11 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 Label type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Label{}
// Label struct for Label
type Label struct {
EndTime *float32 `json:"endTime,omitempty"`
Id *string `json:"id,omitempty"`
Speaker *string `json:"speaker,omitempty"`
StartTime *float32 `json:"startTime,omitempty"`
Tag1 *string `json:"tag1,omitempty"`
Tag2 *string `json:"tag2,omitempty"`
Tag3 *string `json:"tag3,omitempty"`
Text *string `json:"text,omitempty"`
Type *string `json:"type,omitempty"`
User *string `json:"user,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Label Label
// NewLabel instantiates a new Label 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 NewLabel() *Label {
this := Label{}
return &this
}
// NewLabelWithDefaults instantiates a new Label 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 NewLabelWithDefaults() *Label {
this := Label{}
return &this
}
// GetEndTime returns the EndTime field value if set, zero value otherwise.
func (o *Label) GetEndTime() float32 {
if o == nil || IsNil(o.EndTime) {
var ret float32
return ret
}
return *o.EndTime
}
// GetEndTimeOk returns a tuple with the EndTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Label) GetEndTimeOk() (*float32, bool) {
if o == nil || IsNil(o.EndTime) {
return nil, false
}
return o.EndTime, true
}
// HasEndTime returns a boolean if a field has been set.
func (o *Label) HasEndTime() bool {
if o != nil && !IsNil(o.EndTime) {
return true
}
return false
}
// SetEndTime gets a reference to the given float32 and assigns it to the EndTime field.
func (o *Label) SetEndTime(v float32) {
o.EndTime = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *Label) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Label) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *Label) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *Label) SetId(v string) {
o.Id = &v
}
// GetSpeaker returns the Speaker field value if set, zero value otherwise.
func (o *Label) GetSpeaker() string {
if o == nil || IsNil(o.Speaker) {
var ret string
return ret
}
return *o.Speaker
}
// GetSpeakerOk returns a tuple with the Speaker field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Label) GetSpeakerOk() (*string, bool) {
if o == nil || IsNil(o.Speaker) {
return nil, false
}
return o.Speaker, true
}
// HasSpeaker returns a boolean if a field has been set.
func (o *Label) HasSpeaker() bool {
if o != nil && !IsNil(o.Speaker) {
return true
}
return false
}
// SetSpeaker gets a reference to the given string and assigns it to the Speaker field.
func (o *Label) SetSpeaker(v string) {
o.Speaker = &v
}
// GetStartTime returns the StartTime field value if set, zero value otherwise.
func (o *Label) GetStartTime() float32 {
if o == nil || IsNil(o.StartTime) {
var ret float32
return ret
}
return *o.StartTime
}
// GetStartTimeOk returns a tuple with the StartTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Label) GetStartTimeOk() (*float32, bool) {
if o == nil || IsNil(o.StartTime) {
return nil, false
}
return o.StartTime, true
}
// HasStartTime returns a boolean if a field has been set.
func (o *Label) HasStartTime() bool {
if o != nil && !IsNil(o.StartTime) {
return true
}
return false
}
// SetStartTime gets a reference to the given float32 and assigns it to the StartTime field.
func (o *Label) SetStartTime(v float32) {
o.StartTime = &v
}
// GetTag1 returns the Tag1 field value if set, zero value otherwise.
func (o *Label) GetTag1() string {
if o == nil || IsNil(o.Tag1) {
var ret string
return ret
}
return *o.Tag1
}
// GetTag1Ok returns a tuple with the Tag1 field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Label) GetTag1Ok() (*string, bool) {
if o == nil || IsNil(o.Tag1) {
return nil, false
}
return o.Tag1, true
}
// HasTag1 returns a boolean if a field has been set.
func (o *Label) HasTag1() bool {
if o != nil && !IsNil(o.Tag1) {
return true
}
return false
}
// SetTag1 gets a reference to the given string and assigns it to the Tag1 field.
func (o *Label) SetTag1(v string) {
o.Tag1 = &v
}
// GetTag2 returns the Tag2 field value if set, zero value otherwise.
func (o *Label) GetTag2() string {
if o == nil || IsNil(o.Tag2) {
var ret string
return ret
}
return *o.Tag2
}
// GetTag2Ok returns a tuple with the Tag2 field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Label) GetTag2Ok() (*string, bool) {
if o == nil || IsNil(o.Tag2) {
return nil, false
}
return o.Tag2, true
}
// HasTag2 returns a boolean if a field has been set.
func (o *Label) HasTag2() bool {
if o != nil && !IsNil(o.Tag2) {
return true
}
return false
}
// SetTag2 gets a reference to the given string and assigns it to the Tag2 field.
func (o *Label) SetTag2(v string) {
o.Tag2 = &v
}
// GetTag3 returns the Tag3 field value if set, zero value otherwise.
func (o *Label) GetTag3() string {
if o == nil || IsNil(o.Tag3) {
var ret string
return ret
}
return *o.Tag3
}
// GetTag3Ok returns a tuple with the Tag3 field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Label) GetTag3Ok() (*string, bool) {
if o == nil || IsNil(o.Tag3) {
return nil, false
}
return o.Tag3, true
}
// HasTag3 returns a boolean if a field has been set.
func (o *Label) HasTag3() bool {
if o != nil && !IsNil(o.Tag3) {
return true
}
return false
}
// SetTag3 gets a reference to the given string and assigns it to the Tag3 field.
func (o *Label) SetTag3(v string) {
o.Tag3 = &v
}
// GetText returns the Text field value if set, zero value otherwise.
func (o *Label) 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 *Label) 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 *Label) 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 *Label) SetText(v string) {
o.Text = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *Label) 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 *Label) 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 *Label) 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 *Label) SetType(v string) {
o.Type = &v
}
// GetUser returns the User field value if set, zero value otherwise.
func (o *Label) GetUser() string {
if o == nil || IsNil(o.User) {
var ret string
return ret
}
return *o.User
}
// GetUserOk returns a tuple with the User field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Label) GetUserOk() (*string, bool) {
if o == nil || IsNil(o.User) {
return nil, false
}
return o.User, true
}
// HasUser returns a boolean if a field has been set.
func (o *Label) HasUser() bool {
if o != nil && !IsNil(o.User) {
return true
}
return false
}
// SetUser gets a reference to the given string and assigns it to the User field.
func (o *Label) SetUser(v string) {
o.User = &v
}
func (o Label) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Label) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.EndTime) {
toSerialize["endTime"] = o.EndTime
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Speaker) {
toSerialize["speaker"] = o.Speaker
}
if !IsNil(o.StartTime) {
toSerialize["startTime"] = o.StartTime
}
if !IsNil(o.Tag1) {
toSerialize["tag1"] = o.Tag1
}
if !IsNil(o.Tag2) {
toSerialize["tag2"] = o.Tag2
}
if !IsNil(o.Tag3) {
toSerialize["tag3"] = o.Tag3
}
if !IsNil(o.Text) {
toSerialize["text"] = o.Text
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
if !IsNil(o.User) {
toSerialize["user"] = o.User
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Label) UnmarshalJSON(data []byte) (err error) {
varLabel := _Label{}
err = json.Unmarshal(data, &varLabel)
if err != nil {
return err
}
*o = Label(varLabel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "endTime")
delete(additionalProperties, "id")
delete(additionalProperties, "speaker")
delete(additionalProperties, "startTime")
delete(additionalProperties, "tag1")
delete(additionalProperties, "tag2")
delete(additionalProperties, "tag3")
delete(additionalProperties, "text")
delete(additionalProperties, "type")
delete(additionalProperties, "user")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLabel struct {
value *Label
isSet bool
}
func (v NullableLabel) Get() *Label {
return v.value
}
func (v *NullableLabel) Set(val *Label) {
v.value = val
v.isSet = true
}
func (v NullableLabel) IsSet() bool {
return v.isSet
}
func (v *NullableLabel) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLabel(val *Label) *NullableLabel {
return &NullableLabel{value: val, isSet: true}
}
func (v NullableLabel) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLabel) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}