297 lines
7.6 KiB
Go
297 lines
7.6 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"
|
|
)
|
|
|
|
// MetaSearchResponse struct for MetaSearchResponse
|
|
type MetaSearchResponse struct {
|
|
Shards *MetaShards `json:"_shards,omitempty"`
|
|
Aggregations *map[string]MetaAggregationResponse `json:"aggregations,omitempty"`
|
|
Error *string `json:"error,omitempty"`
|
|
Hits *MetaHits `json:"hits,omitempty"`
|
|
TimedOut *bool `json:"timed_out,omitempty"`
|
|
// Time it took to generate the response
|
|
Took *int32 `json:"took,omitempty"`
|
|
}
|
|
|
|
// NewMetaSearchResponse instantiates a new MetaSearchResponse 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 NewMetaSearchResponse() *MetaSearchResponse {
|
|
this := MetaSearchResponse{}
|
|
return &this
|
|
}
|
|
|
|
// NewMetaSearchResponseWithDefaults instantiates a new MetaSearchResponse 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 NewMetaSearchResponseWithDefaults() *MetaSearchResponse {
|
|
this := MetaSearchResponse{}
|
|
return &this
|
|
}
|
|
|
|
// GetShards returns the Shards field value if set, zero value otherwise.
|
|
func (o *MetaSearchResponse) GetShards() MetaShards {
|
|
if o == nil || o.Shards == nil {
|
|
var ret MetaShards
|
|
return ret
|
|
}
|
|
return *o.Shards
|
|
}
|
|
|
|
// GetShardsOk returns a tuple with the Shards field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MetaSearchResponse) GetShardsOk() (*MetaShards, bool) {
|
|
if o == nil || o.Shards == nil {
|
|
return nil, false
|
|
}
|
|
return o.Shards, true
|
|
}
|
|
|
|
// HasShards returns a boolean if a field has been set.
|
|
func (o *MetaSearchResponse) HasShards() bool {
|
|
if o != nil && o.Shards != nil {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetShards gets a reference to the given MetaShards and assigns it to the Shards field.
|
|
func (o *MetaSearchResponse) SetShards(v MetaShards) {
|
|
o.Shards = &v
|
|
}
|
|
|
|
// GetAggregations returns the Aggregations field value if set, zero value otherwise.
|
|
func (o *MetaSearchResponse) GetAggregations() map[string]MetaAggregationResponse {
|
|
if o == nil || o.Aggregations == nil {
|
|
var ret map[string]MetaAggregationResponse
|
|
return ret
|
|
}
|
|
return *o.Aggregations
|
|
}
|
|
|
|
// GetAggregationsOk returns a tuple with the Aggregations field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MetaSearchResponse) GetAggregationsOk() (*map[string]MetaAggregationResponse, bool) {
|
|
if o == nil || o.Aggregations == nil {
|
|
return nil, false
|
|
}
|
|
return o.Aggregations, true
|
|
}
|
|
|
|
// HasAggregations returns a boolean if a field has been set.
|
|
func (o *MetaSearchResponse) HasAggregations() bool {
|
|
if o != nil && o.Aggregations != nil {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAggregations gets a reference to the given map[string]MetaAggregationResponse and assigns it to the Aggregations field.
|
|
func (o *MetaSearchResponse) SetAggregations(v map[string]MetaAggregationResponse) {
|
|
o.Aggregations = &v
|
|
}
|
|
|
|
// GetError returns the Error field value if set, zero value otherwise.
|
|
func (o *MetaSearchResponse) GetError() string {
|
|
if o == nil || o.Error == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Error
|
|
}
|
|
|
|
// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MetaSearchResponse) GetErrorOk() (*string, bool) {
|
|
if o == nil || o.Error == nil {
|
|
return nil, false
|
|
}
|
|
return o.Error, true
|
|
}
|
|
|
|
// HasError returns a boolean if a field has been set.
|
|
func (o *MetaSearchResponse) HasError() bool {
|
|
if o != nil && o.Error != nil {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetError gets a reference to the given string and assigns it to the Error field.
|
|
func (o *MetaSearchResponse) SetError(v string) {
|
|
o.Error = &v
|
|
}
|
|
|
|
// GetHits returns the Hits field value if set, zero value otherwise.
|
|
func (o *MetaSearchResponse) GetHits() MetaHits {
|
|
if o == nil || o.Hits == nil {
|
|
var ret MetaHits
|
|
return ret
|
|
}
|
|
return *o.Hits
|
|
}
|
|
|
|
// GetHitsOk returns a tuple with the Hits field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MetaSearchResponse) GetHitsOk() (*MetaHits, bool) {
|
|
if o == nil || o.Hits == nil {
|
|
return nil, false
|
|
}
|
|
return o.Hits, true
|
|
}
|
|
|
|
// HasHits returns a boolean if a field has been set.
|
|
func (o *MetaSearchResponse) HasHits() bool {
|
|
if o != nil && o.Hits != nil {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetHits gets a reference to the given MetaHits and assigns it to the Hits field.
|
|
func (o *MetaSearchResponse) SetHits(v MetaHits) {
|
|
o.Hits = &v
|
|
}
|
|
|
|
// GetTimedOut returns the TimedOut field value if set, zero value otherwise.
|
|
func (o *MetaSearchResponse) GetTimedOut() bool {
|
|
if o == nil || o.TimedOut == nil {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.TimedOut
|
|
}
|
|
|
|
// GetTimedOutOk returns a tuple with the TimedOut field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MetaSearchResponse) GetTimedOutOk() (*bool, bool) {
|
|
if o == nil || o.TimedOut == nil {
|
|
return nil, false
|
|
}
|
|
return o.TimedOut, true
|
|
}
|
|
|
|
// HasTimedOut returns a boolean if a field has been set.
|
|
func (o *MetaSearchResponse) HasTimedOut() bool {
|
|
if o != nil && o.TimedOut != nil {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTimedOut gets a reference to the given bool and assigns it to the TimedOut field.
|
|
func (o *MetaSearchResponse) SetTimedOut(v bool) {
|
|
o.TimedOut = &v
|
|
}
|
|
|
|
// GetTook returns the Took field value if set, zero value otherwise.
|
|
func (o *MetaSearchResponse) GetTook() int32 {
|
|
if o == nil || o.Took == nil {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.Took
|
|
}
|
|
|
|
// GetTookOk returns a tuple with the Took field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MetaSearchResponse) GetTookOk() (*int32, bool) {
|
|
if o == nil || o.Took == nil {
|
|
return nil, false
|
|
}
|
|
return o.Took, true
|
|
}
|
|
|
|
// HasTook returns a boolean if a field has been set.
|
|
func (o *MetaSearchResponse) HasTook() bool {
|
|
if o != nil && o.Took != nil {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTook gets a reference to the given int32 and assigns it to the Took field.
|
|
func (o *MetaSearchResponse) SetTook(v int32) {
|
|
o.Took = &v
|
|
}
|
|
|
|
func (o MetaSearchResponse) MarshalJSON() ([]byte, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if o.Shards != nil {
|
|
toSerialize["_shards"] = o.Shards
|
|
}
|
|
if o.Aggregations != nil {
|
|
toSerialize["aggregations"] = o.Aggregations
|
|
}
|
|
if o.Error != nil {
|
|
toSerialize["error"] = o.Error
|
|
}
|
|
if o.Hits != nil {
|
|
toSerialize["hits"] = o.Hits
|
|
}
|
|
if o.TimedOut != nil {
|
|
toSerialize["timed_out"] = o.TimedOut
|
|
}
|
|
if o.Took != nil {
|
|
toSerialize["took"] = o.Took
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
type NullableMetaSearchResponse struct {
|
|
value *MetaSearchResponse
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableMetaSearchResponse) Get() *MetaSearchResponse {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableMetaSearchResponse) Set(val *MetaSearchResponse) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableMetaSearchResponse) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableMetaSearchResponse) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableMetaSearchResponse(val *MetaSearchResponse) *NullableMetaSearchResponse {
|
|
return &NullableMetaSearchResponse{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableMetaSearchResponse) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableMetaSearchResponse) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|
|
|
|
|