Files
sdk/model_index_index_documents.go

269 lines
7.1 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 IndexIndexDocuments type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IndexIndexDocuments{}
// IndexIndexDocuments struct for IndexIndexDocuments
type IndexIndexDocuments struct {
// Limit is how many documents this page could hold.
Limit *int64 `json:"limit,omitempty"`
// Offset is where this page starts.
Offset *int64 `json:"offset,omitempty"`
// Results are the documents themselves, exactly as they were stored.
Results []interface{} `json:"results,omitempty"`
// Total is how many documents the index holds altogether.
Total *int64 `json:"total,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IndexIndexDocuments IndexIndexDocuments
// NewIndexIndexDocuments instantiates a new IndexIndexDocuments 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 NewIndexIndexDocuments() *IndexIndexDocuments {
this := IndexIndexDocuments{}
return &this
}
// NewIndexIndexDocumentsWithDefaults instantiates a new IndexIndexDocuments 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 NewIndexIndexDocumentsWithDefaults() *IndexIndexDocuments {
this := IndexIndexDocuments{}
return &this
}
// GetLimit returns the Limit field value if set, zero value otherwise.
func (o *IndexIndexDocuments) 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 *IndexIndexDocuments) 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 *IndexIndexDocuments) 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 *IndexIndexDocuments) SetLimit(v int64) {
o.Limit = &v
}
// GetOffset returns the Offset field value if set, zero value otherwise.
func (o *IndexIndexDocuments) 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 *IndexIndexDocuments) 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 *IndexIndexDocuments) 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 *IndexIndexDocuments) SetOffset(v int64) {
o.Offset = &v
}
// GetResults returns the Results field value if set, zero value otherwise.
func (o *IndexIndexDocuments) GetResults() []interface{} {
if o == nil || IsNil(o.Results) {
var ret []interface{}
return ret
}
return o.Results
}
// GetResultsOk returns a tuple with the Results field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexIndexDocuments) GetResultsOk() ([]interface{}, bool) {
if o == nil || IsNil(o.Results) {
return nil, false
}
return o.Results, true
}
// HasResults returns a boolean if a field has been set.
func (o *IndexIndexDocuments) HasResults() bool {
if o != nil && !IsNil(o.Results) {
return true
}
return false
}
// SetResults gets a reference to the given []interface{} and assigns it to the Results field.
func (o *IndexIndexDocuments) SetResults(v []interface{}) {
o.Results = v
}
// GetTotal returns the Total field value if set, zero value otherwise.
func (o *IndexIndexDocuments) GetTotal() int64 {
if o == nil || IsNil(o.Total) {
var ret int64
return ret
}
return *o.Total
}
// GetTotalOk returns a tuple with the Total field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexIndexDocuments) GetTotalOk() (*int64, bool) {
if o == nil || IsNil(o.Total) {
return nil, false
}
return o.Total, true
}
// HasTotal returns a boolean if a field has been set.
func (o *IndexIndexDocuments) HasTotal() bool {
if o != nil && !IsNil(o.Total) {
return true
}
return false
}
// SetTotal gets a reference to the given int64 and assigns it to the Total field.
func (o *IndexIndexDocuments) SetTotal(v int64) {
o.Total = &v
}
func (o IndexIndexDocuments) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IndexIndexDocuments) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Limit) {
toSerialize["limit"] = o.Limit
}
if !IsNil(o.Offset) {
toSerialize["offset"] = o.Offset
}
if !IsNil(o.Results) {
toSerialize["results"] = o.Results
}
if !IsNil(o.Total) {
toSerialize["total"] = o.Total
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IndexIndexDocuments) UnmarshalJSON(data []byte) (err error) {
varIndexIndexDocuments := _IndexIndexDocuments{}
err = json.Unmarshal(data, &varIndexIndexDocuments)
if err != nil {
return err
}
*o = IndexIndexDocuments(varIndexIndexDocuments)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "limit")
delete(additionalProperties, "offset")
delete(additionalProperties, "results")
delete(additionalProperties, "total")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIndexIndexDocuments struct {
value *IndexIndexDocuments
isSet bool
}
func (v NullableIndexIndexDocuments) Get() *IndexIndexDocuments {
return v.value
}
func (v *NullableIndexIndexDocuments) Set(val *IndexIndexDocuments) {
v.value = val
v.isSet = true
}
func (v NullableIndexIndexDocuments) IsSet() bool {
return v.isSet
}
func (v *NullableIndexIndexDocuments) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableIndexIndexDocuments(val *IndexIndexDocuments) *NullableIndexIndexDocuments {
return &NullableIndexIndexDocuments{value: val, isSet: true}
}
func (v NullableIndexIndexDocuments) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableIndexIndexDocuments) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}