/*
 * peridot/proto/v1/batch.proto
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * API version: version not set
 */

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

package peridotopenapi

import (
	"encoding/json"
)

// V1ListPackagesResponse struct for V1ListPackagesResponse
type V1ListPackagesResponse struct {
	Packages *[]V1Package `json:"packages,omitempty"`
	Total *string `json:"total,omitempty"`
	Size *int32 `json:"size,omitempty"`
	Page *int32 `json:"page,omitempty"`
}

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

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

// GetPackages returns the Packages field value if set, zero value otherwise.
func (o *V1ListPackagesResponse) GetPackages() []V1Package {
	if o == nil || o.Packages == nil {
		var ret []V1Package
		return ret
	}
	return *o.Packages
}

// GetPackagesOk returns a tuple with the Packages field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1ListPackagesResponse) GetPackagesOk() (*[]V1Package, bool) {
	if o == nil || o.Packages == nil {
		return nil, false
	}
	return o.Packages, true
}

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

	return false
}

// SetPackages gets a reference to the given []V1Package and assigns it to the Packages field.
func (o *V1ListPackagesResponse) SetPackages(v []V1Package) {
	o.Packages = &v
}

// GetTotal returns the Total field value if set, zero value otherwise.
func (o *V1ListPackagesResponse) GetTotal() string {
	if o == nil || o.Total == nil {
		var ret string
		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 *V1ListPackagesResponse) GetTotalOk() (*string, bool) {
	if o == nil || o.Total == nil {
		return nil, false
	}
	return o.Total, true
}

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

	return false
}

// SetTotal gets a reference to the given string and assigns it to the Total field.
func (o *V1ListPackagesResponse) SetTotal(v string) {
	o.Total = &v
}

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

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

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

	return false
}

// SetSize gets a reference to the given int32 and assigns it to the Size field.
func (o *V1ListPackagesResponse) SetSize(v int32) {
	o.Size = &v
}

// GetPage returns the Page field value if set, zero value otherwise.
func (o *V1ListPackagesResponse) 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 *V1ListPackagesResponse) 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 *V1ListPackagesResponse) 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 *V1ListPackagesResponse) SetPage(v int32) {
	o.Page = &v
}

func (o V1ListPackagesResponse) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.Packages != nil {
		toSerialize["packages"] = o.Packages
	}
	if o.Total != nil {
		toSerialize["total"] = o.Total
	}
	if o.Size != nil {
		toSerialize["size"] = o.Size
	}
	if o.Page != nil {
		toSerialize["page"] = o.Page
	}
	return json.Marshal(toSerialize)
}

type NullableV1ListPackagesResponse struct {
	value *V1ListPackagesResponse
	isSet bool
}

func (v NullableV1ListPackagesResponse) Get() *V1ListPackagesResponse {
	return v.value
}

func (v *NullableV1ListPackagesResponse) Set(val *V1ListPackagesResponse) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableV1ListPackagesResponse(val *V1ListPackagesResponse) *NullableV1ListPackagesResponse {
	return &NullableV1ListPackagesResponse{value: val, isSet: true}
}

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

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


