// Code generated by github.com/atombender/go-jsonschema, DO NOT EDIT.

package test

import "encoding/json"
import "fmt"
import yaml "gopkg.in/yaml.v3"
import "reflect"

type License string

const LicenseGPL30 License = "GPL-3.0"
const LicenseMIT License = "MIT"
const LicenseWildcard License = "*"

type License_1 string

const License_1_GPL30 License_1 = "GPL-3.0+"
const License_1_MIT License_1 = "MIT+"
const License_1_Wildcard License_1 = "*"

var enumValues_License_1 = []interface{}{
	"GPL-3.0+",
	"MIT+",
	"*",
}

// UnmarshalJSON implements json.Unmarshaler.
func (j *License_1) UnmarshalJSON(value []byte) error {
	var v string
	if err := json.Unmarshal(value, &v); err != nil {
		return err
	}
	var ok bool
	for _, expected := range enumValues_License_1 {
		if reflect.DeepEqual(v, expected) {
			ok = true
			break
		}
	}
	if !ok {
		return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_License_1, v)
	}
	*j = License_1(v)
	return nil
}

// UnmarshalYAML implements yaml.Unmarshaler.
func (j *License_1) UnmarshalYAML(value *yaml.Node) error {
	var v string
	if err := value.Decode(&v); err != nil {
		return err
	}
	var ok bool
	for _, expected := range enumValues_License_1 {
		if reflect.DeepEqual(v, expected) {
			ok = true
			break
		}
	}
	if !ok {
		return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_License_1, v)
	}
	*j = License_1(v)
	return nil
}

var enumValues_License = []interface{}{
	"GPL-3.0",
	"MIT",
	"*",
}

// UnmarshalYAML implements yaml.Unmarshaler.
func (j *License) UnmarshalYAML(value *yaml.Node) error {
	var v string
	if err := value.Decode(&v); err != nil {
		return err
	}
	var ok bool
	for _, expected := range enumValues_License {
		if reflect.DeepEqual(v, expected) {
			ok = true
			break
		}
	}
	if !ok {
		return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_License, v)
	}
	*j = License(v)
	return nil
}

// UnmarshalJSON implements json.Unmarshaler.
func (j *License) UnmarshalJSON(value []byte) error {
	var v string
	if err := json.Unmarshal(value, &v); err != nil {
		return err
	}
	var ok bool
	for _, expected := range enumValues_License {
		if reflect.DeepEqual(v, expected) {
			ok = true
			break
		}
	}
	if !ok {
		return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_License, v)
	}
	*j = License(v)
	return nil
}

type SpecialCharacters struct {
	// PlainLicenses corresponds to the JSON schema field "plainLicenses".
	PlainLicenses *SpecialCharactersPlainLicenses `json:"plainLicenses,omitempty,omitzero" yaml:"plainLicenses,omitempty" mapstructure:"plainLicenses,omitempty"`

	// PlainLicensesRef corresponds to the JSON schema field "plainLicensesRef".
	PlainLicensesRef []License `json:"plainLicensesRef,omitempty,omitzero" yaml:"plainLicensesRef,omitempty" mapstructure:"plainLicensesRef,omitempty"`

	// PlusLicenses corresponds to the JSON schema field "plusLicenses".
	PlusLicenses *SpecialCharactersPlusLicenses `json:"plusLicenses,omitempty,omitzero" yaml:"plusLicenses,omitempty" mapstructure:"plusLicenses,omitempty"`

	// PlusLicensesRef corresponds to the JSON schema field "plusLicensesRef".
	PlusLicensesRef []License_1 `json:"plusLicensesRef,omitempty,omitzero" yaml:"plusLicensesRef,omitempty" mapstructure:"plusLicensesRef,omitempty"`
}

type SpecialCharactersPlainLicenses string

const SpecialCharactersPlainLicensesGPL30 SpecialCharactersPlainLicenses = "GPL-3.0"
const SpecialCharactersPlainLicensesMIT SpecialCharactersPlainLicenses = "MIT"
const SpecialCharactersPlainLicensesWildcard SpecialCharactersPlainLicenses = "*"

var enumValues_SpecialCharactersPlainLicenses = []interface{}{
	"GPL-3.0",
	"MIT",
	"*",
}

// UnmarshalJSON implements json.Unmarshaler.
func (j *SpecialCharactersPlainLicenses) UnmarshalJSON(value []byte) error {
	var v string
	if err := json.Unmarshal(value, &v); err != nil {
		return err
	}
	var ok bool
	for _, expected := range enumValues_SpecialCharactersPlainLicenses {
		if reflect.DeepEqual(v, expected) {
			ok = true
			break
		}
	}
	if !ok {
		return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_SpecialCharactersPlainLicenses, v)
	}
	*j = SpecialCharactersPlainLicenses(v)
	return nil
}

// UnmarshalYAML implements yaml.Unmarshaler.
func (j *SpecialCharactersPlainLicenses) UnmarshalYAML(value *yaml.Node) error {
	var v string
	if err := value.Decode(&v); err != nil {
		return err
	}
	var ok bool
	for _, expected := range enumValues_SpecialCharactersPlainLicenses {
		if reflect.DeepEqual(v, expected) {
			ok = true
			break
		}
	}
	if !ok {
		return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_SpecialCharactersPlainLicenses, v)
	}
	*j = SpecialCharactersPlainLicenses(v)
	return nil
}

type SpecialCharactersPlusLicenses string

const SpecialCharactersPlusLicensesGPL30 SpecialCharactersPlusLicenses = "GPL-3.0+"
const SpecialCharactersPlusLicensesMIT SpecialCharactersPlusLicenses = "MIT+"
const SpecialCharactersPlusLicensesWildcard SpecialCharactersPlusLicenses = "*"

var enumValues_SpecialCharactersPlusLicenses = []interface{}{
	"GPL-3.0+",
	"MIT+",
	"*",
}

// UnmarshalYAML implements yaml.Unmarshaler.
func (j *SpecialCharactersPlusLicenses) UnmarshalYAML(value *yaml.Node) error {
	var v string
	if err := value.Decode(&v); err != nil {
		return err
	}
	var ok bool
	for _, expected := range enumValues_SpecialCharactersPlusLicenses {
		if reflect.DeepEqual(v, expected) {
			ok = true
			break
		}
	}
	if !ok {
		return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_SpecialCharactersPlusLicenses, v)
	}
	*j = SpecialCharactersPlusLicenses(v)
	return nil
}

// UnmarshalJSON implements json.Unmarshaler.
func (j *SpecialCharactersPlusLicenses) UnmarshalJSON(value []byte) error {
	var v string
	if err := json.Unmarshal(value, &v); err != nil {
		return err
	}
	var ok bool
	for _, expected := range enumValues_SpecialCharactersPlusLicenses {
		if reflect.DeepEqual(v, expected) {
			ok = true
			break
		}
	}
	if !ok {
		return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_SpecialCharactersPlusLicenses, v)
	}
	*j = SpecialCharactersPlusLicenses(v)
	return nil
}
