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

package shared

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

type SourceRechargeUpdate struct {
	// The value of the Access Token generated. See the <a href="https://docs.airbyte.com/integrations/sources/recharge">docs</a> for more information.
	AccessToken string `json:"access_token"`
	// Specifies how many days of historical data should be reloaded each time the recharge connector runs.
	LookbackWindowDays *int64 `default:"0" json:"lookback_window_days"`
	// The date from which you'd like to replicate data for Recharge API, in the format YYYY-MM-DDT00:00:00Z. Any data before this date will not be replicated.
	StartDate time.Time `json:"start_date"`
	// Define whether or not the `Orders` stream should use the deprecated `2021-01` API version, or use `2021-11`, otherwise.
	UseOrdersDeprecatedAPI *bool `default:"true" json:"use_orders_deprecated_api"`
}

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

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

func (o *SourceRechargeUpdate) GetAccessToken() string {
	if o == nil {
		return ""
	}
	return o.AccessToken
}

func (o *SourceRechargeUpdate) GetLookbackWindowDays() *int64 {
	if o == nil {
		return nil
	}
	return o.LookbackWindowDays
}

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

func (o *SourceRechargeUpdate) GetUseOrdersDeprecatedAPI() *bool {
	if o == nil {
		return nil
	}
	return o.UseOrdersDeprecatedAPI
}
