Files
sdk/model_mq_durable.go

536 lines
15 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 MqDurable type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MqDurable{}
// MqDurable struct for MqDurable
type MqDurable struct {
// Ack is the acknowledgment policy: explicit (default), all, or none.
AckPolicy *string `json:"ack_policy,omitempty"`
// AckWait is how long the broker waits for an ack before redelivering, e.g. \"30s\" (default).
AckWait *string `json:"ack_wait,omitempty"`
// Deliver is where delivery starts: all (default), last, new, by_start_sequence, by_start_time, or last_per_subject.
DeliverPolicy *string `json:"deliver_policy,omitempty"`
// Description says what this consumer is for.
Description *string `json:"description,omitempty"`
// Name is the durable consumer name (alphanumeric, hyphens, underscores).
DurableName *string `json:"durable_name,omitempty"`
// Filter delivers only messages on this org-relative subject (wildcards supported).
FilterSubject *string `json:"filter_subject,omitempty"`
// MaxAckPending caps unacknowledged messages in flight (default 1000).
MaxAckPending *int64 `json:"max_ack_pending,omitempty"`
// MaxDeliver caps delivery attempts per message; -1 (default) is unlimited.
MaxDeliver *int64 `json:"max_deliver,omitempty"`
// StartSeq is the starting sequence for deliver_policy by_start_sequence.
OptStartSeq *int32 `json:"opt_start_seq,omitempty"`
// StartTime is the starting instant for deliver_policy by_start_time.
OptStartTime *time.Time `json:"opt_start_time,omitempty"`
// Replay is the replay pacing: instant (default) or original.
ReplayPolicy *string `json:"replay_policy,omitempty"`
AdditionalProperties map[string]interface{}
}
type _MqDurable MqDurable
// NewMqDurable instantiates a new MqDurable 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 NewMqDurable() *MqDurable {
this := MqDurable{}
return &this
}
// NewMqDurableWithDefaults instantiates a new MqDurable 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 NewMqDurableWithDefaults() *MqDurable {
this := MqDurable{}
return &this
}
// GetAckPolicy returns the AckPolicy field value if set, zero value otherwise.
func (o *MqDurable) GetAckPolicy() string {
if o == nil || IsNil(o.AckPolicy) {
var ret string
return ret
}
return *o.AckPolicy
}
// GetAckPolicyOk returns a tuple with the AckPolicy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqDurable) GetAckPolicyOk() (*string, bool) {
if o == nil || IsNil(o.AckPolicy) {
return nil, false
}
return o.AckPolicy, true
}
// HasAckPolicy returns a boolean if a field has been set.
func (o *MqDurable) HasAckPolicy() bool {
if o != nil && !IsNil(o.AckPolicy) {
return true
}
return false
}
// SetAckPolicy gets a reference to the given string and assigns it to the AckPolicy field.
func (o *MqDurable) SetAckPolicy(v string) {
o.AckPolicy = &v
}
// GetAckWait returns the AckWait field value if set, zero value otherwise.
func (o *MqDurable) GetAckWait() string {
if o == nil || IsNil(o.AckWait) {
var ret string
return ret
}
return *o.AckWait
}
// GetAckWaitOk returns a tuple with the AckWait field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqDurable) GetAckWaitOk() (*string, bool) {
if o == nil || IsNil(o.AckWait) {
return nil, false
}
return o.AckWait, true
}
// HasAckWait returns a boolean if a field has been set.
func (o *MqDurable) HasAckWait() bool {
if o != nil && !IsNil(o.AckWait) {
return true
}
return false
}
// SetAckWait gets a reference to the given string and assigns it to the AckWait field.
func (o *MqDurable) SetAckWait(v string) {
o.AckWait = &v
}
// GetDeliverPolicy returns the DeliverPolicy field value if set, zero value otherwise.
func (o *MqDurable) GetDeliverPolicy() string {
if o == nil || IsNil(o.DeliverPolicy) {
var ret string
return ret
}
return *o.DeliverPolicy
}
// GetDeliverPolicyOk returns a tuple with the DeliverPolicy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqDurable) GetDeliverPolicyOk() (*string, bool) {
if o == nil || IsNil(o.DeliverPolicy) {
return nil, false
}
return o.DeliverPolicy, true
}
// HasDeliverPolicy returns a boolean if a field has been set.
func (o *MqDurable) HasDeliverPolicy() bool {
if o != nil && !IsNil(o.DeliverPolicy) {
return true
}
return false
}
// SetDeliverPolicy gets a reference to the given string and assigns it to the DeliverPolicy field.
func (o *MqDurable) SetDeliverPolicy(v string) {
o.DeliverPolicy = &v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *MqDurable) GetDescription() string {
if o == nil || IsNil(o.Description) {
var ret string
return ret
}
return *o.Description
}
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqDurable) GetDescriptionOk() (*string, bool) {
if o == nil || IsNil(o.Description) {
return nil, false
}
return o.Description, true
}
// HasDescription returns a boolean if a field has been set.
func (o *MqDurable) HasDescription() bool {
if o != nil && !IsNil(o.Description) {
return true
}
return false
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *MqDurable) SetDescription(v string) {
o.Description = &v
}
// GetDurableName returns the DurableName field value if set, zero value otherwise.
func (o *MqDurable) GetDurableName() string {
if o == nil || IsNil(o.DurableName) {
var ret string
return ret
}
return *o.DurableName
}
// GetDurableNameOk returns a tuple with the DurableName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqDurable) GetDurableNameOk() (*string, bool) {
if o == nil || IsNil(o.DurableName) {
return nil, false
}
return o.DurableName, true
}
// HasDurableName returns a boolean if a field has been set.
func (o *MqDurable) HasDurableName() bool {
if o != nil && !IsNil(o.DurableName) {
return true
}
return false
}
// SetDurableName gets a reference to the given string and assigns it to the DurableName field.
func (o *MqDurable) SetDurableName(v string) {
o.DurableName = &v
}
// GetFilterSubject returns the FilterSubject field value if set, zero value otherwise.
func (o *MqDurable) GetFilterSubject() string {
if o == nil || IsNil(o.FilterSubject) {
var ret string
return ret
}
return *o.FilterSubject
}
// GetFilterSubjectOk returns a tuple with the FilterSubject field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqDurable) GetFilterSubjectOk() (*string, bool) {
if o == nil || IsNil(o.FilterSubject) {
return nil, false
}
return o.FilterSubject, true
}
// HasFilterSubject returns a boolean if a field has been set.
func (o *MqDurable) HasFilterSubject() bool {
if o != nil && !IsNil(o.FilterSubject) {
return true
}
return false
}
// SetFilterSubject gets a reference to the given string and assigns it to the FilterSubject field.
func (o *MqDurable) SetFilterSubject(v string) {
o.FilterSubject = &v
}
// GetMaxAckPending returns the MaxAckPending field value if set, zero value otherwise.
func (o *MqDurable) GetMaxAckPending() int64 {
if o == nil || IsNil(o.MaxAckPending) {
var ret int64
return ret
}
return *o.MaxAckPending
}
// GetMaxAckPendingOk returns a tuple with the MaxAckPending field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqDurable) GetMaxAckPendingOk() (*int64, bool) {
if o == nil || IsNil(o.MaxAckPending) {
return nil, false
}
return o.MaxAckPending, true
}
// HasMaxAckPending returns a boolean if a field has been set.
func (o *MqDurable) HasMaxAckPending() bool {
if o != nil && !IsNil(o.MaxAckPending) {
return true
}
return false
}
// SetMaxAckPending gets a reference to the given int64 and assigns it to the MaxAckPending field.
func (o *MqDurable) SetMaxAckPending(v int64) {
o.MaxAckPending = &v
}
// GetMaxDeliver returns the MaxDeliver field value if set, zero value otherwise.
func (o *MqDurable) GetMaxDeliver() int64 {
if o == nil || IsNil(o.MaxDeliver) {
var ret int64
return ret
}
return *o.MaxDeliver
}
// GetMaxDeliverOk returns a tuple with the MaxDeliver field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqDurable) GetMaxDeliverOk() (*int64, bool) {
if o == nil || IsNil(o.MaxDeliver) {
return nil, false
}
return o.MaxDeliver, true
}
// HasMaxDeliver returns a boolean if a field has been set.
func (o *MqDurable) HasMaxDeliver() bool {
if o != nil && !IsNil(o.MaxDeliver) {
return true
}
return false
}
// SetMaxDeliver gets a reference to the given int64 and assigns it to the MaxDeliver field.
func (o *MqDurable) SetMaxDeliver(v int64) {
o.MaxDeliver = &v
}
// GetOptStartSeq returns the OptStartSeq field value if set, zero value otherwise.
func (o *MqDurable) GetOptStartSeq() int32 {
if o == nil || IsNil(o.OptStartSeq) {
var ret int32
return ret
}
return *o.OptStartSeq
}
// GetOptStartSeqOk returns a tuple with the OptStartSeq field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqDurable) GetOptStartSeqOk() (*int32, bool) {
if o == nil || IsNil(o.OptStartSeq) {
return nil, false
}
return o.OptStartSeq, true
}
// HasOptStartSeq returns a boolean if a field has been set.
func (o *MqDurable) HasOptStartSeq() bool {
if o != nil && !IsNil(o.OptStartSeq) {
return true
}
return false
}
// SetOptStartSeq gets a reference to the given int32 and assigns it to the OptStartSeq field.
func (o *MqDurable) SetOptStartSeq(v int32) {
o.OptStartSeq = &v
}
// GetOptStartTime returns the OptStartTime field value if set, zero value otherwise.
func (o *MqDurable) GetOptStartTime() time.Time {
if o == nil || IsNil(o.OptStartTime) {
var ret time.Time
return ret
}
return *o.OptStartTime
}
// GetOptStartTimeOk returns a tuple with the OptStartTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqDurable) GetOptStartTimeOk() (*time.Time, bool) {
if o == nil || IsNil(o.OptStartTime) {
return nil, false
}
return o.OptStartTime, true
}
// HasOptStartTime returns a boolean if a field has been set.
func (o *MqDurable) HasOptStartTime() bool {
if o != nil && !IsNil(o.OptStartTime) {
return true
}
return false
}
// SetOptStartTime gets a reference to the given time.Time and assigns it to the OptStartTime field.
func (o *MqDurable) SetOptStartTime(v time.Time) {
o.OptStartTime = &v
}
// GetReplayPolicy returns the ReplayPolicy field value if set, zero value otherwise.
func (o *MqDurable) GetReplayPolicy() string {
if o == nil || IsNil(o.ReplayPolicy) {
var ret string
return ret
}
return *o.ReplayPolicy
}
// GetReplayPolicyOk returns a tuple with the ReplayPolicy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqDurable) GetReplayPolicyOk() (*string, bool) {
if o == nil || IsNil(o.ReplayPolicy) {
return nil, false
}
return o.ReplayPolicy, true
}
// HasReplayPolicy returns a boolean if a field has been set.
func (o *MqDurable) HasReplayPolicy() bool {
if o != nil && !IsNil(o.ReplayPolicy) {
return true
}
return false
}
// SetReplayPolicy gets a reference to the given string and assigns it to the ReplayPolicy field.
func (o *MqDurable) SetReplayPolicy(v string) {
o.ReplayPolicy = &v
}
func (o MqDurable) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MqDurable) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AckPolicy) {
toSerialize["ack_policy"] = o.AckPolicy
}
if !IsNil(o.AckWait) {
toSerialize["ack_wait"] = o.AckWait
}
if !IsNil(o.DeliverPolicy) {
toSerialize["deliver_policy"] = o.DeliverPolicy
}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
if !IsNil(o.DurableName) {
toSerialize["durable_name"] = o.DurableName
}
if !IsNil(o.FilterSubject) {
toSerialize["filter_subject"] = o.FilterSubject
}
if !IsNil(o.MaxAckPending) {
toSerialize["max_ack_pending"] = o.MaxAckPending
}
if !IsNil(o.MaxDeliver) {
toSerialize["max_deliver"] = o.MaxDeliver
}
if !IsNil(o.OptStartSeq) {
toSerialize["opt_start_seq"] = o.OptStartSeq
}
if !IsNil(o.OptStartTime) {
toSerialize["opt_start_time"] = o.OptStartTime
}
if !IsNil(o.ReplayPolicy) {
toSerialize["replay_policy"] = o.ReplayPolicy
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *MqDurable) UnmarshalJSON(data []byte) (err error) {
varMqDurable := _MqDurable{}
err = json.Unmarshal(data, &varMqDurable)
if err != nil {
return err
}
*o = MqDurable(varMqDurable)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "ack_policy")
delete(additionalProperties, "ack_wait")
delete(additionalProperties, "deliver_policy")
delete(additionalProperties, "description")
delete(additionalProperties, "durable_name")
delete(additionalProperties, "filter_subject")
delete(additionalProperties, "max_ack_pending")
delete(additionalProperties, "max_deliver")
delete(additionalProperties, "opt_start_seq")
delete(additionalProperties, "opt_start_time")
delete(additionalProperties, "replay_policy")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableMqDurable struct {
value *MqDurable
isSet bool
}
func (v NullableMqDurable) Get() *MqDurable {
return v.value
}
func (v *NullableMqDurable) Set(val *MqDurable) {
v.value = val
v.isSet = true
}
func (v NullableMqDurable) IsSet() bool {
return v.isSet
}
func (v *NullableMqDurable) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMqDurable(val *MqDurable) *NullableMqDurable {
return &NullableMqDurable{value: val, isSet: true}
}
func (v NullableMqDurable) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMqDurable) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}