/*
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"
)

// DiskConfig struct for DiskConfig
type DiskConfig struct {
	Path              *string              `json:"path,omitempty"`
	Readonly          *bool                `json:"readonly,omitempty"`
	Direct            *bool                `json:"direct,omitempty"`
	Iommu             *bool                `json:"iommu,omitempty"`
	NumQueues         *int32               `json:"num_queues,omitempty"`
	QueueSize         *int32               `json:"queue_size,omitempty"`
	VhostUser         *bool                `json:"vhost_user,omitempty"`
	VhostSocket       *string              `json:"vhost_socket,omitempty"`
	RateLimiterConfig *RateLimiterConfig   `json:"rate_limiter_config,omitempty"`
	PciSegment        *int32               `json:"pci_segment,omitempty"`
	Id                *string              `json:"id,omitempty"`
	Serial            *string              `json:"serial,omitempty"`
	RateLimitGroup    *string              `json:"rate_limit_group,omitempty"`
	QueueAffinity     *[]VirtQueueAffinity `json:"queue_affinity,omitempty"`
	BackingFiles      *bool                `json:"backing_files,omitempty"`
	Sparse            *bool                `json:"sparse,omitempty"`
	ImageType         *string              `json:"image_type,omitempty"`
}

// NewDiskConfig instantiates a new DiskConfig 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 NewDiskConfig() *DiskConfig {
	this := DiskConfig{}
	var readonly bool = false
	this.Readonly = &readonly
	var direct bool = false
	this.Direct = &direct
	var iommu bool = false
	this.Iommu = &iommu
	var numQueues int32 = 1
	this.NumQueues = &numQueues
	var queueSize int32 = 128
	this.QueueSize = &queueSize
	var vhostUser bool = false
	this.VhostUser = &vhostUser
	var backingFiles bool = false
	this.BackingFiles = &backingFiles
	var sparse bool = true
	this.Sparse = &sparse
	return &this
}

// NewDiskConfigWithDefaults instantiates a new DiskConfig 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 NewDiskConfigWithDefaults() *DiskConfig {
	this := DiskConfig{}
	var readonly bool = false
	this.Readonly = &readonly
	var direct bool = false
	this.Direct = &direct
	var iommu bool = false
	this.Iommu = &iommu
	var numQueues int32 = 1
	this.NumQueues = &numQueues
	var queueSize int32 = 128
	this.QueueSize = &queueSize
	var vhostUser bool = false
	this.VhostUser = &vhostUser
	var backingFiles bool = false
	this.BackingFiles = &backingFiles
	var sparse bool = true
	this.Sparse = &sparse
	return &this
}

// GetPath returns the Path field value if set, zero value otherwise.
func (o *DiskConfig) GetPath() string {
	if o == nil || o.Path == nil {
		var ret string
		return ret
	}
	return *o.Path
}

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

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

	return false
}

// SetPath gets a reference to the given string and assigns it to the Path field.
func (o *DiskConfig) SetPath(v string) {
	o.Path = &v
}

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

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

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

	return false
}

// SetReadonly gets a reference to the given bool and assigns it to the Readonly field.
func (o *DiskConfig) SetReadonly(v bool) {
	o.Readonly = &v
}

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

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

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

	return false
}

// SetDirect gets a reference to the given bool and assigns it to the Direct field.
func (o *DiskConfig) SetDirect(v bool) {
	o.Direct = &v
}

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

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

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

	return false
}

// SetIommu gets a reference to the given bool and assigns it to the Iommu field.
func (o *DiskConfig) SetIommu(v bool) {
	o.Iommu = &v
}

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

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

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

	return false
}

// SetNumQueues gets a reference to the given int32 and assigns it to the NumQueues field.
func (o *DiskConfig) SetNumQueues(v int32) {
	o.NumQueues = &v
}

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

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

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

	return false
}

// SetQueueSize gets a reference to the given int32 and assigns it to the QueueSize field.
func (o *DiskConfig) SetQueueSize(v int32) {
	o.QueueSize = &v
}

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

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

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

	return false
}

// SetVhostUser gets a reference to the given bool and assigns it to the VhostUser field.
func (o *DiskConfig) SetVhostUser(v bool) {
	o.VhostUser = &v
}

// GetVhostSocket returns the VhostSocket field value if set, zero value otherwise.
func (o *DiskConfig) GetVhostSocket() string {
	if o == nil || o.VhostSocket == nil {
		var ret string
		return ret
	}
	return *o.VhostSocket
}

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

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

	return false
}

// SetVhostSocket gets a reference to the given string and assigns it to the VhostSocket field.
func (o *DiskConfig) SetVhostSocket(v string) {
	o.VhostSocket = &v
}

// GetRateLimiterConfig returns the RateLimiterConfig field value if set, zero value otherwise.
func (o *DiskConfig) GetRateLimiterConfig() RateLimiterConfig {
	if o == nil || o.RateLimiterConfig == nil {
		var ret RateLimiterConfig
		return ret
	}
	return *o.RateLimiterConfig
}

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

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

	return false
}

// SetRateLimiterConfig gets a reference to the given RateLimiterConfig and assigns it to the RateLimiterConfig field.
func (o *DiskConfig) SetRateLimiterConfig(v RateLimiterConfig) {
	o.RateLimiterConfig = &v
}

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

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

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

	return false
}

// SetPciSegment gets a reference to the given int32 and assigns it to the PciSegment field.
func (o *DiskConfig) SetPciSegment(v int32) {
	o.PciSegment = &v
}

// GetId returns the Id field value if set, zero value otherwise.
func (o *DiskConfig) GetId() string {
	if o == nil || o.Id == nil {
		var ret string
		return ret
	}
	return *o.Id
}

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

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

	return false
}

// SetId gets a reference to the given string and assigns it to the Id field.
func (o *DiskConfig) SetId(v string) {
	o.Id = &v
}

// GetSerial returns the Serial field value if set, zero value otherwise.
func (o *DiskConfig) GetSerial() string {
	if o == nil || o.Serial == nil {
		var ret string
		return ret
	}
	return *o.Serial
}

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

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

	return false
}

// SetSerial gets a reference to the given string and assigns it to the Serial field.
func (o *DiskConfig) SetSerial(v string) {
	o.Serial = &v
}

// GetRateLimitGroup returns the RateLimitGroup field value if set, zero value otherwise.
func (o *DiskConfig) GetRateLimitGroup() string {
	if o == nil || o.RateLimitGroup == nil {
		var ret string
		return ret
	}
	return *o.RateLimitGroup
}

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

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

	return false
}

// SetRateLimitGroup gets a reference to the given string and assigns it to the RateLimitGroup field.
func (o *DiskConfig) SetRateLimitGroup(v string) {
	o.RateLimitGroup = &v
}

// GetQueueAffinity returns the QueueAffinity field value if set, zero value otherwise.
func (o *DiskConfig) GetQueueAffinity() []VirtQueueAffinity {
	if o == nil || o.QueueAffinity == nil {
		var ret []VirtQueueAffinity
		return ret
	}
	return *o.QueueAffinity
}

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

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

	return false
}

// SetQueueAffinity gets a reference to the given []VirtQueueAffinity and assigns it to the QueueAffinity field.
func (o *DiskConfig) SetQueueAffinity(v []VirtQueueAffinity) {
	o.QueueAffinity = &v
}

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

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

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

	return false
}

// SetBackingFiles gets a reference to the given bool and assigns it to the BackingFiles field.
func (o *DiskConfig) SetBackingFiles(v bool) {
	o.BackingFiles = &v
}

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

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

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

	return false
}

// SetSparse gets a reference to the given bool and assigns it to the Sparse field.
func (o *DiskConfig) SetSparse(v bool) {
	o.Sparse = &v
}

// GetImageType returns the ImageType field value if set, zero value otherwise.
func (o *DiskConfig) GetImageType() string {
	if o == nil || o.ImageType == nil {
		var ret string
		return ret
	}
	return *o.ImageType
}

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

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

	return false
}

// SetImageType gets a reference to the given string and assigns it to the ImageType field.
func (o *DiskConfig) SetImageType(v string) {
	o.ImageType = &v
}

func (o DiskConfig) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.Path != nil {
		toSerialize["path"] = o.Path
	}
	if o.Readonly != nil {
		toSerialize["readonly"] = o.Readonly
	}
	if o.Direct != nil {
		toSerialize["direct"] = o.Direct
	}
	if o.Iommu != nil {
		toSerialize["iommu"] = o.Iommu
	}
	if o.NumQueues != nil {
		toSerialize["num_queues"] = o.NumQueues
	}
	if o.QueueSize != nil {
		toSerialize["queue_size"] = o.QueueSize
	}
	if o.VhostUser != nil {
		toSerialize["vhost_user"] = o.VhostUser
	}
	if o.VhostSocket != nil {
		toSerialize["vhost_socket"] = o.VhostSocket
	}
	if o.RateLimiterConfig != nil {
		toSerialize["rate_limiter_config"] = o.RateLimiterConfig
	}
	if o.PciSegment != nil {
		toSerialize["pci_segment"] = o.PciSegment
	}
	if o.Id != nil {
		toSerialize["id"] = o.Id
	}
	if o.Serial != nil {
		toSerialize["serial"] = o.Serial
	}
	if o.RateLimitGroup != nil {
		toSerialize["rate_limit_group"] = o.RateLimitGroup
	}
	if o.QueueAffinity != nil {
		toSerialize["queue_affinity"] = o.QueueAffinity
	}
	if o.BackingFiles != nil {
		toSerialize["backing_files"] = o.BackingFiles
	}
	if o.Sparse != nil {
		toSerialize["sparse"] = o.Sparse
	}
	if o.ImageType != nil {
		toSerialize["image_type"] = o.ImageType
	}
	return json.Marshal(toSerialize)
}

type NullableDiskConfig struct {
	value *DiskConfig
	isSet bool
}

func (v NullableDiskConfig) Get() *DiskConfig {
	return v.value
}

func (v *NullableDiskConfig) Set(val *DiskConfig) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableDiskConfig(val *DiskConfig) *NullableDiskConfig {
	return &NullableDiskConfig{value: val, isSet: true}
}

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

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