Files
sdk/model_o11y_span_mapper_group_condition.go

191 lines
5.5 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 O11ySpanMapperGroupCondition type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &O11ySpanMapperGroupCondition{}
// O11ySpanMapperGroupCondition struct for O11ySpanMapperGroupCondition
type O11ySpanMapperGroupCondition struct {
Attributes []string `json:"attributes,omitempty"`
Resource []string `json:"resource,omitempty"`
AdditionalProperties map[string]interface{}
}
type _O11ySpanMapperGroupCondition O11ySpanMapperGroupCondition
// NewO11ySpanMapperGroupCondition instantiates a new O11ySpanMapperGroupCondition 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 NewO11ySpanMapperGroupCondition() *O11ySpanMapperGroupCondition {
this := O11ySpanMapperGroupCondition{}
return &this
}
// NewO11ySpanMapperGroupConditionWithDefaults instantiates a new O11ySpanMapperGroupCondition 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 NewO11ySpanMapperGroupConditionWithDefaults() *O11ySpanMapperGroupCondition {
this := O11ySpanMapperGroupCondition{}
return &this
}
// GetAttributes returns the Attributes field value if set, zero value otherwise.
func (o *O11ySpanMapperGroupCondition) GetAttributes() []string {
if o == nil || IsNil(o.Attributes) {
var ret []string
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 *O11ySpanMapperGroupCondition) GetAttributesOk() ([]string, bool) {
if o == nil || IsNil(o.Attributes) {
return nil, false
}
return o.Attributes, true
}
// HasAttributes returns a boolean if a field has been set.
func (o *O11ySpanMapperGroupCondition) HasAttributes() bool {
if o != nil && !IsNil(o.Attributes) {
return true
}
return false
}
// SetAttributes gets a reference to the given []string and assigns it to the Attributes field.
func (o *O11ySpanMapperGroupCondition) SetAttributes(v []string) {
o.Attributes = v
}
// GetResource returns the Resource field value if set, zero value otherwise.
func (o *O11ySpanMapperGroupCondition) GetResource() []string {
if o == nil || IsNil(o.Resource) {
var ret []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 *O11ySpanMapperGroupCondition) GetResourceOk() ([]string, bool) {
if o == nil || IsNil(o.Resource) {
return nil, false
}
return o.Resource, true
}
// HasResource returns a boolean if a field has been set.
func (o *O11ySpanMapperGroupCondition) HasResource() bool {
if o != nil && !IsNil(o.Resource) {
return true
}
return false
}
// SetResource gets a reference to the given []string and assigns it to the Resource field.
func (o *O11ySpanMapperGroupCondition) SetResource(v []string) {
o.Resource = v
}
func (o O11ySpanMapperGroupCondition) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o O11ySpanMapperGroupCondition) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Attributes) {
toSerialize["attributes"] = o.Attributes
}
if !IsNil(o.Resource) {
toSerialize["resource"] = o.Resource
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *O11ySpanMapperGroupCondition) UnmarshalJSON(data []byte) (err error) {
varO11ySpanMapperGroupCondition := _O11ySpanMapperGroupCondition{}
err = json.Unmarshal(data, &varO11ySpanMapperGroupCondition)
if err != nil {
return err
}
*o = O11ySpanMapperGroupCondition(varO11ySpanMapperGroupCondition)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "attributes")
delete(additionalProperties, "resource")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableO11ySpanMapperGroupCondition struct {
value *O11ySpanMapperGroupCondition
isSet bool
}
func (v NullableO11ySpanMapperGroupCondition) Get() *O11ySpanMapperGroupCondition {
return v.value
}
func (v *NullableO11ySpanMapperGroupCondition) Set(val *O11ySpanMapperGroupCondition) {
v.value = val
v.isSet = true
}
func (v NullableO11ySpanMapperGroupCondition) IsSet() bool {
return v.isSet
}
func (v *NullableO11ySpanMapperGroupCondition) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableO11ySpanMapperGroupCondition(val *O11ySpanMapperGroupCondition) *NullableO11ySpanMapperGroupCondition {
return &NullableO11ySpanMapperGroupCondition{value: val, isSet: true}
}
func (v NullableO11ySpanMapperGroupCondition) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableO11ySpanMapperGroupCondition) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}