mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
193 lines
5.0 KiB
Go
193 lines
5.0 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 O11yVariableItem type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &O11yVariableItem{}
|
|
|
|
// O11yVariableItem struct for O11yVariableItem
|
|
type O11yVariableItem struct {
|
|
Type interface{} `json:"type,omitempty"`
|
|
Value interface{} `json:"value,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _O11yVariableItem O11yVariableItem
|
|
|
|
// NewO11yVariableItem instantiates a new O11yVariableItem 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 NewO11yVariableItem() *O11yVariableItem {
|
|
this := O11yVariableItem{}
|
|
return &this
|
|
}
|
|
|
|
// NewO11yVariableItemWithDefaults instantiates a new O11yVariableItem 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 NewO11yVariableItemWithDefaults() *O11yVariableItem {
|
|
this := O11yVariableItem{}
|
|
return &this
|
|
}
|
|
|
|
// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *O11yVariableItem) GetType() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.Type
|
|
}
|
|
|
|
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *O11yVariableItem) GetTypeOk() (*interface{}, bool) {
|
|
if o == nil || IsNil(o.Type) {
|
|
return nil, false
|
|
}
|
|
return &o.Type, true
|
|
}
|
|
|
|
// HasType returns a boolean if a field has been set.
|
|
func (o *O11yVariableItem) HasType() bool {
|
|
if o != nil && !IsNil(o.Type) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetType gets a reference to the given interface{} and assigns it to the Type field.
|
|
func (o *O11yVariableItem) SetType(v interface{}) {
|
|
o.Type = v
|
|
}
|
|
|
|
// GetValue returns the Value field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *O11yVariableItem) GetValue() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.Value
|
|
}
|
|
|
|
// GetValueOk returns a tuple with the Value field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *O11yVariableItem) GetValueOk() (*interface{}, bool) {
|
|
if o == nil || IsNil(o.Value) {
|
|
return nil, false
|
|
}
|
|
return &o.Value, true
|
|
}
|
|
|
|
// HasValue returns a boolean if a field has been set.
|
|
func (o *O11yVariableItem) HasValue() bool {
|
|
if o != nil && !IsNil(o.Value) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetValue gets a reference to the given interface{} and assigns it to the Value field.
|
|
func (o *O11yVariableItem) SetValue(v interface{}) {
|
|
o.Value = v
|
|
}
|
|
|
|
func (o O11yVariableItem) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o O11yVariableItem) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if o.Type != nil {
|
|
toSerialize["type"] = o.Type
|
|
}
|
|
if o.Value != nil {
|
|
toSerialize["value"] = o.Value
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *O11yVariableItem) UnmarshalJSON(data []byte) (err error) {
|
|
varO11yVariableItem := _O11yVariableItem{}
|
|
|
|
err = json.Unmarshal(data, &varO11yVariableItem)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = O11yVariableItem(varO11yVariableItem)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "type")
|
|
delete(additionalProperties, "value")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableO11yVariableItem struct {
|
|
value *O11yVariableItem
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableO11yVariableItem) Get() *O11yVariableItem {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableO11yVariableItem) Set(val *O11yVariableItem) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableO11yVariableItem) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableO11yVariableItem) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableO11yVariableItem(val *O11yVariableItem) *NullableO11yVariableItem {
|
|
return &NullableO11yVariableItem{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableO11yVariableItem) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableO11yVariableItem) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|