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

package shared

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

type DestinationWeaviateUpdateSchemasEmbeddingEmbedding7Mode string

const (
	DestinationWeaviateUpdateSchemasEmbeddingEmbedding7ModeOpenaiCompatible DestinationWeaviateUpdateSchemasEmbeddingEmbedding7Mode = "openai_compatible"
)

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

// DestinationWeaviateUpdateOpenAICompatible - Use a service that's compatible with the OpenAI API to embed text.
type DestinationWeaviateUpdateOpenAICompatible struct {
	APIKey *string `default:"" json:"api_key"`
	// The base URL for your OpenAI-compatible service
	BaseURL string `json:"base_url"`
	// The number of dimensions the embedding model is generating
	Dimensions int64                                                    `json:"dimensions"`
	mode       *DestinationWeaviateUpdateSchemasEmbeddingEmbedding7Mode `const:"openai_compatible" json:"mode"`
	// The name of the model to use for embedding
	ModelName *string `default:"text-embedding-ada-002" json:"model_name"`
}

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

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

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

func (o *DestinationWeaviateUpdateOpenAICompatible) GetBaseURL() string {
	if o == nil {
		return ""
	}
	return o.BaseURL
}

func (o *DestinationWeaviateUpdateOpenAICompatible) GetDimensions() int64 {
	if o == nil {
		return 0
	}
	return o.Dimensions
}

func (o *DestinationWeaviateUpdateOpenAICompatible) GetMode() *DestinationWeaviateUpdateSchemasEmbeddingEmbedding7Mode {
	return DestinationWeaviateUpdateSchemasEmbeddingEmbedding7ModeOpenaiCompatible.ToPointer()
}

func (o *DestinationWeaviateUpdateOpenAICompatible) GetModelName() *string {
	if o == nil {
		return nil
	}
	return o.ModelName
}

type DestinationWeaviateUpdateSchemasEmbeddingEmbedding6Mode string

const (
	DestinationWeaviateUpdateSchemasEmbeddingEmbedding6ModeFake DestinationWeaviateUpdateSchemasEmbeddingEmbedding6Mode = "fake"
)

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

// DestinationWeaviateUpdateFake - Use a fake embedding made out of random vectors with 1536 embedding dimensions. This is useful for testing the data pipeline without incurring any costs.
type DestinationWeaviateUpdateFake struct {
	mode *DestinationWeaviateUpdateSchemasEmbeddingEmbedding6Mode `const:"fake" json:"mode"`
}

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

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

func (o *DestinationWeaviateUpdateFake) GetMode() *DestinationWeaviateUpdateSchemasEmbeddingEmbedding6Mode {
	return DestinationWeaviateUpdateSchemasEmbeddingEmbedding6ModeFake.ToPointer()
}

type DestinationWeaviateUpdateSchemasEmbeddingEmbedding5Mode string

const (
	DestinationWeaviateUpdateSchemasEmbeddingEmbedding5ModeFromField DestinationWeaviateUpdateSchemasEmbeddingEmbedding5Mode = "from_field"
)

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

// DestinationWeaviateUpdateFromField - Use a field in the record as the embedding. This is useful if you already have an embedding for your data and want to store it in the vector store.
type DestinationWeaviateUpdateFromField struct {
	// The number of dimensions the embedding model is generating
	Dimensions int64 `json:"dimensions"`
	// Name of the field in the record that contains the embedding
	FieldName string                                                   `json:"field_name"`
	mode      *DestinationWeaviateUpdateSchemasEmbeddingEmbedding5Mode `const:"from_field" json:"mode"`
}

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

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

func (o *DestinationWeaviateUpdateFromField) GetDimensions() int64 {
	if o == nil {
		return 0
	}
	return o.Dimensions
}

func (o *DestinationWeaviateUpdateFromField) GetFieldName() string {
	if o == nil {
		return ""
	}
	return o.FieldName
}

func (o *DestinationWeaviateUpdateFromField) GetMode() *DestinationWeaviateUpdateSchemasEmbeddingEmbedding5Mode {
	return DestinationWeaviateUpdateSchemasEmbeddingEmbedding5ModeFromField.ToPointer()
}

type DestinationWeaviateUpdateSchemasEmbeddingEmbeddingMode string

const (
	DestinationWeaviateUpdateSchemasEmbeddingEmbeddingModeCohere DestinationWeaviateUpdateSchemasEmbeddingEmbeddingMode = "cohere"
)

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

// DestinationWeaviateUpdateCohere - Use the Cohere API to embed text.
type DestinationWeaviateUpdateCohere struct {
	CohereKey string                                                  `json:"cohere_key"`
	mode      *DestinationWeaviateUpdateSchemasEmbeddingEmbeddingMode `const:"cohere" json:"mode"`
}

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

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

func (o *DestinationWeaviateUpdateCohere) GetCohereKey() string {
	if o == nil {
		return ""
	}
	return o.CohereKey
}

func (o *DestinationWeaviateUpdateCohere) GetMode() *DestinationWeaviateUpdateSchemasEmbeddingEmbeddingMode {
	return DestinationWeaviateUpdateSchemasEmbeddingEmbeddingModeCohere.ToPointer()
}

type DestinationWeaviateUpdateSchemasEmbeddingMode string

const (
	DestinationWeaviateUpdateSchemasEmbeddingModeOpenai DestinationWeaviateUpdateSchemasEmbeddingMode = "openai"
)

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

// DestinationWeaviateUpdateOpenAI - Use the OpenAI API to embed text. This option is using the text-embedding-ada-002 model with 1536 embedding dimensions.
type DestinationWeaviateUpdateOpenAI struct {
	mode      *DestinationWeaviateUpdateSchemasEmbeddingMode `const:"openai" json:"mode"`
	OpenaiKey string                                         `json:"openai_key"`
}

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

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

func (o *DestinationWeaviateUpdateOpenAI) GetMode() *DestinationWeaviateUpdateSchemasEmbeddingMode {
	return DestinationWeaviateUpdateSchemasEmbeddingModeOpenai.ToPointer()
}

func (o *DestinationWeaviateUpdateOpenAI) GetOpenaiKey() string {
	if o == nil {
		return ""
	}
	return o.OpenaiKey
}

type DestinationWeaviateUpdateSchemasMode string

const (
	DestinationWeaviateUpdateSchemasModeAzureOpenai DestinationWeaviateUpdateSchemasMode = "azure_openai"
)

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

