// 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"
	"time"
)

type Finnworlds string

const (
	FinnworldsFinnworlds Finnworlds = "finnworlds"
)

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

type SourceFinnworlds struct {
	// For example 10y, 5y, 2y...
	BondType []any `json:"bond_type,omitempty"`
	// Options Available: beef, cheese, oil, ...
	Commodities []any `json:"commodities,omitempty"`
	// brazil, united states, italia, japan
	Countries []any  `json:"countries,omitempty"`
	Key       string `json:"key"`
	// Choose isin, ticker, reg_lei or cik
	List                  *string   `default:"ticker" json:"list"`
	ListCountriesForBonds *string   `default:"country" json:"list_countries_for_bonds"`
	StartDate             time.Time `json:"start_date"`
	// AAPL, T, MU, GOOG
	Tickers    []any      `json:"tickers,omitempty"`
	sourceType Finnworlds `const:"finnworlds" json:"sourceType"`
}

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

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

func (o *SourceFinnworlds) GetBondType() []any {
	if o == nil {
		return nil
	}
	return o.BondType
}

func (o *SourceFinnworlds) GetCommodities() []any {
	if o == nil {
		return nil
	}
	return o.Commodities
}

func (o *SourceFinnworlds) GetCountries() []any {
	if o == nil {
		return nil
	}
	return o.Countries
}

func (o *SourceFinnworlds) GetKey() string {
	if o == nil {
		return ""
	}
	return o.Key
}

func (o *SourceFinnworlds) GetList() *string {
	if o == nil {
		return nil
	}
	return o.List
}

func (o *SourceFinnworlds) GetListCountriesForBonds() *string {
	if o == nil {
		return nil
	}
	return o.ListCountriesForBonds
}

func (o *SourceFinnworlds) GetStartDate() time.Time {
	if o == nil {
		return time.Time{}
	}
	return o.StartDate
}

func (o *SourceFinnworlds) GetTickers() []any {
	if o == nil {
		return nil
	}
	return o.Tickers
}

func (o *SourceFinnworlds) GetSourceType() Finnworlds {
	return FinnworldsFinnworlds
}
