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

const (
	FireboltFirebolt Firebolt = "firebolt"
)

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

type SourceFirebolt struct {
	// Firebolt account to login.
	Account string `json:"account"`
	// Firebolt service account ID.
	ClientID string `json:"client_id"`
	// Firebolt secret, corresponding to the service account ID.
	ClientSecret string `json:"client_secret"`
	// The database to connect to.
	Database string `json:"database"`
	// Engine name to connect to.
	Engine string `json:"engine"`
	// The host name of your Firebolt database.
	Host       *string  `json:"host,omitempty"`
	sourceType Firebolt `const:"firebolt" json:"sourceType"`
}

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

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

func (o *SourceFirebolt) GetAccount() string {
	if o == nil {
		return ""
	}
	return o.Account
}

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

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

func (o *SourceFirebolt) GetDatabase() string {
	if o == nil {
		return ""
	}
	return o.Database
}

func (o *SourceFirebolt) GetEngine() string {
	if o == nil {
		return ""
	}
	return o.Engine
}

func (o *SourceFirebolt) GetHost() *string {
	if o == nil {
		return nil
	}
	return o.Host
}

func (o *SourceFirebolt) GetSourceType() Firebolt {
	return FireboltFirebolt
}
