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

const (
	FullstoryFullstory Fullstory = "fullstory"
)

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

type SourceFullstory struct {
	// API Key for the fullstory.com API.
	APIKey string `json:"api_key"`
	// User ID for the fullstory.com API.
	UID        string    `json:"uid"`
	sourceType Fullstory `const:"fullstory" json:"sourceType"`
}

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

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

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

func (o *SourceFullstory) GetUID() string {
	if o == nil {
		return ""
	}
	return o.UID
}

func (o *SourceFullstory) GetSourceType() Fullstory {
	return FullstoryFullstory
}
