// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.

package shared

import (
	"encoding/json"
	"fmt"
)

// NamespaceDefinitionEnumNoDefault - Define the location where the data will be stored in the destination
type NamespaceDefinitionEnumNoDefault string

const (
	NamespaceDefinitionEnumNoDefaultSource       NamespaceDefinitionEnumNoDefault = "source"
	NamespaceDefinitionEnumNoDefaultDestination  NamespaceDefinitionEnumNoDefault = "destination"
	NamespaceDefinitionEnumNoDefaultCustomFormat NamespaceDefinitionEnumNoDefault = "custom_format"
)

func (e NamespaceDefinitionEnumNoDefault) ToPointer() *NamespaceDefinitionEnumNoDefault {
	return &e
}
func (e *NamespaceDefinitionEnumNoDefault) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "source":
		fallthrough
	case "destination":
		fallthrough
	case "custom_format":
		*e = NamespaceDefinitionEnumNoDefault(v)
		return nil
	default:
		return fmt.Errorf("invalid value for NamespaceDefinitionEnumNoDefault: %v", v)
	}
}
