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

type ThinkificCourses string

const (
	ThinkificCoursesThinkificCourses ThinkificCourses = "thinkific-courses"
)

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

type SourceThinkificCourses struct {
	XAuthSubdomain string           `json:"X-Auth-Subdomain"`
	APIKey         string           `json:"api_key"`
	sourceType     ThinkificCourses `const:"thinkific-courses" json:"sourceType"`
}

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

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

func (o *SourceThinkificCourses) GetXAuthSubdomain() string {
	if o == nil {
		return ""
	}
	return o.XAuthSubdomain
}

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

func (o *SourceThinkificCourses) GetSourceType() ThinkificCourses {
	return ThinkificCoursesThinkificCourses
}
