/*
Web Application Firewall API

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

API version: 2.0.0
*/

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

package waf

import (
	"encoding/json"
	"fmt"
)

// WAFSensitivityChoices the model 'WAFSensitivityChoices'
type WAFSensitivityChoices string

// List of WAFSensitivityChoices
const (
	LOWEST WAFSensitivityChoices = "lowest"
	LOW WAFSensitivityChoices = "low"
	MEDIUM WAFSensitivityChoices = "medium"
	HIGH WAFSensitivityChoices = "high"
	HIGHEST WAFSensitivityChoices = "highest"
)

// All allowed values of WAFSensitivityChoices enum
var AllowedWAFSensitivityChoicesEnumValues = []WAFSensitivityChoices{
	"lowest",
	"low",
	"medium",
	"high",
	"highest",
}

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

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

// NewWAFSensitivityChoicesFromValue returns a pointer to a valid WAFSensitivityChoices
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewWAFSensitivityChoicesFromValue(v string) (*WAFSensitivityChoices, error) {
	ev := WAFSensitivityChoices(v)
	if ev.IsValid() {
		return &ev, nil
	} else {
		return nil, fmt.Errorf("invalid value '%v' for WAFSensitivityChoices: valid values are %v", v, AllowedWAFSensitivityChoicesEnumValues)
	}
}

// IsValid return true if the value is valid for the enum, false otherwise
func (v WAFSensitivityChoices) IsValid() bool {
	for _, existing := range AllowedWAFSensitivityChoicesEnumValues {
		if existing == v {
			return true
		}
	}
	return false
}

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

type NullableWAFSensitivityChoices struct {
	value *WAFSensitivityChoices
	isSet bool
}

func (v NullableWAFSensitivityChoices) Get() *WAFSensitivityChoices {
	return v.value
}

func (v *NullableWAFSensitivityChoices) Set(val *WAFSensitivityChoices) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableWAFSensitivityChoices(val *WAFSensitivityChoices) *NullableWAFSensitivityChoices {
	return &NullableWAFSensitivityChoices{value: val, isSet: true}
}

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

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

