// 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"
	"time"
)

type BunnyInc string

const (
	BunnyIncBunnyInc BunnyInc = "bunny-inc"
)

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

type SourceBunnyInc struct {
	Apikey    string     `json:"apikey"`
	StartDate *time.Time `json:"start_date,omitempty"`
	// The subdomain specific to your Bunny account or service.
	Subdomain  string   `json:"subdomain"`
	sourceType BunnyInc `const:"bunny-inc" json:"sourceType"`
}

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

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

func (o *SourceBunnyInc) GetApikey() string {
	if o == nil {
		return ""
	}
	return o.Apikey
}

func (o *SourceBunnyInc) GetStartDate() *time.Time {
	if o == nil {
		return nil
	}
	return o.StartDate
}

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

func (o *SourceBunnyInc) GetSourceType() BunnyInc {
	return BunnyIncBunnyInc
}
