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

// CpuFeatures struct for CpuFeatures
type CpuFeatures struct {
	Amx *bool `json:"amx,omitempty"`
}

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

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

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

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

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

	return false
}

// SetAmx gets a reference to the given bool and assigns it to the Amx field.
func (o *CpuFeatures) SetAmx(v bool) {
	o.Amx = &v
}

func (o CpuFeatures) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.Amx != nil {
		toSerialize["amx"] = o.Amx
	}
	return json.Marshal(toSerialize)
}

type NullableCpuFeatures struct {
	value *CpuFeatures
	isSet bool
}

func (v NullableCpuFeatures) Get() *CpuFeatures {
	return v.value
}

func (v *NullableCpuFeatures) Set(val *CpuFeatures) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableCpuFeatures(val *CpuFeatures) *NullableCpuFeatures {
	return &NullableCpuFeatures{value: val, isSet: true}
}

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

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