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

const (
	JamfProJamfPro JamfPro = "jamf-pro"
)

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

type SourceJamfPro struct {
	Password *string `json:"password,omitempty"`
	// The unique subdomain for your Jamf Pro instance.
	Subdomain  string  `json:"subdomain"`
	Username   string  `json:"username"`
	sourceType JamfPro `const:"jamf-pro" json:"sourceType"`
}

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

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

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

func (o *SourceJamfPro) GetSubdomain() string {
	if o == nil {
		return ""
	}
	return o.Subdomain
}

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

func (o *SourceJamfPro) GetSourceType() JamfPro {
	return JamfProJamfPro
}
