Files
sdk/model_mq_state.go

460 lines
12 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"
"time"
)
// checks if the MqState type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MqState{}
// MqState struct for MqState
type MqState struct {
// Bytes is the total stored size.
Bytes *int32 `json:"bytes,omitempty"`
// Consumers is the number of consumers attached to this stream.
ConsumerCount *int64 `json:"consumer_count,omitempty"`
// FirstSeq is the sequence of the first stored message.
FirstSeq *int32 `json:"first_seq,omitempty"`
// FirstTS is the timestamp of the first stored message.
FirstTs *time.Time `json:"first_ts,omitempty"`
// LastSeq is the sequence of the last stored message.
LastSeq *int32 `json:"last_seq,omitempty"`
// LastTS is the timestamp of the last stored message.
LastTs *time.Time `json:"last_ts,omitempty"`
// Messages is the number of messages currently stored.
Messages *int32 `json:"messages,omitempty"`
// Deleted is the number of deleted messages (sequence gaps).
NumDeleted *int64 `json:"num_deleted,omitempty"`
// Subjects is the number of distinct subjects stored.
NumSubjects *int32 `json:"num_subjects,omitempty"`
AdditionalProperties map[string]interface{}
}
type _MqState MqState
// NewMqState instantiates a new MqState 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 NewMqState() *MqState {
this := MqState{}
return &this
}
// NewMqStateWithDefaults instantiates a new MqState 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 NewMqStateWithDefaults() *MqState {
this := MqState{}
return &this
}
// GetBytes returns the Bytes field value if set, zero value otherwise.
func (o *MqState) GetBytes() int32 {
if o == nil || IsNil(o.Bytes) {
var ret int32
return ret
}
return *o.Bytes
}
// GetBytesOk returns a tuple with the Bytes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqState) GetBytesOk() (*int32, bool) {
if o == nil || IsNil(o.Bytes) {
return nil, false
}
return o.Bytes, true
}
// HasBytes returns a boolean if a field has been set.
func (o *MqState) HasBytes() bool {
if o != nil && !IsNil(o.Bytes) {
return true
}
return false
}
// SetBytes gets a reference to the given int32 and assigns it to the Bytes field.
func (o *MqState) SetBytes(v int32) {
o.Bytes = &v
}
// GetConsumerCount returns the ConsumerCount field value if set, zero value otherwise.
func (o *MqState) GetConsumerCount() int64 {
if o == nil || IsNil(o.ConsumerCount) {
var ret int64
return ret
}
return *o.ConsumerCount
}
// GetConsumerCountOk returns a tuple with the ConsumerCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqState) GetConsumerCountOk() (*int64, bool) {
if o == nil || IsNil(o.ConsumerCount) {
return nil, false
}
return o.ConsumerCount, true
}
// HasConsumerCount returns a boolean if a field has been set.
func (o *MqState) HasConsumerCount() bool {
if o != nil && !IsNil(o.ConsumerCount) {
return true
}
return false
}
// SetConsumerCount gets a reference to the given int64 and assigns it to the ConsumerCount field.
func (o *MqState) SetConsumerCount(v int64) {
o.ConsumerCount = &v
}
// GetFirstSeq returns the FirstSeq field value if set, zero value otherwise.
func (o *MqState) GetFirstSeq() int32 {
if o == nil || IsNil(o.FirstSeq) {
var ret int32
return ret
}
return *o.FirstSeq
}
// GetFirstSeqOk returns a tuple with the FirstSeq field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqState) GetFirstSeqOk() (*int32, bool) {
if o == nil || IsNil(o.FirstSeq) {
return nil, false
}
return o.FirstSeq, true
}
// HasFirstSeq returns a boolean if a field has been set.
func (o *MqState) HasFirstSeq() bool {
if o != nil && !IsNil(o.FirstSeq) {
return true
}
return false
}
// SetFirstSeq gets a reference to the given int32 and assigns it to the FirstSeq field.
func (o *MqState) SetFirstSeq(v int32) {
o.FirstSeq = &v
}
// GetFirstTs returns the FirstTs field value if set, zero value otherwise.
func (o *MqState) GetFirstTs() time.Time {
if o == nil || IsNil(o.FirstTs) {
var ret time.Time
return ret
}
return *o.FirstTs
}
// GetFirstTsOk returns a tuple with the FirstTs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqState) GetFirstTsOk() (*time.Time, bool) {
if o == nil || IsNil(o.FirstTs) {
return nil, false
}
return o.FirstTs, true
}
// HasFirstTs returns a boolean if a field has been set.
func (o *MqState) HasFirstTs() bool {
if o != nil && !IsNil(o.FirstTs) {
return true
}
return false
}
// SetFirstTs gets a reference to the given time.Time and assigns it to the FirstTs field.
func (o *MqState) SetFirstTs(v time.Time) {
o.FirstTs = &v
}
// GetLastSeq returns the LastSeq field value if set, zero value otherwise.
func (o *MqState) GetLastSeq() int32 {
if o == nil || IsNil(o.LastSeq) {
var ret int32
return ret
}
return *o.LastSeq
}
// GetLastSeqOk returns a tuple with the LastSeq field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqState) GetLastSeqOk() (*int32, bool) {
if o == nil || IsNil(o.LastSeq) {
return nil, false
}
return o.LastSeq, true
}
// HasLastSeq returns a boolean if a field has been set.
func (o *MqState) HasLastSeq() bool {
if o != nil && !IsNil(o.LastSeq) {
return true
}
return false
}
// SetLastSeq gets a reference to the given int32 and assigns it to the LastSeq field.
func (o *MqState) SetLastSeq(v int32) {
o.LastSeq = &v
}
// GetLastTs returns the LastTs field value if set, zero value otherwise.
func (o *MqState) GetLastTs() time.Time {
if o == nil || IsNil(o.LastTs) {
var ret time.Time
return ret
}
return *o.LastTs
}
// GetLastTsOk returns a tuple with the LastTs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqState) GetLastTsOk() (*time.Time, bool) {
if o == nil || IsNil(o.LastTs) {
return nil, false
}
return o.LastTs, true
}
// HasLastTs returns a boolean if a field has been set.
func (o *MqState) HasLastTs() bool {
if o != nil && !IsNil(o.LastTs) {
return true
}
return false
}
// SetLastTs gets a reference to the given time.Time and assigns it to the LastTs field.
func (o *MqState) SetLastTs(v time.Time) {
o.LastTs = &v
}
// GetMessages returns the Messages field value if set, zero value otherwise.
func (o *MqState) GetMessages() int32 {
if o == nil || IsNil(o.Messages) {
var ret int32
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 *MqState) GetMessagesOk() (*int32, 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 *MqState) HasMessages() bool {
if o != nil && !IsNil(o.Messages) {
return true
}
return false
}
// SetMessages gets a reference to the given int32 and assigns it to the Messages field.
func (o *MqState) SetMessages(v int32) {
o.Messages = &v
}
// GetNumDeleted returns the NumDeleted field value if set, zero value otherwise.
func (o *MqState) GetNumDeleted() int64 {
if o == nil || IsNil(o.NumDeleted) {
var ret int64
return ret
}
return *o.NumDeleted
}
// GetNumDeletedOk returns a tuple with the NumDeleted field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqState) GetNumDeletedOk() (*int64, bool) {
if o == nil || IsNil(o.NumDeleted) {
return nil, false
}
return o.NumDeleted, true
}
// HasNumDeleted returns a boolean if a field has been set.
func (o *MqState) HasNumDeleted() bool {
if o != nil && !IsNil(o.NumDeleted) {
return true
}
return false
}
// SetNumDeleted gets a reference to the given int64 and assigns it to the NumDeleted field.
func (o *MqState) SetNumDeleted(v int64) {
o.NumDeleted = &v
}
// GetNumSubjects returns the NumSubjects field value if set, zero value otherwise.
func (o *MqState) GetNumSubjects() int32 {
if o == nil || IsNil(o.NumSubjects) {
var ret int32
return ret
}
return *o.NumSubjects
}
// GetNumSubjectsOk returns a tuple with the NumSubjects field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqState) GetNumSubjectsOk() (*int32, bool) {
if o == nil || IsNil(o.NumSubjects) {
return nil, false
}
return o.NumSubjects, true
}
// HasNumSubjects returns a boolean if a field has been set.
func (o *MqState) HasNumSubjects() bool {
if o != nil && !IsNil(o.NumSubjects) {
return true
}
return false
}
// SetNumSubjects gets a reference to the given int32 and assigns it to the NumSubjects field.
func (o *MqState) SetNumSubjects(v int32) {
o.NumSubjects = &v
}
func (o MqState) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MqState) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Bytes) {
toSerialize["bytes"] = o.Bytes
}
if !IsNil(o.ConsumerCount) {
toSerialize["consumer_count"] = o.ConsumerCount
}
if !IsNil(o.FirstSeq) {
toSerialize["first_seq"] = o.FirstSeq
}
if !IsNil(o.FirstTs) {
toSerialize["first_ts"] = o.FirstTs
}
if !IsNil(o.LastSeq) {
toSerialize["last_seq"] = o.LastSeq
}
if !IsNil(o.LastTs) {
toSerialize["last_ts"] = o.LastTs
}
if !IsNil(o.Messages) {
toSerialize["messages"] = o.Messages
}
if !IsNil(o.NumDeleted) {
toSerialize["num_deleted"] = o.NumDeleted
}
if !IsNil(o.NumSubjects) {
toSerialize["num_subjects"] = o.NumSubjects
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *MqState) UnmarshalJSON(data []byte) (err error) {
varMqState := _MqState{}
err = json.Unmarshal(data, &varMqState)
if err != nil {
return err
}
*o = MqState(varMqState)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "bytes")
delete(additionalProperties, "consumer_count")
delete(additionalProperties, "first_seq")
delete(additionalProperties, "first_ts")
delete(additionalProperties, "last_seq")
delete(additionalProperties, "last_ts")
delete(additionalProperties, "messages")
delete(additionalProperties, "num_deleted")
delete(additionalProperties, "num_subjects")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableMqState struct {
value *MqState
isSet bool
}
func (v NullableMqState) Get() *MqState {
return v.value
}
func (v *NullableMqState) Set(val *MqState) {
v.value = val
v.isSet = true
}
func (v NullableMqState) IsSet() bool {
return v.isSet
}
func (v *NullableMqState) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMqState(val *MqState) *NullableMqState {
return &NullableMqState{value: val, isSet: true}
}
func (v NullableMqState) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMqState) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}