Files
sdk/model_studio_message.go

340 lines
8.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 StudioMessage type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &StudioMessage{}
// StudioMessage struct for StudioMessage
type StudioMessage struct {
Assets []string `json:"assets,omitempty"`
Created *string `json:"created,omitempty"`
Id *string `json:"id,omitempty"`
Role *string `json:"role,omitempty"`
// Runs are the runs this message started.
Runs []string `json:"runs,omitempty"`
Text *string `json:"text,omitempty"`
AdditionalProperties map[string]interface{}
}
type _StudioMessage StudioMessage
// NewStudioMessage instantiates a new StudioMessage 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 NewStudioMessage() *StudioMessage {
this := StudioMessage{}
return &this
}
// NewStudioMessageWithDefaults instantiates a new StudioMessage 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 NewStudioMessageWithDefaults() *StudioMessage {
this := StudioMessage{}
return &this
}
// GetAssets returns the Assets field value if set, zero value otherwise.
func (o *StudioMessage) GetAssets() []string {
if o == nil || IsNil(o.Assets) {
var ret []string
return ret
}
return o.Assets
}
// GetAssetsOk returns a tuple with the Assets field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *StudioMessage) GetAssetsOk() ([]string, bool) {
if o == nil || IsNil(o.Assets) {
return nil, false
}
return o.Assets, true
}
// HasAssets returns a boolean if a field has been set.
func (o *StudioMessage) HasAssets() bool {
if o != nil && !IsNil(o.Assets) {
return true
}
return false
}
// SetAssets gets a reference to the given []string and assigns it to the Assets field.
func (o *StudioMessage) SetAssets(v []string) {
o.Assets = v
}
// GetCreated returns the Created field value if set, zero value otherwise.
func (o *StudioMessage) GetCreated() string {
if o == nil || IsNil(o.Created) {
var ret string
return ret
}
return *o.Created
}
// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *StudioMessage) GetCreatedOk() (*string, bool) {
if o == nil || IsNil(o.Created) {
return nil, false
}
return o.Created, true
}
// HasCreated returns a boolean if a field has been set.
func (o *StudioMessage) HasCreated() bool {
if o != nil && !IsNil(o.Created) {
return true
}
return false
}
// SetCreated gets a reference to the given string and assigns it to the Created field.
func (o *StudioMessage) SetCreated(v string) {
o.Created = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *StudioMessage) 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 *StudioMessage) 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 *StudioMessage) 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 *StudioMessage) SetId(v string) {
o.Id = &v
}
// GetRole returns the Role field value if set, zero value otherwise.
func (o *StudioMessage) GetRole() string {
if o == nil || IsNil(o.Role) {
var ret string
return ret
}
return *o.Role
}
// GetRoleOk returns a tuple with the Role field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *StudioMessage) GetRoleOk() (*string, bool) {
if o == nil || IsNil(o.Role) {
return nil, false
}
return o.Role, true
}
// HasRole returns a boolean if a field has been set.
func (o *StudioMessage) HasRole() bool {
if o != nil && !IsNil(o.Role) {
return true
}
return false
}
// SetRole gets a reference to the given string and assigns it to the Role field.
func (o *StudioMessage) SetRole(v string) {
o.Role = &v
}
// GetRuns returns the Runs field value if set, zero value otherwise.
func (o *StudioMessage) GetRuns() []string {
if o == nil || IsNil(o.Runs) {
var ret []string
return ret
}
return o.Runs
}
// GetRunsOk returns a tuple with the Runs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *StudioMessage) GetRunsOk() ([]string, bool) {
if o == nil || IsNil(o.Runs) {
return nil, false
}
return o.Runs, true
}
// HasRuns returns a boolean if a field has been set.
func (o *StudioMessage) HasRuns() bool {
if o != nil && !IsNil(o.Runs) {
return true
}
return false
}
// SetRuns gets a reference to the given []string and assigns it to the Runs field.
func (o *StudioMessage) SetRuns(v []string) {
o.Runs = v
}
// GetText returns the Text field value if set, zero value otherwise.
func (o *StudioMessage) 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 *StudioMessage) 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 *StudioMessage) 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 *StudioMessage) SetText(v string) {
o.Text = &v
}
func (o StudioMessage) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o StudioMessage) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Assets) {
toSerialize["assets"] = o.Assets
}
if !IsNil(o.Created) {
toSerialize["created"] = o.Created
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Role) {
toSerialize["role"] = o.Role
}
if !IsNil(o.Runs) {
toSerialize["runs"] = o.Runs
}
if !IsNil(o.Text) {
toSerialize["text"] = o.Text
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *StudioMessage) UnmarshalJSON(data []byte) (err error) {
varStudioMessage := _StudioMessage{}
err = json.Unmarshal(data, &varStudioMessage)
if err != nil {
return err
}
*o = StudioMessage(varStudioMessage)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "assets")
delete(additionalProperties, "created")
delete(additionalProperties, "id")
delete(additionalProperties, "role")
delete(additionalProperties, "runs")
delete(additionalProperties, "text")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableStudioMessage struct {
value *StudioMessage
isSet bool
}
func (v NullableStudioMessage) Get() *StudioMessage {
return v.value
}
func (v *NullableStudioMessage) Set(val *StudioMessage) {
v.value = val
v.isSet = true
}
func (v NullableStudioMessage) IsSet() bool {
return v.isSet
}
func (v *NullableStudioMessage) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableStudioMessage(val *StudioMessage) *NullableStudioMessage {
return &NullableStudioMessage{value: val, isSet: true}
}
func (v NullableStudioMessage) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableStudioMessage) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}