Files
sdk/model_index_index_query.go

269 lines
6.9 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 IndexIndexQuery type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IndexIndexQuery{}
// IndexIndexQuery struct for IndexIndexQuery
type IndexIndexQuery struct {
Filter interface{} `json:"filter,omitempty"`
// Limit is how many hits to return. Absent means 20; the ceiling is 1000.
Limit *int64 `json:"limit,omitempty"`
// Offset is where to start. Absent means 0.
Offset *int64 `json:"offset,omitempty"`
// Q is the search text. Typos are forgiven. An empty Q matches everything, which is how a client lists an index by relevance rather than by insertion order.
Q *string `json:"q,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IndexIndexQuery IndexIndexQuery
// NewIndexIndexQuery instantiates a new IndexIndexQuery 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 NewIndexIndexQuery() *IndexIndexQuery {
this := IndexIndexQuery{}
return &this
}
// NewIndexIndexQueryWithDefaults instantiates a new IndexIndexQuery 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 NewIndexIndexQueryWithDefaults() *IndexIndexQuery {
this := IndexIndexQuery{}
return &this
}
// GetFilter returns the Filter field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *IndexIndexQuery) GetFilter() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Filter
}
// GetFilterOk returns a tuple with the Filter field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *IndexIndexQuery) GetFilterOk() (*interface{}, bool) {
if o == nil || IsNil(o.Filter) {
return nil, false
}
return &o.Filter, true
}
// HasFilter returns a boolean if a field has been set.
func (o *IndexIndexQuery) HasFilter() bool {
if o != nil && !IsNil(o.Filter) {
return true
}
return false
}
// SetFilter gets a reference to the given interface{} and assigns it to the Filter field.
func (o *IndexIndexQuery) SetFilter(v interface{}) {
o.Filter = v
}
// GetLimit returns the Limit field value if set, zero value otherwise.
func (o *IndexIndexQuery) GetLimit() int64 {
if o == nil || IsNil(o.Limit) {
var ret int64
return ret
}
return *o.Limit
}
// GetLimitOk returns a tuple with the Limit field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexIndexQuery) GetLimitOk() (*int64, bool) {
if o == nil || IsNil(o.Limit) {
return nil, false
}
return o.Limit, true
}
// HasLimit returns a boolean if a field has been set.
func (o *IndexIndexQuery) HasLimit() bool {
if o != nil && !IsNil(o.Limit) {
return true
}
return false
}
// SetLimit gets a reference to the given int64 and assigns it to the Limit field.
func (o *IndexIndexQuery) SetLimit(v int64) {
o.Limit = &v
}
// GetOffset returns the Offset field value if set, zero value otherwise.
func (o *IndexIndexQuery) GetOffset() int64 {
if o == nil || IsNil(o.Offset) {
var ret int64
return ret
}
return *o.Offset
}
// GetOffsetOk returns a tuple with the Offset field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexIndexQuery) GetOffsetOk() (*int64, bool) {
if o == nil || IsNil(o.Offset) {
return nil, false
}
return o.Offset, true
}
// HasOffset returns a boolean if a field has been set.
func (o *IndexIndexQuery) HasOffset() bool {
if o != nil && !IsNil(o.Offset) {
return true
}
return false
}
// SetOffset gets a reference to the given int64 and assigns it to the Offset field.
func (o *IndexIndexQuery) SetOffset(v int64) {
o.Offset = &v
}
// GetQ returns the Q field value if set, zero value otherwise.
func (o *IndexIndexQuery) GetQ() string {
if o == nil || IsNil(o.Q) {
var ret string
return ret
}
return *o.Q
}
// GetQOk returns a tuple with the Q field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexIndexQuery) GetQOk() (*string, bool) {
if o == nil || IsNil(o.Q) {
return nil, false
}
return o.Q, true
}
// HasQ returns a boolean if a field has been set.
func (o *IndexIndexQuery) HasQ() bool {
if o != nil && !IsNil(o.Q) {
return true
}
return false
}
// SetQ gets a reference to the given string and assigns it to the Q field.
func (o *IndexIndexQuery) SetQ(v string) {
o.Q = &v
}
func (o IndexIndexQuery) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IndexIndexQuery) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Filter != nil {
toSerialize["filter"] = o.Filter
}
if !IsNil(o.Limit) {
toSerialize["limit"] = o.Limit
}
if !IsNil(o.Offset) {
toSerialize["offset"] = o.Offset
}
if !IsNil(o.Q) {
toSerialize["q"] = o.Q
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IndexIndexQuery) UnmarshalJSON(data []byte) (err error) {
varIndexIndexQuery := _IndexIndexQuery{}
err = json.Unmarshal(data, &varIndexIndexQuery)
if err != nil {
return err
}
*o = IndexIndexQuery(varIndexIndexQuery)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "filter")
delete(additionalProperties, "limit")
delete(additionalProperties, "offset")
delete(additionalProperties, "q")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIndexIndexQuery struct {
value *IndexIndexQuery
isSet bool
}
func (v NullableIndexIndexQuery) Get() *IndexIndexQuery {
return v.value
}
func (v *NullableIndexIndexQuery) Set(val *IndexIndexQuery) {
v.value = val
v.isSet = true
}
func (v NullableIndexIndexQuery) IsSet() bool {
return v.isSet
}
func (v *NullableIndexIndexQuery) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableIndexIndexQuery(val *IndexIndexQuery) *NullableIndexIndexQuery {
return &NullableIndexIndexQuery{value: val, isSet: true}
}
func (v NullableIndexIndexQuery) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableIndexIndexQuery) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}