sdk-go-zincsearch/model_meta_aggregation_range.go
2022-09-21 18:18:06 +08:00

188 lines
4.7 KiB
Go

/*
Zinc Search engine API
Zinc Search engine API documents https://docs.zincsearch.com
API version: 0.3.3
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package client
import (
"encoding/json"
)
// MetaAggregationRange struct for MetaAggregationRange
type MetaAggregationRange struct {
Field *string `json:"field,omitempty"`
Keyed *bool `json:"keyed,omitempty"`
Ranges []MetaRange `json:"ranges,omitempty"`
}
// NewMetaAggregationRange instantiates a new MetaAggregationRange 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 NewMetaAggregationRange() *MetaAggregationRange {
this := MetaAggregationRange{}
return &this
}
// NewMetaAggregationRangeWithDefaults instantiates a new MetaAggregationRange 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 NewMetaAggregationRangeWithDefaults() *MetaAggregationRange {
this := MetaAggregationRange{}
return &this
}
// GetField returns the Field field value if set, zero value otherwise.
func (o *MetaAggregationRange) GetField() string {
if o == nil || o.Field == nil {
var ret string
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 *MetaAggregationRange) GetFieldOk() (*string, bool) {
if o == nil || o.Field == nil {
return nil, false
}
return o.Field, true
}
// HasField returns a boolean if a field has been set.
func (o *MetaAggregationRange) HasField() bool {
if o != nil && o.Field != nil {
return true
}
return false
}
// SetField gets a reference to the given string and assigns it to the Field field.
func (o *MetaAggregationRange) SetField(v string) {
o.Field = &v
}
// GetKeyed returns the Keyed field value if set, zero value otherwise.
func (o *MetaAggregationRange) GetKeyed() bool {
if o == nil || o.Keyed == nil {
var ret bool
return ret
}
return *o.Keyed
}
// GetKeyedOk returns a tuple with the Keyed field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetaAggregationRange) GetKeyedOk() (*bool, bool) {
if o == nil || o.Keyed == nil {
return nil, false
}
return o.Keyed, true
}
// HasKeyed returns a boolean if a field has been set.
func (o *MetaAggregationRange) HasKeyed() bool {
if o != nil && o.Keyed != nil {
return true
}
return false
}
// SetKeyed gets a reference to the given bool and assigns it to the Keyed field.
func (o *MetaAggregationRange) SetKeyed(v bool) {
o.Keyed = &v
}
// GetRanges returns the Ranges field value if set, zero value otherwise.
func (o *MetaAggregationRange) GetRanges() []MetaRange {
if o == nil || o.Ranges == nil {
var ret []MetaRange
return ret
}
return o.Ranges
}
// GetRangesOk returns a tuple with the Ranges field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetaAggregationRange) GetRangesOk() ([]MetaRange, bool) {
if o == nil || o.Ranges == nil {
return nil, false
}
return o.Ranges, true
}
// HasRanges returns a boolean if a field has been set.
func (o *MetaAggregationRange) HasRanges() bool {
if o != nil && o.Ranges != nil {
return true
}
return false
}
// SetRanges gets a reference to the given []MetaRange and assigns it to the Ranges field.
func (o *MetaAggregationRange) SetRanges(v []MetaRange) {
o.Ranges = v
}
func (o MetaAggregationRange) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Field != nil {
toSerialize["field"] = o.Field
}
if o.Keyed != nil {
toSerialize["keyed"] = o.Keyed
}
if o.Ranges != nil {
toSerialize["ranges"] = o.Ranges
}
return json.Marshal(toSerialize)
}
type NullableMetaAggregationRange struct {
value *MetaAggregationRange
isSet bool
}
func (v NullableMetaAggregationRange) Get() *MetaAggregationRange {
return v.value
}
func (v *NullableMetaAggregationRange) Set(val *MetaAggregationRange) {
v.value = val
v.isSet = true
}
func (v NullableMetaAggregationRange) IsSet() bool {
return v.isSet
}
func (v *NullableMetaAggregationRange) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMetaAggregationRange(val *MetaAggregationRange) *NullableMetaAggregationRange {
return &NullableMetaAggregationRange{value: val, isSet: true}
}
func (v NullableMetaAggregationRange) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMetaAggregationRange) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}