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

const (
	EmploymentHeroEmploymentHero EmploymentHero = "employment-hero"
)

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

type SourceEmploymentHero struct {
	APIKey string `json:"api_key"`
	// Employees IDs in the given organisation found in `employees` stream for passing to sub-streams
	EmployeesConfigids []any `json:"employees_configids,omitempty"`
	// Organization ID which could be found as result of `organizations` stream to be used in other substreams
	OrganizationConfigids []any          `json:"organization_configids,omitempty"`
	sourceType            EmploymentHero `const:"employment-hero" json:"sourceType"`
}

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

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

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

func (o *SourceEmploymentHero) GetEmployeesConfigids() []any {
	if o == nil {
		return nil
	}
	return o.EmployeesConfigids
}

func (o *SourceEmploymentHero) GetOrganizationConfigids() []any {
	if o == nil {
		return nil
	}
	return o.OrganizationConfigids
}

func (o *SourceEmploymentHero) GetSourceType() EmploymentHero {
	return EmploymentHeroEmploymentHero
}
