mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
307 lines
7.9 KiB
Go
307 lines
7.9 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 PubsubBusMessage type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &PubsubBusMessage{}
|
|
|
|
// PubsubBusMessage struct for PubsubBusMessage
|
|
type PubsubBusMessage struct {
|
|
// Data is the payload as UTF-8 text.
|
|
Data *string `json:"data,omitempty"`
|
|
// Headers are the message's headers, when it carries any.
|
|
Headers map[string][]string `json:"headers,omitempty"`
|
|
// Seq is the message's stream sequence — fetched messages only.
|
|
Seq *int32 `json:"seq,omitempty"`
|
|
// Subject is the message's subject in the org's own namespace.
|
|
Subject *string `json:"subject,omitempty"`
|
|
// Time is when the stream stored the message, RFC3339 — fetched messages only.
|
|
Time *string `json:"time,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _PubsubBusMessage PubsubBusMessage
|
|
|
|
// NewPubsubBusMessage instantiates a new PubsubBusMessage 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 NewPubsubBusMessage() *PubsubBusMessage {
|
|
this := PubsubBusMessage{}
|
|
return &this
|
|
}
|
|
|
|
// NewPubsubBusMessageWithDefaults instantiates a new PubsubBusMessage 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 NewPubsubBusMessageWithDefaults() *PubsubBusMessage {
|
|
this := PubsubBusMessage{}
|
|
return &this
|
|
}
|
|
|
|
// GetData returns the Data field value if set, zero value otherwise.
|
|
func (o *PubsubBusMessage) GetData() string {
|
|
if o == nil || IsNil(o.Data) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Data
|
|
}
|
|
|
|
// GetDataOk returns a tuple with the Data field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PubsubBusMessage) GetDataOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Data) {
|
|
return nil, false
|
|
}
|
|
return o.Data, true
|
|
}
|
|
|
|
// HasData returns a boolean if a field has been set.
|
|
func (o *PubsubBusMessage) HasData() bool {
|
|
if o != nil && !IsNil(o.Data) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetData gets a reference to the given string and assigns it to the Data field.
|
|
func (o *PubsubBusMessage) SetData(v string) {
|
|
o.Data = &v
|
|
}
|
|
|
|
// GetHeaders returns the Headers field value if set, zero value otherwise.
|
|
func (o *PubsubBusMessage) GetHeaders() map[string][]string {
|
|
if o == nil || IsNil(o.Headers) {
|
|
var ret map[string][]string
|
|
return ret
|
|
}
|
|
return o.Headers
|
|
}
|
|
|
|
// GetHeadersOk returns a tuple with the Headers field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PubsubBusMessage) GetHeadersOk() (map[string][]string, bool) {
|
|
if o == nil || IsNil(o.Headers) {
|
|
return map[string][]string{}, false
|
|
}
|
|
return o.Headers, true
|
|
}
|
|
|
|
// HasHeaders returns a boolean if a field has been set.
|
|
func (o *PubsubBusMessage) HasHeaders() bool {
|
|
if o != nil && !IsNil(o.Headers) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetHeaders gets a reference to the given map[string][]string and assigns it to the Headers field.
|
|
func (o *PubsubBusMessage) SetHeaders(v map[string][]string) {
|
|
o.Headers = v
|
|
}
|
|
|
|
// GetSeq returns the Seq field value if set, zero value otherwise.
|
|
func (o *PubsubBusMessage) 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 *PubsubBusMessage) 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 *PubsubBusMessage) 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 *PubsubBusMessage) SetSeq(v int32) {
|
|
o.Seq = &v
|
|
}
|
|
|
|
// GetSubject returns the Subject field value if set, zero value otherwise.
|
|
func (o *PubsubBusMessage) GetSubject() string {
|
|
if o == nil || IsNil(o.Subject) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Subject
|
|
}
|
|
|
|
// GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PubsubBusMessage) GetSubjectOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Subject) {
|
|
return nil, false
|
|
}
|
|
return o.Subject, true
|
|
}
|
|
|
|
// HasSubject returns a boolean if a field has been set.
|
|
func (o *PubsubBusMessage) HasSubject() bool {
|
|
if o != nil && !IsNil(o.Subject) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSubject gets a reference to the given string and assigns it to the Subject field.
|
|
func (o *PubsubBusMessage) SetSubject(v string) {
|
|
o.Subject = &v
|
|
}
|
|
|
|
// GetTime returns the Time field value if set, zero value otherwise.
|
|
func (o *PubsubBusMessage) GetTime() string {
|
|
if o == nil || IsNil(o.Time) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Time
|
|
}
|
|
|
|
// GetTimeOk returns a tuple with the Time field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PubsubBusMessage) GetTimeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Time) {
|
|
return nil, false
|
|
}
|
|
return o.Time, true
|
|
}
|
|
|
|
// HasTime returns a boolean if a field has been set.
|
|
func (o *PubsubBusMessage) HasTime() bool {
|
|
if o != nil && !IsNil(o.Time) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTime gets a reference to the given string and assigns it to the Time field.
|
|
func (o *PubsubBusMessage) SetTime(v string) {
|
|
o.Time = &v
|
|
}
|
|
|
|
func (o PubsubBusMessage) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o PubsubBusMessage) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Data) {
|
|
toSerialize["data"] = o.Data
|
|
}
|
|
if !IsNil(o.Headers) {
|
|
toSerialize["headers"] = o.Headers
|
|
}
|
|
if !IsNil(o.Seq) {
|
|
toSerialize["seq"] = o.Seq
|
|
}
|
|
if !IsNil(o.Subject) {
|
|
toSerialize["subject"] = o.Subject
|
|
}
|
|
if !IsNil(o.Time) {
|
|
toSerialize["time"] = o.Time
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *PubsubBusMessage) UnmarshalJSON(data []byte) (err error) {
|
|
varPubsubBusMessage := _PubsubBusMessage{}
|
|
|
|
err = json.Unmarshal(data, &varPubsubBusMessage)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = PubsubBusMessage(varPubsubBusMessage)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "data")
|
|
delete(additionalProperties, "headers")
|
|
delete(additionalProperties, "seq")
|
|
delete(additionalProperties, "subject")
|
|
delete(additionalProperties, "time")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullablePubsubBusMessage struct {
|
|
value *PubsubBusMessage
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePubsubBusMessage) Get() *PubsubBusMessage {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePubsubBusMessage) Set(val *PubsubBusMessage) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePubsubBusMessage) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePubsubBusMessage) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePubsubBusMessage(val *PubsubBusMessage) *NullablePubsubBusMessage {
|
|
return &NullablePubsubBusMessage{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePubsubBusMessage) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePubsubBusMessage) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|