mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
193 lines
4.8 KiB
Go
193 lines
4.8 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 EventLoss type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &EventLoss{}
|
|
|
|
// EventLoss struct for EventLoss
|
|
type EventLoss struct {
|
|
// Exhausted counts facts the bus abandoned after maxDeliver failed inserts.
|
|
Exhausted *int64 `json:"exhausted,omitempty"`
|
|
// Undecodable counts messages acked without landing because they did not parse.
|
|
Undecodable *int64 `json:"undecodable,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _EventLoss EventLoss
|
|
|
|
// NewEventLoss instantiates a new EventLoss 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 NewEventLoss() *EventLoss {
|
|
this := EventLoss{}
|
|
return &this
|
|
}
|
|
|
|
// NewEventLossWithDefaults instantiates a new EventLoss 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 NewEventLossWithDefaults() *EventLoss {
|
|
this := EventLoss{}
|
|
return &this
|
|
}
|
|
|
|
// GetExhausted returns the Exhausted field value if set, zero value otherwise.
|
|
func (o *EventLoss) GetExhausted() int64 {
|
|
if o == nil || IsNil(o.Exhausted) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Exhausted
|
|
}
|
|
|
|
// GetExhaustedOk returns a tuple with the Exhausted field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventLoss) GetExhaustedOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Exhausted) {
|
|
return nil, false
|
|
}
|
|
return o.Exhausted, true
|
|
}
|
|
|
|
// HasExhausted returns a boolean if a field has been set.
|
|
func (o *EventLoss) HasExhausted() bool {
|
|
if o != nil && !IsNil(o.Exhausted) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetExhausted gets a reference to the given int64 and assigns it to the Exhausted field.
|
|
func (o *EventLoss) SetExhausted(v int64) {
|
|
o.Exhausted = &v
|
|
}
|
|
|
|
// GetUndecodable returns the Undecodable field value if set, zero value otherwise.
|
|
func (o *EventLoss) GetUndecodable() int64 {
|
|
if o == nil || IsNil(o.Undecodable) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Undecodable
|
|
}
|
|
|
|
// GetUndecodableOk returns a tuple with the Undecodable field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventLoss) GetUndecodableOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Undecodable) {
|
|
return nil, false
|
|
}
|
|
return o.Undecodable, true
|
|
}
|
|
|
|
// HasUndecodable returns a boolean if a field has been set.
|
|
func (o *EventLoss) HasUndecodable() bool {
|
|
if o != nil && !IsNil(o.Undecodable) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUndecodable gets a reference to the given int64 and assigns it to the Undecodable field.
|
|
func (o *EventLoss) SetUndecodable(v int64) {
|
|
o.Undecodable = &v
|
|
}
|
|
|
|
func (o EventLoss) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o EventLoss) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Exhausted) {
|
|
toSerialize["exhausted"] = o.Exhausted
|
|
}
|
|
if !IsNil(o.Undecodable) {
|
|
toSerialize["undecodable"] = o.Undecodable
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *EventLoss) UnmarshalJSON(data []byte) (err error) {
|
|
varEventLoss := _EventLoss{}
|
|
|
|
err = json.Unmarshal(data, &varEventLoss)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = EventLoss(varEventLoss)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "exhausted")
|
|
delete(additionalProperties, "undecodable")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableEventLoss struct {
|
|
value *EventLoss
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableEventLoss) Get() *EventLoss {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableEventLoss) Set(val *EventLoss) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableEventLoss) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableEventLoss) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableEventLoss(val *EventLoss) *NullableEventLoss {
|
|
return &NullableEventLoss{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableEventLoss) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableEventLoss) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|