Files
sdk/model_o11y_span_mapper_config.go

154 lines
4.2 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 O11ySpanMapperConfig type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &O11ySpanMapperConfig{}
// O11ySpanMapperConfig struct for O11ySpanMapperConfig
type O11ySpanMapperConfig struct {
Sources []O11ySpanMapperSource `json:"sources,omitempty"`
AdditionalProperties map[string]interface{}
}
type _O11ySpanMapperConfig O11ySpanMapperConfig
// NewO11ySpanMapperConfig instantiates a new O11ySpanMapperConfig 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 NewO11ySpanMapperConfig() *O11ySpanMapperConfig {
this := O11ySpanMapperConfig{}
return &this
}
// NewO11ySpanMapperConfigWithDefaults instantiates a new O11ySpanMapperConfig 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 NewO11ySpanMapperConfigWithDefaults() *O11ySpanMapperConfig {
this := O11ySpanMapperConfig{}
return &this
}
// GetSources returns the Sources field value if set, zero value otherwise.
func (o *O11ySpanMapperConfig) GetSources() []O11ySpanMapperSource {
if o == nil || IsNil(o.Sources) {
var ret []O11ySpanMapperSource
return ret
}
return o.Sources
}
// GetSourcesOk returns a tuple with the Sources field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11ySpanMapperConfig) GetSourcesOk() ([]O11ySpanMapperSource, bool) {
if o == nil || IsNil(o.Sources) {
return nil, false
}
return o.Sources, true
}
// HasSources returns a boolean if a field has been set.
func (o *O11ySpanMapperConfig) HasSources() bool {
if o != nil && !IsNil(o.Sources) {
return true
}
return false
}
// SetSources gets a reference to the given []O11ySpanMapperSource and assigns it to the Sources field.
func (o *O11ySpanMapperConfig) SetSources(v []O11ySpanMapperSource) {
o.Sources = v
}
func (o O11ySpanMapperConfig) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o O11ySpanMapperConfig) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Sources) {
toSerialize["sources"] = o.Sources
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *O11ySpanMapperConfig) UnmarshalJSON(data []byte) (err error) {
varO11ySpanMapperConfig := _O11ySpanMapperConfig{}
err = json.Unmarshal(data, &varO11ySpanMapperConfig)
if err != nil {
return err
}
*o = O11ySpanMapperConfig(varO11ySpanMapperConfig)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "sources")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableO11ySpanMapperConfig struct {
value *O11ySpanMapperConfig
isSet bool
}
func (v NullableO11ySpanMapperConfig) Get() *O11ySpanMapperConfig {
return v.value
}
func (v *NullableO11ySpanMapperConfig) Set(val *O11ySpanMapperConfig) {
v.value = val
v.isSet = true
}
func (v NullableO11ySpanMapperConfig) IsSet() bool {
return v.isSet
}
func (v *NullableO11ySpanMapperConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableO11ySpanMapperConfig(val *O11ySpanMapperConfig) *NullableO11ySpanMapperConfig {
return &NullableO11ySpanMapperConfig{value: val, isSet: true}
}
func (v NullableO11ySpanMapperConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableO11ySpanMapperConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}