/*
 * Container Registry service
 *
 * ## Overview Container Registry service enables IONOS clients to manage docker and OCI compliant registries for use by their managed Kubernetes clusters. Use a Container Registry to ensure you have a privately accessed registry to efficiently support image pulls. ## Changelog ### 1.1.0  - Added new endpoints for Repositories  - Added new endpoints for Artifacts  - Added new endpoints for Vulnerabilities  - Added registry vulnerabilityScanning feature ### 1.2.0 - Added registry `apiSubnetAllowList`
 *
 * API version: 1.2.0
 * Contact: support@cloud.ionos.com
 */

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

package ionoscloud

import (
	"encoding/json"
	"fmt"
)

// Day the model 'Day'
type Day string

// List of Day
const (
	DAY_MONDAY    Day = "Monday"
	DAY_TUESDAY   Day = "Tuesday"
	DAY_WEDNESDAY Day = "Wednesday"
	DAY_THURSDAY  Day = "Thursday"
	DAY_FRIDAY    Day = "Friday"
	DAY_SATURDAY  Day = "Saturday"
	DAY_SUNDAY    Day = "Sunday"
)

func (v *Day) UnmarshalJSON(src []byte) error {
	var value string
	err := json.Unmarshal(src, &value)
	if err != nil {
		return err
	}
	enumTypeValue := Day(value)
	for _, existing := range []Day{"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"} {
		if existing == enumTypeValue {
			*v = enumTypeValue
			return nil
		}
	}

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

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

type NullableDay struct {
	value *Day
	isSet bool
}

func (v NullableDay) Get() *Day {
	return v.value
}

func (v *NullableDay) Set(val *Day) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableDay(val *Day) *NullableDay {
	return &NullableDay{value: val, isSet: true}
}

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

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