// DestinationWeaviateUpdateAzureOpenAI - Use the Azure-hosted OpenAI API to embed text. This option is using the text-embedding-ada-002 model with 1536 embedding dimensions.
type DestinationWeaviateUpdateAzureOpenAI struct {
	// The base URL for your Azure OpenAI resource.  You can find this in the Azure portal under your Azure OpenAI resource
	APIBase string `json:"api_base"`
	// The deployment for your Azure OpenAI resource.  You can find this in the Azure portal under your Azure OpenAI resource
	Deployment string                                `json:"deployment"`
	mode       *DestinationWeaviateUpdateSchemasMode `const:"azure_openai" json:"mode"`
	// The API key for your Azure OpenAI resource.  You can find this in the Azure portal under your Azure OpenAI resource
	OpenaiKey string `json:"openai_key"`
}

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

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

func (o *DestinationWeaviateUpdateAzureOpenAI) GetAPIBase() string {
	if o == nil {
		return ""
	}
	return o.APIBase
}

func (o *DestinationWeaviateUpdateAzureOpenAI) GetDeployment() string {
	if o == nil {
		return ""
	}
	return o.Deployment
}

func (o *DestinationWeaviateUpdateAzureOpenAI) GetMode() *DestinationWeaviateUpdateSchemasMode {
	return DestinationWeaviateUpdateSchemasModeAzureOpenai.ToPointer()
}

func (o *DestinationWeaviateUpdateAzureOpenAI) GetOpenaiKey() string {
	if o == nil {
		return ""
	}
	return o.OpenaiKey
}

type DestinationWeaviateUpdateMode string

const (
	DestinationWeaviateUpdateModeNoEmbedding DestinationWeaviateUpdateMode = "no_embedding"
)

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

// DestinationWeaviateUpdateNoExternalEmbedding - Do not calculate and pass embeddings to Weaviate. Suitable for clusters with configured vectorizers to calculate embeddings within Weaviate or for classes that should only support regular text search.
type DestinationWeaviateUpdateNoExternalEmbedding struct {
	mode *DestinationWeaviateUpdateMode `const:"no_embedding" json:"mode"`
}

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

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

func (o *DestinationWeaviateUpdateNoExternalEmbedding) GetMode() *DestinationWeaviateUpdateMode {
	return DestinationWeaviateUpdateModeNoEmbedding.ToPointer()
}

type DestinationWeaviateUpdateEmbeddingType string

const (
	DestinationWeaviateUpdateEmbeddingTypeDestinationWeaviateUpdateNoExternalEmbedding DestinationWeaviateUpdateEmbeddingType = "destination-weaviate-update_No external embedding"
	DestinationWeaviateUpdateEmbeddingTypeDestinationWeaviateUpdateAzureOpenAI         DestinationWeaviateUpdateEmbeddingType = "destination-weaviate-update_Azure OpenAI"
	DestinationWeaviateUpdateEmbeddingTypeDestinationWeaviateUpdateOpenAI              DestinationWeaviateUpdateEmbeddingType = "destination-weaviate-update_OpenAI"
	DestinationWeaviateUpdateEmbeddingTypeDestinationWeaviateUpdateCohere              DestinationWeaviateUpdateEmbeddingType = "destination-weaviate-update_Cohere"
	DestinationWeaviateUpdateEmbeddingTypeDestinationWeaviateUpdateFromField           DestinationWeaviateUpdateEmbeddingType = "destination-weaviate-update_From Field"
	DestinationWeaviateUpdateEmbeddingTypeDestinationWeaviateUpdateFake                DestinationWeaviateUpdateEmbeddingType = "destination-weaviate-update_Fake"
	DestinationWeaviateUpdateEmbeddingTypeDestinationWeaviateUpdateOpenAICompatible    DestinationWeaviateUpdateEmbeddingType = "destination-weaviate-update_OpenAI-compatible"
)

// DestinationWeaviateUpdateEmbedding - Embedding configuration
type DestinationWeaviateUpdateEmbedding struct {
	DestinationWeaviateUpdateNoExternalEmbedding *DestinationWeaviateUpdateNoExternalEmbedding `queryParam:"inline"`
	DestinationWeaviateUpdateAzureOpenAI         *DestinationWeaviateUpdateAzureOpenAI         `queryParam:"inline"`
	DestinationWeaviateUpdateOpenAI              *DestinationWeaviateUpdateOpenAI              `queryParam:"inline"`
	DestinationWeaviateUpdateCohere              *DestinationWeaviateUpdateCohere              `queryParam:"inline"`
	DestinationWeaviateUpdateFromField           *DestinationWeaviateUpdateFromField           `queryParam:"inline"`
	DestinationWeaviateUpdateFake                *DestinationWeaviateUpdateFake                `queryParam:"inline"`
	DestinationWeaviateUpdateOpenAICompatible    *DestinationWeaviateUpdateOpenAICompatible    `queryParam:"inline"`

	Type DestinationWeaviateUpdateEmbeddingType
}

func CreateDestinationWeaviateUpdateEmbeddingDestinationWeaviateUpdateNoExternalEmbedding(destinationWeaviateUpdateNoExternalEmbedding DestinationWeaviateUpdateNoExternalEmbedding) DestinationWeaviateUpdateEmbedding {
	typ := DestinationWeaviateUpdateEmbeddingTypeDestinationWeaviateUpdateNoExternalEmbedding

	return DestinationWeaviateUpdateEmbedding{
		DestinationWeaviateUpdateNoExternalEmbedding: &destinationWeaviateUpdateNoExternalEmbedding,
		Type: typ,
	}
}

func CreateDestinationWeaviateUpdateEmbeddingDestinationWeaviateUpdateAzureOpenAI(destinationWeaviateUpdateAzureOpenAI DestinationWeaviateUpdateAzureOpenAI) DestinationWeaviateUpdateEmbedding {
	typ := DestinationWeaviateUpdateEmbeddingTypeDestinationWeaviateUpdateAzureOpenAI

	return DestinationWeaviateUpdateEmbedding{
		DestinationWeaviateUpdateAzureOpenAI: &destinationWeaviateUpdateAzureOpenAI,
		Type:                                 typ,
	}
}

func CreateDestinationWeaviateUpdateEmbeddingDestinationWeaviateUpdateOpenAI(destinationWeaviateUpdateOpenAI DestinationWeaviateUpdateOpenAI) DestinationWeaviateUpdateEmbedding {
	typ := DestinationWeaviateUpdateEmbeddingTypeDestinationWeaviateUpdateOpenAI

	return DestinationWeaviateUpdateEmbedding{
		DestinationWeaviateUpdateOpenAI: &destinationWeaviateUpdateOpenAI,
		Type:                            typ,
	}
}

