// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.

package shared

import (
	"github.com/airbytehq/terraform-provider-airbyte/internal/sdk/internal/utils"
	"github.com/airbytehq/terraform-provider-airbyte/internal/sdk/types"
)

type SourceExchangeRatesUpdate struct {
	// Your API Key. See <a href="https://apilayer.com/marketplace/exchangerates_data-api">here</a>. The key is case sensitive.
	AccessKey string `json:"access_key"`
	// ISO reference currency. See <a href="https://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exchange_rates/html/index.en.html">here</a>. Free plan doesn't support Source Currency Switching, default base currency is EUR
	Base *string `json:"base,omitempty"`
	// Ignore weekends? (Exchanges don't run on weekends)
	IgnoreWeekends *bool `default:"true" json:"ignore_weekends"`
	// Start getting data from that date.
	StartDate types.Date `json:"start_date"`
}

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

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

func (o *SourceExchangeRatesUpdate) GetAccessKey() string {
	if o == nil {
		return ""
	}
	return o.AccessKey
}

func (o *SourceExchangeRatesUpdate) GetBase() *string {
	if o == nil {
		return nil
	}
	return o.Base
}

func (o *SourceExchangeRatesUpdate) GetIgnoreWeekends() *bool {
	if o == nil {
		return nil
	}
	return o.IgnoreWeekends
}

func (o *SourceExchangeRatesUpdate) GetStartDate() types.Date {
	if o == nil {
		return types.Date{}
	}
	return o.StartDate
}
