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

package components

import (
	"encoding/json"
	"fmt"
)

type Subtitles string

const (
	SubtitlesAuto      Subtitles = "auto"
	SubtitlesBurn      Subtitles = "burn"
	SubtitlesNone      Subtitles = "none"
	SubtitlesSidecar   Subtitles = "sidecar"
	SubtitlesEmbedded  Subtitles = "embedded"
	SubtitlesSegmented Subtitles = "segmented"
	SubtitlesUnknown   Subtitles = "unknown"
)

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