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

const (
	ShortioShortio Shortio = "shortio"
)

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

type SourceShortio struct {
	DomainID string `json:"domain_id"`
	// Short.io Secret Key
	SecretKey string `json:"secret_key"`
	// UTC date and time in the format 2017-01-25T00:00:00Z. Any data before this date will not be replicated.
	StartDate  string  `json:"start_date"`
	sourceType Shortio `const:"shortio" json:"sourceType"`
}

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

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

func (o *SourceShortio) GetDomainID() string {
	if o == nil {
		return ""
	}
	return o.DomainID
}

func (o *SourceShortio) GetSecretKey() string {
	if o == nil {
		return ""
	}
	return o.SecretKey
}

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

func (o *SourceShortio) GetSourceType() Shortio {
	return ShortioShortio
}
