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

type GoogleForms string

const (
	GoogleFormsGoogleForms GoogleForms = "google-forms"
)

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

type SourceGoogleForms struct {
	ClientID           string      `json:"client_id"`
	ClientRefreshToken string      `json:"client_refresh_token"`
	ClientSecret       string      `json:"client_secret"`
	FormID             []any       `json:"form_id"`
	sourceType         GoogleForms `const:"google-forms" json:"sourceType"`
}

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

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

func (o *SourceGoogleForms) GetClientID() string {
	if o == nil {
		return ""
	}
	return o.ClientID
}

func (o *SourceGoogleForms) GetClientRefreshToken() string {
	if o == nil {
		return ""
	}
	return o.ClientRefreshToken
}

func (o *SourceGoogleForms) GetClientSecret() string {
	if o == nil {
		return ""
	}
	return o.ClientSecret
}

func (o *SourceGoogleForms) GetFormID() []any {
	if o == nil {
		return []any{}
	}
	return o.FormID
}

func (o *SourceGoogleForms) GetSourceType() GoogleForms {
	return GoogleFormsGoogleForms
}