func CreateDestinationWeaviateUpdateEmbeddingDestinationWeaviateUpdateCohere(destinationWeaviateUpdateCohere DestinationWeaviateUpdateCohere) DestinationWeaviateUpdateEmbedding {
	typ := DestinationWeaviateUpdateEmbeddingTypeDestinationWeaviateUpdateCohere

	return DestinationWeaviateUpdateEmbedding{
		DestinationWeaviateUpdateCohere: &destinationWeaviateUpdateCohere,
		Type:                            typ,
	}
}

func CreateDestinationWeaviateUpdateEmbeddingDestinationWeaviateUpdateFromField(destinationWeaviateUpdateFromField DestinationWeaviateUpdateFromField) DestinationWeaviateUpdateEmbedding {
	typ := DestinationWeaviateUpdateEmbeddingTypeDestinationWeaviateUpdateFromField

	return DestinationWeaviateUpdateEmbedding{
		DestinationWeaviateUpdateFromField: &destinationWeaviateUpdateFromField,
		Type:                               typ,
	}
}

func CreateDestinationWeaviateUpdateEmbeddingDestinationWeaviateUpdateFake(destinationWeaviateUpdateFake DestinationWeaviateUpdateFake) DestinationWeaviateUpdateEmbedding {
	typ := DestinationWeaviateUpdateEmbeddingTypeDestinationWeaviateUpdateFake

	return DestinationWeaviateUpdateEmbedding{
		DestinationWeaviateUpdateFake: &destinationWeaviateUpdateFake,
		Type:                          typ,
	}
}

func CreateDestinationWeaviateUpdateEmbeddingDestinationWeaviateUpdateOpenAICompatible(destinationWeaviateUpdateOpenAICompatible DestinationWeaviateUpdateOpenAICompatible) DestinationWeaviateUpdateEmbedding {
	typ := DestinationWeaviateUpdateEmbeddingTypeDestinationWeaviateUpdateOpenAICompatible

	return DestinationWeaviateUpdateEmbedding{
		DestinationWeaviateUpdateOpenAICompatible: &destinationWeaviateUpdateOpenAICompatible,
		Type: typ,
	}
}

func (u *DestinationWeaviateUpdateEmbedding) UnmarshalJSON(data []byte) error {

	var destinationWeaviateUpdateNoExternalEmbedding DestinationWeaviateUpdateNoExternalEmbedding = DestinationWeaviateUpdateNoExternalEmbedding{}
	if err := utils.UnmarshalJSON(data, &destinationWeaviateUpdateNoExternalEmbedding, "", true, true); err == nil {
		u.DestinationWeaviateUpdateNoExternalEmbedding = &destinationWeaviateUpdateNoExternalEmbedding
		u.Type = DestinationWeaviateUpdateEmbeddingTypeDestinationWeaviateUpdateNoExternalEmbedding
		return nil
	}

	var destinationWeaviateUpdateFake DestinationWeaviateUpdateFake = DestinationWeaviateUpdateFake{}
	if err := utils.UnmarshalJSON(data, &destinationWeaviateUpdateFake, "", true, true); err == nil {
		u.DestinationWeaviateUpdateFake = &destinationWeaviateUpdateFake
		u.Type = DestinationWeaviateUpdateEmbeddingTypeDestinationWeaviateUpdateFake
		return nil
	}

	var destinationWeaviateUpdateOpenAI DestinationWeaviateUpdateOpenAI = DestinationWeaviateUpdateOpenAI{}
	if err := utils.UnmarshalJSON(data, &destinationWeaviateUpdateOpenAI, "", true, true); err == nil {
		u.DestinationWeaviateUpdateOpenAI = &destinationWeaviateUpdateOpenAI
		u.Type = DestinationWeaviateUpdateEmbeddingTypeDestinationWeaviateUpdateOpenAI
		return nil
	}

	var destinationWeaviateUpdateCohere DestinationWeaviateUpdateCohere = DestinationWeaviateUpdateCohere{}
	if err := utils.UnmarshalJSON(data, &destinationWeaviateUpdateCohere, "", true, true); err == nil {
		u.DestinationWeaviateUpdateCohere = &destinationWeaviateUpdateCohere
		u.Type = DestinationWeaviateUpdateEmbeddingTypeDestinationWeaviateUpdateCohere
		return nil
	}

	var destinationWeaviateUpdateFromField DestinationWeaviateUpdateFromField = DestinationWeaviateUpdateFromField{}
	if err := utils.UnmarshalJSON(data, &destinationWeaviateUpdateFromField, "", true, true); err == nil {
		u.DestinationWeaviateUpdateFromField = &destinationWeaviateUpdateFromField
		u.Type = DestinationWeaviateUpdateEmbeddingTypeDestinationWeaviateUpdateFromField
		return nil
	}

	var destinationWeaviateUpdateAzureOpenAI DestinationWeaviateUpdateAzureOpenAI = DestinationWeaviateUpdateAzureOpenAI{}
	if err := utils.UnmarshalJSON(data, &destinationWeaviateUpdateAzureOpenAI, "", true, true); err == nil {
		u.DestinationWeaviateUpdateAzureOpenAI = &destinationWeaviateUpdateAzureOpenAI
		u.Type = DestinationWeaviateUpdateEmbeddingTypeDestinationWeaviateUpdateAzureOpenAI
		return nil
	}

	var destinationWeaviateUpdateOpenAICompatible DestinationWeaviateUpdateOpenAICompatible = DestinationWeaviateUpdateOpenAICompatible{}
	if err := utils.UnmarshalJSON(data, &destinationWeaviateUpdateOpenAICompatible, "", true, true); err == nil {
		u.DestinationWeaviateUpdateOpenAICompatible = &destinationWeaviateUpdateOpenAICompatible
		u.Type = DestinationWeaviateUpdateEmbeddingTypeDestinationWeaviateUpdateOpenAICompatible
		return nil
	}

	return fmt.Errorf("could not unmarshal `%s` into any supported union types for DestinationWeaviateUpdateEmbedding", string(data))
}

