/*
Hindsight HTTP API

HTTP API for Hindsight

API version: 0.5.3
*/

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package hindsight

import (
	"encoding/json"
	"bytes"
	"fmt"
)

// checks if the ListDocumentsResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ListDocumentsResponse{}

// ListDocumentsResponse Response model for list documents endpoint.
type ListDocumentsResponse struct {
	Items []map[string]interface{} `json:"items"`
	Total int32 `json:"total"`
	Limit int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type _ListDocumentsResponse ListDocumentsResponse

// NewListDocumentsResponse instantiates a new ListDocumentsResponse 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 NewListDocumentsResponse(items []map[string]interface{}, total int32, limit int32, offset int32) *ListDocumentsResponse {
	this := ListDocumentsResponse{}
	this.Items = items
	this.Total = total
	this.Limit = limit
	this.Offset = offset
	return &this
}

// NewListDocumentsResponseWithDefaults instantiates a new ListDocumentsResponse 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 NewListDocumentsResponseWithDefaults() *ListDocumentsResponse {
	this := ListDocumentsResponse{}
	return &this
}

// GetItems returns the Items field value
func (o *ListDocumentsResponse) GetItems() []map[string]interface{} {
	if o == nil {
		var ret []map[string]interface{}
		return ret
	}

	return o.Items
}

// GetItemsOk returns a tuple with the Items field value
// and a boolean to check if the value has been set.
func (o *ListDocumentsResponse) GetItemsOk() ([]map[string]interface{}, bool) {
	if o == nil {
		return nil, false
	}
	return o.Items, true
}

// SetItems sets field value
func (o *ListDocumentsResponse) SetItems(v []map[string]interface{}) {
	o.Items = v
}

// GetTotal returns the Total field value
func (o *ListDocumentsResponse) GetTotal() int32 {
	if o == nil {
		var ret int32
		return ret
	}

	return o.Total
}

// GetTotalOk returns a tuple with the Total field value
// and a boolean to check if the value has been set.
func (o *ListDocumentsResponse) GetTotalOk() (*int32, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Total, true
}

// SetTotal sets field value
func (o *ListDocumentsResponse) SetTotal(v int32) {
	o.Total = v
}

// GetLimit returns the Limit field value
func (o *ListDocumentsResponse) GetLimit() int32 {
	if o == nil {
		var ret int32
		return ret
	}

	return o.Limit
}

// GetLimitOk returns a tuple with the Limit field value
// and a boolean to check if the value has been set.
func (o *ListDocumentsResponse) GetLimitOk() (*int32, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Limit, true
}

// SetLimit sets field value
func (o *ListDocumentsResponse) SetLimit(v int32) {
	o.Limit = v
}

// GetOffset returns the Offset field value
func (o *ListDocumentsResponse) GetOffset() int32 {
	if o == nil {
		var ret int32
		return ret
	}

	return o.Offset
}

// GetOffsetOk returns a tuple with the Offset field value
// and a boolean to check if the value has been set.
func (o *ListDocumentsResponse) GetOffsetOk() (*int32, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Offset, true
}

// SetOffset sets field value
func (o *ListDocumentsResponse) SetOffset(v int32) {
	o.Offset = v
}

func (o ListDocumentsResponse) MarshalJSON() ([]byte, error) {
	toSerialize,err := o.ToMap()
	if err != nil {
		return []byte{}, err
	}
	return json.Marshal(toSerialize)
}

func (o ListDocumentsResponse) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["items"] = o.Items
	toSerialize["total"] = o.Total
	toSerialize["limit"] = o.Limit
	toSerialize["offset"] = o.Offset
	return toSerialize, nil
}

func (o *ListDocumentsResponse) UnmarshalJSON(data []byte) (err error) {
	// This validates that all required properties are included in the JSON object
	// by unmarshalling the object into a generic map with string keys and checking
	// that every required field exists as a key in the generic map.
	requiredProperties := []string{
		"items",
		"total",
		"limit",
		"offset",
	}

	allProperties := make(map[string]interface{})

	err = json.Unmarshal(data, &allProperties)

	if err != nil {
		return err;
	}

	for _, requiredProperty := range(requiredProperties) {
		if _, exists := allProperties[requiredProperty]; !exists {
			return fmt.Errorf("no value given for required property %v", requiredProperty)
		}
	}

	varListDocumentsResponse := _ListDocumentsResponse{}

	decoder := json.NewDecoder(bytes.NewReader(data))
	decoder.DisallowUnknownFields()
	err = decoder.Decode(&varListDocumentsResponse)

	if err != nil {
		return err
	}

	*o = ListDocumentsResponse(varListDocumentsResponse)

	return err
}

type NullableListDocumentsResponse struct {
	value *ListDocumentsResponse
	isSet bool
}

func (v NullableListDocumentsResponse) Get() *ListDocumentsResponse {
	return v.value
}

func (v *NullableListDocumentsResponse) Set(val *ListDocumentsResponse) {
	v.value = val
	v.isSet = true
}

func (v NullableListDocumentsResponse) IsSet() bool {
	return v.isSet
}

func (v *NullableListDocumentsResponse) Unset() {
	v.value = nil
	v.isSet = false
}

func NewNullableListDocumentsResponse(val *ListDocumentsResponse) *NullableListDocumentsResponse {
	return &NullableListDocumentsResponse{value: val, isSet: true}
}

func (v NullableListDocumentsResponse) MarshalJSON() ([]byte, error) {
	return json.Marshal(v.value)
}

func (v *NullableListDocumentsResponse) UnmarshalJSON(src []byte) error {
	v.isSet = true
	return json.Unmarshal(src, &v.value)
}


