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

const (
	WufooWufoo Wufoo = "wufoo"
)

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

type SourceWufoo struct {
	// Your Wufoo API Key. You can find it by logging into your Wufoo account, selecting 'API Information' from the 'More' dropdown on any form, and locating the 16-digit code.
	APIKey string `json:"api_key"`
	// Your account subdomain/username for Wufoo.
	Subdomain  string `json:"subdomain"`
	sourceType Wufoo  `const:"wufoo" json:"sourceType"`
}

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

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

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

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

func (o *SourceWufoo) GetSourceType() Wufoo {
	return WufooWufoo
}
