/*
Anchore Engine API Server

This is the Anchore Engine API. Provides the primary external API for users of the service.

API version: 0.1.20
Contact: nurmi@anchore.com
*/

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

package anchore

import (
	"encoding/json"
)

// EventsList Response envelope for paginated listing of events
type EventsList struct {
	// List of events
	Results []EventResponse `json:"results,omitempty"`
	// Boolean flag, True indicates there are more events and False otherwise
	NextPage *bool `json:"next_page,omitempty"`
	// Number of events in this page
	ItemCount *int32 `json:"item_count,omitempty"`
	// Page number of this result set
	Page *int32 `json:"page,omitempty"`
}

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

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

// GetResults returns the Results field value if set, zero value otherwise.
func (o *EventsList) GetResults() []EventResponse {
	if o == nil || o.Results == nil {
		var ret []EventResponse
		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 *EventsList) GetResultsOk() ([]EventResponse, bool) {
	if o == nil || o.Results == nil {
		return nil, false
	}
	return o.Results, true
}

// HasResults returns a boolean if a field has been set.
func (o *EventsList) HasResults() bool {
	if o != nil && o.Results != nil {
		return true
	}

	return false
}

// SetResults gets a reference to the given []EventResponse and assigns it to the Results field.
func (o *EventsList) SetResults(v []EventResponse) {
	o.Results = v
}

// GetNextPage returns the NextPage field value if set, zero value otherwise.
func (o *EventsList) GetNextPage() bool {
	if o == nil || o.NextPage == nil {
		var ret bool
		return ret
	}
	return *o.NextPage
}

// GetNextPageOk returns a tuple with the NextPage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventsList) GetNextPageOk() (*bool, bool) {
	if o == nil || o.NextPage == nil {
		return nil, false
	}
	return o.NextPage, true
}

// HasNextPage returns a boolean if a field has been set.
func (o *EventsList) HasNextPage() bool {
	if o != nil && o.NextPage != nil {
		return true
	}

	return false
}

// SetNextPage gets a reference to the given bool and assigns it to the NextPage field.
func (o *EventsList) SetNextPage(v bool) {
	o.NextPage = &v
}

// GetItemCount returns the ItemCount field value if set, zero value otherwise.
func (o *EventsList) GetItemCount() int32 {
	if o == nil || o.ItemCount == nil {
		var ret int32
		return ret
	}
	return *o.ItemCount
}

// GetItemCountOk returns a tuple with the ItemCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventsList) GetItemCountOk() (*int32, bool) {
	if o == nil || o.ItemCount == nil {
		return nil, false
	}
	return o.ItemCount, true
}

// HasItemCount returns a boolean if a field has been set.
func (o *EventsList) HasItemCount() bool {
	if o != nil && o.ItemCount != nil {
		return true
	}

	return false
}

// SetItemCount gets a reference to the given int32 and assigns it to the ItemCount field.
func (o *EventsList) SetItemCount(v int32) {
	o.ItemCount = &v
}

// GetPage returns the Page field value if set, zero value otherwise.
func (o *EventsList) GetPage() int32 {
	if o == nil || o.Page == nil {
		var ret int32
		return ret
	}
	return *o.Page
}

// GetPageOk returns a tuple with the Page field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventsList) GetPageOk() (*int32, bool) {
	if o == nil || o.Page == nil {
		return nil, false
	}
	return o.Page, true
}

// HasPage returns a boolean if a field has been set.
func (o *EventsList) HasPage() bool {
	if o != nil && o.Page != nil {
		return true
	}

	return false
}

// SetPage gets a reference to the given int32 and assigns it to the Page field.
func (o *EventsList) SetPage(v int32) {
	o.Page = &v
}

func (o EventsList) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.Results != nil {
		toSerialize["results"] = o.Results
	}
	if o.NextPage != nil {
		toSerialize["next_page"] = o.NextPage
	}
	if o.ItemCount != nil {
		toSerialize["item_count"] = o.ItemCount
	}
	if o.Page != nil {
		toSerialize["page"] = o.Page
	}
	return json.Marshal(toSerialize)
}

type NullableEventsList struct {
	value *EventsList
	isSet bool
}

func (v NullableEventsList) Get() *EventsList {
	return v.value
}

func (v *NullableEventsList) Set(val *EventsList) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableEventsList(val *EventsList) *NullableEventsList {
	return &NullableEventsList{value: val, isSet: true}
}

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

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


