/*
Cloud Hypervisor API

Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.

API version: 0.3.0
*/

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

package openapi

import (
	"encoding/json"
)

// VirtQueueAffinity struct for VirtQueueAffinity
type VirtQueueAffinity struct {
	QueueIndex int32   `json:"queue_index"`
	HostCpus   []int32 `json:"host_cpus"`
}

// NewVirtQueueAffinity instantiates a new VirtQueueAffinity 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 NewVirtQueueAffinity(queueIndex int32, hostCpus []int32) *VirtQueueAffinity {
	this := VirtQueueAffinity{}
	this.QueueIndex = queueIndex
	this.HostCpus = hostCpus
	return &this
}

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

// GetQueueIndex returns the QueueIndex field value
func (o *VirtQueueAffinity) GetQueueIndex() int32 {
	if o == nil {
		var ret int32
		return ret
	}

	return o.QueueIndex
}

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

// SetQueueIndex sets field value
func (o *VirtQueueAffinity) SetQueueIndex(v int32) {
	o.QueueIndex = v
}

// GetHostCpus returns the HostCpus field value
func (o *VirtQueueAffinity) GetHostCpus() []int32 {
	if o == nil {
		var ret []int32
		return ret
	}

	return o.HostCpus
}

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

// SetHostCpus sets field value
func (o *VirtQueueAffinity) SetHostCpus(v []int32) {
	o.HostCpus = v
}

func (o VirtQueueAffinity) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if true {
		toSerialize["queue_index"] = o.QueueIndex
	}
	if true {
		toSerialize["host_cpus"] = o.HostCpus
	}
	return json.Marshal(toSerialize)
}

type NullableVirtQueueAffinity struct {
	value *VirtQueueAffinity
	isSet bool
}

func (v NullableVirtQueueAffinity) Get() *VirtQueueAffinity {
	return v.value
}

func (v *NullableVirtQueueAffinity) Set(val *VirtQueueAffinity) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableVirtQueueAffinity(val *VirtQueueAffinity) *NullableVirtQueueAffinity {
	return &NullableVirtQueueAffinity{value: val, isSet: true}
}

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

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