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

package shared

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

type Shutterstock string

const (
	ShutterstockShutterstock Shutterstock = "shutterstock"
)

func (e Shutterstock) ToPointer() *Shutterstock {
	return &e
}
func (e *Shutterstock) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "shutterstock":
		*e = Shutterstock(v)
		return nil
	default:
		return fmt.Errorf("invalid value for Shutterstock: %v", v)
	}
}

type SourceShutterstock struct {
	// Your OAuth 2.0 token for accessing the Shutterstock API. Obtain this token from your Shutterstock developer account.
	APIToken string `json:"api_token"`
	// The query for image search
	QueryForAudioSearch *string `default:"mountain" json:"query_for_audio_search"`
	// The query for catalog search
	QueryForCatalogSearch *string `default:"mountain" json:"query_for_catalog_search"`
	// The query for image search
	QueryForImageSearch *string `default:"mountain" json:"query_for_image_search"`
	// The Query for `videos_search` stream
	QueryForVideoSearch *string      `default:"mountain" json:"query_for_video_search"`
	StartDate           time.Time    `json:"start_date"`
	sourceType          Shutterstock `const:"shutterstock" json:"sourceType"`
}

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

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

func (o *SourceShutterstock) GetAPIToken() string {
	if o == nil {
		return ""
	}
	return o.APIToken
}

func (o *SourceShutterstock) GetQueryForAudioSearch() *string {
	if o == nil {
		return nil
	}
	return o.QueryForAudioSearch
}

func (o *SourceShutterstock) GetQueryForCatalogSearch() *string {
	if o == nil {
		return nil
	}
	return o.QueryForCatalogSearch
}

func (o *SourceShutterstock) GetQueryForImageSearch() *string {
	if o == nil {
		return nil
	}
	return o.QueryForImageSearch
}

func (o *SourceShutterstock) GetQueryForVideoSearch() *string {
	if o == nil {
		return nil
	}
	return o.QueryForVideoSearch
}

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

func (o *SourceShutterstock) GetSourceType() Shutterstock {
	return ShutterstockShutterstock
}
