Files
sdk/model_pubsub_bus_request.go

269 lines
7.2 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 PubsubBusRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PubsubBusRequest{}
// PubsubBusRequest struct for PubsubBusRequest
type PubsubBusRequest struct {
// Data is the request payload, carried verbatim as UTF-8 text.
Data *string `json:"data,omitempty"`
// Headers are optional request headers, one value per name.
Headers map[string]string `json:"headers,omitempty"`
// Subject is the subject a responder listens on, in the org's namespace.
Subject *string `json:"subject,omitempty"`
// TimeoutMs bounds the wait for a reply. 0 or less means the default of 5000; anything above 30000 is clamped to 30000.
TimeoutMs *int64 `json:"timeoutMs,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PubsubBusRequest PubsubBusRequest
// NewPubsubBusRequest instantiates a new PubsubBusRequest 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 NewPubsubBusRequest() *PubsubBusRequest {
this := PubsubBusRequest{}
return &this
}
// NewPubsubBusRequestWithDefaults instantiates a new PubsubBusRequest 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 NewPubsubBusRequestWithDefaults() *PubsubBusRequest {
this := PubsubBusRequest{}
return &this
}
// GetData returns the Data field value if set, zero value otherwise.
func (o *PubsubBusRequest) 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 *PubsubBusRequest) 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 *PubsubBusRequest) 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 *PubsubBusRequest) SetData(v string) {
o.Data = &v
}
// GetHeaders returns the Headers field value if set, zero value otherwise.
func (o *PubsubBusRequest) 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 *PubsubBusRequest) 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 *PubsubBusRequest) 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 *PubsubBusRequest) SetHeaders(v map[string]string) {
o.Headers = v
}
// GetSubject returns the Subject field value if set, zero value otherwise.
func (o *PubsubBusRequest) 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 *PubsubBusRequest) 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 *PubsubBusRequest) 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 *PubsubBusRequest) SetSubject(v string) {
o.Subject = &v
}
// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise.
func (o *PubsubBusRequest) GetTimeoutMs() int64 {
if o == nil || IsNil(o.TimeoutMs) {
var ret int64
return ret
}
return *o.TimeoutMs
}
// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PubsubBusRequest) GetTimeoutMsOk() (*int64, bool) {
if o == nil || IsNil(o.TimeoutMs) {
return nil, false
}
return o.TimeoutMs, true
}
// HasTimeoutMs returns a boolean if a field has been set.
func (o *PubsubBusRequest) HasTimeoutMs() bool {
if o != nil && !IsNil(o.TimeoutMs) {
return true
}
return false
}
// SetTimeoutMs gets a reference to the given int64 and assigns it to the TimeoutMs field.
func (o *PubsubBusRequest) SetTimeoutMs(v int64) {
o.TimeoutMs = &v
}
func (o PubsubBusRequest) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PubsubBusRequest) 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.Subject) {
toSerialize["subject"] = o.Subject
}
if !IsNil(o.TimeoutMs) {
toSerialize["timeoutMs"] = o.TimeoutMs
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PubsubBusRequest) UnmarshalJSON(data []byte) (err error) {
varPubsubBusRequest := _PubsubBusRequest{}
err = json.Unmarshal(data, &varPubsubBusRequest)
if err != nil {
return err
}
*o = PubsubBusRequest(varPubsubBusRequest)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "data")
delete(additionalProperties, "headers")
delete(additionalProperties, "subject")
delete(additionalProperties, "timeoutMs")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePubsubBusRequest struct {
value *PubsubBusRequest
isSet bool
}
func (v NullablePubsubBusRequest) Get() *PubsubBusRequest {
return v.value
}
func (v *NullablePubsubBusRequest) Set(val *PubsubBusRequest) {
v.value = val
v.isSet = true
}
func (v NullablePubsubBusRequest) IsSet() bool {
return v.isSet
}
func (v *NullablePubsubBusRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePubsubBusRequest(val *PubsubBusRequest) *NullablePubsubBusRequest {
return &NullablePubsubBusRequest{value: val, isSet: true}
}
func (v NullablePubsubBusRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePubsubBusRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}