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

const (
	SmartwaiverSmartwaiver Smartwaiver = "smartwaiver"
)

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

type SourceSmartwaiver struct {
	// You can retrieve your token by visiting your dashboard then click on My Account then click on API keys.
	APIKey     string      `json:"api_key"`
	StartDate  *string     `default:"2017-01-24 13:12:29" json:"start_date"`
	StartDate2 time.Time   `json:"start_date_2"`
	sourceType Smartwaiver `const:"smartwaiver" json:"sourceType"`
}

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

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

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

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

func (o *SourceSmartwaiver) GetStartDate2() time.Time {
	if o == nil {
		return time.Time{}
	}
	return o.StartDate2
}

func (o *SourceSmartwaiver) GetSourceType() Smartwaiver {
	return SmartwaiverSmartwaiver
}
