// 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 SourceAwinAdvertiserUpdate struct {
	// Your Awin Advertiser ID. You can find this in your Awin dashboard or account settings.
	AdvertiserID string `json:"advertiserId"`
	// Your Awin API key. Generate this from your Awin account under API Credentials.
	APIKey string `json:"api_key"`
	// Number of days to look back on each sync to catch any updates to existing records.
	LookbackDays int64 `json:"lookback_days"`
	// Start date for data replication in YYYY-MM-DD format
	StartDate types.Date `json:"start_date"`
	// The time window size for each API request in ISO8601 duration format.
	// For the campaign performance stream, Awin API explicitly limits the period between startDate and endDate to 400 days maximum.
	//
	StepIncrement *string `default:"P400D" json:"step_increment"`
}

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

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

func (o *SourceAwinAdvertiserUpdate) GetAdvertiserID() string {
	if o == nil {
		return ""
	}
	return o.AdvertiserID
}

func (o *SourceAwinAdvertiserUpdate) GetAPIKey() string {
	if o == nil {
		return ""
	}
	return o.APIKey
}

func (o *SourceAwinAdvertiserUpdate) GetLookbackDays() int64 {
	if o == nil {
		return 0
	}
	return o.LookbackDays
}

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

func (o *SourceAwinAdvertiserUpdate) GetStepIncrement() *string {
	if o == nil {
		return nil
	}
	return o.StepIncrement
}
