mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
487 lines
13 KiB
Go
487 lines
13 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 O11yFlamegraphSpan type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &O11yFlamegraphSpan{}
|
|
|
|
// O11yFlamegraphSpan struct for O11yFlamegraphSpan
|
|
type O11yFlamegraphSpan struct {
|
|
Attributes map[string]interface{} `json:"attributes,omitempty"`
|
|
DurationNano *int32 `json:"durationNano,omitempty"`
|
|
Event []O11yEvent `json:"event,omitempty"`
|
|
HasError *bool `json:"hasError,omitempty"`
|
|
Level *int64 `json:"level,omitempty"`
|
|
Name *string `json:"name,omitempty"`
|
|
ParentSpanId *string `json:"parentSpanId,omitempty"`
|
|
Resource map[string]string `json:"resource,omitempty"`
|
|
SpanId *string `json:"spanId,omitempty"`
|
|
Timestamp *int32 `json:"timestamp,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _O11yFlamegraphSpan O11yFlamegraphSpan
|
|
|
|
// NewO11yFlamegraphSpan instantiates a new O11yFlamegraphSpan 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 NewO11yFlamegraphSpan() *O11yFlamegraphSpan {
|
|
this := O11yFlamegraphSpan{}
|
|
return &this
|
|
}
|
|
|
|
// NewO11yFlamegraphSpanWithDefaults instantiates a new O11yFlamegraphSpan 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 NewO11yFlamegraphSpanWithDefaults() *O11yFlamegraphSpan {
|
|
this := O11yFlamegraphSpan{}
|
|
return &this
|
|
}
|
|
|
|
// GetAttributes returns the Attributes field value if set, zero value otherwise.
|
|
func (o *O11yFlamegraphSpan) GetAttributes() map[string]interface{} {
|
|
if o == nil || IsNil(o.Attributes) {
|
|
var ret map[string]interface{}
|
|
return ret
|
|
}
|
|
return o.Attributes
|
|
}
|
|
|
|
// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yFlamegraphSpan) GetAttributesOk() (map[string]interface{}, bool) {
|
|
if o == nil || IsNil(o.Attributes) {
|
|
return map[string]interface{}{}, false
|
|
}
|
|
return o.Attributes, true
|
|
}
|
|
|
|
// HasAttributes returns a boolean if a field has been set.
|
|
func (o *O11yFlamegraphSpan) HasAttributes() bool {
|
|
if o != nil && !IsNil(o.Attributes) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field.
|
|
func (o *O11yFlamegraphSpan) SetAttributes(v map[string]interface{}) {
|
|
o.Attributes = v
|
|
}
|
|
|
|
// GetDurationNano returns the DurationNano field value if set, zero value otherwise.
|
|
func (o *O11yFlamegraphSpan) GetDurationNano() int32 {
|
|
if o == nil || IsNil(o.DurationNano) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.DurationNano
|
|
}
|
|
|
|
// GetDurationNanoOk returns a tuple with the DurationNano field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yFlamegraphSpan) GetDurationNanoOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.DurationNano) {
|
|
return nil, false
|
|
}
|
|
return o.DurationNano, true
|
|
}
|
|
|
|
// HasDurationNano returns a boolean if a field has been set.
|
|
func (o *O11yFlamegraphSpan) HasDurationNano() bool {
|
|
if o != nil && !IsNil(o.DurationNano) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDurationNano gets a reference to the given int32 and assigns it to the DurationNano field.
|
|
func (o *O11yFlamegraphSpan) SetDurationNano(v int32) {
|
|
o.DurationNano = &v
|
|
}
|
|
|
|
// GetEvent returns the Event field value if set, zero value otherwise.
|
|
func (o *O11yFlamegraphSpan) GetEvent() []O11yEvent {
|
|
if o == nil || IsNil(o.Event) {
|
|
var ret []O11yEvent
|
|
return ret
|
|
}
|
|
return o.Event
|
|
}
|
|
|
|
// GetEventOk returns a tuple with the Event field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yFlamegraphSpan) GetEventOk() ([]O11yEvent, bool) {
|
|
if o == nil || IsNil(o.Event) {
|
|
return nil, false
|
|
}
|
|
return o.Event, true
|
|
}
|
|
|
|
// HasEvent returns a boolean if a field has been set.
|
|
func (o *O11yFlamegraphSpan) HasEvent() bool {
|
|
if o != nil && !IsNil(o.Event) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEvent gets a reference to the given []O11yEvent and assigns it to the Event field.
|
|
func (o *O11yFlamegraphSpan) SetEvent(v []O11yEvent) {
|
|
o.Event = v
|
|
}
|
|
|
|
// GetHasError returns the HasError field value if set, zero value otherwise.
|
|
func (o *O11yFlamegraphSpan) GetHasError() bool {
|
|
if o == nil || IsNil(o.HasError) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.HasError
|
|
}
|
|
|
|
// GetHasErrorOk returns a tuple with the HasError field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yFlamegraphSpan) GetHasErrorOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.HasError) {
|
|
return nil, false
|
|
}
|
|
return o.HasError, true
|
|
}
|
|
|
|
// HasHasError returns a boolean if a field has been set.
|
|
func (o *O11yFlamegraphSpan) HasHasError() bool {
|
|
if o != nil && !IsNil(o.HasError) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetHasError gets a reference to the given bool and assigns it to the HasError field.
|
|
func (o *O11yFlamegraphSpan) SetHasError(v bool) {
|
|
o.HasError = &v
|
|
}
|
|
|
|
// GetLevel returns the Level field value if set, zero value otherwise.
|
|
func (o *O11yFlamegraphSpan) GetLevel() int64 {
|
|
if o == nil || IsNil(o.Level) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Level
|
|
}
|
|
|
|
// GetLevelOk returns a tuple with the Level field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yFlamegraphSpan) GetLevelOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Level) {
|
|
return nil, false
|
|
}
|
|
return o.Level, true
|
|
}
|
|
|
|
// HasLevel returns a boolean if a field has been set.
|
|
func (o *O11yFlamegraphSpan) HasLevel() bool {
|
|
if o != nil && !IsNil(o.Level) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLevel gets a reference to the given int64 and assigns it to the Level field.
|
|
func (o *O11yFlamegraphSpan) SetLevel(v int64) {
|
|
o.Level = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *O11yFlamegraphSpan) 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 *O11yFlamegraphSpan) 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 *O11yFlamegraphSpan) 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 *O11yFlamegraphSpan) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetParentSpanId returns the ParentSpanId field value if set, zero value otherwise.
|
|
func (o *O11yFlamegraphSpan) GetParentSpanId() string {
|
|
if o == nil || IsNil(o.ParentSpanId) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.ParentSpanId
|
|
}
|
|
|
|
// GetParentSpanIdOk returns a tuple with the ParentSpanId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yFlamegraphSpan) GetParentSpanIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.ParentSpanId) {
|
|
return nil, false
|
|
}
|
|
return o.ParentSpanId, true
|
|
}
|
|
|
|
// HasParentSpanId returns a boolean if a field has been set.
|
|
func (o *O11yFlamegraphSpan) HasParentSpanId() bool {
|
|
if o != nil && !IsNil(o.ParentSpanId) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetParentSpanId gets a reference to the given string and assigns it to the ParentSpanId field.
|
|
func (o *O11yFlamegraphSpan) SetParentSpanId(v string) {
|
|
o.ParentSpanId = &v
|
|
}
|
|
|
|
// GetResource returns the Resource field value if set, zero value otherwise.
|
|
func (o *O11yFlamegraphSpan) GetResource() map[string]string {
|
|
if o == nil || IsNil(o.Resource) {
|
|
var ret map[string]string
|
|
return ret
|
|
}
|
|
return o.Resource
|
|
}
|
|
|
|
// GetResourceOk returns a tuple with the Resource field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yFlamegraphSpan) GetResourceOk() (map[string]string, bool) {
|
|
if o == nil || IsNil(o.Resource) {
|
|
return map[string]string{}, false
|
|
}
|
|
return o.Resource, true
|
|
}
|
|
|
|
// HasResource returns a boolean if a field has been set.
|
|
func (o *O11yFlamegraphSpan) HasResource() bool {
|
|
if o != nil && !IsNil(o.Resource) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetResource gets a reference to the given map[string]string and assigns it to the Resource field.
|
|
func (o *O11yFlamegraphSpan) SetResource(v map[string]string) {
|
|
o.Resource = v
|
|
}
|
|
|
|
// GetSpanId returns the SpanId field value if set, zero value otherwise.
|
|
func (o *O11yFlamegraphSpan) GetSpanId() string {
|
|
if o == nil || IsNil(o.SpanId) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.SpanId
|
|
}
|
|
|
|
// GetSpanIdOk returns a tuple with the SpanId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yFlamegraphSpan) GetSpanIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.SpanId) {
|
|
return nil, false
|
|
}
|
|
return o.SpanId, true
|
|
}
|
|
|
|
// HasSpanId returns a boolean if a field has been set.
|
|
func (o *O11yFlamegraphSpan) HasSpanId() bool {
|
|
if o != nil && !IsNil(o.SpanId) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSpanId gets a reference to the given string and assigns it to the SpanId field.
|
|
func (o *O11yFlamegraphSpan) SetSpanId(v string) {
|
|
o.SpanId = &v
|
|
}
|
|
|
|
// GetTimestamp returns the Timestamp field value if set, zero value otherwise.
|
|
func (o *O11yFlamegraphSpan) GetTimestamp() int32 {
|
|
if o == nil || IsNil(o.Timestamp) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.Timestamp
|
|
}
|
|
|
|
// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yFlamegraphSpan) GetTimestampOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.Timestamp) {
|
|
return nil, false
|
|
}
|
|
return o.Timestamp, true
|
|
}
|
|
|
|
// HasTimestamp returns a boolean if a field has been set.
|
|
func (o *O11yFlamegraphSpan) HasTimestamp() bool {
|
|
if o != nil && !IsNil(o.Timestamp) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTimestamp gets a reference to the given int32 and assigns it to the Timestamp field.
|
|
func (o *O11yFlamegraphSpan) SetTimestamp(v int32) {
|
|
o.Timestamp = &v
|
|
}
|
|
|
|
func (o O11yFlamegraphSpan) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o O11yFlamegraphSpan) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Attributes) {
|
|
toSerialize["attributes"] = o.Attributes
|
|
}
|
|
if !IsNil(o.DurationNano) {
|
|
toSerialize["durationNano"] = o.DurationNano
|
|
}
|
|
if !IsNil(o.Event) {
|
|
toSerialize["event"] = o.Event
|
|
}
|
|
if !IsNil(o.HasError) {
|
|
toSerialize["hasError"] = o.HasError
|
|
}
|
|
if !IsNil(o.Level) {
|
|
toSerialize["level"] = o.Level
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.ParentSpanId) {
|
|
toSerialize["parentSpanId"] = o.ParentSpanId
|
|
}
|
|
if !IsNil(o.Resource) {
|
|
toSerialize["resource"] = o.Resource
|
|
}
|
|
if !IsNil(o.SpanId) {
|
|
toSerialize["spanId"] = o.SpanId
|
|
}
|
|
if !IsNil(o.Timestamp) {
|
|
toSerialize["timestamp"] = o.Timestamp
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *O11yFlamegraphSpan) UnmarshalJSON(data []byte) (err error) {
|
|
varO11yFlamegraphSpan := _O11yFlamegraphSpan{}
|
|
|
|
err = json.Unmarshal(data, &varO11yFlamegraphSpan)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = O11yFlamegraphSpan(varO11yFlamegraphSpan)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "attributes")
|
|
delete(additionalProperties, "durationNano")
|
|
delete(additionalProperties, "event")
|
|
delete(additionalProperties, "hasError")
|
|
delete(additionalProperties, "level")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "parentSpanId")
|
|
delete(additionalProperties, "resource")
|
|
delete(additionalProperties, "spanId")
|
|
delete(additionalProperties, "timestamp")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableO11yFlamegraphSpan struct {
|
|
value *O11yFlamegraphSpan
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableO11yFlamegraphSpan) Get() *O11yFlamegraphSpan {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableO11yFlamegraphSpan) Set(val *O11yFlamegraphSpan) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableO11yFlamegraphSpan) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableO11yFlamegraphSpan) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableO11yFlamegraphSpan(val *O11yFlamegraphSpan) *NullableO11yFlamegraphSpan {
|
|
return &NullableO11yFlamegraphSpan{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableO11yFlamegraphSpan) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableO11yFlamegraphSpan) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|