Files
sdk/model_o11y_span_aggregation_result.go

229 lines
6.6 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 O11ySpanAggregationResult type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &O11ySpanAggregationResult{}
// O11ySpanAggregationResult struct for O11ySpanAggregationResult
type O11ySpanAggregationResult struct {
Aggregation interface{} `json:"aggregation,omitempty"`
Field *O11yTelemetryFieldKey `json:"field,omitempty"`
Value map[string]int32 `json:"value,omitempty"`
AdditionalProperties map[string]interface{}
}
type _O11ySpanAggregationResult O11ySpanAggregationResult
// NewO11ySpanAggregationResult instantiates a new O11ySpanAggregationResult 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 NewO11ySpanAggregationResult() *O11ySpanAggregationResult {
this := O11ySpanAggregationResult{}
return &this
}
// NewO11ySpanAggregationResultWithDefaults instantiates a new O11ySpanAggregationResult 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 NewO11ySpanAggregationResultWithDefaults() *O11ySpanAggregationResult {
this := O11ySpanAggregationResult{}
return &this
}
// GetAggregation returns the Aggregation field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *O11ySpanAggregationResult) GetAggregation() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Aggregation
}
// GetAggregationOk returns a tuple with the Aggregation 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 *O11ySpanAggregationResult) GetAggregationOk() (*interface{}, bool) {
if o == nil || IsNil(o.Aggregation) {
return nil, false
}
return &o.Aggregation, true
}
// HasAggregation returns a boolean if a field has been set.
func (o *O11ySpanAggregationResult) HasAggregation() bool {
if o != nil && !IsNil(o.Aggregation) {
return true
}
return false
}
// SetAggregation gets a reference to the given interface{} and assigns it to the Aggregation field.
func (o *O11ySpanAggregationResult) SetAggregation(v interface{}) {
o.Aggregation = v
}
// GetField returns the Field field value if set, zero value otherwise.
func (o *O11ySpanAggregationResult) GetField() O11yTelemetryFieldKey {
if o == nil || IsNil(o.Field) {
var ret O11yTelemetryFieldKey
return ret
}
return *o.Field
}
// GetFieldOk returns a tuple with the Field field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11ySpanAggregationResult) GetFieldOk() (*O11yTelemetryFieldKey, bool) {
if o == nil || IsNil(o.Field) {
return nil, false
}
return o.Field, true
}
// HasField returns a boolean if a field has been set.
func (o *O11ySpanAggregationResult) HasField() bool {
if o != nil && !IsNil(o.Field) {
return true
}
return false
}
// SetField gets a reference to the given O11yTelemetryFieldKey and assigns it to the Field field.
func (o *O11ySpanAggregationResult) SetField(v O11yTelemetryFieldKey) {
o.Field = &v
}
// GetValue returns the Value field value if set, zero value otherwise.
func (o *O11ySpanAggregationResult) GetValue() map[string]int32 {
if o == nil || IsNil(o.Value) {
var ret map[string]int32
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.
func (o *O11ySpanAggregationResult) GetValueOk() (map[string]int32, bool) {
if o == nil || IsNil(o.Value) {
return map[string]int32{}, false
}
return o.Value, true
}
// HasValue returns a boolean if a field has been set.
func (o *O11ySpanAggregationResult) HasValue() bool {
if o != nil && !IsNil(o.Value) {
return true
}
return false
}
// SetValue gets a reference to the given map[string]int32 and assigns it to the Value field.
func (o *O11ySpanAggregationResult) SetValue(v map[string]int32) {
o.Value = v
}
func (o O11ySpanAggregationResult) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o O11ySpanAggregationResult) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Aggregation != nil {
toSerialize["aggregation"] = o.Aggregation
}
if !IsNil(o.Field) {
toSerialize["field"] = o.Field
}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *O11ySpanAggregationResult) UnmarshalJSON(data []byte) (err error) {
varO11ySpanAggregationResult := _O11ySpanAggregationResult{}
err = json.Unmarshal(data, &varO11ySpanAggregationResult)
if err != nil {
return err
}
*o = O11ySpanAggregationResult(varO11ySpanAggregationResult)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "aggregation")
delete(additionalProperties, "field")
delete(additionalProperties, "value")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableO11ySpanAggregationResult struct {
value *O11ySpanAggregationResult
isSet bool
}
func (v NullableO11ySpanAggregationResult) Get() *O11ySpanAggregationResult {
return v.value
}
func (v *NullableO11ySpanAggregationResult) Set(val *O11ySpanAggregationResult) {
v.value = val
v.isSet = true
}
func (v NullableO11ySpanAggregationResult) IsSet() bool {
return v.isSet
}
func (v *NullableO11ySpanAggregationResult) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableO11ySpanAggregationResult(val *O11ySpanAggregationResult) *NullableO11ySpanAggregationResult {
return &NullableO11ySpanAggregationResult{value: val, isSet: true}
}
func (v NullableO11ySpanAggregationResult) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableO11ySpanAggregationResult) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}