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

const (
	HoorayhrHoorayhr Hoorayhr = "hoorayhr"
)

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

type SourceHoorayhr struct {
	Hoorayhrpassword string   `json:"hoorayhrpassword"`
	Hoorayhrusername string   `json:"hoorayhrusername"`
	sourceType       Hoorayhr `const:"hoorayhr" json:"sourceType"`
}

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

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

func (o *SourceHoorayhr) GetHoorayhrpassword() string {
	if o == nil {
		return ""
	}
	return o.Hoorayhrpassword
}

func (o *SourceHoorayhr) GetHoorayhrusername() string {
	if o == nil {
		return ""
	}
	return o.Hoorayhrusername
}

func (o *SourceHoorayhr) GetSourceType() Hoorayhr {
	return HoorayhrHoorayhr
}
