mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
498 lines
13 KiB
Go
498 lines
13 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 MqConsumer type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &MqConsumer{}
|
|
|
|
// MqConsumer struct for MqConsumer
|
|
type MqConsumer struct {
|
|
// AckFloor is the highest contiguously acknowledged sequence pair.
|
|
AckFloor *MqSequences `json:"ack_floor,omitempty"`
|
|
// Config is the consumer's configuration.
|
|
Config *MqDurable `json:"config,omitempty"`
|
|
// Created is when the consumer was created.
|
|
Created *time.Time `json:"created,omitempty"`
|
|
// Delivered is the highest delivered sequence pair.
|
|
Delivered *MqSequences `json:"delivered,omitempty"`
|
|
// Name is the consumer name.
|
|
Name *string `json:"name,omitempty"`
|
|
// AckPending is the number of delivered, not yet acknowledged messages.
|
|
NumAckPending *int64 `json:"num_ack_pending,omitempty"`
|
|
// Pending is the number of messages yet to be delivered.
|
|
NumPending *int32 `json:"num_pending,omitempty"`
|
|
// Redelivered is the number of messages currently being redelivered.
|
|
NumRedelivered *int64 `json:"num_redelivered,omitempty"`
|
|
// Waiting is the number of pull requests waiting for messages.
|
|
NumWaiting *int64 `json:"num_waiting,omitempty"`
|
|
// Stream is the stream this consumer reads.
|
|
StreamName *string `json:"stream_name,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _MqConsumer MqConsumer
|
|
|
|
// NewMqConsumer instantiates a new MqConsumer 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 NewMqConsumer() *MqConsumer {
|
|
this := MqConsumer{}
|
|
return &this
|
|
}
|
|
|
|
// NewMqConsumerWithDefaults instantiates a new MqConsumer 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 NewMqConsumerWithDefaults() *MqConsumer {
|
|
this := MqConsumer{}
|
|
return &this
|
|
}
|
|
|
|
// GetAckFloor returns the AckFloor field value if set, zero value otherwise.
|
|
func (o *MqConsumer) GetAckFloor() MqSequences {
|
|
if o == nil || IsNil(o.AckFloor) {
|
|
var ret MqSequences
|
|
return ret
|
|
}
|
|
return *o.AckFloor
|
|
}
|
|
|
|
// GetAckFloorOk returns a tuple with the AckFloor field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MqConsumer) GetAckFloorOk() (*MqSequences, bool) {
|
|
if o == nil || IsNil(o.AckFloor) {
|
|
return nil, false
|
|
}
|
|
return o.AckFloor, true
|
|
}
|
|
|
|
// HasAckFloor returns a boolean if a field has been set.
|
|
func (o *MqConsumer) HasAckFloor() bool {
|
|
if o != nil && !IsNil(o.AckFloor) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAckFloor gets a reference to the given MqSequences and assigns it to the AckFloor field.
|
|
func (o *MqConsumer) SetAckFloor(v MqSequences) {
|
|
o.AckFloor = &v
|
|
}
|
|
|
|
// GetConfig returns the Config field value if set, zero value otherwise.
|
|
func (o *MqConsumer) GetConfig() MqDurable {
|
|
if o == nil || IsNil(o.Config) {
|
|
var ret MqDurable
|
|
return ret
|
|
}
|
|
return *o.Config
|
|
}
|
|
|
|
// GetConfigOk returns a tuple with the Config field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MqConsumer) GetConfigOk() (*MqDurable, bool) {
|
|
if o == nil || IsNil(o.Config) {
|
|
return nil, false
|
|
}
|
|
return o.Config, true
|
|
}
|
|
|
|
// HasConfig returns a boolean if a field has been set.
|
|
func (o *MqConsumer) HasConfig() bool {
|
|
if o != nil && !IsNil(o.Config) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetConfig gets a reference to the given MqDurable and assigns it to the Config field.
|
|
func (o *MqConsumer) SetConfig(v MqDurable) {
|
|
o.Config = &v
|
|
}
|
|
|
|
// GetCreated returns the Created field value if set, zero value otherwise.
|
|
func (o *MqConsumer) GetCreated() time.Time {
|
|
if o == nil || IsNil(o.Created) {
|
|
var ret time.Time
|
|
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 *MqConsumer) GetCreatedOk() (*time.Time, 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 *MqConsumer) HasCreated() bool {
|
|
if o != nil && !IsNil(o.Created) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCreated gets a reference to the given time.Time and assigns it to the Created field.
|
|
func (o *MqConsumer) SetCreated(v time.Time) {
|
|
o.Created = &v
|
|
}
|
|
|
|
// GetDelivered returns the Delivered field value if set, zero value otherwise.
|
|
func (o *MqConsumer) GetDelivered() MqSequences {
|
|
if o == nil || IsNil(o.Delivered) {
|
|
var ret MqSequences
|
|
return ret
|
|
}
|
|
return *o.Delivered
|
|
}
|
|
|
|
// GetDeliveredOk returns a tuple with the Delivered field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MqConsumer) GetDeliveredOk() (*MqSequences, bool) {
|
|
if o == nil || IsNil(o.Delivered) {
|
|
return nil, false
|
|
}
|
|
return o.Delivered, true
|
|
}
|
|
|
|
// HasDelivered returns a boolean if a field has been set.
|
|
func (o *MqConsumer) HasDelivered() bool {
|
|
if o != nil && !IsNil(o.Delivered) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDelivered gets a reference to the given MqSequences and assigns it to the Delivered field.
|
|
func (o *MqConsumer) SetDelivered(v MqSequences) {
|
|
o.Delivered = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *MqConsumer) GetName() string {
|
|
if o == nil || IsNil(o.Name) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Name
|
|
}
|
|
|
|
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MqConsumer) GetNameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Name) {
|
|
return nil, false
|
|
}
|
|
return o.Name, true
|
|
}
|
|
|
|
// HasName returns a boolean if a field has been set.
|
|
func (o *MqConsumer) HasName() bool {
|
|
if o != nil && !IsNil(o.Name) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetName gets a reference to the given string and assigns it to the Name field.
|
|
func (o *MqConsumer) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetNumAckPending returns the NumAckPending field value if set, zero value otherwise.
|
|
func (o *MqConsumer) GetNumAckPending() int64 {
|
|
if o == nil || IsNil(o.NumAckPending) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.NumAckPending
|
|
}
|
|
|
|
// GetNumAckPendingOk returns a tuple with the NumAckPending field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MqConsumer) GetNumAckPendingOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.NumAckPending) {
|
|
return nil, false
|
|
}
|
|
return o.NumAckPending, true
|
|
}
|
|
|
|
// HasNumAckPending returns a boolean if a field has been set.
|
|
func (o *MqConsumer) HasNumAckPending() bool {
|
|
if o != nil && !IsNil(o.NumAckPending) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNumAckPending gets a reference to the given int64 and assigns it to the NumAckPending field.
|
|
func (o *MqConsumer) SetNumAckPending(v int64) {
|
|
o.NumAckPending = &v
|
|
}
|
|
|
|
// GetNumPending returns the NumPending field value if set, zero value otherwise.
|
|
func (o *MqConsumer) GetNumPending() int32 {
|
|
if o == nil || IsNil(o.NumPending) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.NumPending
|
|
}
|
|
|
|
// GetNumPendingOk returns a tuple with the NumPending field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MqConsumer) GetNumPendingOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.NumPending) {
|
|
return nil, false
|
|
}
|
|
return o.NumPending, true
|
|
}
|
|
|
|
// HasNumPending returns a boolean if a field has been set.
|
|
func (o *MqConsumer) HasNumPending() bool {
|
|
if o != nil && !IsNil(o.NumPending) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNumPending gets a reference to the given int32 and assigns it to the NumPending field.
|
|
func (o *MqConsumer) SetNumPending(v int32) {
|
|
o.NumPending = &v
|
|
}
|
|
|
|
// GetNumRedelivered returns the NumRedelivered field value if set, zero value otherwise.
|
|
func (o *MqConsumer) GetNumRedelivered() int64 {
|
|
if o == nil || IsNil(o.NumRedelivered) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.NumRedelivered
|
|
}
|
|
|
|
// GetNumRedeliveredOk returns a tuple with the NumRedelivered field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MqConsumer) GetNumRedeliveredOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.NumRedelivered) {
|
|
return nil, false
|
|
}
|
|
return o.NumRedelivered, true
|
|
}
|
|
|
|
// HasNumRedelivered returns a boolean if a field has been set.
|
|
func (o *MqConsumer) HasNumRedelivered() bool {
|
|
if o != nil && !IsNil(o.NumRedelivered) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNumRedelivered gets a reference to the given int64 and assigns it to the NumRedelivered field.
|
|
func (o *MqConsumer) SetNumRedelivered(v int64) {
|
|
o.NumRedelivered = &v
|
|
}
|
|
|
|
// GetNumWaiting returns the NumWaiting field value if set, zero value otherwise.
|
|
func (o *MqConsumer) GetNumWaiting() int64 {
|
|
if o == nil || IsNil(o.NumWaiting) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.NumWaiting
|
|
}
|
|
|
|
// GetNumWaitingOk returns a tuple with the NumWaiting field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MqConsumer) GetNumWaitingOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.NumWaiting) {
|
|
return nil, false
|
|
}
|
|
return o.NumWaiting, true
|
|
}
|
|
|
|
// HasNumWaiting returns a boolean if a field has been set.
|
|
func (o *MqConsumer) HasNumWaiting() bool {
|
|
if o != nil && !IsNil(o.NumWaiting) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNumWaiting gets a reference to the given int64 and assigns it to the NumWaiting field.
|
|
func (o *MqConsumer) SetNumWaiting(v int64) {
|
|
o.NumWaiting = &v
|
|
}
|
|
|
|
// GetStreamName returns the StreamName field value if set, zero value otherwise.
|
|
func (o *MqConsumer) GetStreamName() string {
|
|
if o == nil || IsNil(o.StreamName) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.StreamName
|
|
}
|
|
|
|
// GetStreamNameOk returns a tuple with the StreamName field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MqConsumer) GetStreamNameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.StreamName) {
|
|
return nil, false
|
|
}
|
|
return o.StreamName, true
|
|
}
|
|
|
|
// HasStreamName returns a boolean if a field has been set.
|
|
func (o *MqConsumer) HasStreamName() bool {
|
|
if o != nil && !IsNil(o.StreamName) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStreamName gets a reference to the given string and assigns it to the StreamName field.
|
|
func (o *MqConsumer) SetStreamName(v string) {
|
|
o.StreamName = &v
|
|
}
|
|
|
|
func (o MqConsumer) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o MqConsumer) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.AckFloor) {
|
|
toSerialize["ack_floor"] = o.AckFloor
|
|
}
|
|
if !IsNil(o.Config) {
|
|
toSerialize["config"] = o.Config
|
|
}
|
|
if !IsNil(o.Created) {
|
|
toSerialize["created"] = o.Created
|
|
}
|
|
if !IsNil(o.Delivered) {
|
|
toSerialize["delivered"] = o.Delivered
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.NumAckPending) {
|
|
toSerialize["num_ack_pending"] = o.NumAckPending
|
|
}
|
|
if !IsNil(o.NumPending) {
|
|
toSerialize["num_pending"] = o.NumPending
|
|
}
|
|
if !IsNil(o.NumRedelivered) {
|
|
toSerialize["num_redelivered"] = o.NumRedelivered
|
|
}
|
|
if !IsNil(o.NumWaiting) {
|
|
toSerialize["num_waiting"] = o.NumWaiting
|
|
}
|
|
if !IsNil(o.StreamName) {
|
|
toSerialize["stream_name"] = o.StreamName
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *MqConsumer) UnmarshalJSON(data []byte) (err error) {
|
|
varMqConsumer := _MqConsumer{}
|
|
|
|
err = json.Unmarshal(data, &varMqConsumer)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = MqConsumer(varMqConsumer)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "ack_floor")
|
|
delete(additionalProperties, "config")
|
|
delete(additionalProperties, "created")
|
|
delete(additionalProperties, "delivered")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "num_ack_pending")
|
|
delete(additionalProperties, "num_pending")
|
|
delete(additionalProperties, "num_redelivered")
|
|
delete(additionalProperties, "num_waiting")
|
|
delete(additionalProperties, "stream_name")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableMqConsumer struct {
|
|
value *MqConsumer
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableMqConsumer) Get() *MqConsumer {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableMqConsumer) Set(val *MqConsumer) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableMqConsumer) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableMqConsumer) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableMqConsumer(val *MqConsumer) *NullableMqConsumer {
|
|
return &NullableMqConsumer{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableMqConsumer) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableMqConsumer) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|