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

// PlatformConfig struct for PlatformConfig
type PlatformConfig struct {
	NumPciSegments *int32   `json:"num_pci_segments,omitempty"`
	IommuSegments  *[]int32 `json:"iommu_segments,omitempty"`
}

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

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

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

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

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

	return false
}

// SetNumPciSegments gets a reference to the given int32 and assigns it to the NumPciSegments field.
func (o *PlatformConfig) SetNumPciSegments(v int32) {
	o.NumPciSegments = &v
}

// GetIommuSegments returns the IommuSegments field value if set, zero value otherwise.
func (o *PlatformConfig) GetIommuSegments() []int32 {
	if o == nil || o.IommuSegments == nil {
		var ret []int32
		return ret
	}
	return *o.IommuSegments
}

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

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

	return false
}

// SetIommuSegments gets a reference to the given []int32 and assigns it to the IommuSegments field.
func (o *PlatformConfig) SetIommuSegments(v []int32) {
	o.IommuSegments = &v
}

func (o PlatformConfig) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.NumPciSegments != nil {
		toSerialize["num_pci_segments"] = o.NumPciSegments
	}
	if o.IommuSegments != nil {
		toSerialize["iommu_segments"] = o.IommuSegments
	}
	return json.Marshal(toSerialize)
}

type NullablePlatformConfig struct {
	value *PlatformConfig
	isSet bool
}

func (v NullablePlatformConfig) Get() *PlatformConfig {
	return v.value
}

func (v *NullablePlatformConfig) Set(val *PlatformConfig) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullablePlatformConfig(val *PlatformConfig) *NullablePlatformConfig {
	return &NullablePlatformConfig{value: val, isSet: true}
}

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

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