mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
459 lines
12 KiB
Go
459 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"
|
||
)
|
||
|
||
// checks if the MqConfig type satisfies the MappedNullable interface at compile time
|
||
var _ MappedNullable = &MqConfig{}
|
||
|
||
// MqConfig struct for MqConfig
|
||
type MqConfig struct {
|
||
// MaxAge caps message age, e.g. \"24h\" or \"7d\"; \"0\" (default) is unlimited.
|
||
MaxAge *string `json:"max_age,omitempty"`
|
||
// MaxBytes caps the stream's total stored bytes; -1 (default) is unlimited.
|
||
MaxBytes *int64 `json:"max_bytes,omitempty"`
|
||
// MaxMsgSize caps one message's size in bytes; -1 (default) is the broker's limit.
|
||
MaxMsgSize *int32 `json:"max_msg_size,omitempty"`
|
||
// MaxMsgs caps the number of stored messages; -1 (default) is unlimited.
|
||
MaxMsgs *int64 `json:"max_msgs,omitempty"`
|
||
// Name is the stream name, unique within the org (alphanumeric, hyphens, underscores).
|
||
Name *string `json:"name,omitempty"`
|
||
// Replicas is the number of stream replicas (1–5); this plane runs 1.
|
||
NumReplicas *int64 `json:"num_replicas,omitempty"`
|
||
// Retention is the retention policy: limits (default), interest, or workqueue.
|
||
Retention *string `json:"retention,omitempty"`
|
||
// Storage is the storage backend: file (default) or memory.
|
||
Storage *string `json:"storage,omitempty"`
|
||
// Subjects are the org-relative subjects bound to this stream (wildcards supported). Default: the stream name.
|
||
Subjects []string `json:"subjects,omitempty"`
|
||
AdditionalProperties map[string]interface{}
|
||
}
|
||
|
||
type _MqConfig MqConfig
|
||
|
||
// NewMqConfig instantiates a new MqConfig 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 NewMqConfig() *MqConfig {
|
||
this := MqConfig{}
|
||
return &this
|
||
}
|
||
|
||
// NewMqConfigWithDefaults instantiates a new MqConfig 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 NewMqConfigWithDefaults() *MqConfig {
|
||
this := MqConfig{}
|
||
return &this
|
||
}
|
||
|
||
// GetMaxAge returns the MaxAge field value if set, zero value otherwise.
|
||
func (o *MqConfig) GetMaxAge() string {
|
||
if o == nil || IsNil(o.MaxAge) {
|
||
var ret string
|
||
return ret
|
||
}
|
||
return *o.MaxAge
|
||
}
|
||
|
||
// GetMaxAgeOk returns a tuple with the MaxAge field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *MqConfig) GetMaxAgeOk() (*string, bool) {
|
||
if o == nil || IsNil(o.MaxAge) {
|
||
return nil, false
|
||
}
|
||
return o.MaxAge, true
|
||
}
|
||
|
||
// HasMaxAge returns a boolean if a field has been set.
|
||
func (o *MqConfig) HasMaxAge() bool {
|
||
if o != nil && !IsNil(o.MaxAge) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetMaxAge gets a reference to the given string and assigns it to the MaxAge field.
|
||
func (o *MqConfig) SetMaxAge(v string) {
|
||
o.MaxAge = &v
|
||
}
|
||
|
||
// GetMaxBytes returns the MaxBytes field value if set, zero value otherwise.
|
||
func (o *MqConfig) GetMaxBytes() int64 {
|
||
if o == nil || IsNil(o.MaxBytes) {
|
||
var ret int64
|
||
return ret
|
||
}
|
||
return *o.MaxBytes
|
||
}
|
||
|
||
// GetMaxBytesOk returns a tuple with the MaxBytes field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *MqConfig) GetMaxBytesOk() (*int64, bool) {
|
||
if o == nil || IsNil(o.MaxBytes) {
|
||
return nil, false
|
||
}
|
||
return o.MaxBytes, true
|
||
}
|
||
|
||
// HasMaxBytes returns a boolean if a field has been set.
|
||
func (o *MqConfig) HasMaxBytes() bool {
|
||
if o != nil && !IsNil(o.MaxBytes) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetMaxBytes gets a reference to the given int64 and assigns it to the MaxBytes field.
|
||
func (o *MqConfig) SetMaxBytes(v int64) {
|
||
o.MaxBytes = &v
|
||
}
|
||
|
||
// GetMaxMsgSize returns the MaxMsgSize field value if set, zero value otherwise.
|
||
func (o *MqConfig) GetMaxMsgSize() int32 {
|
||
if o == nil || IsNil(o.MaxMsgSize) {
|
||
var ret int32
|
||
return ret
|
||
}
|
||
return *o.MaxMsgSize
|
||
}
|
||
|
||
// GetMaxMsgSizeOk returns a tuple with the MaxMsgSize field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *MqConfig) GetMaxMsgSizeOk() (*int32, bool) {
|
||
if o == nil || IsNil(o.MaxMsgSize) {
|
||
return nil, false
|
||
}
|
||
return o.MaxMsgSize, true
|
||
}
|
||
|
||
// HasMaxMsgSize returns a boolean if a field has been set.
|
||
func (o *MqConfig) HasMaxMsgSize() bool {
|
||
if o != nil && !IsNil(o.MaxMsgSize) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetMaxMsgSize gets a reference to the given int32 and assigns it to the MaxMsgSize field.
|
||
func (o *MqConfig) SetMaxMsgSize(v int32) {
|
||
o.MaxMsgSize = &v
|
||
}
|
||
|
||
// GetMaxMsgs returns the MaxMsgs field value if set, zero value otherwise.
|
||
func (o *MqConfig) GetMaxMsgs() int64 {
|
||
if o == nil || IsNil(o.MaxMsgs) {
|
||
var ret int64
|
||
return ret
|
||
}
|
||
return *o.MaxMsgs
|
||
}
|
||
|
||
// GetMaxMsgsOk returns a tuple with the MaxMsgs field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *MqConfig) GetMaxMsgsOk() (*int64, bool) {
|
||
if o == nil || IsNil(o.MaxMsgs) {
|
||
return nil, false
|
||
}
|
||
return o.MaxMsgs, true
|
||
}
|
||
|
||
// HasMaxMsgs returns a boolean if a field has been set.
|
||
func (o *MqConfig) HasMaxMsgs() bool {
|
||
if o != nil && !IsNil(o.MaxMsgs) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetMaxMsgs gets a reference to the given int64 and assigns it to the MaxMsgs field.
|
||
func (o *MqConfig) SetMaxMsgs(v int64) {
|
||
o.MaxMsgs = &v
|
||
}
|
||
|
||
// GetName returns the Name field value if set, zero value otherwise.
|
||
func (o *MqConfig) 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 *MqConfig) 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 *MqConfig) 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 *MqConfig) SetName(v string) {
|
||
o.Name = &v
|
||
}
|
||
|
||
// GetNumReplicas returns the NumReplicas field value if set, zero value otherwise.
|
||
func (o *MqConfig) GetNumReplicas() int64 {
|
||
if o == nil || IsNil(o.NumReplicas) {
|
||
var ret int64
|
||
return ret
|
||
}
|
||
return *o.NumReplicas
|
||
}
|
||
|
||
// GetNumReplicasOk returns a tuple with the NumReplicas field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *MqConfig) GetNumReplicasOk() (*int64, bool) {
|
||
if o == nil || IsNil(o.NumReplicas) {
|
||
return nil, false
|
||
}
|
||
return o.NumReplicas, true
|
||
}
|
||
|
||
// HasNumReplicas returns a boolean if a field has been set.
|
||
func (o *MqConfig) HasNumReplicas() bool {
|
||
if o != nil && !IsNil(o.NumReplicas) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetNumReplicas gets a reference to the given int64 and assigns it to the NumReplicas field.
|
||
func (o *MqConfig) SetNumReplicas(v int64) {
|
||
o.NumReplicas = &v
|
||
}
|
||
|
||
// GetRetention returns the Retention field value if set, zero value otherwise.
|
||
func (o *MqConfig) GetRetention() string {
|
||
if o == nil || IsNil(o.Retention) {
|
||
var ret string
|
||
return ret
|
||
}
|
||
return *o.Retention
|
||
}
|
||
|
||
// GetRetentionOk returns a tuple with the Retention field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *MqConfig) GetRetentionOk() (*string, bool) {
|
||
if o == nil || IsNil(o.Retention) {
|
||
return nil, false
|
||
}
|
||
return o.Retention, true
|
||
}
|
||
|
||
// HasRetention returns a boolean if a field has been set.
|
||
func (o *MqConfig) HasRetention() bool {
|
||
if o != nil && !IsNil(o.Retention) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetRetention gets a reference to the given string and assigns it to the Retention field.
|
||
func (o *MqConfig) SetRetention(v string) {
|
||
o.Retention = &v
|
||
}
|
||
|
||
// GetStorage returns the Storage field value if set, zero value otherwise.
|
||
func (o *MqConfig) GetStorage() string {
|
||
if o == nil || IsNil(o.Storage) {
|
||
var ret string
|
||
return ret
|
||
}
|
||
return *o.Storage
|
||
}
|
||
|
||
// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *MqConfig) GetStorageOk() (*string, bool) {
|
||
if o == nil || IsNil(o.Storage) {
|
||
return nil, false
|
||
}
|
||
return o.Storage, true
|
||
}
|
||
|
||
// HasStorage returns a boolean if a field has been set.
|
||
func (o *MqConfig) HasStorage() bool {
|
||
if o != nil && !IsNil(o.Storage) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetStorage gets a reference to the given string and assigns it to the Storage field.
|
||
func (o *MqConfig) SetStorage(v string) {
|
||
o.Storage = &v
|
||
}
|
||
|
||
// GetSubjects returns the Subjects field value if set, zero value otherwise.
|
||
func (o *MqConfig) GetSubjects() []string {
|
||
if o == nil || IsNil(o.Subjects) {
|
||
var ret []string
|
||
return ret
|
||
}
|
||
return o.Subjects
|
||
}
|
||
|
||
// GetSubjectsOk returns a tuple with the Subjects field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *MqConfig) GetSubjectsOk() ([]string, bool) {
|
||
if o == nil || IsNil(o.Subjects) {
|
||
return nil, false
|
||
}
|
||
return o.Subjects, true
|
||
}
|
||
|
||
// HasSubjects returns a boolean if a field has been set.
|
||
func (o *MqConfig) HasSubjects() bool {
|
||
if o != nil && !IsNil(o.Subjects) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetSubjects gets a reference to the given []string and assigns it to the Subjects field.
|
||
func (o *MqConfig) SetSubjects(v []string) {
|
||
o.Subjects = v
|
||
}
|
||
|
||
func (o MqConfig) MarshalJSON() ([]byte, error) {
|
||
toSerialize, err := o.ToMap()
|
||
if err != nil {
|
||
return []byte{}, err
|
||
}
|
||
return json.Marshal(toSerialize)
|
||
}
|
||
|
||
func (o MqConfig) ToMap() (map[string]interface{}, error) {
|
||
toSerialize := map[string]interface{}{}
|
||
if !IsNil(o.MaxAge) {
|
||
toSerialize["max_age"] = o.MaxAge
|
||
}
|
||
if !IsNil(o.MaxBytes) {
|
||
toSerialize["max_bytes"] = o.MaxBytes
|
||
}
|
||
if !IsNil(o.MaxMsgSize) {
|
||
toSerialize["max_msg_size"] = o.MaxMsgSize
|
||
}
|
||
if !IsNil(o.MaxMsgs) {
|
||
toSerialize["max_msgs"] = o.MaxMsgs
|
||
}
|
||
if !IsNil(o.Name) {
|
||
toSerialize["name"] = o.Name
|
||
}
|
||
if !IsNil(o.NumReplicas) {
|
||
toSerialize["num_replicas"] = o.NumReplicas
|
||
}
|
||
if !IsNil(o.Retention) {
|
||
toSerialize["retention"] = o.Retention
|
||
}
|
||
if !IsNil(o.Storage) {
|
||
toSerialize["storage"] = o.Storage
|
||
}
|
||
if !IsNil(o.Subjects) {
|
||
toSerialize["subjects"] = o.Subjects
|
||
}
|
||
|
||
for key, value := range o.AdditionalProperties {
|
||
toSerialize[key] = value
|
||
}
|
||
|
||
return toSerialize, nil
|
||
}
|
||
|
||
func (o *MqConfig) UnmarshalJSON(data []byte) (err error) {
|
||
varMqConfig := _MqConfig{}
|
||
|
||
err = json.Unmarshal(data, &varMqConfig)
|
||
|
||
if err != nil {
|
||
return err
|
||
}
|
||
|
||
*o = MqConfig(varMqConfig)
|
||
|
||
additionalProperties := make(map[string]interface{})
|
||
|
||
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
||
delete(additionalProperties, "max_age")
|
||
delete(additionalProperties, "max_bytes")
|
||
delete(additionalProperties, "max_msg_size")
|
||
delete(additionalProperties, "max_msgs")
|
||
delete(additionalProperties, "name")
|
||
delete(additionalProperties, "num_replicas")
|
||
delete(additionalProperties, "retention")
|
||
delete(additionalProperties, "storage")
|
||
delete(additionalProperties, "subjects")
|
||
o.AdditionalProperties = additionalProperties
|
||
}
|
||
|
||
return err
|
||
}
|
||
|
||
type NullableMqConfig struct {
|
||
value *MqConfig
|
||
isSet bool
|
||
}
|
||
|
||
func (v NullableMqConfig) Get() *MqConfig {
|
||
return v.value
|
||
}
|
||
|
||
func (v *NullableMqConfig) Set(val *MqConfig) {
|
||
v.value = val
|
||
v.isSet = true
|
||
}
|
||
|
||
func (v NullableMqConfig) IsSet() bool {
|
||
return v.isSet
|
||
}
|
||
|
||
func (v *NullableMqConfig) Unset() {
|
||
v.value = nil
|
||
v.isSet = false
|
||
}
|
||
|
||
func NewNullableMqConfig(val *MqConfig) *NullableMqConfig {
|
||
return &NullableMqConfig{value: val, isSet: true}
|
||
}
|
||
|
||
func (v NullableMqConfig) MarshalJSON() ([]byte, error) {
|
||
return json.Marshal(v.value)
|
||
}
|
||
|
||
func (v *NullableMqConfig) UnmarshalJSON(src []byte) error {
|
||
v.isSet = true
|
||
return json.Unmarshal(src, &v.value)
|
||
}
|