Files
sdk/model_mq_stream.go

270 lines
6.4 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"
"time"
)
// checks if the MqStream type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MqStream{}
// MqStream struct for MqStream
type MqStream struct {
// Config is the stream's configuration.
Config *MqConfig `json:"config,omitempty"`
// Created is when the stream was created.
Created *time.Time `json:"created,omitempty"`
// Name is the stream name within the org.
Name *string `json:"name,omitempty"`
// State is the stream's current state.
State *MqState `json:"state,omitempty"`
AdditionalProperties map[string]interface{}
}
type _MqStream MqStream
// NewMqStream instantiates a new MqStream 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 NewMqStream() *MqStream {
this := MqStream{}
return &this
}
// NewMqStreamWithDefaults instantiates a new MqStream 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 NewMqStreamWithDefaults() *MqStream {
this := MqStream{}
return &this
}
// GetConfig returns the Config field value if set, zero value otherwise.
func (o *MqStream) GetConfig() MqConfig {
if o == nil || IsNil(o.Config) {
var ret MqConfig
return ret
}
return *o.Config
}
// GetConfigOk returns a tuple with the Config field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqStream) GetConfigOk() (*MqConfig, bool) {
if o == nil || IsNil(o.Config) {
return nil, false
}
return o.Config, true
}
// HasConfig returns a boolean if a field has been set.
func (o *MqStream) HasConfig() bool {
if o != nil && !IsNil(o.Config) {
return true
}
return false
}
// SetConfig gets a reference to the given MqConfig and assigns it to the Config field.
func (o *MqStream) SetConfig(v MqConfig) {
o.Config = &v
}
// GetCreated returns the Created field value if set, zero value otherwise.
func (o *MqStream) GetCreated() time.Time {
if o == nil || IsNil(o.Created) {
var ret time.Time
return ret
}
return *o.Created
}
// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqStream) GetCreatedOk() (*time.Time, bool) {
if o == nil || IsNil(o.Created) {
return nil, false
}
return o.Created, true
}
// HasCreated returns a boolean if a field has been set.
func (o *MqStream) HasCreated() bool {
if o != nil && !IsNil(o.Created) {
return true
}
return false
}
// SetCreated gets a reference to the given time.Time and assigns it to the Created field.
func (o *MqStream) SetCreated(v time.Time) {
o.Created = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *MqStream) 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 *MqStream) 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 *MqStream) 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 *MqStream) SetName(v string) {
o.Name = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *MqStream) GetState() MqState {
if o == nil || IsNil(o.State) {
var ret MqState
return ret
}
return *o.State
}
// GetStateOk returns a tuple with the State field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MqStream) GetStateOk() (*MqState, bool) {
if o == nil || IsNil(o.State) {
return nil, false
}
return o.State, true
}
// HasState returns a boolean if a field has been set.
func (o *MqStream) HasState() bool {
if o != nil && !IsNil(o.State) {
return true
}
return false
}
// SetState gets a reference to the given MqState and assigns it to the State field.
func (o *MqStream) SetState(v MqState) {
o.State = &v
}
func (o MqStream) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MqStream) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Config) {
toSerialize["config"] = o.Config
}
if !IsNil(o.Created) {
toSerialize["created"] = o.Created
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *MqStream) UnmarshalJSON(data []byte) (err error) {
varMqStream := _MqStream{}
err = json.Unmarshal(data, &varMqStream)
if err != nil {
return err
}
*o = MqStream(varMqStream)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "config")
delete(additionalProperties, "created")
delete(additionalProperties, "name")
delete(additionalProperties, "state")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableMqStream struct {
value *MqStream
isSet bool
}
func (v NullableMqStream) Get() *MqStream {
return v.value
}
func (v *NullableMqStream) Set(val *MqStream) {
v.value = val
v.isSet = true
}
func (v NullableMqStream) IsSet() bool {
return v.isSet
}
func (v *NullableMqStream) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMqStream(val *MqStream) *NullableMqStream {
return &NullableMqStream{value: val, isSet: true}
}
func (v NullableMqStream) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMqStream) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}