func (u DestinationWeaviateUpdateEmbedding) MarshalJSON() ([]byte, error) {
	if u.DestinationWeaviateUpdateNoExternalEmbedding != nil {
		return utils.MarshalJSON(u.DestinationWeaviateUpdateNoExternalEmbedding, "", true)
	}

	if u.DestinationWeaviateUpdateAzureOpenAI != nil {
		return utils.MarshalJSON(u.DestinationWeaviateUpdateAzureOpenAI, "", true)
	}

	if u.DestinationWeaviateUpdateOpenAI != nil {
		return utils.MarshalJSON(u.DestinationWeaviateUpdateOpenAI, "", true)
	}

	if u.DestinationWeaviateUpdateCohere != nil {
		return utils.MarshalJSON(u.DestinationWeaviateUpdateCohere, "", true)
	}

	if u.DestinationWeaviateUpdateFromField != nil {
		return utils.MarshalJSON(u.DestinationWeaviateUpdateFromField, "", true)
	}

	if u.DestinationWeaviateUpdateFake != nil {
		return utils.MarshalJSON(u.DestinationWeaviateUpdateFake, "", true)
	}

	if u.DestinationWeaviateUpdateOpenAICompatible != nil {
		return utils.MarshalJSON(u.DestinationWeaviateUpdateOpenAICompatible, "", true)
	}

	return nil, errors.New("could not marshal union type DestinationWeaviateUpdateEmbedding: all fields are null")
}

type DestinationWeaviateUpdateHeader struct {
	HeaderKey string `json:"header_key"`
	Value     string `json:"value"`
}

func (o *DestinationWeaviateUpdateHeader) GetHeaderKey() string {
	if o == nil {
		return ""
	}
	return o.HeaderKey
}

func (o *DestinationWeaviateUpdateHeader) GetValue() string {
	if o == nil {
		return ""
	}
	return o.Value
}

type DestinationWeaviateUpdateSchemasIndexingAuthAuthenticationMode string

const (
	DestinationWeaviateUpdateSchemasIndexingAuthAuthenticationModeNoAuth DestinationWeaviateUpdateSchemasIndexingAuthAuthenticationMode = "no_auth"
)

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

// DestinationWeaviateUpdateNoAuthentication - Do not authenticate (suitable for locally running test clusters, do not use for clusters with public IP addresses)
type DestinationWeaviateUpdateNoAuthentication struct {
	mode *DestinationWeaviateUpdateSchemasIndexingAuthAuthenticationMode `const:"no_auth" json:"mode"`
}

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

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

func (o *DestinationWeaviateUpdateNoAuthentication) GetMode() *DestinationWeaviateUpdateSchemasIndexingAuthAuthenticationMode {
	return DestinationWeaviateUpdateSchemasIndexingAuthAuthenticationModeNoAuth.ToPointer()
}

type DestinationWeaviateUpdateSchemasIndexingAuthMode string

const (
	DestinationWeaviateUpdateSchemasIndexingAuthModeUsernamePassword DestinationWeaviateUpdateSchemasIndexingAuthMode = "username_password"
)

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

// DestinationWeaviateUpdateUsernamePassword - Authenticate using username and password (suitable for self-managed Weaviate clusters)
type DestinationWeaviateUpdateUsernamePassword struct {
	mode *DestinationWeaviateUpdateSchemasIndexingAuthMode `const:"username_password" json:"mode"`
	// Password for the Weaviate cluster
	Password string `json:"password"`
	// Username for the Weaviate cluster
	Username string `json:"username"`
}

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

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

func (o *DestinationWeaviateUpdateUsernamePassword) GetMode() *DestinationWeaviateUpdateSchemasIndexingAuthMode {
	return DestinationWeaviateUpdateSchemasIndexingAuthModeUsernamePassword.ToPointer()
}

func (o *DestinationWeaviateUpdateUsernamePassword) GetPassword() string {
	if o == nil {
		return ""
	}
	return o.Password
}

func (o *DestinationWeaviateUpdateUsernamePassword) GetUsername() string {
	if o == nil {
		return ""
	}
	return o.Username
}

type DestinationWeaviateUpdateSchemasIndexingMode string

const (
	DestinationWeaviateUpdateSchemasIndexingModeToken DestinationWeaviateUpdateSchemasIndexingMode = "token"
)

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

// DestinationWeaviateUpdateAPIToken - Authenticate using an API token (suitable for Weaviate Cloud)
type DestinationWeaviateUpdateAPIToken struct {
	mode *DestinationWeaviateUpdateSchemasIndexingMode `const:"token" json:"mode"`
	// API Token for the Weaviate instance
	Token string `json:"token"`
}

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

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

func (o *DestinationWeaviateUpdateAPIToken) GetMode() *DestinationWeaviateUpdateSchemasIndexingMode {
	return DestinationWeaviateUpdateSchemasIndexingModeToken.ToPointer()
}

func (o *DestinationWeaviateUpdateAPIToken) GetToken() string {
	if o == nil {
		return ""
	}
	return o.Token
}

type DestinationWeaviateUpdateAuthenticationType string

const (
	DestinationWeaviateUpdateAuthenticationTypeDestinationWeaviateUpdateAPIToken         DestinationWeaviateUpdateAuthenticationType = "destination-weaviate-update_API Token"
	DestinationWeaviateUpdateAuthenticationTypeDestinationWeaviateUpdateUsernamePassword DestinationWeaviateUpdateAuthenticationType = "destination-weaviate-update_Username/Password"
	DestinationWeaviateUpdateAuthenticationTypeDestinationWeaviateUpdateNoAuthentication DestinationWeaviateUpdateAuthenticationType = "destination-weaviate-update_No Authentication"
)

// DestinationWeaviateUpdateAuthentication - Authentication method
type DestinationWeaviateUpdateAuthentication struct {
	DestinationWeaviateUpdateAPIToken         *DestinationWeaviateUpdateAPIToken         `queryParam:"inline"`
	DestinationWeaviateUpdateUsernamePassword *DestinationWeaviateUpdateUsernamePassword `queryParam:"inline"`
	DestinationWeaviateUpdateNoAuthentication *DestinationWeaviateUpdateNoAuthentication `queryParam:"inline"`

	Type DestinationWeaviateUpdateAuthenticationType
}

func CreateDestinationWeaviateUpdateAuthenticationDestinationWeaviateUpdateAPIToken(destinationWeaviateUpdateAPIToken DestinationWeaviateUpdateAPIToken) DestinationWeaviateUpdateAuthentication {
	typ := DestinationWeaviateUpdateAuthenticationTypeDestinationWeaviateUpdateAPIToken

	return DestinationWeaviateUpdateAuthentication{
		DestinationWeaviateUpdateAPIToken: &destinationWeaviateUpdateAPIToken,
		Type:                              typ,
	}
}

