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

package shared

import (
	"encoding/json"
	"fmt"
	"github.com/airbytehq/terraform-provider-airbyte/internal/sdk/internal/utils"
	"time"
)

// SubtitleFormat - The subtitle format for transcript_subtitle stream
type SubtitleFormat string

const (
	SubtitleFormatVtt SubtitleFormat = "vtt"
	SubtitleFormatSrt SubtitleFormat = "srt"
)

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

type Assemblyai string

const (
	AssemblyaiAssemblyai Assemblyai = "assemblyai"
)

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

type SourceAssemblyai struct {
	// Your AssemblyAI API key. You can find it in the AssemblyAI dashboard at https://www.assemblyai.com/app/api-keys.
	APIKey string `json:"api_key"`
	// The request ID for LeMur responses
	RequestID *string   `json:"request_id,omitempty"`
	StartDate time.Time `json:"start_date"`
	// The subtitle format for transcript_subtitle stream
	SubtitleFormat *SubtitleFormat `default:"srt" json:"subtitle_format"`
	sourceType     Assemblyai      `const:"assemblyai" json:"sourceType"`
}

func (s SourceAssemblyai) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(s, "", false)
}

func (s *SourceAssemblyai) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil {
		return err
	}
	return nil
}

func (o *SourceAssemblyai) GetAPIKey() string {
	if o == nil {
		return ""
	}
	return o.APIKey
}

func (o *SourceAssemblyai) GetRequestID() *string {
	if o == nil {
		return nil
	}
	return o.RequestID
}

func (o *SourceAssemblyai) GetStartDate() time.Time {
	if o == nil {
		return time.Time{}
	}
	return o.StartDate
}

func (o *SourceAssemblyai) GetSubtitleFormat() *SubtitleFormat {
	if o == nil {
		return nil
	}
	return o.SubtitleFormat
}

func (o *SourceAssemblyai) GetSourceType() Assemblyai {
	return AssemblyaiAssemblyai
}
