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 O11yQueryEnvelope type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &O11yQueryEnvelope{}
|
|
|
|
// O11yQueryEnvelope struct for O11yQueryEnvelope
|
|
type O11yQueryEnvelope struct {
|
|
Spec interface{} `json:"spec,omitempty"`
|
|
Type interface{} `json:"type,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _O11yQueryEnvelope O11yQueryEnvelope
|
|
|
|
// NewO11yQueryEnvelope instantiates a new O11yQueryEnvelope 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 NewO11yQueryEnvelope() *O11yQueryEnvelope {
|
|
this := O11yQueryEnvelope{}
|
|
return &this
|
|
}
|
|
|
|
// NewO11yQueryEnvelopeWithDefaults instantiates a new O11yQueryEnvelope 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 NewO11yQueryEnvelopeWithDefaults() *O11yQueryEnvelope {
|
|
this := O11yQueryEnvelope{}
|
|
return &this
|
|
}
|
|
|
|
// GetSpec returns the Spec field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *O11yQueryEnvelope) GetSpec() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.Spec
|
|
}
|
|
|
|
// GetSpecOk returns a tuple with the Spec 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 *O11yQueryEnvelope) GetSpecOk() (*interface{}, bool) {
|
|
if o == nil || IsNil(o.Spec) {
|
|
return nil, false
|
|
}
|
|
return &o.Spec, true
|
|
}
|
|
|
|
// HasSpec returns a boolean if a field has been set.
|
|
func (o *O11yQueryEnvelope) HasSpec() bool {
|
|
if o != nil && !IsNil(o.Spec) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSpec gets a reference to the given interface{} and assigns it to the Spec field.
|
|
func (o *O11yQueryEnvelope) SetSpec(v interface{}) {
|
|
o.Spec = v
|
|
}
|
|
|
|
// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *O11yQueryEnvelope) 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 *O11yQueryEnvelope) 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 *O11yQueryEnvelope) 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 *O11yQueryEnvelope) SetType(v interface{}) {
|
|
o.Type = v
|
|
}
|
|
|
|
func (o O11yQueryEnvelope) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o O11yQueryEnvelope) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if o.Spec != nil {
|
|
toSerialize["spec"] = o.Spec
|
|
}
|
|
if o.Type != nil {
|
|
toSerialize["type"] = o.Type
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *O11yQueryEnvelope) UnmarshalJSON(data []byte) (err error) {
|
|
varO11yQueryEnvelope := _O11yQueryEnvelope{}
|
|
|
|
err = json.Unmarshal(data, &varO11yQueryEnvelope)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = O11yQueryEnvelope(varO11yQueryEnvelope)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "spec")
|
|
delete(additionalProperties, "type")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableO11yQueryEnvelope struct {
|
|
value *O11yQueryEnvelope
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableO11yQueryEnvelope) Get() *O11yQueryEnvelope {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableO11yQueryEnvelope) Set(val *O11yQueryEnvelope) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableO11yQueryEnvelope) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableO11yQueryEnvelope) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableO11yQueryEnvelope(val *O11yQueryEnvelope) *NullableO11yQueryEnvelope {
|
|
return &NullableO11yQueryEnvelope{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableO11yQueryEnvelope) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableO11yQueryEnvelope) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|