func CreateDestinationWeaviateUpdateAuthenticationDestinationWeaviateUpdateUsernamePassword(destinationWeaviateUpdateUsernamePassword DestinationWeaviateUpdateUsernamePassword) DestinationWeaviateUpdateAuthentication {
	typ := DestinationWeaviateUpdateAuthenticationTypeDestinationWeaviateUpdateUsernamePassword

	return DestinationWeaviateUpdateAuthentication{
		DestinationWeaviateUpdateUsernamePassword: &destinationWeaviateUpdateUsernamePassword,
		Type: typ,
	}
}

func CreateDestinationWeaviateUpdateAuthenticationDestinationWeaviateUpdateNoAuthentication(destinationWeaviateUpdateNoAuthentication DestinationWeaviateUpdateNoAuthentication) DestinationWeaviateUpdateAuthentication {
	typ := DestinationWeaviateUpdateAuthenticationTypeDestinationWeaviateUpdateNoAuthentication

	return DestinationWeaviateUpdateAuthentication{
		DestinationWeaviateUpdateNoAuthentication: &destinationWeaviateUpdateNoAuthentication,
		Type: typ,
	}
}

func (u *DestinationWeaviateUpdateAuthentication) UnmarshalJSON(data []byte) error {

	var destinationWeaviateUpdateNoAuthentication DestinationWeaviateUpdateNoAuthentication = DestinationWeaviateUpdateNoAuthentication{}
	if err := utils.UnmarshalJSON(data, &destinationWeaviateUpdateNoAuthentication, "", true, true); err == nil {
		u.DestinationWeaviateUpdateNoAuthentication = &destinationWeaviateUpdateNoAuthentication
		u.Type = DestinationWeaviateUpdateAuthenticationTypeDestinationWeaviateUpdateNoAuthentication
		return nil
	}

	var destinationWeaviateUpdateAPIToken DestinationWeaviateUpdateAPIToken = DestinationWeaviateUpdateAPIToken{}
	if err := utils.UnmarshalJSON(data, &destinationWeaviateUpdateAPIToken, "", true, true); err == nil {
		u.DestinationWeaviateUpdateAPIToken = &destinationWeaviateUpdateAPIToken
		u.Type = DestinationWeaviateUpdateAuthenticationTypeDestinationWeaviateUpdateAPIToken
		return nil
	}

	var destinationWeaviateUpdateUsernamePassword DestinationWeaviateUpdateUsernamePassword = DestinationWeaviateUpdateUsernamePassword{}
	if err := utils.UnmarshalJSON(data, &destinationWeaviateUpdateUsernamePassword, "", true, true); err == nil {
		u.DestinationWeaviateUpdateUsernamePassword = &destinationWeaviateUpdateUsernamePassword
		u.Type = DestinationWeaviateUpdateAuthenticationTypeDestinationWeaviateUpdateUsernamePassword
		return nil
	}

	return fmt.Errorf("could not unmarshal `%s` into any supported union types for DestinationWeaviateUpdateAuthentication", string(data))
}

func (u DestinationWeaviateUpdateAuthentication) MarshalJSON() ([]byte, error) {
	if u.DestinationWeaviateUpdateAPIToken != nil {
		return utils.MarshalJSON(u.DestinationWeaviateUpdateAPIToken, "", true)
	}

	if u.DestinationWeaviateUpdateUsernamePassword != nil {
		return utils.MarshalJSON(u.DestinationWeaviateUpdateUsernamePassword, "", true)
	}

	if u.DestinationWeaviateUpdateNoAuthentication != nil {
		return utils.MarshalJSON(u.DestinationWeaviateUpdateNoAuthentication, "", true)
	}

	return nil, errors.New("could not marshal union type DestinationWeaviateUpdateAuthentication: all fields are null")
}

// DestinationWeaviateUpdateDefaultVectorizer - The vectorizer to use if new classes need to be created
type DestinationWeaviateUpdateDefaultVectorizer string

const (
	DestinationWeaviateUpdateDefaultVectorizerNone                  DestinationWeaviateUpdateDefaultVectorizer = "none"
	DestinationWeaviateUpdateDefaultVectorizerText2vecCohere        DestinationWeaviateUpdateDefaultVectorizer = "text2vec-cohere"
	DestinationWeaviateUpdateDefaultVectorizerText2vecHuggingface   DestinationWeaviateUpdateDefaultVectorizer = "text2vec-huggingface"
	DestinationWeaviateUpdateDefaultVectorizerText2vecOpenai        DestinationWeaviateUpdateDefaultVectorizer = "text2vec-openai"
	DestinationWeaviateUpdateDefaultVectorizerText2vecPalm          DestinationWeaviateUpdateDefaultVectorizer = "text2vec-palm"
	DestinationWeaviateUpdateDefaultVectorizerText2vecContextionary DestinationWeaviateUpdateDefaultVectorizer = "text2vec-contextionary"
	DestinationWeaviateUpdateDefaultVectorizerText2vecTransformers  DestinationWeaviateUpdateDefaultVectorizer = "text2vec-transformers"
	DestinationWeaviateUpdateDefaultVectorizerText2vecGpt4all       DestinationWeaviateUpdateDefaultVectorizer = "text2vec-gpt4all"
)

func (e DestinationWeaviateUpdateDefaultVectorizer) ToPointer() *DestinationWeaviateUpdateDefaultVectorizer {
	return &e
}
func (e *DestinationWeaviateUpdateDefaultVectorizer) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "none":
		fallthrough
	case "text2vec-cohere":
		fallthrough
	case "text2vec-huggingface":
		fallthrough
	case "text2vec-openai":
		fallthrough
	case "text2vec-palm":
		fallthrough
	case "text2vec-contextionary":
		fallthrough
	case "text2vec-transformers":
		fallthrough
	case "text2vec-gpt4all":
		*e = DestinationWeaviateUpdateDefaultVectorizer(v)
		return nil
	default:
		return fmt.Errorf("invalid value for DestinationWeaviateUpdateDefaultVectorizer: %v", v)
	}
}

// DestinationWeaviateUpdateIndexing - Indexing configuration
type DestinationWeaviateUpdateIndexing struct {
	// Additional HTTP headers to send with every request.
	AdditionalHeaders []DestinationWeaviateUpdateHeader `json:"additional_headers,omitempty"`
	// Authentication method
	Auth DestinationWeaviateUpdateAuthentication `json:"auth"`
	// The number of records to send to Weaviate in each batch
	BatchSize *int64 `default:"128" json:"batch_size"`
	// The vectorizer to use if new classes need to be created
	DefaultVectorizer *DestinationWeaviateUpdateDefaultVectorizer `default:"none" json:"default_vectorizer"`
	// The public endpoint of the Weaviate cluster.
	Host string `json:"host"`
	// The tenant ID to use for multi tenancy
	TenantID *string `default:"" json:"tenant_id"`
	// The field in the object that contains the embedded text
	TextField *string `default:"text" json:"text_field"`
}

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

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

