// 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 SourceFreshcallerUpdate struct {
	// Freshcaller API Key. See the <a href="https://docs.airbyte.com/integrations/sources/freshcaller">docs</a> for more information on how to obtain this key.
	APIKey string `json:"api_key"`
	// Used to construct Base URL for the Freshcaller APIs
	Domain string `json:"domain"`
	// The number of requests per minute that this source allowed to use. There is a rate limit of 50 requests per minute per app per account.
	RequestsPerMinute *int64 `json:"requests_per_minute,omitempty"`
	// UTC date and time. Any data created after this date will be replicated.
	StartDate *time.Time `json:"start_date,omitempty"`
	// Lag in minutes for each sync, i.e., at time T, data for the time range [prev_sync_time, T-30] will be fetched
	SyncLagMinutes *int64 `json:"sync_lag_minutes,omitempty"`
}

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

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

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

func (o *SourceFreshcallerUpdate) GetDomain() string {
	if o == nil {
		return ""
	}
	return o.Domain
}

func (o *SourceFreshcallerUpdate) GetRequestsPerMinute() *int64 {
	if o == nil {
		return nil
	}
	return o.RequestsPerMinute
}

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

func (o *SourceFreshcallerUpdate) GetSyncLagMinutes() *int64 {
	if o == nil {
		return nil
	}
	return o.SyncLagMinutes
}
