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

const (
	PrimetricPrimetric Primetric = "primetric"
)

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

type SourcePrimetric struct {
	// The Client ID of your Primetric developer application. The Client ID is visible <a href=\"https://app.primetric.com/administrator/integrations">here</a>.
	ClientID string `json:"client_id"`
	// The Client Secret of your Primetric developer application. You can manage your client's credentials <a href=\"https://app.primetric.com/administrator/integrations">here</a>.
	ClientSecret string    `json:"client_secret"`
	sourceType   Primetric `const:"primetric" json:"sourceType"`
}

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

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

func (o *SourcePrimetric) GetClientID() string {
	if o == nil {
		return ""
	}
	return o.ClientID
}

func (o *SourcePrimetric) GetClientSecret() string {
	if o == nil {
		return ""
	}
	return o.ClientSecret
}

func (o *SourcePrimetric) GetSourceType() Primetric {
	return PrimetricPrimetric
}
