mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
6.7 KiB
Go
269 lines
6.7 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 PubsubBusAck type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &PubsubBusAck{}
|
|
|
|
// PubsubBusAck struct for PubsubBusAck
|
|
type PubsubBusAck struct {
|
|
// Duplicate is true when JetStream deduplicated the message by its Nats-Msg-Id instead of storing it again.
|
|
Duplicate *bool `json:"duplicate,omitempty"`
|
|
// OK is true when the bus accepted the message.
|
|
Ok *bool `json:"ok,omitempty"`
|
|
// Seq is the message's sequence in that stream.
|
|
Seq *int32 `json:"seq,omitempty"`
|
|
// Stream is the stream that stored the message — absent when no stream captures the subject and the message went out core (fire-and-forget).
|
|
Stream *string `json:"stream,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _PubsubBusAck PubsubBusAck
|
|
|
|
// NewPubsubBusAck instantiates a new PubsubBusAck 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 NewPubsubBusAck() *PubsubBusAck {
|
|
this := PubsubBusAck{}
|
|
return &this
|
|
}
|
|
|
|
// NewPubsubBusAckWithDefaults instantiates a new PubsubBusAck 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 NewPubsubBusAckWithDefaults() *PubsubBusAck {
|
|
this := PubsubBusAck{}
|
|
return &this
|
|
}
|
|
|
|
// GetDuplicate returns the Duplicate field value if set, zero value otherwise.
|
|
func (o *PubsubBusAck) GetDuplicate() bool {
|
|
if o == nil || IsNil(o.Duplicate) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Duplicate
|
|
}
|
|
|
|
// GetDuplicateOk returns a tuple with the Duplicate field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PubsubBusAck) GetDuplicateOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Duplicate) {
|
|
return nil, false
|
|
}
|
|
return o.Duplicate, true
|
|
}
|
|
|
|
// HasDuplicate returns a boolean if a field has been set.
|
|
func (o *PubsubBusAck) HasDuplicate() bool {
|
|
if o != nil && !IsNil(o.Duplicate) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDuplicate gets a reference to the given bool and assigns it to the Duplicate field.
|
|
func (o *PubsubBusAck) SetDuplicate(v bool) {
|
|
o.Duplicate = &v
|
|
}
|
|
|
|
// GetOk returns the Ok field value if set, zero value otherwise.
|
|
func (o *PubsubBusAck) GetOk() bool {
|
|
if o == nil || IsNil(o.Ok) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Ok
|
|
}
|
|
|
|
// GetOkOk returns a tuple with the Ok field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PubsubBusAck) GetOkOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Ok) {
|
|
return nil, false
|
|
}
|
|
return o.Ok, true
|
|
}
|
|
|
|
// HasOk returns a boolean if a field has been set.
|
|
func (o *PubsubBusAck) HasOk() bool {
|
|
if o != nil && !IsNil(o.Ok) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetOk gets a reference to the given bool and assigns it to the Ok field.
|
|
func (o *PubsubBusAck) SetOk(v bool) {
|
|
o.Ok = &v
|
|
}
|
|
|
|
// GetSeq returns the Seq field value if set, zero value otherwise.
|
|
func (o *PubsubBusAck) GetSeq() int32 {
|
|
if o == nil || IsNil(o.Seq) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.Seq
|
|
}
|
|
|
|
// GetSeqOk returns a tuple with the Seq field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PubsubBusAck) GetSeqOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.Seq) {
|
|
return nil, false
|
|
}
|
|
return o.Seq, true
|
|
}
|
|
|
|
// HasSeq returns a boolean if a field has been set.
|
|
func (o *PubsubBusAck) HasSeq() bool {
|
|
if o != nil && !IsNil(o.Seq) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSeq gets a reference to the given int32 and assigns it to the Seq field.
|
|
func (o *PubsubBusAck) SetSeq(v int32) {
|
|
o.Seq = &v
|
|
}
|
|
|
|
// GetStream returns the Stream field value if set, zero value otherwise.
|
|
func (o *PubsubBusAck) GetStream() string {
|
|
if o == nil || IsNil(o.Stream) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Stream
|
|
}
|
|
|
|
// GetStreamOk returns a tuple with the Stream field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PubsubBusAck) GetStreamOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Stream) {
|
|
return nil, false
|
|
}
|
|
return o.Stream, true
|
|
}
|
|
|
|
// HasStream returns a boolean if a field has been set.
|
|
func (o *PubsubBusAck) HasStream() bool {
|
|
if o != nil && !IsNil(o.Stream) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStream gets a reference to the given string and assigns it to the Stream field.
|
|
func (o *PubsubBusAck) SetStream(v string) {
|
|
o.Stream = &v
|
|
}
|
|
|
|
func (o PubsubBusAck) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o PubsubBusAck) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Duplicate) {
|
|
toSerialize["duplicate"] = o.Duplicate
|
|
}
|
|
if !IsNil(o.Ok) {
|
|
toSerialize["ok"] = o.Ok
|
|
}
|
|
if !IsNil(o.Seq) {
|
|
toSerialize["seq"] = o.Seq
|
|
}
|
|
if !IsNil(o.Stream) {
|
|
toSerialize["stream"] = o.Stream
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *PubsubBusAck) UnmarshalJSON(data []byte) (err error) {
|
|
varPubsubBusAck := _PubsubBusAck{}
|
|
|
|
err = json.Unmarshal(data, &varPubsubBusAck)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = PubsubBusAck(varPubsubBusAck)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "duplicate")
|
|
delete(additionalProperties, "ok")
|
|
delete(additionalProperties, "seq")
|
|
delete(additionalProperties, "stream")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullablePubsubBusAck struct {
|
|
value *PubsubBusAck
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePubsubBusAck) Get() *PubsubBusAck {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePubsubBusAck) Set(val *PubsubBusAck) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePubsubBusAck) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePubsubBusAck) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePubsubBusAck(val *PubsubBusAck) *NullablePubsubBusAck {
|
|
return &NullablePubsubBusAck{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePubsubBusAck) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePubsubBusAck) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|