// 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"
	"time"
)

type SourceNewsdataIoUpdate struct {
	APIKey string `json:"api_key"`
	// Search the news articles for a specific category. You can add up to 5 categories in a single query.
	Categories []any `json:"categories,omitempty"`
	// Search the news articles from a specific country. You can add up to 5 countries in a single query. Example: au, jp, br
	Countries []any `json:"countries,omitempty"`
	// Search the news articles for specific domains or news sources. You can add up to 5 domains in a single query.
	Domains []any `json:"domains,omitempty"`
	// Choose an end date. Now UTC is default value
	EndDate *types.Date `json:"end_date,omitempty"`
	// Search the news articles for a specific language. You can add up to 5 languages in a single query.
	Languages []any `json:"languages,omitempty"`
	// Search news articles for specific keywords or phrases present in the news title, content, URL, meta keywords and meta description.
	SearchQuery *string   `json:"search_query,omitempty"`
	StartDate   time.Time `json:"start_date"`
}

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

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

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

func (o *SourceNewsdataIoUpdate) GetCategories() []any {
	if o == nil {
		return nil
	}
	return o.Categories
}

func (o *SourceNewsdataIoUpdate) GetCountries() []any {
	if o == nil {
		return nil
	}
	return o.Countries
}

func (o *SourceNewsdataIoUpdate) GetDomains() []any {
	if o == nil {
		return nil
	}
	return o.Domains
}

func (o *SourceNewsdataIoUpdate) GetEndDate() *types.Date {
	if o == nil {
		return nil
	}
	return o.EndDate
}

func (o *SourceNewsdataIoUpdate) GetLanguages() []any {
	if o == nil {
		return nil
	}
	return o.Languages
}

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

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