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

package components

import (
	"encoding/json"
	"fmt"
)

type AdvancedSubtitles string

const (
	AdvancedSubtitlesBurn    AdvancedSubtitles = "burn"
	AdvancedSubtitlesText    AdvancedSubtitles = "text"
	AdvancedSubtitlesUnknown AdvancedSubtitles = "unknown"
)

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