// 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 Teamtailor string

const (
	TeamtailorTeamtailor Teamtailor = "teamtailor"
)

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

type SourceTeamtailor struct {
	API string `json:"api"`
	// The version of the API
	XAPIVersion string     `json:"x_api_version"`
	sourceType  Teamtailor `const:"teamtailor" json:"sourceType"`
}

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

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

func (o *SourceTeamtailor) GetAPI() string {
	if o == nil {
		return ""
	}
	return o.API
}

func (o *SourceTeamtailor) GetXAPIVersion() string {
	if o == nil {
		return ""
	}
	return o.XAPIVersion
}

func (o *SourceTeamtailor) GetSourceType() Teamtailor {
	return TeamtailorTeamtailor
}
