Files
sdk/model_o11y_filter.go

155 lines
3.8 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 O11yFilter type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &O11yFilter{}
// O11yFilter struct for O11yFilter
type O11yFilter struct {
// expression to filter by following the filter syntax
Expression *string `json:"expression,omitempty"`
AdditionalProperties map[string]interface{}
}
type _O11yFilter O11yFilter
// NewO11yFilter instantiates a new O11yFilter 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 NewO11yFilter() *O11yFilter {
this := O11yFilter{}
return &this
}
// NewO11yFilterWithDefaults instantiates a new O11yFilter 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 NewO11yFilterWithDefaults() *O11yFilter {
this := O11yFilter{}
return &this
}
// GetExpression returns the Expression field value if set, zero value otherwise.
func (o *O11yFilter) GetExpression() string {
if o == nil || IsNil(o.Expression) {
var ret string
return ret
}
return *o.Expression
}
// GetExpressionOk returns a tuple with the Expression field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yFilter) GetExpressionOk() (*string, bool) {
if o == nil || IsNil(o.Expression) {
return nil, false
}
return o.Expression, true
}
// HasExpression returns a boolean if a field has been set.
func (o *O11yFilter) HasExpression() bool {
if o != nil && !IsNil(o.Expression) {
return true
}
return false
}
// SetExpression gets a reference to the given string and assigns it to the Expression field.
func (o *O11yFilter) SetExpression(v string) {
o.Expression = &v
}
func (o O11yFilter) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o O11yFilter) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Expression) {
toSerialize["expression"] = o.Expression
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *O11yFilter) UnmarshalJSON(data []byte) (err error) {
varO11yFilter := _O11yFilter{}
err = json.Unmarshal(data, &varO11yFilter)
if err != nil {
return err
}
*o = O11yFilter(varO11yFilter)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "expression")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableO11yFilter struct {
value *O11yFilter
isSet bool
}
func (v NullableO11yFilter) Get() *O11yFilter {
return v.value
}
func (v *NullableO11yFilter) Set(val *O11yFilter) {
v.value = val
v.isSet = true
}
func (v NullableO11yFilter) IsSet() bool {
return v.isSet
}
func (v *NullableO11yFilter) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableO11yFilter(val *O11yFilter) *NullableO11yFilter {
return &NullableO11yFilter{value: val, isSet: true}
}
func (v NullableO11yFilter) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableO11yFilter) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}