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

const (
	EventzillaEventzilla Eventzilla = "eventzilla"
)

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

type SourceEventzilla struct {
	// API key to use. Generate it by creating a new application within your Eventzilla account settings under Settings > App Management.
	XAPIKey    string     `json:"x-api-key"`
	sourceType Eventzilla `const:"eventzilla" json:"sourceType"`
}

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

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

func (o *SourceEventzilla) GetXAPIKey() string {
	if o == nil {
		return ""
	}
	return o.XAPIKey
}

func (o *SourceEventzilla) GetSourceType() Eventzilla {
	return EventzillaEventzilla
}
