// 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 Giphy string

const (
	GiphyGiphy Giphy = "giphy"
)

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

type SourceGiphy struct {
	// Your GIPHY API Key. You can create and find your API key in the GIPHY Developer Dashboard at https://developers.giphy.com/dashboard/.
	APIKey string `json:"api_key"`
	// A query for search endpoint
	Query *string `default:"foo" json:"query"`
	// Query for clips search endpoint
	QueryForClips *string `default:"foo" json:"query_for_clips"`
	// Query for gif search endpoint
	QueryForGif *string `default:"foo" json:"query_for_gif"`
	// Query for stickers search endpoint
	QueryForStickers *string   `default:"foo" json:"query_for_stickers"`
	StartDate        time.Time `json:"start_date"`
	sourceType       Giphy     `const:"giphy" json:"sourceType"`
}

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

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

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

func (o *SourceGiphy) GetQuery() *string {
	if o == nil {
		return nil
	}
	return o.Query
}

func (o *SourceGiphy) GetQueryForClips() *string {
	if o == nil {
		return nil
	}
	return o.QueryForClips
}

func (o *SourceGiphy) GetQueryForGif() *string {
	if o == nil {
		return nil
	}
	return o.QueryForGif
}

func (o *SourceGiphy) GetQueryForStickers() *string {
	if o == nil {
		return nil
	}
	return o.QueryForStickers
}

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

func (o *SourceGiphy) GetSourceType() Giphy {
	return GiphyGiphy
}
