mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-11-27 10:34:42 -05:00
First tagged release carrying the merged search spec: the search query endpoint with aggregations (metricDefinition/searchMetric, geohashDefinition, aggregationFilterToken), sortProperty and the auth-guest additions.
165 lines
4.2 KiB
Go
165 lines
4.2 KiB
Go
/*
|
|
Libre Graph API
|
|
|
|
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
|
|
|
|
API version: v1.0.8
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package libregraph
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// checks if the SearchMetric type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &SearchMetric{}
|
|
|
|
// SearchMetric The result of a metric aggregation, the counterpart of `buckets` for aggregations requested with a `@libre.graph.metricDefinition`. Absent for terms, range and geohash aggregations. Libregraph extension not present in MS Graph.
|
|
type SearchMetric struct {
|
|
// Echoes the `kind` of the corresponding `metricDefinition`, allowing consumers (and the search service's cross-space merge layer) to pick the right reducer when combining results.
|
|
Kind *string `json:"kind,omitempty"`
|
|
// The scalar result of the metric.
|
|
Value *float64 `json:"value,omitempty"`
|
|
}
|
|
|
|
// NewSearchMetric instantiates a new SearchMetric 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 NewSearchMetric() *SearchMetric {
|
|
this := SearchMetric{}
|
|
return &this
|
|
}
|
|
|
|
// NewSearchMetricWithDefaults instantiates a new SearchMetric 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 NewSearchMetricWithDefaults() *SearchMetric {
|
|
this := SearchMetric{}
|
|
return &this
|
|
}
|
|
|
|
// GetKind returns the Kind field value if set, zero value otherwise.
|
|
func (o *SearchMetric) GetKind() string {
|
|
if o == nil || IsNil(o.Kind) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Kind
|
|
}
|
|
|
|
// GetKindOk returns a tuple with the Kind field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *SearchMetric) GetKindOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Kind) {
|
|
return nil, false
|
|
}
|
|
return o.Kind, true
|
|
}
|
|
|
|
// HasKind returns a boolean if a field has been set.
|
|
func (o *SearchMetric) HasKind() bool {
|
|
if o != nil && !IsNil(o.Kind) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetKind gets a reference to the given string and assigns it to the Kind field.
|
|
func (o *SearchMetric) SetKind(v string) {
|
|
o.Kind = &v
|
|
}
|
|
|
|
// GetValue returns the Value field value if set, zero value otherwise.
|
|
func (o *SearchMetric) GetValue() float64 {
|
|
if o == nil || IsNil(o.Value) {
|
|
var ret float64
|
|
return ret
|
|
}
|
|
return *o.Value
|
|
}
|
|
|
|
// GetValueOk returns a tuple with the Value field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *SearchMetric) GetValueOk() (*float64, bool) {
|
|
if o == nil || IsNil(o.Value) {
|
|
return nil, false
|
|
}
|
|
return o.Value, true
|
|
}
|
|
|
|
// HasValue returns a boolean if a field has been set.
|
|
func (o *SearchMetric) HasValue() bool {
|
|
if o != nil && !IsNil(o.Value) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetValue gets a reference to the given float64 and assigns it to the Value field.
|
|
func (o *SearchMetric) SetValue(v float64) {
|
|
o.Value = &v
|
|
}
|
|
|
|
func (o SearchMetric) MarshalJSON() ([]byte, error) {
|
|
toSerialize,err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o SearchMetric) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Kind) {
|
|
toSerialize["kind"] = o.Kind
|
|
}
|
|
if !IsNil(o.Value) {
|
|
toSerialize["value"] = o.Value
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableSearchMetric struct {
|
|
value *SearchMetric
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableSearchMetric) Get() *SearchMetric {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableSearchMetric) Set(val *SearchMetric) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableSearchMetric) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableSearchMetric) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableSearchMetric(val *SearchMetric) *NullableSearchMetric {
|
|
return &NullableSearchMetric{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableSearchMetric) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableSearchMetric) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|
|
|
|
|