func (o *DestinationWeaviateUpdateIndexing) GetAdditionalHeaders() []DestinationWeaviateUpdateHeader {
	if o == nil {
		return nil
	}
	return o.AdditionalHeaders
}

func (o *DestinationWeaviateUpdateIndexing) GetAuth() DestinationWeaviateUpdateAuthentication {
	if o == nil {
		return DestinationWeaviateUpdateAuthentication{}
	}
	return o.Auth
}

func (o *DestinationWeaviateUpdateIndexing) GetBatchSize() *int64 {
	if o == nil {
		return nil
	}
	return o.BatchSize
}

func (o *DestinationWeaviateUpdateIndexing) GetDefaultVectorizer() *DestinationWeaviateUpdateDefaultVectorizer {
	if o == nil {
		return nil
	}
	return o.DefaultVectorizer
}

func (o *DestinationWeaviateUpdateIndexing) GetHost() string {
	if o == nil {
		return ""
	}
	return o.Host
}

func (o *DestinationWeaviateUpdateIndexing) GetTenantID() *string {
	if o == nil {
		return nil
	}
	return o.TenantID
}

func (o *DestinationWeaviateUpdateIndexing) GetTextField() *string {
	if o == nil {
		return nil
	}
	return o.TextField
}

type DestinationWeaviateUpdateFieldNameMappingConfigModel struct {
	// The field name in the source
	FromField string `json:"from_field"`
	// The field name to use in the destination
	ToField string `json:"to_field"`
}

func (o *DestinationWeaviateUpdateFieldNameMappingConfigModel) GetFromField() string {
	if o == nil {
		return ""
	}
	return o.FromField
}

func (o *DestinationWeaviateUpdateFieldNameMappingConfigModel) GetToField() string {
	if o == nil {
		return ""
	}
	return o.ToField
}

// DestinationWeaviateUpdateLanguage - Split code in suitable places based on the programming language
type DestinationWeaviateUpdateLanguage string

const (
	DestinationWeaviateUpdateLanguageCpp      DestinationWeaviateUpdateLanguage = "cpp"
	DestinationWeaviateUpdateLanguageGo       DestinationWeaviateUpdateLanguage = "go"
	DestinationWeaviateUpdateLanguageJava     DestinationWeaviateUpdateLanguage = "java"
	DestinationWeaviateUpdateLanguageJs       DestinationWeaviateUpdateLanguage = "js"
	DestinationWeaviateUpdateLanguagePhp      DestinationWeaviateUpdateLanguage = "php"
	DestinationWeaviateUpdateLanguageProto    DestinationWeaviateUpdateLanguage = "proto"
	DestinationWeaviateUpdateLanguagePython   DestinationWeaviateUpdateLanguage = "python"
	DestinationWeaviateUpdateLanguageRst      DestinationWeaviateUpdateLanguage = "rst"
	DestinationWeaviateUpdateLanguageRuby     DestinationWeaviateUpdateLanguage = "ruby"
	DestinationWeaviateUpdateLanguageRust     DestinationWeaviateUpdateLanguage = "rust"
	DestinationWeaviateUpdateLanguageScala    DestinationWeaviateUpdateLanguage = "scala"
	DestinationWeaviateUpdateLanguageSwift    DestinationWeaviateUpdateLanguage = "swift"
	DestinationWeaviateUpdateLanguageMarkdown DestinationWeaviateUpdateLanguage = "markdown"
	DestinationWeaviateUpdateLanguageLatex    DestinationWeaviateUpdateLanguage = "latex"
	DestinationWeaviateUpdateLanguageHTML     DestinationWeaviateUpdateLanguage = "html"
	DestinationWeaviateUpdateLanguageSol      DestinationWeaviateUpdateLanguage = "sol"
)

func (e DestinationWeaviateUpdateLanguage) ToPointer() *DestinationWeaviateUpdateLanguage {
	return &e
}
func (e *DestinationWeaviateUpdateLanguage) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "cpp":
		fallthrough
	case "go":
		fallthrough
	case "java":
		fallthrough
	case "js":
		fallthrough
	case "php":
		fallthrough
	case "proto":
		fallthrough
	case "python":
		fallthrough
	case "rst":
		fallthrough
	case "ruby":
		fallthrough
	case "rust":
		fallthrough
	case "scala":
		fallthrough
	case "swift":
		fallthrough
	case "markdown":
		fallthrough
	case "latex":
		fallthrough
	case "html":
		fallthrough
	case "sol":
		*e = DestinationWeaviateUpdateLanguage(v)
		return nil
	default:
		return fmt.Errorf("invalid value for DestinationWeaviateUpdateLanguage: %v", v)
	}
}

type DestinationWeaviateUpdateSchemasProcessingTextSplitterTextSplitterMode string

const (
	DestinationWeaviateUpdateSchemasProcessingTextSplitterTextSplitterModeCode DestinationWeaviateUpdateSchemasProcessingTextSplitterTextSplitterMode = "code"
)

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

// DestinationWeaviateUpdateByProgrammingLanguage - Split the text by suitable delimiters based on the programming language. This is useful for splitting code into chunks.
type DestinationWeaviateUpdateByProgrammingLanguage struct {
	// Split code in suitable places based on the programming language
	Language DestinationWeaviateUpdateLanguage                                       `json:"language"`
	mode     *DestinationWeaviateUpdateSchemasProcessingTextSplitterTextSplitterMode `const:"code" json:"mode"`
}

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

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

func (o *DestinationWeaviateUpdateByProgrammingLanguage) GetLanguage() DestinationWeaviateUpdateLanguage {
	if o == nil {
		return DestinationWeaviateUpdateLanguage("")
	}
	return o.Language
}

func (o *DestinationWeaviateUpdateByProgrammingLanguage) GetMode() *DestinationWeaviateUpdateSchemasProcessingTextSplitterTextSplitterMode {
	return DestinationWeaviateUpdateSchemasProcessingTextSplitterTextSplitterModeCode.ToPointer()
}

type DestinationWeaviateUpdateSchemasProcessingTextSplitterMode string

const (
	DestinationWeaviateUpdateSchemasProcessingTextSplitterModeMarkdown DestinationWeaviateUpdateSchemasProcessingTextSplitterMode = "markdown"
)

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

