mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
307 lines
7.9 KiB
Go
307 lines
7.9 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 O11yTraceRow type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &O11yTraceRow{}
|
|
|
|
// O11yTraceRow struct for O11yTraceRow
|
|
type O11yTraceRow struct {
|
|
// DurationMs is End minus Start in milliseconds: the trace's wall clock, not the sum of its spans, which double-counts everything concurrent.
|
|
DurationMs *float64 `json:"durationMs,omitempty"`
|
|
// End is the latest span end, RFC3339 with nanoseconds, in UTC.
|
|
End *string `json:"end,omitempty"`
|
|
// NumSpans is how many spans the trace carries.
|
|
NumSpans *int64 `json:"numSpans,omitempty"`
|
|
// Start is the earliest span start, RFC3339 with nanoseconds, in UTC.
|
|
Start *string `json:"start,omitempty"`
|
|
// TraceID is the trace's id — the {traceId} of the detail read.
|
|
TraceId *string `json:"traceId,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _O11yTraceRow O11yTraceRow
|
|
|
|
// NewO11yTraceRow instantiates a new O11yTraceRow 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 NewO11yTraceRow() *O11yTraceRow {
|
|
this := O11yTraceRow{}
|
|
return &this
|
|
}
|
|
|
|
// NewO11yTraceRowWithDefaults instantiates a new O11yTraceRow 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 NewO11yTraceRowWithDefaults() *O11yTraceRow {
|
|
this := O11yTraceRow{}
|
|
return &this
|
|
}
|
|
|
|
// GetDurationMs returns the DurationMs field value if set, zero value otherwise.
|
|
func (o *O11yTraceRow) GetDurationMs() float64 {
|
|
if o == nil || IsNil(o.DurationMs) {
|
|
var ret float64
|
|
return ret
|
|
}
|
|
return *o.DurationMs
|
|
}
|
|
|
|
// GetDurationMsOk returns a tuple with the DurationMs field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yTraceRow) GetDurationMsOk() (*float64, bool) {
|
|
if o == nil || IsNil(o.DurationMs) {
|
|
return nil, false
|
|
}
|
|
return o.DurationMs, true
|
|
}
|
|
|
|
// HasDurationMs returns a boolean if a field has been set.
|
|
func (o *O11yTraceRow) HasDurationMs() bool {
|
|
if o != nil && !IsNil(o.DurationMs) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDurationMs gets a reference to the given float64 and assigns it to the DurationMs field.
|
|
func (o *O11yTraceRow) SetDurationMs(v float64) {
|
|
o.DurationMs = &v
|
|
}
|
|
|
|
// GetEnd returns the End field value if set, zero value otherwise.
|
|
func (o *O11yTraceRow) GetEnd() string {
|
|
if o == nil || IsNil(o.End) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.End
|
|
}
|
|
|
|
// GetEndOk returns a tuple with the End field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yTraceRow) GetEndOk() (*string, bool) {
|
|
if o == nil || IsNil(o.End) {
|
|
return nil, false
|
|
}
|
|
return o.End, true
|
|
}
|
|
|
|
// HasEnd returns a boolean if a field has been set.
|
|
func (o *O11yTraceRow) HasEnd() bool {
|
|
if o != nil && !IsNil(o.End) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEnd gets a reference to the given string and assigns it to the End field.
|
|
func (o *O11yTraceRow) SetEnd(v string) {
|
|
o.End = &v
|
|
}
|
|
|
|
// GetNumSpans returns the NumSpans field value if set, zero value otherwise.
|
|
func (o *O11yTraceRow) GetNumSpans() int64 {
|
|
if o == nil || IsNil(o.NumSpans) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.NumSpans
|
|
}
|
|
|
|
// GetNumSpansOk returns a tuple with the NumSpans field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yTraceRow) GetNumSpansOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.NumSpans) {
|
|
return nil, false
|
|
}
|
|
return o.NumSpans, true
|
|
}
|
|
|
|
// HasNumSpans returns a boolean if a field has been set.
|
|
func (o *O11yTraceRow) HasNumSpans() bool {
|
|
if o != nil && !IsNil(o.NumSpans) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNumSpans gets a reference to the given int64 and assigns it to the NumSpans field.
|
|
func (o *O11yTraceRow) SetNumSpans(v int64) {
|
|
o.NumSpans = &v
|
|
}
|
|
|
|
// GetStart returns the Start field value if set, zero value otherwise.
|
|
func (o *O11yTraceRow) GetStart() string {
|
|
if o == nil || IsNil(o.Start) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Start
|
|
}
|
|
|
|
// GetStartOk returns a tuple with the Start field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yTraceRow) GetStartOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Start) {
|
|
return nil, false
|
|
}
|
|
return o.Start, true
|
|
}
|
|
|
|
// HasStart returns a boolean if a field has been set.
|
|
func (o *O11yTraceRow) HasStart() bool {
|
|
if o != nil && !IsNil(o.Start) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStart gets a reference to the given string and assigns it to the Start field.
|
|
func (o *O11yTraceRow) SetStart(v string) {
|
|
o.Start = &v
|
|
}
|
|
|
|
// GetTraceId returns the TraceId field value if set, zero value otherwise.
|
|
func (o *O11yTraceRow) GetTraceId() string {
|
|
if o == nil || IsNil(o.TraceId) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.TraceId
|
|
}
|
|
|
|
// GetTraceIdOk returns a tuple with the TraceId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yTraceRow) GetTraceIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.TraceId) {
|
|
return nil, false
|
|
}
|
|
return o.TraceId, true
|
|
}
|
|
|
|
// HasTraceId returns a boolean if a field has been set.
|
|
func (o *O11yTraceRow) HasTraceId() bool {
|
|
if o != nil && !IsNil(o.TraceId) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTraceId gets a reference to the given string and assigns it to the TraceId field.
|
|
func (o *O11yTraceRow) SetTraceId(v string) {
|
|
o.TraceId = &v
|
|
}
|
|
|
|
func (o O11yTraceRow) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o O11yTraceRow) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.DurationMs) {
|
|
toSerialize["durationMs"] = o.DurationMs
|
|
}
|
|
if !IsNil(o.End) {
|
|
toSerialize["end"] = o.End
|
|
}
|
|
if !IsNil(o.NumSpans) {
|
|
toSerialize["numSpans"] = o.NumSpans
|
|
}
|
|
if !IsNil(o.Start) {
|
|
toSerialize["start"] = o.Start
|
|
}
|
|
if !IsNil(o.TraceId) {
|
|
toSerialize["traceId"] = o.TraceId
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *O11yTraceRow) UnmarshalJSON(data []byte) (err error) {
|
|
varO11yTraceRow := _O11yTraceRow{}
|
|
|
|
err = json.Unmarshal(data, &varO11yTraceRow)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = O11yTraceRow(varO11yTraceRow)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "durationMs")
|
|
delete(additionalProperties, "end")
|
|
delete(additionalProperties, "numSpans")
|
|
delete(additionalProperties, "start")
|
|
delete(additionalProperties, "traceId")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableO11yTraceRow struct {
|
|
value *O11yTraceRow
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableO11yTraceRow) Get() *O11yTraceRow {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableO11yTraceRow) Set(val *O11yTraceRow) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableO11yTraceRow) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableO11yTraceRow) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableO11yTraceRow(val *O11yTraceRow) *NullableO11yTraceRow {
|
|
return &NullableO11yTraceRow{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableO11yTraceRow) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableO11yTraceRow) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|