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

const (
	DbtDbt Dbt = "dbt"
)

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

type SourceDbt struct {
	AccountID  string `json:"account_id"`
	APIKey2    string `json:"api_key_2"`
	sourceType Dbt    `const:"dbt" json:"sourceType"`
}

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

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

func (o *SourceDbt) GetAccountID() string {
	if o == nil {
		return ""
	}
	return o.AccountID
}

func (o *SourceDbt) GetAPIKey2() string {
	if o == nil {
		return ""
	}
	return o.APIKey2
}

func (o *SourceDbt) GetSourceType() Dbt {
	return DbtDbt
}
