/*
 * VM Auto Scaling API
 *
 * The VM Auto Scaling Service enables IONOS clients to horizontally scale the number of VM replicas based on configured rules. You can use VM Auto Scaling to ensure that you have a sufficient number of replicas to handle your application loads at all times.  For this purpose, create a VM Auto Scaling Group that contains the server replicas. The VM Auto Scaling Service ensures that the number of replicas in the group is always within the defined limits.   When scaling policies are set, VM Auto Scaling creates or deletes replicas according to the requirements of your applications. For each policy, specified 'scale-in' and 'scale-out' actions are performed when the corresponding thresholds are reached.
 *
 * API version: 1-SDK.1
 * Contact: support@cloud.ionos.com
 */

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

package ionoscloud

import (
	"encoding/json"
	"fmt"
)

// VolumeHwType The storage type of this replica volume (SSD or HDD).
type VolumeHwType string

// List of VolumeHwType
const (
	VOLUMEHWTYPE_HDD          VolumeHwType = "HDD"
	VOLUMEHWTYPE_SSD          VolumeHwType = "SSD"
	VOLUMEHWTYPE_SSD_PREMIUM  VolumeHwType = "SSD_PREMIUM"
	VOLUMEHWTYPE_SSD_STANDARD VolumeHwType = "SSD_STANDARD"
)

func (v *VolumeHwType) UnmarshalJSON(src []byte) error {
	var value string
	err := json.Unmarshal(src, &value)
	if err != nil {
		return err
	}
	enumTypeValue := VolumeHwType(value)
	for _, existing := range []VolumeHwType{"HDD", "SSD", "SSD_PREMIUM", "SSD_STANDARD"} {
		if existing == enumTypeValue {
			*v = enumTypeValue
			return nil
		}
	}

	return fmt.Errorf("%+v is not a valid VolumeHwType", value)
}

// Ptr returns reference to VolumeHwType value
func (v VolumeHwType) Ptr() *VolumeHwType {
	return &v
}

type NullableVolumeHwType struct {
	value *VolumeHwType
	isSet bool
}

func (v NullableVolumeHwType) Get() *VolumeHwType {
	return v.value
}

func (v *NullableVolumeHwType) Set(val *VolumeHwType) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableVolumeHwType(val *VolumeHwType) *NullableVolumeHwType {
	return &NullableVolumeHwType{value: val, isSet: true}
}

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

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