// 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"
)

type Mux string

const (
	MuxMux Mux = "mux"
)

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

type SourceMux struct {
	Password *string `json:"password,omitempty"`
	// The playback id for your video asset shown in website details
	PlaybackID *string   `json:"playback_id,omitempty"`
	StartDate  time.Time `json:"start_date"`
	Username   string    `json:"username"`
	sourceType Mux       `const:"mux" json:"sourceType"`
}

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

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

func (o *SourceMux) GetPassword() *string {
	if o == nil {
		return nil
	}
	return o.Password
}

func (o *SourceMux) GetPlaybackID() *string {
	if o == nil {
		return nil
	}
	return o.PlaybackID
}

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

func (o *SourceMux) GetUsername() string {
	if o == nil {
		return ""
	}
	return o.Username
}

func (o *SourceMux) GetSourceType() Mux {
	return MuxMux
}
