/*
Daytona Toolbox API

Daytona Toolbox API

API version: v0.0.0-dev
*/

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

package toolbox

import (
	"encoding/json"
)

// Status the model 'Status'
type Status string

// List of Status
const (
	STATUS_Unmodified Status = "Unmodified"
	STATUS_Untracked Status = "Untracked"
	STATUS_Modified Status = "Modified"
	STATUS_Added Status = "Added"
	STATUS_Deleted Status = "Deleted"
	STATUS_Renamed Status = "Renamed"
	STATUS_Copied Status = "Copied"
	STATUS_UpdatedButUnmerged Status = "Updated but unmerged"
	STATUS_UNKNOWN_DEFAULT_OPEN_API Status = "11184809"
)

// All allowed values of Status enum
var AllowedStatusEnumValues = []Status{
	"Unmodified",
	"Untracked",
	"Modified",
	"Added",
	"Deleted",
	"Renamed",
	"Copied",
	"Updated but unmerged",
	"11184809",
}

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

	*v = STATUS_UNKNOWN_DEFAULT_OPEN_API
	return nil
}

// NewStatusFromValue returns a pointer to a valid Status
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewStatusFromValue(v string) (*Status, error) {
	ev := Status(v)
	if ev.IsValid() {
		return &ev, nil
	} else {
		enumValue := STATUS_UNKNOWN_DEFAULT_OPEN_API
		return &enumValue, nil
	}
}

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

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

type NullableStatus struct {
	value *Status
	isSet bool
}

func (v NullableStatus) Get() *Status {
	return v.value
}

func (v *NullableStatus) Set(val *Status) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableStatus(val *Status) *NullableStatus {
	return &NullableStatus{value: val, isSet: true}
}

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

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

