Files
sdk/model_o11y_span_aggregation.go

192 lines
5.3 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 O11ySpanAggregation type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &O11ySpanAggregation{}
// O11ySpanAggregation struct for O11ySpanAggregation
type O11ySpanAggregation struct {
Aggregation interface{} `json:"aggregation,omitempty"`
Field *O11yTelemetryFieldKey `json:"field,omitempty"`
AdditionalProperties map[string]interface{}
}
type _O11ySpanAggregation O11ySpanAggregation
// NewO11ySpanAggregation instantiates a new O11ySpanAggregation 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 NewO11ySpanAggregation() *O11ySpanAggregation {
this := O11ySpanAggregation{}
return &this
}
// NewO11ySpanAggregationWithDefaults instantiates a new O11ySpanAggregation 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 NewO11ySpanAggregationWithDefaults() *O11ySpanAggregation {
this := O11ySpanAggregation{}
return &this
}
// GetAggregation returns the Aggregation field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *O11ySpanAggregation) 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 *O11ySpanAggregation) 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 *O11ySpanAggregation) 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 *O11ySpanAggregation) SetAggregation(v interface{}) {
o.Aggregation = v
}
// GetField returns the Field field value if set, zero value otherwise.
func (o *O11ySpanAggregation) 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 *O11ySpanAggregation) 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 *O11ySpanAggregation) 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 *O11ySpanAggregation) SetField(v O11yTelemetryFieldKey) {
o.Field = &v
}
func (o O11ySpanAggregation) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o O11ySpanAggregation) 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
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *O11ySpanAggregation) UnmarshalJSON(data []byte) (err error) {
varO11ySpanAggregation := _O11ySpanAggregation{}
err = json.Unmarshal(data, &varO11ySpanAggregation)
if err != nil {
return err
}
*o = O11ySpanAggregation(varO11ySpanAggregation)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "aggregation")
delete(additionalProperties, "field")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableO11ySpanAggregation struct {
value *O11ySpanAggregation
isSet bool
}
func (v NullableO11ySpanAggregation) Get() *O11ySpanAggregation {
return v.value
}
func (v *NullableO11ySpanAggregation) Set(val *O11ySpanAggregation) {
v.value = val
v.isSet = true
}
func (v NullableO11ySpanAggregation) IsSet() bool {
return v.isSet
}
func (v *NullableO11ySpanAggregation) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableO11ySpanAggregation(val *O11ySpanAggregation) *NullableO11ySpanAggregation {
return &NullableO11ySpanAggregation{value: val, isSet: true}
}
func (v NullableO11ySpanAggregation) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableO11ySpanAggregation) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}