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

package shared

import (
	"encoding/json"
	"fmt"
)

// NonBreakingSchemaUpdatesBehaviorEnum - Set how Airbyte handles syncs when it detects a non-breaking schema change in the source
type NonBreakingSchemaUpdatesBehaviorEnum string

const (
	NonBreakingSchemaUpdatesBehaviorEnumIgnore            NonBreakingSchemaUpdatesBehaviorEnum = "ignore"
	NonBreakingSchemaUpdatesBehaviorEnumDisableConnection NonBreakingSchemaUpdatesBehaviorEnum = "disable_connection"
	NonBreakingSchemaUpdatesBehaviorEnumPropagateColumns  NonBreakingSchemaUpdatesBehaviorEnum = "propagate_columns"
	NonBreakingSchemaUpdatesBehaviorEnumPropagateFully    NonBreakingSchemaUpdatesBehaviorEnum = "propagate_fully"
)

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