// DestinationWeaviateUpdateByMarkdownHeader - Split the text by Markdown headers down to the specified header level. If the chunk size fits multiple sections, they will be combined into a single chunk.
type DestinationWeaviateUpdateByMarkdownHeader struct {
	mode *DestinationWeaviateUpdateSchemasProcessingTextSplitterMode `const:"markdown" json:"mode"`
	// Level of markdown headers to split text fields by. Headings down to the specified level will be used as split points
	SplitLevel *int64 `default:"1" json:"split_level"`
}

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

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

func (o *DestinationWeaviateUpdateByMarkdownHeader) GetMode() *DestinationWeaviateUpdateSchemasProcessingTextSplitterMode {
	return DestinationWeaviateUpdateSchemasProcessingTextSplitterModeMarkdown.ToPointer()
}

func (o *DestinationWeaviateUpdateByMarkdownHeader) GetSplitLevel() *int64 {
	if o == nil {
		return nil
	}
	return o.SplitLevel
}

type DestinationWeaviateUpdateSchemasProcessingMode string

const (
	DestinationWeaviateUpdateSchemasProcessingModeSeparator DestinationWeaviateUpdateSchemasProcessingMode = "separator"
)

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

// DestinationWeaviateUpdateBySeparator - Split the text by the list of separators until the chunk size is reached, using the earlier mentioned separators where possible. This is useful for splitting text fields by paragraphs, sentences, words, etc.
type DestinationWeaviateUpdateBySeparator struct {
	// Whether to keep the separator in the resulting chunks
	KeepSeparator *bool                                           `default:"false" json:"keep_separator"`
	mode          *DestinationWeaviateUpdateSchemasProcessingMode `const:"separator" json:"mode"`
	// List of separator strings to split text fields by. The separator itself needs to be wrapped in double quotes, e.g. to split by the dot character, use ".". To split by a newline, use "\n".
	Separators []string `json:"separators,omitempty"`
}

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

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

func (o *DestinationWeaviateUpdateBySeparator) GetKeepSeparator() *bool {
	if o == nil {
		return nil
	}
	return o.KeepSeparator
}

func (o *DestinationWeaviateUpdateBySeparator) GetMode() *DestinationWeaviateUpdateSchemasProcessingMode {
	return DestinationWeaviateUpdateSchemasProcessingModeSeparator.ToPointer()
}

func (o *DestinationWeaviateUpdateBySeparator) GetSeparators() []string {
	if o == nil {
		return nil
	}
	return o.Separators
}

type DestinationWeaviateUpdateTextSplitterType string

const (
	DestinationWeaviateUpdateTextSplitterTypeDestinationWeaviateUpdateBySeparator           DestinationWeaviateUpdateTextSplitterType = "destination-weaviate-update_By Separator"
	DestinationWeaviateUpdateTextSplitterTypeDestinationWeaviateUpdateByMarkdownHeader      DestinationWeaviateUpdateTextSplitterType = "destination-weaviate-update_By Markdown header"
	DestinationWeaviateUpdateTextSplitterTypeDestinationWeaviateUpdateByProgrammingLanguage DestinationWeaviateUpdateTextSplitterType = "destination-weaviate-update_By Programming Language"
)

// DestinationWeaviateUpdateTextSplitter - Split text fields into chunks based on the specified method.
type DestinationWeaviateUpdateTextSplitter struct {
	DestinationWeaviateUpdateBySeparator           *DestinationWeaviateUpdateBySeparator           `queryParam:"inline"`
	DestinationWeaviateUpdateByMarkdownHeader      *DestinationWeaviateUpdateByMarkdownHeader      `queryParam:"inline"`
	DestinationWeaviateUpdateByProgrammingLanguage *DestinationWeaviateUpdateByProgrammingLanguage `queryParam:"inline"`

	Type DestinationWeaviateUpdateTextSplitterType
}

func CreateDestinationWeaviateUpdateTextSplitterDestinationWeaviateUpdateBySeparator(destinationWeaviateUpdateBySeparator DestinationWeaviateUpdateBySeparator) DestinationWeaviateUpdateTextSplitter {
	typ := DestinationWeaviateUpdateTextSplitterTypeDestinationWeaviateUpdateBySeparator

	return DestinationWeaviateUpdateTextSplitter{
		DestinationWeaviateUpdateBySeparator: &destinationWeaviateUpdateBySeparator,
		Type:                                 typ,
	}
}

func CreateDestinationWeaviateUpdateTextSplitterDestinationWeaviateUpdateByMarkdownHeader(destinationWeaviateUpdateByMarkdownHeader DestinationWeaviateUpdateByMarkdownHeader) DestinationWeaviateUpdateTextSplitter {
	typ := DestinationWeaviateUpdateTextSplitterTypeDestinationWeaviateUpdateByMarkdownHeader

	return DestinationWeaviateUpdateTextSplitter{
		DestinationWeaviateUpdateByMarkdownHeader: &destinationWeaviateUpdateByMarkdownHeader,
		Type: typ,
	}
}

func CreateDestinationWeaviateUpdateTextSplitterDestinationWeaviateUpdateByProgrammingLanguage(destinationWeaviateUpdateByProgrammingLanguage DestinationWeaviateUpdateByProgrammingLanguage) DestinationWeaviateUpdateTextSplitter {
	typ := DestinationWeaviateUpdateTextSplitterTypeDestinationWeaviateUpdateByProgrammingLanguage

	return DestinationWeaviateUpdateTextSplitter{
		DestinationWeaviateUpdateByProgrammingLanguage: &destinationWeaviateUpdateByProgrammingLanguage,
		Type: typ,
	}
}

func (u *DestinationWeaviateUpdateTextSplitter) UnmarshalJSON(data []byte) error {

	var destinationWeaviateUpdateByMarkdownHeader DestinationWeaviateUpdateByMarkdownHeader = DestinationWeaviateUpdateByMarkdownHeader{}
	if err := utils.UnmarshalJSON(data, &destinationWeaviateUpdateByMarkdownHeader, "", true, true); err == nil {
		u.DestinationWeaviateUpdateByMarkdownHeader = &destinationWeaviateUpdateByMarkdownHeader
		u.Type = DestinationWeaviateUpdateTextSplitterTypeDestinationWeaviateUpdateByMarkdownHeader
		return nil
	}

	var destinationWeaviateUpdateByProgrammingLanguage DestinationWeaviateUpdateByProgrammingLanguage = DestinationWeaviateUpdateByProgrammingLanguage{}
	if err := utils.UnmarshalJSON(data, &destinationWeaviateUpdateByProgrammingLanguage, "", true, true); err == nil {
		u.DestinationWeaviateUpdateByProgrammingLanguage = &destinationWeaviateUpdateByProgrammingLanguage
		u.Type = DestinationWeaviateUpdateTextSplitterTypeDestinationWeaviateUpdateByProgrammingLanguage
		return nil
	}

	var destinationWeaviateUpdateBySeparator DestinationWeaviateUpdateBySeparator = DestinationWeaviateUpdateBySeparator{}
	if err := utils.UnmarshalJSON(data, &destinationWeaviateUpdateBySeparator, "", true, true); err == nil {
		u.DestinationWeaviateUpdateBySeparator = &destinationWeaviateUpdateBySeparator
		u.Type = DestinationWeaviateUpdateTextSplitterTypeDestinationWeaviateUpdateBySeparator
		return nil
	}

	return fmt.Errorf("could not unmarshal `%s` into any supported union types for DestinationWeaviateUpdateTextSplitter", string(data))
}

