Files
sdk/model_mq_sequences.go

193 lines
4.9 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 MqSequences type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MqSequences{}
// MqSequences struct for MqSequences
type MqSequences struct {
// Consumer is the consumer's own sequence.
ConsumerSeq *int32 `json:"consumer_seq,omitempty"`
// Stream is the corresponding stream sequence.
StreamSeq *int32 `json:"stream_seq,omitempty"`
AdditionalProperties map[string]interface{}
}
type _MqSequences MqSequences
// NewMqSequences instantiates a new MqSequences 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 NewMqSequences() *MqSequences {
this := MqSequences{}
return &this
}
// NewMqSequencesWithDefaults instantiates a new MqSequences 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 NewMqSequencesWithDefaults() *MqSequences {
this := MqSequences{}
return &this
}
// GetConsumerSeq returns the ConsumerSeq field value if set, zero value otherwise.
func (o *MqSequences) GetConsumerSeq() int32 {
if o == nil || IsNil(o.ConsumerSeq) {
var ret int32
return ret
}
return *o.ConsumerSeq
}
// GetConsumerSeqOk returns a tuple with the ConsumerSeq field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqSequences) GetConsumerSeqOk() (*int32, bool) {
if o == nil || IsNil(o.ConsumerSeq) {
return nil, false
}
return o.ConsumerSeq, true
}
// HasConsumerSeq returns a boolean if a field has been set.
func (o *MqSequences) HasConsumerSeq() bool {
if o != nil && !IsNil(o.ConsumerSeq) {
return true
}
return false
}
// SetConsumerSeq gets a reference to the given int32 and assigns it to the ConsumerSeq field.
func (o *MqSequences) SetConsumerSeq(v int32) {
o.ConsumerSeq = &v
}
// GetStreamSeq returns the StreamSeq field value if set, zero value otherwise.
func (o *MqSequences) GetStreamSeq() int32 {
if o == nil || IsNil(o.StreamSeq) {
var ret int32
return ret
}
return *o.StreamSeq
}
// GetStreamSeqOk returns a tuple with the StreamSeq field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqSequences) GetStreamSeqOk() (*int32, bool) {
if o == nil || IsNil(o.StreamSeq) {
return nil, false
}
return o.StreamSeq, true
}
// HasStreamSeq returns a boolean if a field has been set.
func (o *MqSequences) HasStreamSeq() bool {
if o != nil && !IsNil(o.StreamSeq) {
return true
}
return false
}
// SetStreamSeq gets a reference to the given int32 and assigns it to the StreamSeq field.
func (o *MqSequences) SetStreamSeq(v int32) {
o.StreamSeq = &v
}
func (o MqSequences) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MqSequences) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ConsumerSeq) {
toSerialize["consumer_seq"] = o.ConsumerSeq
}
if !IsNil(o.StreamSeq) {
toSerialize["stream_seq"] = o.StreamSeq
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *MqSequences) UnmarshalJSON(data []byte) (err error) {
varMqSequences := _MqSequences{}
err = json.Unmarshal(data, &varMqSequences)
if err != nil {
return err
}
*o = MqSequences(varMqSequences)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "consumer_seq")
delete(additionalProperties, "stream_seq")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableMqSequences struct {
value *MqSequences
isSet bool
}
func (v NullableMqSequences) Get() *MqSequences {
return v.value
}
func (v *NullableMqSequences) Set(val *MqSequences) {
v.value = val
v.isSet = true
}
func (v NullableMqSequences) IsSet() bool {
return v.isSet
}
func (v *NullableMqSequences) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMqSequences(val *MqSequences) *NullableMqSequences {
return &NullableMqSequences{value: val, isSet: true}
}
func (v NullableMqSequences) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMqSequences) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}