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

const (
	WaiteraidWaiteraid Waiteraid = "waiteraid"
)

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

type SourceWaiteraid struct {
	// Your WaiterAid API key, obtained from API request with Username and Password
	AuthHash string `json:"auth_hash"`
	// Your WaiterAid restaurant id from API request to getRestaurants
	Restid string `json:"restid"`
	// Start getting data from that date.
	StartDate  string    `json:"start_date"`
	sourceType Waiteraid `const:"waiteraid" json:"sourceType"`
}

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

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

func (o *SourceWaiteraid) GetAuthHash() string {
	if o == nil {
		return ""
	}
	return o.AuthHash
}

func (o *SourceWaiteraid) GetRestid() string {
	if o == nil {
		return ""
	}
	return o.Restid
}

func (o *SourceWaiteraid) GetStartDate() string {
	if o == nil {
		return ""
	}
	return o.StartDate
}

func (o *SourceWaiteraid) GetSourceType() Waiteraid {
	return WaiteraidWaiteraid
}
