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

// VsockConfig struct for VsockConfig
type VsockConfig struct {
	// Guest Vsock CID
	Cid int64 `json:"cid"`
	// Path to UNIX domain socket, used to proxy vsock connections.
	Socket     string  `json:"socket"`
	Iommu      *bool   `json:"iommu,omitempty"`
	PciSegment *int32  `json:"pci_segment,omitempty"`
	Id         *string `json:"id,omitempty"`
}

// NewVsockConfig instantiates a new VsockConfig 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 NewVsockConfig(cid int64, socket string) *VsockConfig {
	this := VsockConfig{}
	this.Cid = cid
	this.Socket = socket
	var iommu bool = false
	this.Iommu = &iommu
	return &this
}

// NewVsockConfigWithDefaults instantiates a new VsockConfig 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 NewVsockConfigWithDefaults() *VsockConfig {
	this := VsockConfig{}
	var iommu bool = false
	this.Iommu = &iommu
	return &this
}

// GetCid returns the Cid field value
func (o *VsockConfig) GetCid() int64 {
	if o == nil {
		var ret int64
		return ret
	}

	return o.Cid
}

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

// SetCid sets field value
func (o *VsockConfig) SetCid(v int64) {
	o.Cid = v
}

// GetSocket returns the Socket field value
func (o *VsockConfig) GetSocket() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Socket
}

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

// SetSocket sets field value
func (o *VsockConfig) SetSocket(v string) {
	o.Socket = v
}

// GetIommu returns the Iommu field value if set, zero value otherwise.
func (o *VsockConfig) 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 *VsockConfig) 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 *VsockConfig) 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 *VsockConfig) SetIommu(v bool) {
	o.Iommu = &v
}

// GetPciSegment returns the PciSegment field value if set, zero value otherwise.
func (o *VsockConfig) 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 *VsockConfig) 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 *VsockConfig) 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 *VsockConfig) SetPciSegment(v int32) {
	o.PciSegment = &v
}

// GetId returns the Id field value if set, zero value otherwise.
func (o *VsockConfig) 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 *VsockConfig) 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 *VsockConfig) 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 *VsockConfig) SetId(v string) {
	o.Id = &v
}

func (o VsockConfig) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if true {
		toSerialize["cid"] = o.Cid
	}
	if true {
		toSerialize["socket"] = o.Socket
	}
	if o.Iommu != nil {
		toSerialize["iommu"] = o.Iommu
	}
	if o.PciSegment != nil {
		toSerialize["pci_segment"] = o.PciSegment
	}
	if o.Id != nil {
		toSerialize["id"] = o.Id
	}
	return json.Marshal(toSerialize)
}

type NullableVsockConfig struct {
	value *VsockConfig
	isSet bool
}

func (v NullableVsockConfig) Get() *VsockConfig {
	return v.value
}

func (v *NullableVsockConfig) Set(val *VsockConfig) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableVsockConfig(val *VsockConfig) *NullableVsockConfig {
	return &NullableVsockConfig{value: val, isSet: true}
}

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

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