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

333 lines
8.9 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"
)
// V1AggregationParams struct for V1AggregationParams
type V1AggregationParams struct {
AggType *string `json:"agg_type,omitempty"`
Aggs *map[string]V1AggregationParams `json:"aggs,omitempty"`
DateRanges []V1AggregationDateRange `json:"date_ranges,omitempty"`
Field *string `json:"field,omitempty"`
Ranges []V1AggregationNumberRange `json:"ranges,omitempty"`
Size *int32 `json:"size,omitempty"`
// Field name to be used for setting weight for primary field for weighted average aggregation
WeightField *string `json:"weight_field,omitempty"`
}
// NewV1AggregationParams instantiates a new V1AggregationParams 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 NewV1AggregationParams() *V1AggregationParams {
this := V1AggregationParams{}
return &this
}
// NewV1AggregationParamsWithDefaults instantiates a new V1AggregationParams 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 NewV1AggregationParamsWithDefaults() *V1AggregationParams {
this := V1AggregationParams{}
return &this
}
// GetAggType returns the AggType field value if set, zero value otherwise.
func (o *V1AggregationParams) GetAggType() string {
if o == nil || o.AggType == nil {
var ret string
return ret
}
return *o.AggType
}
// GetAggTypeOk returns a tuple with the AggType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1AggregationParams) GetAggTypeOk() (*string, bool) {
if o == nil || o.AggType == nil {
return nil, false
}
return o.AggType, true
}
// HasAggType returns a boolean if a field has been set.
func (o *V1AggregationParams) HasAggType() bool {
if o != nil && o.AggType != nil {
return true
}
return false
}
// SetAggType gets a reference to the given string and assigns it to the AggType field.
func (o *V1AggregationParams) SetAggType(v string) {
o.AggType = &v
}
// GetAggs returns the Aggs field value if set, zero value otherwise.
func (o *V1AggregationParams) GetAggs() map[string]V1AggregationParams {
if o == nil || o.Aggs == nil {
var ret map[string]V1AggregationParams
return ret
}
return *o.Aggs
}
// GetAggsOk returns a tuple with the Aggs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1AggregationParams) GetAggsOk() (*map[string]V1AggregationParams, bool) {
if o == nil || o.Aggs == nil {
return nil, false
}
return o.Aggs, true
}
// HasAggs returns a boolean if a field has been set.
func (o *V1AggregationParams) HasAggs() bool {
if o != nil && o.Aggs != nil {
return true
}
return false
}
// SetAggs gets a reference to the given map[string]V1AggregationParams and assigns it to the Aggs field.
func (o *V1AggregationParams) SetAggs(v map[string]V1AggregationParams) {
o.Aggs = &v
}
// GetDateRanges returns the DateRanges field value if set, zero value otherwise.
func (o *V1AggregationParams) GetDateRanges() []V1AggregationDateRange {
if o == nil || o.DateRanges == nil {
var ret []V1AggregationDateRange
return ret
}
return o.DateRanges
}
// GetDateRangesOk returns a tuple with the DateRanges field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1AggregationParams) GetDateRangesOk() ([]V1AggregationDateRange, bool) {
if o == nil || o.DateRanges == nil {
return nil, false
}
return o.DateRanges, true
}
// HasDateRanges returns a boolean if a field has been set.
func (o *V1AggregationParams) HasDateRanges() bool {
if o != nil && o.DateRanges != nil {
return true
}
return false
}
// SetDateRanges gets a reference to the given []V1AggregationDateRange and assigns it to the DateRanges field.
func (o *V1AggregationParams) SetDateRanges(v []V1AggregationDateRange) {
o.DateRanges = v
}
// GetField returns the Field field value if set, zero value otherwise.
func (o *V1AggregationParams) 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 *V1AggregationParams) 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 *V1AggregationParams) 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 *V1AggregationParams) SetField(v string) {
o.Field = &v
}
// GetRanges returns the Ranges field value if set, zero value otherwise.
func (o *V1AggregationParams) GetRanges() []V1AggregationNumberRange {
if o == nil || o.Ranges == nil {
var ret []V1AggregationNumberRange
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 *V1AggregationParams) GetRangesOk() ([]V1AggregationNumberRange, 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 *V1AggregationParams) HasRanges() bool {
if o != nil && o.Ranges != nil {
return true
}
return false
}
// SetRanges gets a reference to the given []V1AggregationNumberRange and assigns it to the Ranges field.
func (o *V1AggregationParams) SetRanges(v []V1AggregationNumberRange) {
o.Ranges = v
}
// GetSize returns the Size field value if set, zero value otherwise.
func (o *V1AggregationParams) GetSize() int32 {
if o == nil || o.Size == nil {
var ret int32
return ret
}
return *o.Size
}
// GetSizeOk returns a tuple with the Size field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1AggregationParams) GetSizeOk() (*int32, bool) {
if o == nil || o.Size == nil {
return nil, false
}
return o.Size, true
}
// HasSize returns a boolean if a field has been set.
func (o *V1AggregationParams) HasSize() bool {
if o != nil && o.Size != nil {
return true
}
return false
}
// SetSize gets a reference to the given int32 and assigns it to the Size field.
func (o *V1AggregationParams) SetSize(v int32) {
o.Size = &v
}
// GetWeightField returns the WeightField field value if set, zero value otherwise.
func (o *V1AggregationParams) GetWeightField() string {
if o == nil || o.WeightField == nil {
var ret string
return ret
}
return *o.WeightField
}
// GetWeightFieldOk returns a tuple with the WeightField field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1AggregationParams) GetWeightFieldOk() (*string, bool) {
if o == nil || o.WeightField == nil {
return nil, false
}
return o.WeightField, true
}
// HasWeightField returns a boolean if a field has been set.
func (o *V1AggregationParams) HasWeightField() bool {
if o != nil && o.WeightField != nil {
return true
}
return false
}
// SetWeightField gets a reference to the given string and assigns it to the WeightField field.
func (o *V1AggregationParams) SetWeightField(v string) {
o.WeightField = &v
}
func (o V1AggregationParams) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.AggType != nil {
toSerialize["agg_type"] = o.AggType
}
if o.Aggs != nil {
toSerialize["aggs"] = o.Aggs
}
if o.DateRanges != nil {
toSerialize["date_ranges"] = o.DateRanges
}
if o.Field != nil {
toSerialize["field"] = o.Field
}
if o.Ranges != nil {
toSerialize["ranges"] = o.Ranges
}
if o.Size != nil {
toSerialize["size"] = o.Size
}
if o.WeightField != nil {
toSerialize["weight_field"] = o.WeightField
}
return json.Marshal(toSerialize)
}
type NullableV1AggregationParams struct {
value *V1AggregationParams
isSet bool
}
func (v NullableV1AggregationParams) Get() *V1AggregationParams {
return v.value
}
func (v *NullableV1AggregationParams) Set(val *V1AggregationParams) {
v.value = val
v.isSet = true
}
func (v NullableV1AggregationParams) IsSet() bool {
return v.isSet
}
func (v *NullableV1AggregationParams) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableV1AggregationParams(val *V1AggregationParams) *NullableV1AggregationParams {
return &NullableV1AggregationParams{value: val, isSet: true}
}
func (v NullableV1AggregationParams) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableV1AggregationParams) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}