Files
sdk/model_mq_read_out.go

155 lines
3.7 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 MqReadOut type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MqReadOut{}
// MqReadOut struct for MqReadOut
type MqReadOut struct {
// Messages is what was read, stream-ordered.
Messages []MqDelivery `json:"messages,omitempty"`
AdditionalProperties map[string]interface{}
}
type _MqReadOut MqReadOut
// NewMqReadOut instantiates a new MqReadOut 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 NewMqReadOut() *MqReadOut {
this := MqReadOut{}
return &this
}
// NewMqReadOutWithDefaults instantiates a new MqReadOut 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 NewMqReadOutWithDefaults() *MqReadOut {
this := MqReadOut{}
return &this
}
// GetMessages returns the Messages field value if set, zero value otherwise.
func (o *MqReadOut) GetMessages() []MqDelivery {
if o == nil || IsNil(o.Messages) {
var ret []MqDelivery
return ret
}
return o.Messages
}
// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqReadOut) GetMessagesOk() ([]MqDelivery, bool) {
if o == nil || IsNil(o.Messages) {
return nil, false
}
return o.Messages, true
}
// HasMessages returns a boolean if a field has been set.
func (o *MqReadOut) HasMessages() bool {
if o != nil && !IsNil(o.Messages) {
return true
}
return false
}
// SetMessages gets a reference to the given []MqDelivery and assigns it to the Messages field.
func (o *MqReadOut) SetMessages(v []MqDelivery) {
o.Messages = v
}
func (o MqReadOut) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MqReadOut) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Messages) {
toSerialize["messages"] = o.Messages
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *MqReadOut) UnmarshalJSON(data []byte) (err error) {
varMqReadOut := _MqReadOut{}
err = json.Unmarshal(data, &varMqReadOut)
if err != nil {
return err
}
*o = MqReadOut(varMqReadOut)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "messages")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableMqReadOut struct {
value *MqReadOut
isSet bool
}
func (v NullableMqReadOut) Get() *MqReadOut {
return v.value
}
func (v *NullableMqReadOut) Set(val *MqReadOut) {
v.value = val
v.isSet = true
}
func (v NullableMqReadOut) IsSet() bool {
return v.isSet
}
func (v *NullableMqReadOut) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMqReadOut(val *MqReadOut) *NullableMqReadOut {
return &NullableMqReadOut{value: val, isSet: true}
}
func (v NullableMqReadOut) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMqReadOut) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}