Files
sdk/model_o11y_span_mapper_source.go

267 lines
7.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 O11ySpanMapperSource type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &O11ySpanMapperSource{}
// O11ySpanMapperSource struct for O11ySpanMapperSource
type O11ySpanMapperSource struct {
Context interface{} `json:"context,omitempty"`
Key *string `json:"key,omitempty"`
Operation interface{} `json:"operation,omitempty"`
Priority *int64 `json:"priority,omitempty"`
AdditionalProperties map[string]interface{}
}
type _O11ySpanMapperSource O11ySpanMapperSource
// NewO11ySpanMapperSource instantiates a new O11ySpanMapperSource 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 NewO11ySpanMapperSource() *O11ySpanMapperSource {
this := O11ySpanMapperSource{}
return &this
}
// NewO11ySpanMapperSourceWithDefaults instantiates a new O11ySpanMapperSource 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 NewO11ySpanMapperSourceWithDefaults() *O11ySpanMapperSource {
this := O11ySpanMapperSource{}
return &this
}
// GetContext returns the Context field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *O11ySpanMapperSource) GetContext() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Context
}
// GetContextOk returns a tuple with the Context 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 *O11ySpanMapperSource) GetContextOk() (*interface{}, bool) {
if o == nil || IsNil(o.Context) {
return nil, false
}
return &o.Context, true
}
// HasContext returns a boolean if a field has been set.
func (o *O11ySpanMapperSource) HasContext() bool {
if o != nil && !IsNil(o.Context) {
return true
}
return false
}
// SetContext gets a reference to the given interface{} and assigns it to the Context field.
func (o *O11ySpanMapperSource) SetContext(v interface{}) {
o.Context = v
}
// GetKey returns the Key field value if set, zero value otherwise.
func (o *O11ySpanMapperSource) GetKey() string {
if o == nil || IsNil(o.Key) {
var ret string
return ret
}
return *o.Key
}
// GetKeyOk returns a tuple with the Key field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11ySpanMapperSource) GetKeyOk() (*string, bool) {
if o == nil || IsNil(o.Key) {
return nil, false
}
return o.Key, true
}
// HasKey returns a boolean if a field has been set.
func (o *O11ySpanMapperSource) HasKey() bool {
if o != nil && !IsNil(o.Key) {
return true
}
return false
}
// SetKey gets a reference to the given string and assigns it to the Key field.
func (o *O11ySpanMapperSource) SetKey(v string) {
o.Key = &v
}
// GetOperation returns the Operation field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *O11ySpanMapperSource) GetOperation() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Operation
}
// GetOperationOk returns a tuple with the Operation 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 *O11ySpanMapperSource) GetOperationOk() (*interface{}, bool) {
if o == nil || IsNil(o.Operation) {
return nil, false
}
return &o.Operation, true
}
// HasOperation returns a boolean if a field has been set.
func (o *O11ySpanMapperSource) HasOperation() bool {
if o != nil && !IsNil(o.Operation) {
return true
}
return false
}
// SetOperation gets a reference to the given interface{} and assigns it to the Operation field.
func (o *O11ySpanMapperSource) SetOperation(v interface{}) {
o.Operation = v
}
// GetPriority returns the Priority field value if set, zero value otherwise.
func (o *O11ySpanMapperSource) GetPriority() int64 {
if o == nil || IsNil(o.Priority) {
var ret int64
return ret
}
return *o.Priority
}
// GetPriorityOk returns a tuple with the Priority field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11ySpanMapperSource) GetPriorityOk() (*int64, bool) {
if o == nil || IsNil(o.Priority) {
return nil, false
}
return o.Priority, true
}
// HasPriority returns a boolean if a field has been set.
func (o *O11ySpanMapperSource) HasPriority() bool {
if o != nil && !IsNil(o.Priority) {
return true
}
return false
}
// SetPriority gets a reference to the given int64 and assigns it to the Priority field.
func (o *O11ySpanMapperSource) SetPriority(v int64) {
o.Priority = &v
}
func (o O11ySpanMapperSource) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o O11ySpanMapperSource) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Context != nil {
toSerialize["context"] = o.Context
}
if !IsNil(o.Key) {
toSerialize["key"] = o.Key
}
if o.Operation != nil {
toSerialize["operation"] = o.Operation
}
if !IsNil(o.Priority) {
toSerialize["priority"] = o.Priority
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *O11ySpanMapperSource) UnmarshalJSON(data []byte) (err error) {
varO11ySpanMapperSource := _O11ySpanMapperSource{}
err = json.Unmarshal(data, &varO11ySpanMapperSource)
if err != nil {
return err
}
*o = O11ySpanMapperSource(varO11ySpanMapperSource)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "context")
delete(additionalProperties, "key")
delete(additionalProperties, "operation")
delete(additionalProperties, "priority")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableO11ySpanMapperSource struct {
value *O11ySpanMapperSource
isSet bool
}
func (v NullableO11ySpanMapperSource) Get() *O11ySpanMapperSource {
return v.value
}
func (v *NullableO11ySpanMapperSource) Set(val *O11ySpanMapperSource) {
v.value = val
v.isSet = true
}
func (v NullableO11ySpanMapperSource) IsSet() bool {
return v.isSet
}
func (v *NullableO11ySpanMapperSource) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableO11ySpanMapperSource(val *O11ySpanMapperSource) *NullableO11ySpanMapperSource {
return &NullableO11ySpanMapperSource{value: val, isSet: true}
}
func (v NullableO11ySpanMapperSource) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableO11ySpanMapperSource) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}