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

const (
	HardcodedRecordsHardcodedRecords HardcodedRecords = "hardcoded-records"
)

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

type SourceHardcodedRecords struct {
	// How many records per stream should be generated
	Count      *int64           `default:"1000" json:"count"`
	sourceType HardcodedRecords `const:"hardcoded-records" json:"sourceType"`
}

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

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

func (o *SourceHardcodedRecords) GetCount() *int64 {
	if o == nil {
		return nil
	}
	return o.Count
}

func (o *SourceHardcodedRecords) GetSourceType() HardcodedRecords {
	return HardcodedRecordsHardcodedRecords
}