func (u DestinationWeaviateUpdateTextSplitter) MarshalJSON() ([]byte, error) {
	if u.DestinationWeaviateUpdateBySeparator != nil {
		return utils.MarshalJSON(u.DestinationWeaviateUpdateBySeparator, "", true)
	}

	if u.DestinationWeaviateUpdateByMarkdownHeader != nil {
		return utils.MarshalJSON(u.DestinationWeaviateUpdateByMarkdownHeader, "", true)
	}

	if u.DestinationWeaviateUpdateByProgrammingLanguage != nil {
		return utils.MarshalJSON(u.DestinationWeaviateUpdateByProgrammingLanguage, "", true)
	}

	return nil, errors.New("could not marshal union type DestinationWeaviateUpdateTextSplitter: all fields are null")
}

type DestinationWeaviateUpdateProcessingConfigModel struct {
	// Size of overlap between chunks in tokens to store in vector store to better capture relevant context
	ChunkOverlap *int64 `default:"0" json:"chunk_overlap"`
	// Size of chunks in tokens to store in vector store (make sure it is not too big for the context if your LLM)
	ChunkSize int64 `json:"chunk_size"`
	// List of fields to rename. Not applicable for nested fields, but can be used to rename fields already flattened via dot notation.
	FieldNameMappings []DestinationWeaviateUpdateFieldNameMappingConfigModel `json:"field_name_mappings,omitempty"`
	// List of fields in the record that should be stored as metadata. The field list is applied to all streams in the same way and non-existing fields are ignored. If none are defined, all fields are considered metadata fields. When specifying text fields, you can access nested fields in the record by using dot notation, e.g. `user.name` will access the `name` field in the `user` object. It's also possible to use wildcards to access all fields in an object, e.g. `users.*.name` will access all `names` fields in all entries of the `users` array. When specifying nested paths, all matching values are flattened into an array set to a field named by the path.
	MetadataFields []string `json:"metadata_fields,omitempty"`
	// List of fields in the record that should be used to calculate the embedding. The field list is applied to all streams in the same way and non-existing fields are ignored. If none are defined, all fields are considered text fields. When specifying text fields, you can access nested fields in the record by using dot notation, e.g. `user.name` will access the `name` field in the `user` object. It's also possible to use wildcards to access all fields in an object, e.g. `users.*.name` will access all `names` fields in all entries of the `users` array.
	TextFields []string `json:"text_fields,omitempty"`
	// Split text fields into chunks based on the specified method.
	TextSplitter *DestinationWeaviateUpdateTextSplitter `json:"text_splitter,omitempty"`
}

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

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

func (o *DestinationWeaviateUpdateProcessingConfigModel) GetChunkOverlap() *int64 {
	if o == nil {
		return nil
	}
	return o.ChunkOverlap
}

func (o *DestinationWeaviateUpdateProcessingConfigModel) GetChunkSize() int64 {
	if o == nil {
		return 0
	}
	return o.ChunkSize
}

func (o *DestinationWeaviateUpdateProcessingConfigModel) GetFieldNameMappings() []DestinationWeaviateUpdateFieldNameMappingConfigModel {
	if o == nil {
		return nil
	}
	return o.FieldNameMappings
}

func (o *DestinationWeaviateUpdateProcessingConfigModel) GetMetadataFields() []string {
	if o == nil {
		return nil
	}
	return o.MetadataFields
}

func (o *DestinationWeaviateUpdateProcessingConfigModel) GetTextFields() []string {
	if o == nil {
		return nil
	}
	return o.TextFields
}

func (o *DestinationWeaviateUpdateProcessingConfigModel) GetTextSplitter() *DestinationWeaviateUpdateTextSplitter {
	if o == nil {
		return nil
	}
	return o.TextSplitter
}

// DestinationWeaviateUpdate - The configuration model for the Vector DB based destinations. This model is used to generate the UI for the destination configuration,
// as well as to provide type safety for the configuration passed to the destination.
//
// The configuration model is composed of four parts:
// * Processing configuration
// * Embedding configuration
// * Indexing configuration
// * Advanced configuration
//
// Processing, embedding and advanced configuration are provided by this base class, while the indexing configuration is provided by the destination connector in the sub class.
type DestinationWeaviateUpdate struct {
	// Embedding configuration
	Embedding DestinationWeaviateUpdateEmbedding `json:"embedding"`
	// Indexing configuration
	Indexing DestinationWeaviateUpdateIndexing `json:"indexing"`
	// Do not store the text that gets embedded along with the vector and the metadata in the destination. If set to true, only the vector and the metadata will be stored - in this case raw text for LLM use cases needs to be retrieved from another source.
	OmitRawText *bool                                          `default:"false" json:"omit_raw_text"`
	Processing  DestinationWeaviateUpdateProcessingConfigModel `json:"processing"`
}

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

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

func (o *DestinationWeaviateUpdate) GetEmbedding() DestinationWeaviateUpdateEmbedding {
	if o == nil {
		return DestinationWeaviateUpdateEmbedding{}
	}
	return o.Embedding
}

func (o *DestinationWeaviateUpdate) GetIndexing() DestinationWeaviateUpdateIndexing {
	if o == nil {
		return DestinationWeaviateUpdateIndexing{}
	}
	return o.Indexing
}

func (o *DestinationWeaviateUpdate) GetOmitRawText() *bool {
	if o == nil {
		return nil
	}
	return o.OmitRawText
}

func (o *DestinationWeaviateUpdate) GetProcessing() DestinationWeaviateUpdateProcessingConfigModel {
	if o == nil {
		return DestinationWeaviateUpdateProcessingConfigModel{}
	}
	return o.Processing
}
