// 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 SourceAlgoliaUpdate struct {
	APIKey string `json:"api_key"`
	// The application ID for your application found in settings
	ApplicationID string `json:"application_id"`
	// Object ID within index for search queries
	ObjectID *string `default:"ecommerce-sample-data-9999996" json:"object_id"`
	// Search query to be used with indexes_query stream with format defined in `https://www.algolia.com/doc/rest-api/search/#tag/Search/operation/searchSingleIndex`
	SearchQuery *string   `default:"hitsPerPage=2&getRankingInfo=1" json:"search_query"`
	StartDate   time.Time `json:"start_date"`
}

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

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

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

func (o *SourceAlgoliaUpdate) GetApplicationID() string {
	if o == nil {
		return ""
	}
	return o.ApplicationID
}

func (o *SourceAlgoliaUpdate) GetObjectID() *string {
	if o == nil {
		return nil
	}
	return o.ObjectID
}

func (o *SourceAlgoliaUpdate) GetSearchQuery() *string {
	if o == nil {
		return nil
	}
	return o.SearchQuery
}

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