// Code generated by Fern. DO NOT EDIT.

package api

import (
	json "encoding/json"
	fmt "fmt"
	big "math/big"
	internal "pentagi/pkg/observability/langfuse/api/internal"
	time "time"
)

var (
	ingestionBatchRequestFieldBatch    = big.NewInt(1 << 0)
	ingestionBatchRequestFieldMetadata = big.NewInt(1 << 1)
)

type IngestionBatchRequest struct {
	// Batch of tracing events to be ingested. Discriminated by attribute `type`.
	Batch []*IngestionEvent `json:"batch" url:"-"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{} `json:"metadata,omitempty" url:"-"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`
}

func (i *IngestionBatchRequest) require(field *big.Int) {
	if i.explicitFields == nil {
		i.explicitFields = big.NewInt(0)
	}
	i.explicitFields.Or(i.explicitFields, field)
}

// SetBatch sets the Batch field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionBatchRequest) SetBatch(batch []*IngestionEvent) {
	i.Batch = batch
	i.require(ingestionBatchRequestFieldBatch)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionBatchRequest) SetMetadata(metadata interface{}) {
	i.Metadata = metadata
	i.require(ingestionBatchRequestFieldMetadata)
}

func (i *IngestionBatchRequest) UnmarshalJSON(data []byte) error {
	type unmarshaler IngestionBatchRequest
	var body unmarshaler
	if err := json.Unmarshal(data, &body); err != nil {
		return err
	}
	*i = IngestionBatchRequest(body)
	return nil
}

func (i *IngestionBatchRequest) MarshalJSON() ([]byte, error) {
	type embed IngestionBatchRequest
	var marshaler = struct {
		embed
	}{
		embed: embed(*i),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields)
	return json.Marshal(explicitMarshaler)
}

var (
	baseEventFieldID        = big.NewInt(1 << 0)
	baseEventFieldTimestamp = big.NewInt(1 << 1)
	baseEventFieldMetadata  = big.NewInt(1 << 2)
)

type BaseEvent struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (b *BaseEvent) GetID() string {
	if b == nil {
		return ""
	}
	return b.ID
}

func (b *BaseEvent) GetTimestamp() string {
	if b == nil {
		return ""
	}
	return b.Timestamp
}

func (b *BaseEvent) GetMetadata() interface{} {
	if b == nil {
		return nil
	}
	return b.Metadata
}

func (b *BaseEvent) GetExtraProperties() map[string]interface{} {
	return b.extraProperties
}

func (b *BaseEvent) require(field *big.Int) {
	if b.explicitFields == nil {
		b.explicitFields = big.NewInt(0)
	}
	b.explicitFields.Or(b.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BaseEvent) SetID(id string) {
	b.ID = id
	b.require(baseEventFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BaseEvent) SetTimestamp(timestamp string) {
	b.Timestamp = timestamp
	b.require(baseEventFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BaseEvent) SetMetadata(metadata interface{}) {
	b.Metadata = metadata
	b.require(baseEventFieldMetadata)
}

func (b *BaseEvent) UnmarshalJSON(data []byte) error {
	type unmarshaler BaseEvent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*b = BaseEvent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *b)
	if err != nil {
		return err
	}
	b.extraProperties = extraProperties
	b.rawJSON = json.RawMessage(data)
	return nil
}

func (b *BaseEvent) MarshalJSON() ([]byte, error) {
	type embed BaseEvent
	var marshaler = struct {
		embed
	}{
		embed: embed(*b),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, b.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (b *BaseEvent) String() string {
	if len(b.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(b.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(b); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", b)
}

var (
	createAgentEventFieldID        = big.NewInt(1 << 0)
	createAgentEventFieldTimestamp = big.NewInt(1 << 1)
	createAgentEventFieldMetadata  = big.NewInt(1 << 2)
	createAgentEventFieldBody      = big.NewInt(1 << 3)
)

type CreateAgentEvent struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}           `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *CreateGenerationBody `json:"body" url:"body"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (c *CreateAgentEvent) GetID() string {
	if c == nil {
		return ""
	}
	return c.ID
}

func (c *CreateAgentEvent) GetTimestamp() string {
	if c == nil {
		return ""
	}
	return c.Timestamp
}

func (c *CreateAgentEvent) GetMetadata() interface{} {
	if c == nil {
		return nil
	}
	return c.Metadata
}

func (c *CreateAgentEvent) GetBody() *CreateGenerationBody {
	if c == nil {
		return nil
	}
	return c.Body
}

func (c *CreateAgentEvent) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

func (c *CreateAgentEvent) require(field *big.Int) {
	if c.explicitFields == nil {
		c.explicitFields = big.NewInt(0)
	}
	c.explicitFields.Or(c.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateAgentEvent) SetID(id string) {
	c.ID = id
	c.require(createAgentEventFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateAgentEvent) SetTimestamp(timestamp string) {
	c.Timestamp = timestamp
	c.require(createAgentEventFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateAgentEvent) SetMetadata(metadata interface{}) {
	c.Metadata = metadata
	c.require(createAgentEventFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateAgentEvent) SetBody(body *CreateGenerationBody) {
	c.Body = body
	c.require(createAgentEventFieldBody)
}

func (c *CreateAgentEvent) UnmarshalJSON(data []byte) error {
	type unmarshaler CreateAgentEvent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*c = CreateAgentEvent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *c)
	if err != nil {
		return err
	}
	c.extraProperties = extraProperties
	c.rawJSON = json.RawMessage(data)
	return nil
}

func (c *CreateAgentEvent) MarshalJSON() ([]byte, error) {
	type embed CreateAgentEvent
	var marshaler = struct {
		embed
	}{
		embed: embed(*c),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (c *CreateAgentEvent) String() string {
	if len(c.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(c); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", c)
}

var (
	createChainEventFieldID        = big.NewInt(1 << 0)
	createChainEventFieldTimestamp = big.NewInt(1 << 1)
	createChainEventFieldMetadata  = big.NewInt(1 << 2)
	createChainEventFieldBody      = big.NewInt(1 << 3)
)

type CreateChainEvent struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}           `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *CreateGenerationBody `json:"body" url:"body"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (c *CreateChainEvent) GetID() string {
	if c == nil {
		return ""
	}
	return c.ID
}

func (c *CreateChainEvent) GetTimestamp() string {
	if c == nil {
		return ""
	}
	return c.Timestamp
}

func (c *CreateChainEvent) GetMetadata() interface{} {
	if c == nil {
		return nil
	}
	return c.Metadata
}

func (c *CreateChainEvent) GetBody() *CreateGenerationBody {
	if c == nil {
		return nil
	}
	return c.Body
}

func (c *CreateChainEvent) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

func (c *CreateChainEvent) require(field *big.Int) {
	if c.explicitFields == nil {
		c.explicitFields = big.NewInt(0)
	}
	c.explicitFields.Or(c.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateChainEvent) SetID(id string) {
	c.ID = id
	c.require(createChainEventFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateChainEvent) SetTimestamp(timestamp string) {
	c.Timestamp = timestamp
	c.require(createChainEventFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateChainEvent) SetMetadata(metadata interface{}) {
	c.Metadata = metadata
	c.require(createChainEventFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateChainEvent) SetBody(body *CreateGenerationBody) {
	c.Body = body
	c.require(createChainEventFieldBody)
}

func (c *CreateChainEvent) UnmarshalJSON(data []byte) error {
	type unmarshaler CreateChainEvent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*c = CreateChainEvent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *c)
	if err != nil {
		return err
	}
	c.extraProperties = extraProperties
	c.rawJSON = json.RawMessage(data)
	return nil
}

func (c *CreateChainEvent) MarshalJSON() ([]byte, error) {
	type embed CreateChainEvent
	var marshaler = struct {
		embed
	}{
		embed: embed(*c),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (c *CreateChainEvent) String() string {
	if len(c.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(c); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", c)
}

var (
	createEmbeddingEventFieldID        = big.NewInt(1 << 0)
	createEmbeddingEventFieldTimestamp = big.NewInt(1 << 1)
	createEmbeddingEventFieldMetadata  = big.NewInt(1 << 2)
	createEmbeddingEventFieldBody      = big.NewInt(1 << 3)
)

type CreateEmbeddingEvent struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}           `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *CreateGenerationBody `json:"body" url:"body"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (c *CreateEmbeddingEvent) GetID() string {
	if c == nil {
		return ""
	}
	return c.ID
}

func (c *CreateEmbeddingEvent) GetTimestamp() string {
	if c == nil {
		return ""
	}
	return c.Timestamp
}

func (c *CreateEmbeddingEvent) GetMetadata() interface{} {
	if c == nil {
		return nil
	}
	return c.Metadata
}

func (c *CreateEmbeddingEvent) GetBody() *CreateGenerationBody {
	if c == nil {
		return nil
	}
	return c.Body
}

func (c *CreateEmbeddingEvent) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

func (c *CreateEmbeddingEvent) require(field *big.Int) {
	if c.explicitFields == nil {
		c.explicitFields = big.NewInt(0)
	}
	c.explicitFields.Or(c.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEmbeddingEvent) SetID(id string) {
	c.ID = id
	c.require(createEmbeddingEventFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEmbeddingEvent) SetTimestamp(timestamp string) {
	c.Timestamp = timestamp
	c.require(createEmbeddingEventFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEmbeddingEvent) SetMetadata(metadata interface{}) {
	c.Metadata = metadata
	c.require(createEmbeddingEventFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEmbeddingEvent) SetBody(body *CreateGenerationBody) {
	c.Body = body
	c.require(createEmbeddingEventFieldBody)
}

func (c *CreateEmbeddingEvent) UnmarshalJSON(data []byte) error {
	type unmarshaler CreateEmbeddingEvent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*c = CreateEmbeddingEvent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *c)
	if err != nil {
		return err
	}
	c.extraProperties = extraProperties
	c.rawJSON = json.RawMessage(data)
	return nil
}

func (c *CreateEmbeddingEvent) MarshalJSON() ([]byte, error) {
	type embed CreateEmbeddingEvent
	var marshaler = struct {
		embed
	}{
		embed: embed(*c),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (c *CreateEmbeddingEvent) String() string {
	if len(c.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(c); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", c)
}

var (
	createEvaluatorEventFieldID        = big.NewInt(1 << 0)
	createEvaluatorEventFieldTimestamp = big.NewInt(1 << 1)
	createEvaluatorEventFieldMetadata  = big.NewInt(1 << 2)
	createEvaluatorEventFieldBody      = big.NewInt(1 << 3)
)

type CreateEvaluatorEvent struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}           `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *CreateGenerationBody `json:"body" url:"body"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (c *CreateEvaluatorEvent) GetID() string {
	if c == nil {
		return ""
	}
	return c.ID
}

func (c *CreateEvaluatorEvent) GetTimestamp() string {
	if c == nil {
		return ""
	}
	return c.Timestamp
}

func (c *CreateEvaluatorEvent) GetMetadata() interface{} {
	if c == nil {
		return nil
	}
	return c.Metadata
}

func (c *CreateEvaluatorEvent) GetBody() *CreateGenerationBody {
	if c == nil {
		return nil
	}
	return c.Body
}

func (c *CreateEvaluatorEvent) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

func (c *CreateEvaluatorEvent) require(field *big.Int) {
	if c.explicitFields == nil {
		c.explicitFields = big.NewInt(0)
	}
	c.explicitFields.Or(c.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEvaluatorEvent) SetID(id string) {
	c.ID = id
	c.require(createEvaluatorEventFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEvaluatorEvent) SetTimestamp(timestamp string) {
	c.Timestamp = timestamp
	c.require(createEvaluatorEventFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEvaluatorEvent) SetMetadata(metadata interface{}) {
	c.Metadata = metadata
	c.require(createEvaluatorEventFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEvaluatorEvent) SetBody(body *CreateGenerationBody) {
	c.Body = body
	c.require(createEvaluatorEventFieldBody)
}

func (c *CreateEvaluatorEvent) UnmarshalJSON(data []byte) error {
	type unmarshaler CreateEvaluatorEvent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*c = CreateEvaluatorEvent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *c)
	if err != nil {
		return err
	}
	c.extraProperties = extraProperties
	c.rawJSON = json.RawMessage(data)
	return nil
}

func (c *CreateEvaluatorEvent) MarshalJSON() ([]byte, error) {
	type embed CreateEvaluatorEvent
	var marshaler = struct {
		embed
	}{
		embed: embed(*c),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (c *CreateEvaluatorEvent) String() string {
	if len(c.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(c); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", c)
}

var (
	createEventBodyFieldTraceID             = big.NewInt(1 << 0)
	createEventBodyFieldName                = big.NewInt(1 << 1)
	createEventBodyFieldStartTime           = big.NewInt(1 << 2)
	createEventBodyFieldMetadata            = big.NewInt(1 << 3)
	createEventBodyFieldInput               = big.NewInt(1 << 4)
	createEventBodyFieldOutput              = big.NewInt(1 << 5)
	createEventBodyFieldLevel               = big.NewInt(1 << 6)
	createEventBodyFieldStatusMessage       = big.NewInt(1 << 7)
	createEventBodyFieldParentObservationID = big.NewInt(1 << 8)
	createEventBodyFieldVersion             = big.NewInt(1 << 9)
	createEventBodyFieldEnvironment         = big.NewInt(1 << 10)
	createEventBodyFieldID                  = big.NewInt(1 << 11)
)

type CreateEventBody struct {
	TraceID             *string           `json:"traceId,omitempty" url:"traceId,omitempty"`
	Name                *string           `json:"name,omitempty" url:"name,omitempty"`
	StartTime           *time.Time        `json:"startTime,omitempty" url:"startTime,omitempty"`
	Metadata            interface{}       `json:"metadata,omitempty" url:"metadata,omitempty"`
	Input               interface{}       `json:"input,omitempty" url:"input,omitempty"`
	Output              interface{}       `json:"output,omitempty" url:"output,omitempty"`
	Level               *ObservationLevel `json:"level,omitempty" url:"level,omitempty"`
	StatusMessage       *string           `json:"statusMessage,omitempty" url:"statusMessage,omitempty"`
	ParentObservationID *string           `json:"parentObservationId,omitempty" url:"parentObservationId,omitempty"`
	Version             *string           `json:"version,omitempty" url:"version,omitempty"`
	Environment         *string           `json:"environment,omitempty" url:"environment,omitempty"`
	ID                  *string           `json:"id,omitempty" url:"id,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (c *CreateEventBody) GetTraceID() *string {
	if c == nil {
		return nil
	}
	return c.TraceID
}

func (c *CreateEventBody) GetName() *string {
	if c == nil {
		return nil
	}
	return c.Name
}

func (c *CreateEventBody) GetStartTime() *time.Time {
	if c == nil {
		return nil
	}
	return c.StartTime
}

func (c *CreateEventBody) GetMetadata() interface{} {
	if c == nil {
		return nil
	}
	return c.Metadata
}

func (c *CreateEventBody) GetInput() interface{} {
	if c == nil {
		return nil
	}
	return c.Input
}

func (c *CreateEventBody) GetOutput() interface{} {
	if c == nil {
		return nil
	}
	return c.Output
}

func (c *CreateEventBody) GetLevel() *ObservationLevel {
	if c == nil {
		return nil
	}
	return c.Level
}

func (c *CreateEventBody) GetStatusMessage() *string {
	if c == nil {
		return nil
	}
	return c.StatusMessage
}

func (c *CreateEventBody) GetParentObservationID() *string {
	if c == nil {
		return nil
	}
	return c.ParentObservationID
}

func (c *CreateEventBody) GetVersion() *string {
	if c == nil {
		return nil
	}
	return c.Version
}

func (c *CreateEventBody) GetEnvironment() *string {
	if c == nil {
		return nil
	}
	return c.Environment
}

func (c *CreateEventBody) GetID() *string {
	if c == nil {
		return nil
	}
	return c.ID
}

func (c *CreateEventBody) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

func (c *CreateEventBody) require(field *big.Int) {
	if c.explicitFields == nil {
		c.explicitFields = big.NewInt(0)
	}
	c.explicitFields.Or(c.explicitFields, field)
}

// SetTraceID sets the TraceID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventBody) SetTraceID(traceID *string) {
	c.TraceID = traceID
	c.require(createEventBodyFieldTraceID)
}

// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventBody) SetName(name *string) {
	c.Name = name
	c.require(createEventBodyFieldName)
}

// SetStartTime sets the StartTime field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventBody) SetStartTime(startTime *time.Time) {
	c.StartTime = startTime
	c.require(createEventBodyFieldStartTime)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventBody) SetMetadata(metadata interface{}) {
	c.Metadata = metadata
	c.require(createEventBodyFieldMetadata)
}

// SetInput sets the Input field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventBody) SetInput(input interface{}) {
	c.Input = input
	c.require(createEventBodyFieldInput)
}

// SetOutput sets the Output field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventBody) SetOutput(output interface{}) {
	c.Output = output
	c.require(createEventBodyFieldOutput)
}

// SetLevel sets the Level field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventBody) SetLevel(level *ObservationLevel) {
	c.Level = level
	c.require(createEventBodyFieldLevel)
}

// SetStatusMessage sets the StatusMessage field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventBody) SetStatusMessage(statusMessage *string) {
	c.StatusMessage = statusMessage
	c.require(createEventBodyFieldStatusMessage)
}

// SetParentObservationID sets the ParentObservationID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventBody) SetParentObservationID(parentObservationID *string) {
	c.ParentObservationID = parentObservationID
	c.require(createEventBodyFieldParentObservationID)
}

// SetVersion sets the Version field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventBody) SetVersion(version *string) {
	c.Version = version
	c.require(createEventBodyFieldVersion)
}

// SetEnvironment sets the Environment field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventBody) SetEnvironment(environment *string) {
	c.Environment = environment
	c.require(createEventBodyFieldEnvironment)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventBody) SetID(id *string) {
	c.ID = id
	c.require(createEventBodyFieldID)
}

func (c *CreateEventBody) UnmarshalJSON(data []byte) error {
	type embed CreateEventBody
	var unmarshaler = struct {
		embed
		StartTime *internal.DateTime `json:"startTime,omitempty"`
	}{
		embed: embed(*c),
	}
	if err := json.Unmarshal(data, &unmarshaler); err != nil {
		return err
	}
	*c = CreateEventBody(unmarshaler.embed)
	c.StartTime = unmarshaler.StartTime.TimePtr()
	extraProperties, err := internal.ExtractExtraProperties(data, *c)
	if err != nil {
		return err
	}
	c.extraProperties = extraProperties
	c.rawJSON = json.RawMessage(data)
	return nil
}

func (c *CreateEventBody) MarshalJSON() ([]byte, error) {
	type embed CreateEventBody
	var marshaler = struct {
		embed
		StartTime *internal.DateTime `json:"startTime,omitempty"`
	}{
		embed:     embed(*c),
		StartTime: internal.NewOptionalDateTime(c.StartTime),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (c *CreateEventBody) String() string {
	if len(c.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(c); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", c)
}

var (
	createEventEventFieldID        = big.NewInt(1 << 0)
	createEventEventFieldTimestamp = big.NewInt(1 << 1)
	createEventEventFieldMetadata  = big.NewInt(1 << 2)
	createEventEventFieldBody      = big.NewInt(1 << 3)
)

type CreateEventEvent struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}      `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *CreateEventBody `json:"body" url:"body"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (c *CreateEventEvent) GetID() string {
	if c == nil {
		return ""
	}
	return c.ID
}

func (c *CreateEventEvent) GetTimestamp() string {
	if c == nil {
		return ""
	}
	return c.Timestamp
}

func (c *CreateEventEvent) GetMetadata() interface{} {
	if c == nil {
		return nil
	}
	return c.Metadata
}

func (c *CreateEventEvent) GetBody() *CreateEventBody {
	if c == nil {
		return nil
	}
	return c.Body
}

func (c *CreateEventEvent) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

func (c *CreateEventEvent) require(field *big.Int) {
	if c.explicitFields == nil {
		c.explicitFields = big.NewInt(0)
	}
	c.explicitFields.Or(c.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventEvent) SetID(id string) {
	c.ID = id
	c.require(createEventEventFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventEvent) SetTimestamp(timestamp string) {
	c.Timestamp = timestamp
	c.require(createEventEventFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventEvent) SetMetadata(metadata interface{}) {
	c.Metadata = metadata
	c.require(createEventEventFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventEvent) SetBody(body *CreateEventBody) {
	c.Body = body
	c.require(createEventEventFieldBody)
}

func (c *CreateEventEvent) UnmarshalJSON(data []byte) error {
	type unmarshaler CreateEventEvent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*c = CreateEventEvent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *c)
	if err != nil {
		return err
	}
	c.extraProperties = extraProperties
	c.rawJSON = json.RawMessage(data)
	return nil
}

func (c *CreateEventEvent) MarshalJSON() ([]byte, error) {
	type embed CreateEventEvent
	var marshaler = struct {
		embed
	}{
		embed: embed(*c),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (c *CreateEventEvent) String() string {
	if len(c.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(c); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", c)
}

var (
	createGenerationBodyFieldTraceID             = big.NewInt(1 << 0)
	createGenerationBodyFieldName                = big.NewInt(1 << 1)
	createGenerationBodyFieldStartTime           = big.NewInt(1 << 2)
	createGenerationBodyFieldMetadata            = big.NewInt(1 << 3)
	createGenerationBodyFieldInput               = big.NewInt(1 << 4)
	createGenerationBodyFieldOutput              = big.NewInt(1 << 5)
	createGenerationBodyFieldLevel               = big.NewInt(1 << 6)
	createGenerationBodyFieldStatusMessage       = big.NewInt(1 << 7)
	createGenerationBodyFieldParentObservationID = big.NewInt(1 << 8)
	createGenerationBodyFieldVersion             = big.NewInt(1 << 9)
	createGenerationBodyFieldEnvironment         = big.NewInt(1 << 10)
	createGenerationBodyFieldID                  = big.NewInt(1 << 11)
	createGenerationBodyFieldEndTime             = big.NewInt(1 << 12)
	createGenerationBodyFieldCompletionStartTime = big.NewInt(1 << 13)
	createGenerationBodyFieldModel               = big.NewInt(1 << 14)
	createGenerationBodyFieldModelParameters     = big.NewInt(1 << 15)
	createGenerationBodyFieldUsage               = big.NewInt(1 << 16)
	createGenerationBodyFieldUsageDetails        = big.NewInt(1 << 17)
	createGenerationBodyFieldCostDetails         = big.NewInt(1 << 18)
	createGenerationBodyFieldPromptName          = big.NewInt(1 << 19)
	createGenerationBodyFieldPromptVersion       = big.NewInt(1 << 20)
)

type CreateGenerationBody struct {
	TraceID             *string              `json:"traceId,omitempty" url:"traceId,omitempty"`
	Name                *string              `json:"name,omitempty" url:"name,omitempty"`
	StartTime           *time.Time           `json:"startTime,omitempty" url:"startTime,omitempty"`
	Metadata            interface{}          `json:"metadata,omitempty" url:"metadata,omitempty"`
	Input               interface{}          `json:"input,omitempty" url:"input,omitempty"`
	Output              interface{}          `json:"output,omitempty" url:"output,omitempty"`
	Level               *ObservationLevel    `json:"level,omitempty" url:"level,omitempty"`
	StatusMessage       *string              `json:"statusMessage,omitempty" url:"statusMessage,omitempty"`
	ParentObservationID *string              `json:"parentObservationId,omitempty" url:"parentObservationId,omitempty"`
	Version             *string              `json:"version,omitempty" url:"version,omitempty"`
	Environment         *string              `json:"environment,omitempty" url:"environment,omitempty"`
	ID                  *string              `json:"id,omitempty" url:"id,omitempty"`
	EndTime             *time.Time           `json:"endTime,omitempty" url:"endTime,omitempty"`
	CompletionStartTime *time.Time           `json:"completionStartTime,omitempty" url:"completionStartTime,omitempty"`
	Model               *string              `json:"model,omitempty" url:"model,omitempty"`
	ModelParameters     map[string]*MapValue `json:"modelParameters,omitempty" url:"modelParameters,omitempty"`
	Usage               *IngestionUsage      `json:"usage,omitempty" url:"usage,omitempty"`
	UsageDetails        *UsageDetails        `json:"usageDetails,omitempty" url:"usageDetails,omitempty"`
	CostDetails         map[string]*float64  `json:"costDetails,omitempty" url:"costDetails,omitempty"`
	PromptName          *string              `json:"promptName,omitempty" url:"promptName,omitempty"`
	PromptVersion       *int                 `json:"promptVersion,omitempty" url:"promptVersion,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (c *CreateGenerationBody) GetTraceID() *string {
	if c == nil {
		return nil
	}
	return c.TraceID
}

func (c *CreateGenerationBody) GetName() *string {
	if c == nil {
		return nil
	}
	return c.Name
}

func (c *CreateGenerationBody) GetStartTime() *time.Time {
	if c == nil {
		return nil
	}
	return c.StartTime
}

func (c *CreateGenerationBody) GetMetadata() interface{} {
	if c == nil {
		return nil
	}
	return c.Metadata
}

func (c *CreateGenerationBody) GetInput() interface{} {
	if c == nil {
		return nil
	}
	return c.Input
}

func (c *CreateGenerationBody) GetOutput() interface{} {
	if c == nil {
		return nil
	}
	return c.Output
}

func (c *CreateGenerationBody) GetLevel() *ObservationLevel {
	if c == nil {
		return nil
	}
	return c.Level
}

func (c *CreateGenerationBody) GetStatusMessage() *string {
	if c == nil {
		return nil
	}
	return c.StatusMessage
}

func (c *CreateGenerationBody) GetParentObservationID() *string {
	if c == nil {
		return nil
	}
	return c.ParentObservationID
}

func (c *CreateGenerationBody) GetVersion() *string {
	if c == nil {
		return nil
	}
	return c.Version
}

func (c *CreateGenerationBody) GetEnvironment() *string {
	if c == nil {
		return nil
	}
	return c.Environment
}

func (c *CreateGenerationBody) GetID() *string {
	if c == nil {
		return nil
	}
	return c.ID
}

func (c *CreateGenerationBody) GetEndTime() *time.Time {
	if c == nil {
		return nil
	}
	return c.EndTime
}

func (c *CreateGenerationBody) GetCompletionStartTime() *time.Time {
	if c == nil {
		return nil
	}
	return c.CompletionStartTime
}

func (c *CreateGenerationBody) GetModel() *string {
	if c == nil {
		return nil
	}
	return c.Model
}

func (c *CreateGenerationBody) GetModelParameters() map[string]*MapValue {
	if c == nil {
		return nil
	}
	return c.ModelParameters
}

func (c *CreateGenerationBody) GetUsage() *IngestionUsage {
	if c == nil {
		return nil
	}
	return c.Usage
}

func (c *CreateGenerationBody) GetUsageDetails() *UsageDetails {
	if c == nil {
		return nil
	}
	return c.UsageDetails
}

func (c *CreateGenerationBody) GetCostDetails() map[string]*float64 {
	if c == nil {
		return nil
	}
	return c.CostDetails
}

func (c *CreateGenerationBody) GetPromptName() *string {
	if c == nil {
		return nil
	}
	return c.PromptName
}

func (c *CreateGenerationBody) GetPromptVersion() *int {
	if c == nil {
		return nil
	}
	return c.PromptVersion
}

func (c *CreateGenerationBody) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

func (c *CreateGenerationBody) require(field *big.Int) {
	if c.explicitFields == nil {
		c.explicitFields = big.NewInt(0)
	}
	c.explicitFields.Or(c.explicitFields, field)
}

// SetTraceID sets the TraceID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationBody) SetTraceID(traceID *string) {
	c.TraceID = traceID
	c.require(createGenerationBodyFieldTraceID)
}

// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationBody) SetName(name *string) {
	c.Name = name
	c.require(createGenerationBodyFieldName)
}

// SetStartTime sets the StartTime field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationBody) SetStartTime(startTime *time.Time) {
	c.StartTime = startTime
	c.require(createGenerationBodyFieldStartTime)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationBody) SetMetadata(metadata interface{}) {
	c.Metadata = metadata
	c.require(createGenerationBodyFieldMetadata)
}

// SetInput sets the Input field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationBody) SetInput(input interface{}) {
	c.Input = input
	c.require(createGenerationBodyFieldInput)
}

// SetOutput sets the Output field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationBody) SetOutput(output interface{}) {
	c.Output = output
	c.require(createGenerationBodyFieldOutput)
}

// SetLevel sets the Level field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationBody) SetLevel(level *ObservationLevel) {
	c.Level = level
	c.require(createGenerationBodyFieldLevel)
}

// SetStatusMessage sets the StatusMessage field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationBody) SetStatusMessage(statusMessage *string) {
	c.StatusMessage = statusMessage
	c.require(createGenerationBodyFieldStatusMessage)
}

// SetParentObservationID sets the ParentObservationID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationBody) SetParentObservationID(parentObservationID *string) {
	c.ParentObservationID = parentObservationID
	c.require(createGenerationBodyFieldParentObservationID)
}

// SetVersion sets the Version field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationBody) SetVersion(version *string) {
	c.Version = version
	c.require(createGenerationBodyFieldVersion)
}

// SetEnvironment sets the Environment field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationBody) SetEnvironment(environment *string) {
	c.Environment = environment
	c.require(createGenerationBodyFieldEnvironment)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationBody) SetID(id *string) {
	c.ID = id
	c.require(createGenerationBodyFieldID)
}

// SetEndTime sets the EndTime field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationBody) SetEndTime(endTime *time.Time) {
	c.EndTime = endTime
	c.require(createGenerationBodyFieldEndTime)
}

// SetCompletionStartTime sets the CompletionStartTime field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationBody) SetCompletionStartTime(completionStartTime *time.Time) {
	c.CompletionStartTime = completionStartTime
	c.require(createGenerationBodyFieldCompletionStartTime)
}

// SetModel sets the Model field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationBody) SetModel(model *string) {
	c.Model = model
	c.require(createGenerationBodyFieldModel)
}

// SetModelParameters sets the ModelParameters field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationBody) SetModelParameters(modelParameters map[string]*MapValue) {
	c.ModelParameters = modelParameters
	c.require(createGenerationBodyFieldModelParameters)
}

// SetUsage sets the Usage field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationBody) SetUsage(usage *IngestionUsage) {
	c.Usage = usage
	c.require(createGenerationBodyFieldUsage)
}

// SetUsageDetails sets the UsageDetails field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationBody) SetUsageDetails(usageDetails *UsageDetails) {
	c.UsageDetails = usageDetails
	c.require(createGenerationBodyFieldUsageDetails)
}

// SetCostDetails sets the CostDetails field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationBody) SetCostDetails(costDetails map[string]*float64) {
	c.CostDetails = costDetails
	c.require(createGenerationBodyFieldCostDetails)
}

// SetPromptName sets the PromptName field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationBody) SetPromptName(promptName *string) {
	c.PromptName = promptName
	c.require(createGenerationBodyFieldPromptName)
}

// SetPromptVersion sets the PromptVersion field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationBody) SetPromptVersion(promptVersion *int) {
	c.PromptVersion = promptVersion
	c.require(createGenerationBodyFieldPromptVersion)
}

func (c *CreateGenerationBody) UnmarshalJSON(data []byte) error {
	type embed CreateGenerationBody
	var unmarshaler = struct {
		embed
		StartTime           *internal.DateTime `json:"startTime,omitempty"`
		EndTime             *internal.DateTime `json:"endTime,omitempty"`
		CompletionStartTime *internal.DateTime `json:"completionStartTime,omitempty"`
	}{
		embed: embed(*c),
	}
	if err := json.Unmarshal(data, &unmarshaler); err != nil {
		return err
	}
	*c = CreateGenerationBody(unmarshaler.embed)
	c.StartTime = unmarshaler.StartTime.TimePtr()
	c.EndTime = unmarshaler.EndTime.TimePtr()
	c.CompletionStartTime = unmarshaler.CompletionStartTime.TimePtr()
	extraProperties, err := internal.ExtractExtraProperties(data, *c)
	if err != nil {
		return err
	}
	c.extraProperties = extraProperties
	c.rawJSON = json.RawMessage(data)
	return nil
}

func (c *CreateGenerationBody) MarshalJSON() ([]byte, error) {
	type embed CreateGenerationBody
	var marshaler = struct {
		embed
		StartTime           *internal.DateTime `json:"startTime,omitempty"`
		EndTime             *internal.DateTime `json:"endTime,omitempty"`
		CompletionStartTime *internal.DateTime `json:"completionStartTime,omitempty"`
	}{
		embed:               embed(*c),
		StartTime:           internal.NewOptionalDateTime(c.StartTime),
		EndTime:             internal.NewOptionalDateTime(c.EndTime),
		CompletionStartTime: internal.NewOptionalDateTime(c.CompletionStartTime),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (c *CreateGenerationBody) String() string {
	if len(c.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(c); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", c)
}

var (
	createGenerationEventFieldID        = big.NewInt(1 << 0)
	createGenerationEventFieldTimestamp = big.NewInt(1 << 1)
	createGenerationEventFieldMetadata  = big.NewInt(1 << 2)
	createGenerationEventFieldBody      = big.NewInt(1 << 3)
)

type CreateGenerationEvent struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}           `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *CreateGenerationBody `json:"body" url:"body"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (c *CreateGenerationEvent) GetID() string {
	if c == nil {
		return ""
	}
	return c.ID
}

func (c *CreateGenerationEvent) GetTimestamp() string {
	if c == nil {
		return ""
	}
	return c.Timestamp
}

func (c *CreateGenerationEvent) GetMetadata() interface{} {
	if c == nil {
		return nil
	}
	return c.Metadata
}

func (c *CreateGenerationEvent) GetBody() *CreateGenerationBody {
	if c == nil {
		return nil
	}
	return c.Body
}

func (c *CreateGenerationEvent) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

func (c *CreateGenerationEvent) require(field *big.Int) {
	if c.explicitFields == nil {
		c.explicitFields = big.NewInt(0)
	}
	c.explicitFields.Or(c.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationEvent) SetID(id string) {
	c.ID = id
	c.require(createGenerationEventFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationEvent) SetTimestamp(timestamp string) {
	c.Timestamp = timestamp
	c.require(createGenerationEventFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationEvent) SetMetadata(metadata interface{}) {
	c.Metadata = metadata
	c.require(createGenerationEventFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGenerationEvent) SetBody(body *CreateGenerationBody) {
	c.Body = body
	c.require(createGenerationEventFieldBody)
}

func (c *CreateGenerationEvent) UnmarshalJSON(data []byte) error {
	type unmarshaler CreateGenerationEvent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*c = CreateGenerationEvent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *c)
	if err != nil {
		return err
	}
	c.extraProperties = extraProperties
	c.rawJSON = json.RawMessage(data)
	return nil
}

func (c *CreateGenerationEvent) MarshalJSON() ([]byte, error) {
	type embed CreateGenerationEvent
	var marshaler = struct {
		embed
	}{
		embed: embed(*c),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (c *CreateGenerationEvent) String() string {
	if len(c.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(c); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", c)
}

var (
	createGuardrailEventFieldID        = big.NewInt(1 << 0)
	createGuardrailEventFieldTimestamp = big.NewInt(1 << 1)
	createGuardrailEventFieldMetadata  = big.NewInt(1 << 2)
	createGuardrailEventFieldBody      = big.NewInt(1 << 3)
)

type CreateGuardrailEvent struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}           `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *CreateGenerationBody `json:"body" url:"body"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (c *CreateGuardrailEvent) GetID() string {
	if c == nil {
		return ""
	}
	return c.ID
}

func (c *CreateGuardrailEvent) GetTimestamp() string {
	if c == nil {
		return ""
	}
	return c.Timestamp
}

func (c *CreateGuardrailEvent) GetMetadata() interface{} {
	if c == nil {
		return nil
	}
	return c.Metadata
}

func (c *CreateGuardrailEvent) GetBody() *CreateGenerationBody {
	if c == nil {
		return nil
	}
	return c.Body
}

func (c *CreateGuardrailEvent) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

func (c *CreateGuardrailEvent) require(field *big.Int) {
	if c.explicitFields == nil {
		c.explicitFields = big.NewInt(0)
	}
	c.explicitFields.Or(c.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGuardrailEvent) SetID(id string) {
	c.ID = id
	c.require(createGuardrailEventFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGuardrailEvent) SetTimestamp(timestamp string) {
	c.Timestamp = timestamp
	c.require(createGuardrailEventFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGuardrailEvent) SetMetadata(metadata interface{}) {
	c.Metadata = metadata
	c.require(createGuardrailEventFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateGuardrailEvent) SetBody(body *CreateGenerationBody) {
	c.Body = body
	c.require(createGuardrailEventFieldBody)
}

func (c *CreateGuardrailEvent) UnmarshalJSON(data []byte) error {
	type unmarshaler CreateGuardrailEvent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*c = CreateGuardrailEvent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *c)
	if err != nil {
		return err
	}
	c.extraProperties = extraProperties
	c.rawJSON = json.RawMessage(data)
	return nil
}

func (c *CreateGuardrailEvent) MarshalJSON() ([]byte, error) {
	type embed CreateGuardrailEvent
	var marshaler = struct {
		embed
	}{
		embed: embed(*c),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (c *CreateGuardrailEvent) String() string {
	if len(c.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(c); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", c)
}

var (
	createObservationEventFieldID        = big.NewInt(1 << 0)
	createObservationEventFieldTimestamp = big.NewInt(1 << 1)
	createObservationEventFieldMetadata  = big.NewInt(1 << 2)
	createObservationEventFieldBody      = big.NewInt(1 << 3)
)

type CreateObservationEvent struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}      `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *ObservationBody `json:"body" url:"body"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (c *CreateObservationEvent) GetID() string {
	if c == nil {
		return ""
	}
	return c.ID
}

func (c *CreateObservationEvent) GetTimestamp() string {
	if c == nil {
		return ""
	}
	return c.Timestamp
}

func (c *CreateObservationEvent) GetMetadata() interface{} {
	if c == nil {
		return nil
	}
	return c.Metadata
}

func (c *CreateObservationEvent) GetBody() *ObservationBody {
	if c == nil {
		return nil
	}
	return c.Body
}

func (c *CreateObservationEvent) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

func (c *CreateObservationEvent) require(field *big.Int) {
	if c.explicitFields == nil {
		c.explicitFields = big.NewInt(0)
	}
	c.explicitFields.Or(c.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateObservationEvent) SetID(id string) {
	c.ID = id
	c.require(createObservationEventFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateObservationEvent) SetTimestamp(timestamp string) {
	c.Timestamp = timestamp
	c.require(createObservationEventFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateObservationEvent) SetMetadata(metadata interface{}) {
	c.Metadata = metadata
	c.require(createObservationEventFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateObservationEvent) SetBody(body *ObservationBody) {
	c.Body = body
	c.require(createObservationEventFieldBody)
}

func (c *CreateObservationEvent) UnmarshalJSON(data []byte) error {
	type unmarshaler CreateObservationEvent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*c = CreateObservationEvent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *c)
	if err != nil {
		return err
	}
	c.extraProperties = extraProperties
	c.rawJSON = json.RawMessage(data)
	return nil
}

func (c *CreateObservationEvent) MarshalJSON() ([]byte, error) {
	type embed CreateObservationEvent
	var marshaler = struct {
		embed
	}{
		embed: embed(*c),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (c *CreateObservationEvent) String() string {
	if len(c.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(c); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", c)
}

var (
	createRetrieverEventFieldID        = big.NewInt(1 << 0)
	createRetrieverEventFieldTimestamp = big.NewInt(1 << 1)
	createRetrieverEventFieldMetadata  = big.NewInt(1 << 2)
	createRetrieverEventFieldBody      = big.NewInt(1 << 3)
)

type CreateRetrieverEvent struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}           `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *CreateGenerationBody `json:"body" url:"body"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (c *CreateRetrieverEvent) GetID() string {
	if c == nil {
		return ""
	}
	return c.ID
}

func (c *CreateRetrieverEvent) GetTimestamp() string {
	if c == nil {
		return ""
	}
	return c.Timestamp
}

func (c *CreateRetrieverEvent) GetMetadata() interface{} {
	if c == nil {
		return nil
	}
	return c.Metadata
}

func (c *CreateRetrieverEvent) GetBody() *CreateGenerationBody {
	if c == nil {
		return nil
	}
	return c.Body
}

func (c *CreateRetrieverEvent) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

func (c *CreateRetrieverEvent) require(field *big.Int) {
	if c.explicitFields == nil {
		c.explicitFields = big.NewInt(0)
	}
	c.explicitFields.Or(c.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateRetrieverEvent) SetID(id string) {
	c.ID = id
	c.require(createRetrieverEventFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateRetrieverEvent) SetTimestamp(timestamp string) {
	c.Timestamp = timestamp
	c.require(createRetrieverEventFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateRetrieverEvent) SetMetadata(metadata interface{}) {
	c.Metadata = metadata
	c.require(createRetrieverEventFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateRetrieverEvent) SetBody(body *CreateGenerationBody) {
	c.Body = body
	c.require(createRetrieverEventFieldBody)
}

func (c *CreateRetrieverEvent) UnmarshalJSON(data []byte) error {
	type unmarshaler CreateRetrieverEvent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*c = CreateRetrieverEvent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *c)
	if err != nil {
		return err
	}
	c.extraProperties = extraProperties
	c.rawJSON = json.RawMessage(data)
	return nil
}

func (c *CreateRetrieverEvent) MarshalJSON() ([]byte, error) {
	type embed CreateRetrieverEvent
	var marshaler = struct {
		embed
	}{
		embed: embed(*c),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (c *CreateRetrieverEvent) String() string {
	if len(c.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(c); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", c)
}

var (
	createSpanBodyFieldTraceID             = big.NewInt(1 << 0)
	createSpanBodyFieldName                = big.NewInt(1 << 1)
	createSpanBodyFieldStartTime           = big.NewInt(1 << 2)
	createSpanBodyFieldMetadata            = big.NewInt(1 << 3)
	createSpanBodyFieldInput               = big.NewInt(1 << 4)
	createSpanBodyFieldOutput              = big.NewInt(1 << 5)
	createSpanBodyFieldLevel               = big.NewInt(1 << 6)
	createSpanBodyFieldStatusMessage       = big.NewInt(1 << 7)
	createSpanBodyFieldParentObservationID = big.NewInt(1 << 8)
	createSpanBodyFieldVersion             = big.NewInt(1 << 9)
	createSpanBodyFieldEnvironment         = big.NewInt(1 << 10)
	createSpanBodyFieldID                  = big.NewInt(1 << 11)
	createSpanBodyFieldEndTime             = big.NewInt(1 << 12)
)

type CreateSpanBody struct {
	TraceID             *string           `json:"traceId,omitempty" url:"traceId,omitempty"`
	Name                *string           `json:"name,omitempty" url:"name,omitempty"`
	StartTime           *time.Time        `json:"startTime,omitempty" url:"startTime,omitempty"`
	Metadata            interface{}       `json:"metadata,omitempty" url:"metadata,omitempty"`
	Input               interface{}       `json:"input,omitempty" url:"input,omitempty"`
	Output              interface{}       `json:"output,omitempty" url:"output,omitempty"`
	Level               *ObservationLevel `json:"level,omitempty" url:"level,omitempty"`
	StatusMessage       *string           `json:"statusMessage,omitempty" url:"statusMessage,omitempty"`
	ParentObservationID *string           `json:"parentObservationId,omitempty" url:"parentObservationId,omitempty"`
	Version             *string           `json:"version,omitempty" url:"version,omitempty"`
	Environment         *string           `json:"environment,omitempty" url:"environment,omitempty"`
	ID                  *string           `json:"id,omitempty" url:"id,omitempty"`
	EndTime             *time.Time        `json:"endTime,omitempty" url:"endTime,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (c *CreateSpanBody) GetTraceID() *string {
	if c == nil {
		return nil
	}
	return c.TraceID
}

func (c *CreateSpanBody) GetName() *string {
	if c == nil {
		return nil
	}
	return c.Name
}

func (c *CreateSpanBody) GetStartTime() *time.Time {
	if c == nil {
		return nil
	}
	return c.StartTime
}

func (c *CreateSpanBody) GetMetadata() interface{} {
	if c == nil {
		return nil
	}
	return c.Metadata
}

func (c *CreateSpanBody) GetInput() interface{} {
	if c == nil {
		return nil
	}
	return c.Input
}

func (c *CreateSpanBody) GetOutput() interface{} {
	if c == nil {
		return nil
	}
	return c.Output
}

func (c *CreateSpanBody) GetLevel() *ObservationLevel {
	if c == nil {
		return nil
	}
	return c.Level
}

func (c *CreateSpanBody) GetStatusMessage() *string {
	if c == nil {
		return nil
	}
	return c.StatusMessage
}

func (c *CreateSpanBody) GetParentObservationID() *string {
	if c == nil {
		return nil
	}
	return c.ParentObservationID
}

func (c *CreateSpanBody) GetVersion() *string {
	if c == nil {
		return nil
	}
	return c.Version
}

func (c *CreateSpanBody) GetEnvironment() *string {
	if c == nil {
		return nil
	}
	return c.Environment
}

func (c *CreateSpanBody) GetID() *string {
	if c == nil {
		return nil
	}
	return c.ID
}

func (c *CreateSpanBody) GetEndTime() *time.Time {
	if c == nil {
		return nil
	}
	return c.EndTime
}

func (c *CreateSpanBody) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

func (c *CreateSpanBody) require(field *big.Int) {
	if c.explicitFields == nil {
		c.explicitFields = big.NewInt(0)
	}
	c.explicitFields.Or(c.explicitFields, field)
}

// SetTraceID sets the TraceID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateSpanBody) SetTraceID(traceID *string) {
	c.TraceID = traceID
	c.require(createSpanBodyFieldTraceID)
}

// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateSpanBody) SetName(name *string) {
	c.Name = name
	c.require(createSpanBodyFieldName)
}

// SetStartTime sets the StartTime field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateSpanBody) SetStartTime(startTime *time.Time) {
	c.StartTime = startTime
	c.require(createSpanBodyFieldStartTime)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateSpanBody) SetMetadata(metadata interface{}) {
	c.Metadata = metadata
	c.require(createSpanBodyFieldMetadata)
}

// SetInput sets the Input field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateSpanBody) SetInput(input interface{}) {
	c.Input = input
	c.require(createSpanBodyFieldInput)
}

// SetOutput sets the Output field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateSpanBody) SetOutput(output interface{}) {
	c.Output = output
	c.require(createSpanBodyFieldOutput)
}

// SetLevel sets the Level field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateSpanBody) SetLevel(level *ObservationLevel) {
	c.Level = level
	c.require(createSpanBodyFieldLevel)
}

// SetStatusMessage sets the StatusMessage field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateSpanBody) SetStatusMessage(statusMessage *string) {
	c.StatusMessage = statusMessage
	c.require(createSpanBodyFieldStatusMessage)
}

// SetParentObservationID sets the ParentObservationID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateSpanBody) SetParentObservationID(parentObservationID *string) {
	c.ParentObservationID = parentObservationID
	c.require(createSpanBodyFieldParentObservationID)
}

// SetVersion sets the Version field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateSpanBody) SetVersion(version *string) {
	c.Version = version
	c.require(createSpanBodyFieldVersion)
}

// SetEnvironment sets the Environment field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateSpanBody) SetEnvironment(environment *string) {
	c.Environment = environment
	c.require(createSpanBodyFieldEnvironment)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateSpanBody) SetID(id *string) {
	c.ID = id
	c.require(createSpanBodyFieldID)
}

// SetEndTime sets the EndTime field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateSpanBody) SetEndTime(endTime *time.Time) {
	c.EndTime = endTime
	c.require(createSpanBodyFieldEndTime)
}

func (c *CreateSpanBody) UnmarshalJSON(data []byte) error {
	type embed CreateSpanBody
	var unmarshaler = struct {
		embed
		StartTime *internal.DateTime `json:"startTime,omitempty"`
		EndTime   *internal.DateTime `json:"endTime,omitempty"`
	}{
		embed: embed(*c),
	}
	if err := json.Unmarshal(data, &unmarshaler); err != nil {
		return err
	}
	*c = CreateSpanBody(unmarshaler.embed)
	c.StartTime = unmarshaler.StartTime.TimePtr()
	c.EndTime = unmarshaler.EndTime.TimePtr()
	extraProperties, err := internal.ExtractExtraProperties(data, *c)
	if err != nil {
		return err
	}
	c.extraProperties = extraProperties
	c.rawJSON = json.RawMessage(data)
	return nil
}

func (c *CreateSpanBody) MarshalJSON() ([]byte, error) {
	type embed CreateSpanBody
	var marshaler = struct {
		embed
		StartTime *internal.DateTime `json:"startTime,omitempty"`
		EndTime   *internal.DateTime `json:"endTime,omitempty"`
	}{
		embed:     embed(*c),
		StartTime: internal.NewOptionalDateTime(c.StartTime),
		EndTime:   internal.NewOptionalDateTime(c.EndTime),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (c *CreateSpanBody) String() string {
	if len(c.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(c); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", c)
}

var (
	createSpanEventFieldID        = big.NewInt(1 << 0)
	createSpanEventFieldTimestamp = big.NewInt(1 << 1)
	createSpanEventFieldMetadata  = big.NewInt(1 << 2)
	createSpanEventFieldBody      = big.NewInt(1 << 3)
)

type CreateSpanEvent struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}     `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *CreateSpanBody `json:"body" url:"body"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (c *CreateSpanEvent) GetID() string {
	if c == nil {
		return ""
	}
	return c.ID
}

func (c *CreateSpanEvent) GetTimestamp() string {
	if c == nil {
		return ""
	}
	return c.Timestamp
}

func (c *CreateSpanEvent) GetMetadata() interface{} {
	if c == nil {
		return nil
	}
	return c.Metadata
}

func (c *CreateSpanEvent) GetBody() *CreateSpanBody {
	if c == nil {
		return nil
	}
	return c.Body
}

func (c *CreateSpanEvent) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

func (c *CreateSpanEvent) require(field *big.Int) {
	if c.explicitFields == nil {
		c.explicitFields = big.NewInt(0)
	}
	c.explicitFields.Or(c.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateSpanEvent) SetID(id string) {
	c.ID = id
	c.require(createSpanEventFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateSpanEvent) SetTimestamp(timestamp string) {
	c.Timestamp = timestamp
	c.require(createSpanEventFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateSpanEvent) SetMetadata(metadata interface{}) {
	c.Metadata = metadata
	c.require(createSpanEventFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateSpanEvent) SetBody(body *CreateSpanBody) {
	c.Body = body
	c.require(createSpanEventFieldBody)
}

func (c *CreateSpanEvent) UnmarshalJSON(data []byte) error {
	type unmarshaler CreateSpanEvent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*c = CreateSpanEvent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *c)
	if err != nil {
		return err
	}
	c.extraProperties = extraProperties
	c.rawJSON = json.RawMessage(data)
	return nil
}

func (c *CreateSpanEvent) MarshalJSON() ([]byte, error) {
	type embed CreateSpanEvent
	var marshaler = struct {
		embed
	}{
		embed: embed(*c),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (c *CreateSpanEvent) String() string {
	if len(c.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(c); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", c)
}

var (
	createToolEventFieldID        = big.NewInt(1 << 0)
	createToolEventFieldTimestamp = big.NewInt(1 << 1)
	createToolEventFieldMetadata  = big.NewInt(1 << 2)
	createToolEventFieldBody      = big.NewInt(1 << 3)
)

type CreateToolEvent struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}           `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *CreateGenerationBody `json:"body" url:"body"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (c *CreateToolEvent) GetID() string {
	if c == nil {
		return ""
	}
	return c.ID
}

func (c *CreateToolEvent) GetTimestamp() string {
	if c == nil {
		return ""
	}
	return c.Timestamp
}

func (c *CreateToolEvent) GetMetadata() interface{} {
	if c == nil {
		return nil
	}
	return c.Metadata
}

func (c *CreateToolEvent) GetBody() *CreateGenerationBody {
	if c == nil {
		return nil
	}
	return c.Body
}

func (c *CreateToolEvent) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

func (c *CreateToolEvent) require(field *big.Int) {
	if c.explicitFields == nil {
		c.explicitFields = big.NewInt(0)
	}
	c.explicitFields.Or(c.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateToolEvent) SetID(id string) {
	c.ID = id
	c.require(createToolEventFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateToolEvent) SetTimestamp(timestamp string) {
	c.Timestamp = timestamp
	c.require(createToolEventFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateToolEvent) SetMetadata(metadata interface{}) {
	c.Metadata = metadata
	c.require(createToolEventFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateToolEvent) SetBody(body *CreateGenerationBody) {
	c.Body = body
	c.require(createToolEventFieldBody)
}

func (c *CreateToolEvent) UnmarshalJSON(data []byte) error {
	type unmarshaler CreateToolEvent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*c = CreateToolEvent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *c)
	if err != nil {
		return err
	}
	c.extraProperties = extraProperties
	c.rawJSON = json.RawMessage(data)
	return nil
}

func (c *CreateToolEvent) MarshalJSON() ([]byte, error) {
	type embed CreateToolEvent
	var marshaler = struct {
		embed
	}{
		embed: embed(*c),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (c *CreateToolEvent) String() string {
	if len(c.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(c); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", c)
}

var (
	ingestionErrorFieldID      = big.NewInt(1 << 0)
	ingestionErrorFieldStatus  = big.NewInt(1 << 1)
	ingestionErrorFieldMessage = big.NewInt(1 << 2)
	ingestionErrorFieldError   = big.NewInt(1 << 3)
)

type IngestionError struct {
	ID      string      `json:"id" url:"id"`
	Status  int         `json:"status" url:"status"`
	Message *string     `json:"message,omitempty" url:"message,omitempty"`
	Error   interface{} `json:"error,omitempty" url:"error,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (i *IngestionError) GetID() string {
	if i == nil {
		return ""
	}
	return i.ID
}

func (i *IngestionError) GetStatus() int {
	if i == nil {
		return 0
	}
	return i.Status
}

func (i *IngestionError) GetMessage() *string {
	if i == nil {
		return nil
	}
	return i.Message
}

func (i *IngestionError) GetError() interface{} {
	if i == nil {
		return nil
	}
	return i.Error
}

func (i *IngestionError) GetExtraProperties() map[string]interface{} {
	return i.extraProperties
}

func (i *IngestionError) require(field *big.Int) {
	if i.explicitFields == nil {
		i.explicitFields = big.NewInt(0)
	}
	i.explicitFields.Or(i.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionError) SetID(id string) {
	i.ID = id
	i.require(ingestionErrorFieldID)
}

// SetStatus sets the Status field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionError) SetStatus(status int) {
	i.Status = status
	i.require(ingestionErrorFieldStatus)
}

// SetMessage sets the Message field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionError) SetMessage(message *string) {
	i.Message = message
	i.require(ingestionErrorFieldMessage)
}

// SetError sets the Error field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionError) SetError(error_ interface{}) {
	i.Error = error_
	i.require(ingestionErrorFieldError)
}

func (i *IngestionError) UnmarshalJSON(data []byte) error {
	type unmarshaler IngestionError
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*i = IngestionError(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *i)
	if err != nil {
		return err
	}
	i.extraProperties = extraProperties
	i.rawJSON = json.RawMessage(data)
	return nil
}

func (i *IngestionError) MarshalJSON() ([]byte, error) {
	type embed IngestionError
	var marshaler = struct {
		embed
	}{
		embed: embed(*i),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (i *IngestionError) String() string {
	if len(i.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(i.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(i); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", i)
}

type IngestionEvent struct {
	IngestionEventZero     *IngestionEventZero
	IngestionEventOne      *IngestionEventOne
	IngestionEventTwo      *IngestionEventTwo
	IngestionEventThree    *IngestionEventThree
	IngestionEventFour     *IngestionEventFour
	IngestionEventFive     *IngestionEventFive
	IngestionEventSix      *IngestionEventSix
	IngestionEventSeven    *IngestionEventSeven
	IngestionEventEight    *IngestionEventEight
	IngestionEventNine     *IngestionEventNine
	IngestionEventTen      *IngestionEventTen
	IngestionEventEleven   *IngestionEventEleven
	IngestionEventTwelve   *IngestionEventTwelve
	IngestionEventThirteen *IngestionEventThirteen
	IngestionEventFourteen *IngestionEventFourteen
	IngestionEventFifteen  *IngestionEventFifteen
	IngestionEventSixteen  *IngestionEventSixteen

	typ string
}

func (i *IngestionEvent) GetIngestionEventZero() *IngestionEventZero {
	if i == nil {
		return nil
	}
	return i.IngestionEventZero
}

func (i *IngestionEvent) GetIngestionEventOne() *IngestionEventOne {
	if i == nil {
		return nil
	}
	return i.IngestionEventOne
}

func (i *IngestionEvent) GetIngestionEventTwo() *IngestionEventTwo {
	if i == nil {
		return nil
	}
	return i.IngestionEventTwo
}

func (i *IngestionEvent) GetIngestionEventThree() *IngestionEventThree {
	if i == nil {
		return nil
	}
	return i.IngestionEventThree
}

func (i *IngestionEvent) GetIngestionEventFour() *IngestionEventFour {
	if i == nil {
		return nil
	}
	return i.IngestionEventFour
}

func (i *IngestionEvent) GetIngestionEventFive() *IngestionEventFive {
	if i == nil {
		return nil
	}
	return i.IngestionEventFive
}

func (i *IngestionEvent) GetIngestionEventSix() *IngestionEventSix {
	if i == nil {
		return nil
	}
	return i.IngestionEventSix
}

func (i *IngestionEvent) GetIngestionEventSeven() *IngestionEventSeven {
	if i == nil {
		return nil
	}
	return i.IngestionEventSeven
}

func (i *IngestionEvent) GetIngestionEventEight() *IngestionEventEight {
	if i == nil {
		return nil
	}
	return i.IngestionEventEight
}

func (i *IngestionEvent) GetIngestionEventNine() *IngestionEventNine {
	if i == nil {
		return nil
	}
	return i.IngestionEventNine
}

func (i *IngestionEvent) GetIngestionEventTen() *IngestionEventTen {
	if i == nil {
		return nil
	}
	return i.IngestionEventTen
}

func (i *IngestionEvent) GetIngestionEventEleven() *IngestionEventEleven {
	if i == nil {
		return nil
	}
	return i.IngestionEventEleven
}

func (i *IngestionEvent) GetIngestionEventTwelve() *IngestionEventTwelve {
	if i == nil {
		return nil
	}
	return i.IngestionEventTwelve
}

func (i *IngestionEvent) GetIngestionEventThirteen() *IngestionEventThirteen {
	if i == nil {
		return nil
	}
	return i.IngestionEventThirteen
}

func (i *IngestionEvent) GetIngestionEventFourteen() *IngestionEventFourteen {
	if i == nil {
		return nil
	}
	return i.IngestionEventFourteen
}

func (i *IngestionEvent) GetIngestionEventFifteen() *IngestionEventFifteen {
	if i == nil {
		return nil
	}
	return i.IngestionEventFifteen
}

func (i *IngestionEvent) GetIngestionEventSixteen() *IngestionEventSixteen {
	if i == nil {
		return nil
	}
	return i.IngestionEventSixteen
}

func (i *IngestionEvent) UnmarshalJSON(data []byte) error {
	valueIngestionEventZero := new(IngestionEventZero)
	if err := json.Unmarshal(data, &valueIngestionEventZero); err == nil {
		i.typ = "IngestionEventZero"
		i.IngestionEventZero = valueIngestionEventZero
		return nil
	}
	valueIngestionEventOne := new(IngestionEventOne)
	if err := json.Unmarshal(data, &valueIngestionEventOne); err == nil {
		i.typ = "IngestionEventOne"
		i.IngestionEventOne = valueIngestionEventOne
		return nil
	}
	valueIngestionEventTwo := new(IngestionEventTwo)
	if err := json.Unmarshal(data, &valueIngestionEventTwo); err == nil {
		i.typ = "IngestionEventTwo"
		i.IngestionEventTwo = valueIngestionEventTwo
		return nil
	}
	valueIngestionEventThree := new(IngestionEventThree)
	if err := json.Unmarshal(data, &valueIngestionEventThree); err == nil {
		i.typ = "IngestionEventThree"
		i.IngestionEventThree = valueIngestionEventThree
		return nil
	}
	valueIngestionEventFour := new(IngestionEventFour)
	if err := json.Unmarshal(data, &valueIngestionEventFour); err == nil {
		i.typ = "IngestionEventFour"
		i.IngestionEventFour = valueIngestionEventFour
		return nil
	}
	valueIngestionEventFive := new(IngestionEventFive)
	if err := json.Unmarshal(data, &valueIngestionEventFive); err == nil {
		i.typ = "IngestionEventFive"
		i.IngestionEventFive = valueIngestionEventFive
		return nil
	}
	valueIngestionEventSix := new(IngestionEventSix)
	if err := json.Unmarshal(data, &valueIngestionEventSix); err == nil {
		i.typ = "IngestionEventSix"
		i.IngestionEventSix = valueIngestionEventSix
		return nil
	}
	valueIngestionEventSeven := new(IngestionEventSeven)
	if err := json.Unmarshal(data, &valueIngestionEventSeven); err == nil {
		i.typ = "IngestionEventSeven"
		i.IngestionEventSeven = valueIngestionEventSeven
		return nil
	}
	valueIngestionEventEight := new(IngestionEventEight)
	if err := json.Unmarshal(data, &valueIngestionEventEight); err == nil {
		i.typ = "IngestionEventEight"
		i.IngestionEventEight = valueIngestionEventEight
		return nil
	}
	valueIngestionEventNine := new(IngestionEventNine)
	if err := json.Unmarshal(data, &valueIngestionEventNine); err == nil {
		i.typ = "IngestionEventNine"
		i.IngestionEventNine = valueIngestionEventNine
		return nil
	}
	valueIngestionEventTen := new(IngestionEventTen)
	if err := json.Unmarshal(data, &valueIngestionEventTen); err == nil {
		i.typ = "IngestionEventTen"
		i.IngestionEventTen = valueIngestionEventTen
		return nil
	}
	valueIngestionEventEleven := new(IngestionEventEleven)
	if err := json.Unmarshal(data, &valueIngestionEventEleven); err == nil {
		i.typ = "IngestionEventEleven"
		i.IngestionEventEleven = valueIngestionEventEleven
		return nil
	}
	valueIngestionEventTwelve := new(IngestionEventTwelve)
	if err := json.Unmarshal(data, &valueIngestionEventTwelve); err == nil {
		i.typ = "IngestionEventTwelve"
		i.IngestionEventTwelve = valueIngestionEventTwelve
		return nil
	}
	valueIngestionEventThirteen := new(IngestionEventThirteen)
	if err := json.Unmarshal(data, &valueIngestionEventThirteen); err == nil {
		i.typ = "IngestionEventThirteen"
		i.IngestionEventThirteen = valueIngestionEventThirteen
		return nil
	}
	valueIngestionEventFourteen := new(IngestionEventFourteen)
	if err := json.Unmarshal(data, &valueIngestionEventFourteen); err == nil {
		i.typ = "IngestionEventFourteen"
		i.IngestionEventFourteen = valueIngestionEventFourteen
		return nil
	}
	valueIngestionEventFifteen := new(IngestionEventFifteen)
	if err := json.Unmarshal(data, &valueIngestionEventFifteen); err == nil {
		i.typ = "IngestionEventFifteen"
		i.IngestionEventFifteen = valueIngestionEventFifteen
		return nil
	}
	valueIngestionEventSixteen := new(IngestionEventSixteen)
	if err := json.Unmarshal(data, &valueIngestionEventSixteen); err == nil {
		i.typ = "IngestionEventSixteen"
		i.IngestionEventSixteen = valueIngestionEventSixteen
		return nil
	}
	return fmt.Errorf("%s cannot be deserialized as a %T", data, i)
}

func (i IngestionEvent) MarshalJSON() ([]byte, error) {
	if i.typ == "IngestionEventZero" || i.IngestionEventZero != nil {
		return json.Marshal(i.IngestionEventZero)
	}
	if i.typ == "IngestionEventOne" || i.IngestionEventOne != nil {
		return json.Marshal(i.IngestionEventOne)
	}
	if i.typ == "IngestionEventTwo" || i.IngestionEventTwo != nil {
		return json.Marshal(i.IngestionEventTwo)
	}
	if i.typ == "IngestionEventThree" || i.IngestionEventThree != nil {
		return json.Marshal(i.IngestionEventThree)
	}
	if i.typ == "IngestionEventFour" || i.IngestionEventFour != nil {
		return json.Marshal(i.IngestionEventFour)
	}
	if i.typ == "IngestionEventFive" || i.IngestionEventFive != nil {
		return json.Marshal(i.IngestionEventFive)
	}
	if i.typ == "IngestionEventSix" || i.IngestionEventSix != nil {
		return json.Marshal(i.IngestionEventSix)
	}
	if i.typ == "IngestionEventSeven" || i.IngestionEventSeven != nil {
		return json.Marshal(i.IngestionEventSeven)
	}
	if i.typ == "IngestionEventEight" || i.IngestionEventEight != nil {
		return json.Marshal(i.IngestionEventEight)
	}
	if i.typ == "IngestionEventNine" || i.IngestionEventNine != nil {
		return json.Marshal(i.IngestionEventNine)
	}
	if i.typ == "IngestionEventTen" || i.IngestionEventTen != nil {
		return json.Marshal(i.IngestionEventTen)
	}
	if i.typ == "IngestionEventEleven" || i.IngestionEventEleven != nil {
		return json.Marshal(i.IngestionEventEleven)
	}
	if i.typ == "IngestionEventTwelve" || i.IngestionEventTwelve != nil {
		return json.Marshal(i.IngestionEventTwelve)
	}
	if i.typ == "IngestionEventThirteen" || i.IngestionEventThirteen != nil {
		return json.Marshal(i.IngestionEventThirteen)
	}
	if i.typ == "IngestionEventFourteen" || i.IngestionEventFourteen != nil {
		return json.Marshal(i.IngestionEventFourteen)
	}
	if i.typ == "IngestionEventFifteen" || i.IngestionEventFifteen != nil {
		return json.Marshal(i.IngestionEventFifteen)
	}
	if i.typ == "IngestionEventSixteen" || i.IngestionEventSixteen != nil {
		return json.Marshal(i.IngestionEventSixteen)
	}
	return nil, fmt.Errorf("type %T does not include a non-empty union type", i)
}

type IngestionEventVisitor interface {
	VisitIngestionEventZero(*IngestionEventZero) error
	VisitIngestionEventOne(*IngestionEventOne) error
	VisitIngestionEventTwo(*IngestionEventTwo) error
	VisitIngestionEventThree(*IngestionEventThree) error
	VisitIngestionEventFour(*IngestionEventFour) error
	VisitIngestionEventFive(*IngestionEventFive) error
	VisitIngestionEventSix(*IngestionEventSix) error
	VisitIngestionEventSeven(*IngestionEventSeven) error
	VisitIngestionEventEight(*IngestionEventEight) error
	VisitIngestionEventNine(*IngestionEventNine) error
	VisitIngestionEventTen(*IngestionEventTen) error
	VisitIngestionEventEleven(*IngestionEventEleven) error
	VisitIngestionEventTwelve(*IngestionEventTwelve) error
	VisitIngestionEventThirteen(*IngestionEventThirteen) error
	VisitIngestionEventFourteen(*IngestionEventFourteen) error
	VisitIngestionEventFifteen(*IngestionEventFifteen) error
	VisitIngestionEventSixteen(*IngestionEventSixteen) error
}

func (i *IngestionEvent) Accept(visitor IngestionEventVisitor) error {
	if i.typ == "IngestionEventZero" || i.IngestionEventZero != nil {
		return visitor.VisitIngestionEventZero(i.IngestionEventZero)
	}
	if i.typ == "IngestionEventOne" || i.IngestionEventOne != nil {
		return visitor.VisitIngestionEventOne(i.IngestionEventOne)
	}
	if i.typ == "IngestionEventTwo" || i.IngestionEventTwo != nil {
		return visitor.VisitIngestionEventTwo(i.IngestionEventTwo)
	}
	if i.typ == "IngestionEventThree" || i.IngestionEventThree != nil {
		return visitor.VisitIngestionEventThree(i.IngestionEventThree)
	}
	if i.typ == "IngestionEventFour" || i.IngestionEventFour != nil {
		return visitor.VisitIngestionEventFour(i.IngestionEventFour)
	}
	if i.typ == "IngestionEventFive" || i.IngestionEventFive != nil {
		return visitor.VisitIngestionEventFive(i.IngestionEventFive)
	}
	if i.typ == "IngestionEventSix" || i.IngestionEventSix != nil {
		return visitor.VisitIngestionEventSix(i.IngestionEventSix)
	}
	if i.typ == "IngestionEventSeven" || i.IngestionEventSeven != nil {
		return visitor.VisitIngestionEventSeven(i.IngestionEventSeven)
	}
	if i.typ == "IngestionEventEight" || i.IngestionEventEight != nil {
		return visitor.VisitIngestionEventEight(i.IngestionEventEight)
	}
	if i.typ == "IngestionEventNine" || i.IngestionEventNine != nil {
		return visitor.VisitIngestionEventNine(i.IngestionEventNine)
	}
	if i.typ == "IngestionEventTen" || i.IngestionEventTen != nil {
		return visitor.VisitIngestionEventTen(i.IngestionEventTen)
	}
	if i.typ == "IngestionEventEleven" || i.IngestionEventEleven != nil {
		return visitor.VisitIngestionEventEleven(i.IngestionEventEleven)
	}
	if i.typ == "IngestionEventTwelve" || i.IngestionEventTwelve != nil {
		return visitor.VisitIngestionEventTwelve(i.IngestionEventTwelve)
	}
	if i.typ == "IngestionEventThirteen" || i.IngestionEventThirteen != nil {
		return visitor.VisitIngestionEventThirteen(i.IngestionEventThirteen)
	}
	if i.typ == "IngestionEventFourteen" || i.IngestionEventFourteen != nil {
		return visitor.VisitIngestionEventFourteen(i.IngestionEventFourteen)
	}
	if i.typ == "IngestionEventFifteen" || i.IngestionEventFifteen != nil {
		return visitor.VisitIngestionEventFifteen(i.IngestionEventFifteen)
	}
	if i.typ == "IngestionEventSixteen" || i.IngestionEventSixteen != nil {
		return visitor.VisitIngestionEventSixteen(i.IngestionEventSixteen)
	}
	return fmt.Errorf("type %T does not include a non-empty union type", i)
}

var (
	ingestionEventEightFieldID        = big.NewInt(1 << 0)
	ingestionEventEightFieldTimestamp = big.NewInt(1 << 1)
	ingestionEventEightFieldMetadata  = big.NewInt(1 << 2)
	ingestionEventEightFieldBody      = big.NewInt(1 << 3)
	ingestionEventEightFieldType      = big.NewInt(1 << 4)
)

type IngestionEventEight struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}              `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *ObservationBody         `json:"body" url:"body"`
	Type     *IngestionEventEightType `json:"type,omitempty" url:"type,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (i *IngestionEventEight) GetID() string {
	if i == nil {
		return ""
	}
	return i.ID
}

func (i *IngestionEventEight) GetTimestamp() string {
	if i == nil {
		return ""
	}
	return i.Timestamp
}

func (i *IngestionEventEight) GetMetadata() interface{} {
	if i == nil {
		return nil
	}
	return i.Metadata
}

func (i *IngestionEventEight) GetBody() *ObservationBody {
	if i == nil {
		return nil
	}
	return i.Body
}

func (i *IngestionEventEight) GetType() *IngestionEventEightType {
	if i == nil {
		return nil
	}
	return i.Type
}

func (i *IngestionEventEight) GetExtraProperties() map[string]interface{} {
	return i.extraProperties
}

func (i *IngestionEventEight) require(field *big.Int) {
	if i.explicitFields == nil {
		i.explicitFields = big.NewInt(0)
	}
	i.explicitFields.Or(i.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventEight) SetID(id string) {
	i.ID = id
	i.require(ingestionEventEightFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventEight) SetTimestamp(timestamp string) {
	i.Timestamp = timestamp
	i.require(ingestionEventEightFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventEight) SetMetadata(metadata interface{}) {
	i.Metadata = metadata
	i.require(ingestionEventEightFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventEight) SetBody(body *ObservationBody) {
	i.Body = body
	i.require(ingestionEventEightFieldBody)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventEight) SetType(type_ *IngestionEventEightType) {
	i.Type = type_
	i.require(ingestionEventEightFieldType)
}

func (i *IngestionEventEight) UnmarshalJSON(data []byte) error {
	type unmarshaler IngestionEventEight
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*i = IngestionEventEight(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *i)
	if err != nil {
		return err
	}
	i.extraProperties = extraProperties
	i.rawJSON = json.RawMessage(data)
	return nil
}

func (i *IngestionEventEight) MarshalJSON() ([]byte, error) {
	type embed IngestionEventEight
	var marshaler = struct {
		embed
	}{
		embed: embed(*i),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (i *IngestionEventEight) String() string {
	if len(i.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(i.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(i); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", i)
}

type IngestionEventEightType string

const (
	IngestionEventEightTypeObservationCreate IngestionEventEightType = "observation-create"
)

func NewIngestionEventEightTypeFromString(s string) (IngestionEventEightType, error) {
	switch s {
	case "observation-create":
		return IngestionEventEightTypeObservationCreate, nil
	}
	var t IngestionEventEightType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (i IngestionEventEightType) Ptr() *IngestionEventEightType {
	return &i
}

var (
	ingestionEventElevenFieldID        = big.NewInt(1 << 0)
	ingestionEventElevenFieldTimestamp = big.NewInt(1 << 1)
	ingestionEventElevenFieldMetadata  = big.NewInt(1 << 2)
	ingestionEventElevenFieldBody      = big.NewInt(1 << 3)
	ingestionEventElevenFieldType      = big.NewInt(1 << 4)
)

type IngestionEventEleven struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}               `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *CreateGenerationBody     `json:"body" url:"body"`
	Type     *IngestionEventElevenType `json:"type,omitempty" url:"type,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (i *IngestionEventEleven) GetID() string {
	if i == nil {
		return ""
	}
	return i.ID
}

func (i *IngestionEventEleven) GetTimestamp() string {
	if i == nil {
		return ""
	}
	return i.Timestamp
}

func (i *IngestionEventEleven) GetMetadata() interface{} {
	if i == nil {
		return nil
	}
	return i.Metadata
}

func (i *IngestionEventEleven) GetBody() *CreateGenerationBody {
	if i == nil {
		return nil
	}
	return i.Body
}

func (i *IngestionEventEleven) GetType() *IngestionEventElevenType {
	if i == nil {
		return nil
	}
	return i.Type
}

func (i *IngestionEventEleven) GetExtraProperties() map[string]interface{} {
	return i.extraProperties
}

func (i *IngestionEventEleven) require(field *big.Int) {
	if i.explicitFields == nil {
		i.explicitFields = big.NewInt(0)
	}
	i.explicitFields.Or(i.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventEleven) SetID(id string) {
	i.ID = id
	i.require(ingestionEventElevenFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventEleven) SetTimestamp(timestamp string) {
	i.Timestamp = timestamp
	i.require(ingestionEventElevenFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventEleven) SetMetadata(metadata interface{}) {
	i.Metadata = metadata
	i.require(ingestionEventElevenFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventEleven) SetBody(body *CreateGenerationBody) {
	i.Body = body
	i.require(ingestionEventElevenFieldBody)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventEleven) SetType(type_ *IngestionEventElevenType) {
	i.Type = type_
	i.require(ingestionEventElevenFieldType)
}

func (i *IngestionEventEleven) UnmarshalJSON(data []byte) error {
	type unmarshaler IngestionEventEleven
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*i = IngestionEventEleven(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *i)
	if err != nil {
		return err
	}
	i.extraProperties = extraProperties
	i.rawJSON = json.RawMessage(data)
	return nil
}

func (i *IngestionEventEleven) MarshalJSON() ([]byte, error) {
	type embed IngestionEventEleven
	var marshaler = struct {
		embed
	}{
		embed: embed(*i),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (i *IngestionEventEleven) String() string {
	if len(i.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(i.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(i); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", i)
}

type IngestionEventElevenType string

const (
	IngestionEventElevenTypeToolCreate IngestionEventElevenType = "tool-create"
)

func NewIngestionEventElevenTypeFromString(s string) (IngestionEventElevenType, error) {
	switch s {
	case "tool-create":
		return IngestionEventElevenTypeToolCreate, nil
	}
	var t IngestionEventElevenType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (i IngestionEventElevenType) Ptr() *IngestionEventElevenType {
	return &i
}

var (
	ingestionEventFifteenFieldID        = big.NewInt(1 << 0)
	ingestionEventFifteenFieldTimestamp = big.NewInt(1 << 1)
	ingestionEventFifteenFieldMetadata  = big.NewInt(1 << 2)
	ingestionEventFifteenFieldBody      = big.NewInt(1 << 3)
	ingestionEventFifteenFieldType      = big.NewInt(1 << 4)
)

type IngestionEventFifteen struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}                `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *CreateGenerationBody      `json:"body" url:"body"`
	Type     *IngestionEventFifteenType `json:"type,omitempty" url:"type,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (i *IngestionEventFifteen) GetID() string {
	if i == nil {
		return ""
	}
	return i.ID
}

func (i *IngestionEventFifteen) GetTimestamp() string {
	if i == nil {
		return ""
	}
	return i.Timestamp
}

func (i *IngestionEventFifteen) GetMetadata() interface{} {
	if i == nil {
		return nil
	}
	return i.Metadata
}

func (i *IngestionEventFifteen) GetBody() *CreateGenerationBody {
	if i == nil {
		return nil
	}
	return i.Body
}

func (i *IngestionEventFifteen) GetType() *IngestionEventFifteenType {
	if i == nil {
		return nil
	}
	return i.Type
}

func (i *IngestionEventFifteen) GetExtraProperties() map[string]interface{} {
	return i.extraProperties
}

func (i *IngestionEventFifteen) require(field *big.Int) {
	if i.explicitFields == nil {
		i.explicitFields = big.NewInt(0)
	}
	i.explicitFields.Or(i.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventFifteen) SetID(id string) {
	i.ID = id
	i.require(ingestionEventFifteenFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventFifteen) SetTimestamp(timestamp string) {
	i.Timestamp = timestamp
	i.require(ingestionEventFifteenFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventFifteen) SetMetadata(metadata interface{}) {
	i.Metadata = metadata
	i.require(ingestionEventFifteenFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventFifteen) SetBody(body *CreateGenerationBody) {
	i.Body = body
	i.require(ingestionEventFifteenFieldBody)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventFifteen) SetType(type_ *IngestionEventFifteenType) {
	i.Type = type_
	i.require(ingestionEventFifteenFieldType)
}

func (i *IngestionEventFifteen) UnmarshalJSON(data []byte) error {
	type unmarshaler IngestionEventFifteen
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*i = IngestionEventFifteen(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *i)
	if err != nil {
		return err
	}
	i.extraProperties = extraProperties
	i.rawJSON = json.RawMessage(data)
	return nil
}

func (i *IngestionEventFifteen) MarshalJSON() ([]byte, error) {
	type embed IngestionEventFifteen
	var marshaler = struct {
		embed
	}{
		embed: embed(*i),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (i *IngestionEventFifteen) String() string {
	if len(i.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(i.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(i); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", i)
}

type IngestionEventFifteenType string

const (
	IngestionEventFifteenTypeEmbeddingCreate IngestionEventFifteenType = "embedding-create"
)

func NewIngestionEventFifteenTypeFromString(s string) (IngestionEventFifteenType, error) {
	switch s {
	case "embedding-create":
		return IngestionEventFifteenTypeEmbeddingCreate, nil
	}
	var t IngestionEventFifteenType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (i IngestionEventFifteenType) Ptr() *IngestionEventFifteenType {
	return &i
}

var (
	ingestionEventFiveFieldID        = big.NewInt(1 << 0)
	ingestionEventFiveFieldTimestamp = big.NewInt(1 << 1)
	ingestionEventFiveFieldMetadata  = big.NewInt(1 << 2)
	ingestionEventFiveFieldBody      = big.NewInt(1 << 3)
	ingestionEventFiveFieldType      = big.NewInt(1 << 4)
)

type IngestionEventFive struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}             `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *UpdateGenerationBody   `json:"body" url:"body"`
	Type     *IngestionEventFiveType `json:"type,omitempty" url:"type,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (i *IngestionEventFive) GetID() string {
	if i == nil {
		return ""
	}
	return i.ID
}

func (i *IngestionEventFive) GetTimestamp() string {
	if i == nil {
		return ""
	}
	return i.Timestamp
}

func (i *IngestionEventFive) GetMetadata() interface{} {
	if i == nil {
		return nil
	}
	return i.Metadata
}

func (i *IngestionEventFive) GetBody() *UpdateGenerationBody {
	if i == nil {
		return nil
	}
	return i.Body
}

func (i *IngestionEventFive) GetType() *IngestionEventFiveType {
	if i == nil {
		return nil
	}
	return i.Type
}

func (i *IngestionEventFive) GetExtraProperties() map[string]interface{} {
	return i.extraProperties
}

func (i *IngestionEventFive) require(field *big.Int) {
	if i.explicitFields == nil {
		i.explicitFields = big.NewInt(0)
	}
	i.explicitFields.Or(i.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventFive) SetID(id string) {
	i.ID = id
	i.require(ingestionEventFiveFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventFive) SetTimestamp(timestamp string) {
	i.Timestamp = timestamp
	i.require(ingestionEventFiveFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventFive) SetMetadata(metadata interface{}) {
	i.Metadata = metadata
	i.require(ingestionEventFiveFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventFive) SetBody(body *UpdateGenerationBody) {
	i.Body = body
	i.require(ingestionEventFiveFieldBody)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventFive) SetType(type_ *IngestionEventFiveType) {
	i.Type = type_
	i.require(ingestionEventFiveFieldType)
}

func (i *IngestionEventFive) UnmarshalJSON(data []byte) error {
	type unmarshaler IngestionEventFive
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*i = IngestionEventFive(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *i)
	if err != nil {
		return err
	}
	i.extraProperties = extraProperties
	i.rawJSON = json.RawMessage(data)
	return nil
}

func (i *IngestionEventFive) MarshalJSON() ([]byte, error) {
	type embed IngestionEventFive
	var marshaler = struct {
		embed
	}{
		embed: embed(*i),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (i *IngestionEventFive) String() string {
	if len(i.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(i.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(i); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", i)
}

type IngestionEventFiveType string

const (
	IngestionEventFiveTypeGenerationUpdate IngestionEventFiveType = "generation-update"
)

func NewIngestionEventFiveTypeFromString(s string) (IngestionEventFiveType, error) {
	switch s {
	case "generation-update":
		return IngestionEventFiveTypeGenerationUpdate, nil
	}
	var t IngestionEventFiveType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (i IngestionEventFiveType) Ptr() *IngestionEventFiveType {
	return &i
}

var (
	ingestionEventFourFieldID        = big.NewInt(1 << 0)
	ingestionEventFourFieldTimestamp = big.NewInt(1 << 1)
	ingestionEventFourFieldMetadata  = big.NewInt(1 << 2)
	ingestionEventFourFieldBody      = big.NewInt(1 << 3)
	ingestionEventFourFieldType      = big.NewInt(1 << 4)
)

type IngestionEventFour struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}             `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *CreateGenerationBody   `json:"body" url:"body"`
	Type     *IngestionEventFourType `json:"type,omitempty" url:"type,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (i *IngestionEventFour) GetID() string {
	if i == nil {
		return ""
	}
	return i.ID
}

func (i *IngestionEventFour) GetTimestamp() string {
	if i == nil {
		return ""
	}
	return i.Timestamp
}

func (i *IngestionEventFour) GetMetadata() interface{} {
	if i == nil {
		return nil
	}
	return i.Metadata
}

func (i *IngestionEventFour) GetBody() *CreateGenerationBody {
	if i == nil {
		return nil
	}
	return i.Body
}

func (i *IngestionEventFour) GetType() *IngestionEventFourType {
	if i == nil {
		return nil
	}
	return i.Type
}

func (i *IngestionEventFour) GetExtraProperties() map[string]interface{} {
	return i.extraProperties
}

func (i *IngestionEventFour) require(field *big.Int) {
	if i.explicitFields == nil {
		i.explicitFields = big.NewInt(0)
	}
	i.explicitFields.Or(i.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventFour) SetID(id string) {
	i.ID = id
	i.require(ingestionEventFourFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventFour) SetTimestamp(timestamp string) {
	i.Timestamp = timestamp
	i.require(ingestionEventFourFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventFour) SetMetadata(metadata interface{}) {
	i.Metadata = metadata
	i.require(ingestionEventFourFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventFour) SetBody(body *CreateGenerationBody) {
	i.Body = body
	i.require(ingestionEventFourFieldBody)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventFour) SetType(type_ *IngestionEventFourType) {
	i.Type = type_
	i.require(ingestionEventFourFieldType)
}

func (i *IngestionEventFour) UnmarshalJSON(data []byte) error {
	type unmarshaler IngestionEventFour
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*i = IngestionEventFour(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *i)
	if err != nil {
		return err
	}
	i.extraProperties = extraProperties
	i.rawJSON = json.RawMessage(data)
	return nil
}

func (i *IngestionEventFour) MarshalJSON() ([]byte, error) {
	type embed IngestionEventFour
	var marshaler = struct {
		embed
	}{
		embed: embed(*i),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (i *IngestionEventFour) String() string {
	if len(i.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(i.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(i); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", i)
}

type IngestionEventFourType string

const (
	IngestionEventFourTypeGenerationCreate IngestionEventFourType = "generation-create"
)

func NewIngestionEventFourTypeFromString(s string) (IngestionEventFourType, error) {
	switch s {
	case "generation-create":
		return IngestionEventFourTypeGenerationCreate, nil
	}
	var t IngestionEventFourType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (i IngestionEventFourType) Ptr() *IngestionEventFourType {
	return &i
}

var (
	ingestionEventFourteenFieldID        = big.NewInt(1 << 0)
	ingestionEventFourteenFieldTimestamp = big.NewInt(1 << 1)
	ingestionEventFourteenFieldMetadata  = big.NewInt(1 << 2)
	ingestionEventFourteenFieldBody      = big.NewInt(1 << 3)
	ingestionEventFourteenFieldType      = big.NewInt(1 << 4)
)

type IngestionEventFourteen struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}                 `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *CreateGenerationBody       `json:"body" url:"body"`
	Type     *IngestionEventFourteenType `json:"type,omitempty" url:"type,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (i *IngestionEventFourteen) GetID() string {
	if i == nil {
		return ""
	}
	return i.ID
}

func (i *IngestionEventFourteen) GetTimestamp() string {
	if i == nil {
		return ""
	}
	return i.Timestamp
}

func (i *IngestionEventFourteen) GetMetadata() interface{} {
	if i == nil {
		return nil
	}
	return i.Metadata
}

func (i *IngestionEventFourteen) GetBody() *CreateGenerationBody {
	if i == nil {
		return nil
	}
	return i.Body
}

func (i *IngestionEventFourteen) GetType() *IngestionEventFourteenType {
	if i == nil {
		return nil
	}
	return i.Type
}

func (i *IngestionEventFourteen) GetExtraProperties() map[string]interface{} {
	return i.extraProperties
}

func (i *IngestionEventFourteen) require(field *big.Int) {
	if i.explicitFields == nil {
		i.explicitFields = big.NewInt(0)
	}
	i.explicitFields.Or(i.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventFourteen) SetID(id string) {
	i.ID = id
	i.require(ingestionEventFourteenFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventFourteen) SetTimestamp(timestamp string) {
	i.Timestamp = timestamp
	i.require(ingestionEventFourteenFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventFourteen) SetMetadata(metadata interface{}) {
	i.Metadata = metadata
	i.require(ingestionEventFourteenFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventFourteen) SetBody(body *CreateGenerationBody) {
	i.Body = body
	i.require(ingestionEventFourteenFieldBody)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventFourteen) SetType(type_ *IngestionEventFourteenType) {
	i.Type = type_
	i.require(ingestionEventFourteenFieldType)
}

func (i *IngestionEventFourteen) UnmarshalJSON(data []byte) error {
	type unmarshaler IngestionEventFourteen
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*i = IngestionEventFourteen(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *i)
	if err != nil {
		return err
	}
	i.extraProperties = extraProperties
	i.rawJSON = json.RawMessage(data)
	return nil
}

func (i *IngestionEventFourteen) MarshalJSON() ([]byte, error) {
	type embed IngestionEventFourteen
	var marshaler = struct {
		embed
	}{
		embed: embed(*i),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (i *IngestionEventFourteen) String() string {
	if len(i.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(i.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(i); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", i)
}

type IngestionEventFourteenType string

const (
	IngestionEventFourteenTypeEvaluatorCreate IngestionEventFourteenType = "evaluator-create"
)

func NewIngestionEventFourteenTypeFromString(s string) (IngestionEventFourteenType, error) {
	switch s {
	case "evaluator-create":
		return IngestionEventFourteenTypeEvaluatorCreate, nil
	}
	var t IngestionEventFourteenType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (i IngestionEventFourteenType) Ptr() *IngestionEventFourteenType {
	return &i
}

var (
	ingestionEventNineFieldID        = big.NewInt(1 << 0)
	ingestionEventNineFieldTimestamp = big.NewInt(1 << 1)
	ingestionEventNineFieldMetadata  = big.NewInt(1 << 2)
	ingestionEventNineFieldBody      = big.NewInt(1 << 3)
	ingestionEventNineFieldType      = big.NewInt(1 << 4)
)

type IngestionEventNine struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}             `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *ObservationBody        `json:"body" url:"body"`
	Type     *IngestionEventNineType `json:"type,omitempty" url:"type,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (i *IngestionEventNine) GetID() string {
	if i == nil {
		return ""
	}
	return i.ID
}

func (i *IngestionEventNine) GetTimestamp() string {
	if i == nil {
		return ""
	}
	return i.Timestamp
}

func (i *IngestionEventNine) GetMetadata() interface{} {
	if i == nil {
		return nil
	}
	return i.Metadata
}

func (i *IngestionEventNine) GetBody() *ObservationBody {
	if i == nil {
		return nil
	}
	return i.Body
}

func (i *IngestionEventNine) GetType() *IngestionEventNineType {
	if i == nil {
		return nil
	}
	return i.Type
}

func (i *IngestionEventNine) GetExtraProperties() map[string]interface{} {
	return i.extraProperties
}

func (i *IngestionEventNine) require(field *big.Int) {
	if i.explicitFields == nil {
		i.explicitFields = big.NewInt(0)
	}
	i.explicitFields.Or(i.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventNine) SetID(id string) {
	i.ID = id
	i.require(ingestionEventNineFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventNine) SetTimestamp(timestamp string) {
	i.Timestamp = timestamp
	i.require(ingestionEventNineFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventNine) SetMetadata(metadata interface{}) {
	i.Metadata = metadata
	i.require(ingestionEventNineFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventNine) SetBody(body *ObservationBody) {
	i.Body = body
	i.require(ingestionEventNineFieldBody)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventNine) SetType(type_ *IngestionEventNineType) {
	i.Type = type_
	i.require(ingestionEventNineFieldType)
}

func (i *IngestionEventNine) UnmarshalJSON(data []byte) error {
	type unmarshaler IngestionEventNine
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*i = IngestionEventNine(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *i)
	if err != nil {
		return err
	}
	i.extraProperties = extraProperties
	i.rawJSON = json.RawMessage(data)
	return nil
}

func (i *IngestionEventNine) MarshalJSON() ([]byte, error) {
	type embed IngestionEventNine
	var marshaler = struct {
		embed
	}{
		embed: embed(*i),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (i *IngestionEventNine) String() string {
	if len(i.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(i.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(i); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", i)
}

type IngestionEventNineType string

const (
	IngestionEventNineTypeObservationUpdate IngestionEventNineType = "observation-update"
)

func NewIngestionEventNineTypeFromString(s string) (IngestionEventNineType, error) {
	switch s {
	case "observation-update":
		return IngestionEventNineTypeObservationUpdate, nil
	}
	var t IngestionEventNineType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (i IngestionEventNineType) Ptr() *IngestionEventNineType {
	return &i
}

var (
	ingestionEventOneFieldID        = big.NewInt(1 << 0)
	ingestionEventOneFieldTimestamp = big.NewInt(1 << 1)
	ingestionEventOneFieldMetadata  = big.NewInt(1 << 2)
	ingestionEventOneFieldBody      = big.NewInt(1 << 3)
	ingestionEventOneFieldType      = big.NewInt(1 << 4)
)

type IngestionEventOne struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}            `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *ScoreBody             `json:"body" url:"body"`
	Type     *IngestionEventOneType `json:"type,omitempty" url:"type,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (i *IngestionEventOne) GetID() string {
	if i == nil {
		return ""
	}
	return i.ID
}

func (i *IngestionEventOne) GetTimestamp() string {
	if i == nil {
		return ""
	}
	return i.Timestamp
}

func (i *IngestionEventOne) GetMetadata() interface{} {
	if i == nil {
		return nil
	}
	return i.Metadata
}

func (i *IngestionEventOne) GetBody() *ScoreBody {
	if i == nil {
		return nil
	}
	return i.Body
}

func (i *IngestionEventOne) GetType() *IngestionEventOneType {
	if i == nil {
		return nil
	}
	return i.Type
}

func (i *IngestionEventOne) GetExtraProperties() map[string]interface{} {
	return i.extraProperties
}

func (i *IngestionEventOne) require(field *big.Int) {
	if i.explicitFields == nil {
		i.explicitFields = big.NewInt(0)
	}
	i.explicitFields.Or(i.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventOne) SetID(id string) {
	i.ID = id
	i.require(ingestionEventOneFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventOne) SetTimestamp(timestamp string) {
	i.Timestamp = timestamp
	i.require(ingestionEventOneFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventOne) SetMetadata(metadata interface{}) {
	i.Metadata = metadata
	i.require(ingestionEventOneFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventOne) SetBody(body *ScoreBody) {
	i.Body = body
	i.require(ingestionEventOneFieldBody)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventOne) SetType(type_ *IngestionEventOneType) {
	i.Type = type_
	i.require(ingestionEventOneFieldType)
}

func (i *IngestionEventOne) UnmarshalJSON(data []byte) error {
	type unmarshaler IngestionEventOne
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*i = IngestionEventOne(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *i)
	if err != nil {
		return err
	}
	i.extraProperties = extraProperties
	i.rawJSON = json.RawMessage(data)
	return nil
}

func (i *IngestionEventOne) MarshalJSON() ([]byte, error) {
	type embed IngestionEventOne
	var marshaler = struct {
		embed
	}{
		embed: embed(*i),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (i *IngestionEventOne) String() string {
	if len(i.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(i.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(i); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", i)
}

type IngestionEventOneType string

const (
	IngestionEventOneTypeScoreCreate IngestionEventOneType = "score-create"
)

func NewIngestionEventOneTypeFromString(s string) (IngestionEventOneType, error) {
	switch s {
	case "score-create":
		return IngestionEventOneTypeScoreCreate, nil
	}
	var t IngestionEventOneType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (i IngestionEventOneType) Ptr() *IngestionEventOneType {
	return &i
}

var (
	ingestionEventSevenFieldID        = big.NewInt(1 << 0)
	ingestionEventSevenFieldTimestamp = big.NewInt(1 << 1)
	ingestionEventSevenFieldMetadata  = big.NewInt(1 << 2)
	ingestionEventSevenFieldBody      = big.NewInt(1 << 3)
	ingestionEventSevenFieldType      = big.NewInt(1 << 4)
)

type IngestionEventSeven struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}              `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *SdkLogBody              `json:"body" url:"body"`
	Type     *IngestionEventSevenType `json:"type,omitempty" url:"type,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (i *IngestionEventSeven) GetID() string {
	if i == nil {
		return ""
	}
	return i.ID
}

func (i *IngestionEventSeven) GetTimestamp() string {
	if i == nil {
		return ""
	}
	return i.Timestamp
}

func (i *IngestionEventSeven) GetMetadata() interface{} {
	if i == nil {
		return nil
	}
	return i.Metadata
}

func (i *IngestionEventSeven) GetBody() *SdkLogBody {
	if i == nil {
		return nil
	}
	return i.Body
}

func (i *IngestionEventSeven) GetType() *IngestionEventSevenType {
	if i == nil {
		return nil
	}
	return i.Type
}

func (i *IngestionEventSeven) GetExtraProperties() map[string]interface{} {
	return i.extraProperties
}

func (i *IngestionEventSeven) require(field *big.Int) {
	if i.explicitFields == nil {
		i.explicitFields = big.NewInt(0)
	}
	i.explicitFields.Or(i.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventSeven) SetID(id string) {
	i.ID = id
	i.require(ingestionEventSevenFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventSeven) SetTimestamp(timestamp string) {
	i.Timestamp = timestamp
	i.require(ingestionEventSevenFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventSeven) SetMetadata(metadata interface{}) {
	i.Metadata = metadata
	i.require(ingestionEventSevenFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventSeven) SetBody(body *SdkLogBody) {
	i.Body = body
	i.require(ingestionEventSevenFieldBody)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventSeven) SetType(type_ *IngestionEventSevenType) {
	i.Type = type_
	i.require(ingestionEventSevenFieldType)
}

func (i *IngestionEventSeven) UnmarshalJSON(data []byte) error {
	type unmarshaler IngestionEventSeven
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*i = IngestionEventSeven(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *i)
	if err != nil {
		return err
	}
	i.extraProperties = extraProperties
	i.rawJSON = json.RawMessage(data)
	return nil
}

func (i *IngestionEventSeven) MarshalJSON() ([]byte, error) {
	type embed IngestionEventSeven
	var marshaler = struct {
		embed
	}{
		embed: embed(*i),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (i *IngestionEventSeven) String() string {
	if len(i.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(i.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(i); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", i)
}

type IngestionEventSevenType string

const (
	IngestionEventSevenTypeSdkLog IngestionEventSevenType = "sdk-log"
)

func NewIngestionEventSevenTypeFromString(s string) (IngestionEventSevenType, error) {
	switch s {
	case "sdk-log":
		return IngestionEventSevenTypeSdkLog, nil
	}
	var t IngestionEventSevenType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (i IngestionEventSevenType) Ptr() *IngestionEventSevenType {
	return &i
}

var (
	ingestionEventSixFieldID        = big.NewInt(1 << 0)
	ingestionEventSixFieldTimestamp = big.NewInt(1 << 1)
	ingestionEventSixFieldMetadata  = big.NewInt(1 << 2)
	ingestionEventSixFieldBody      = big.NewInt(1 << 3)
	ingestionEventSixFieldType      = big.NewInt(1 << 4)
)

type IngestionEventSix struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}            `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *CreateEventBody       `json:"body" url:"body"`
	Type     *IngestionEventSixType `json:"type,omitempty" url:"type,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (i *IngestionEventSix) GetID() string {
	if i == nil {
		return ""
	}
	return i.ID
}

func (i *IngestionEventSix) GetTimestamp() string {
	if i == nil {
		return ""
	}
	return i.Timestamp
}

func (i *IngestionEventSix) GetMetadata() interface{} {
	if i == nil {
		return nil
	}
	return i.Metadata
}

func (i *IngestionEventSix) GetBody() *CreateEventBody {
	if i == nil {
		return nil
	}
	return i.Body
}

func (i *IngestionEventSix) GetType() *IngestionEventSixType {
	if i == nil {
		return nil
	}
	return i.Type
}

func (i *IngestionEventSix) GetExtraProperties() map[string]interface{} {
	return i.extraProperties
}

func (i *IngestionEventSix) require(field *big.Int) {
	if i.explicitFields == nil {
		i.explicitFields = big.NewInt(0)
	}
	i.explicitFields.Or(i.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventSix) SetID(id string) {
	i.ID = id
	i.require(ingestionEventSixFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventSix) SetTimestamp(timestamp string) {
	i.Timestamp = timestamp
	i.require(ingestionEventSixFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventSix) SetMetadata(metadata interface{}) {
	i.Metadata = metadata
	i.require(ingestionEventSixFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventSix) SetBody(body *CreateEventBody) {
	i.Body = body
	i.require(ingestionEventSixFieldBody)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventSix) SetType(type_ *IngestionEventSixType) {
	i.Type = type_
	i.require(ingestionEventSixFieldType)
}

func (i *IngestionEventSix) UnmarshalJSON(data []byte) error {
	type unmarshaler IngestionEventSix
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*i = IngestionEventSix(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *i)
	if err != nil {
		return err
	}
	i.extraProperties = extraProperties
	i.rawJSON = json.RawMessage(data)
	return nil
}

func (i *IngestionEventSix) MarshalJSON() ([]byte, error) {
	type embed IngestionEventSix
	var marshaler = struct {
		embed
	}{
		embed: embed(*i),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (i *IngestionEventSix) String() string {
	if len(i.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(i.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(i); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", i)
}

type IngestionEventSixType string

const (
	IngestionEventSixTypeEventCreate IngestionEventSixType = "event-create"
)

func NewIngestionEventSixTypeFromString(s string) (IngestionEventSixType, error) {
	switch s {
	case "event-create":
		return IngestionEventSixTypeEventCreate, nil
	}
	var t IngestionEventSixType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (i IngestionEventSixType) Ptr() *IngestionEventSixType {
	return &i
}

var (
	ingestionEventSixteenFieldID        = big.NewInt(1 << 0)
	ingestionEventSixteenFieldTimestamp = big.NewInt(1 << 1)
	ingestionEventSixteenFieldMetadata  = big.NewInt(1 << 2)
	ingestionEventSixteenFieldBody      = big.NewInt(1 << 3)
	ingestionEventSixteenFieldType      = big.NewInt(1 << 4)
)

type IngestionEventSixteen struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}                `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *CreateGenerationBody      `json:"body" url:"body"`
	Type     *IngestionEventSixteenType `json:"type,omitempty" url:"type,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (i *IngestionEventSixteen) GetID() string {
	if i == nil {
		return ""
	}
	return i.ID
}

func (i *IngestionEventSixteen) GetTimestamp() string {
	if i == nil {
		return ""
	}
	return i.Timestamp
}

func (i *IngestionEventSixteen) GetMetadata() interface{} {
	if i == nil {
		return nil
	}
	return i.Metadata
}

func (i *IngestionEventSixteen) GetBody() *CreateGenerationBody {
	if i == nil {
		return nil
	}
	return i.Body
}

func (i *IngestionEventSixteen) GetType() *IngestionEventSixteenType {
	if i == nil {
		return nil
	}
	return i.Type
}

func (i *IngestionEventSixteen) GetExtraProperties() map[string]interface{} {
	return i.extraProperties
}

func (i *IngestionEventSixteen) require(field *big.Int) {
	if i.explicitFields == nil {
		i.explicitFields = big.NewInt(0)
	}
	i.explicitFields.Or(i.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventSixteen) SetID(id string) {
	i.ID = id
	i.require(ingestionEventSixteenFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventSixteen) SetTimestamp(timestamp string) {
	i.Timestamp = timestamp
	i.require(ingestionEventSixteenFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventSixteen) SetMetadata(metadata interface{}) {
	i.Metadata = metadata
	i.require(ingestionEventSixteenFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventSixteen) SetBody(body *CreateGenerationBody) {
	i.Body = body
	i.require(ingestionEventSixteenFieldBody)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventSixteen) SetType(type_ *IngestionEventSixteenType) {
	i.Type = type_
	i.require(ingestionEventSixteenFieldType)
}

func (i *IngestionEventSixteen) UnmarshalJSON(data []byte) error {
	type unmarshaler IngestionEventSixteen
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*i = IngestionEventSixteen(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *i)
	if err != nil {
		return err
	}
	i.extraProperties = extraProperties
	i.rawJSON = json.RawMessage(data)
	return nil
}

func (i *IngestionEventSixteen) MarshalJSON() ([]byte, error) {
	type embed IngestionEventSixteen
	var marshaler = struct {
		embed
	}{
		embed: embed(*i),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (i *IngestionEventSixteen) String() string {
	if len(i.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(i.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(i); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", i)
}

type IngestionEventSixteenType string

const (
	IngestionEventSixteenTypeGuardrailCreate IngestionEventSixteenType = "guardrail-create"
)

func NewIngestionEventSixteenTypeFromString(s string) (IngestionEventSixteenType, error) {
	switch s {
	case "guardrail-create":
		return IngestionEventSixteenTypeGuardrailCreate, nil
	}
	var t IngestionEventSixteenType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (i IngestionEventSixteenType) Ptr() *IngestionEventSixteenType {
	return &i
}

var (
	ingestionEventTenFieldID        = big.NewInt(1 << 0)
	ingestionEventTenFieldTimestamp = big.NewInt(1 << 1)
	ingestionEventTenFieldMetadata  = big.NewInt(1 << 2)
	ingestionEventTenFieldBody      = big.NewInt(1 << 3)
	ingestionEventTenFieldType      = big.NewInt(1 << 4)
)

type IngestionEventTen struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}            `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *CreateGenerationBody  `json:"body" url:"body"`
	Type     *IngestionEventTenType `json:"type,omitempty" url:"type,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (i *IngestionEventTen) GetID() string {
	if i == nil {
		return ""
	}
	return i.ID
}

func (i *IngestionEventTen) GetTimestamp() string {
	if i == nil {
		return ""
	}
	return i.Timestamp
}

func (i *IngestionEventTen) GetMetadata() interface{} {
	if i == nil {
		return nil
	}
	return i.Metadata
}

func (i *IngestionEventTen) GetBody() *CreateGenerationBody {
	if i == nil {
		return nil
	}
	return i.Body
}

func (i *IngestionEventTen) GetType() *IngestionEventTenType {
	if i == nil {
		return nil
	}
	return i.Type
}

func (i *IngestionEventTen) GetExtraProperties() map[string]interface{} {
	return i.extraProperties
}

func (i *IngestionEventTen) require(field *big.Int) {
	if i.explicitFields == nil {
		i.explicitFields = big.NewInt(0)
	}
	i.explicitFields.Or(i.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventTen) SetID(id string) {
	i.ID = id
	i.require(ingestionEventTenFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventTen) SetTimestamp(timestamp string) {
	i.Timestamp = timestamp
	i.require(ingestionEventTenFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventTen) SetMetadata(metadata interface{}) {
	i.Metadata = metadata
	i.require(ingestionEventTenFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventTen) SetBody(body *CreateGenerationBody) {
	i.Body = body
	i.require(ingestionEventTenFieldBody)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventTen) SetType(type_ *IngestionEventTenType) {
	i.Type = type_
	i.require(ingestionEventTenFieldType)
}

func (i *IngestionEventTen) UnmarshalJSON(data []byte) error {
	type unmarshaler IngestionEventTen
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*i = IngestionEventTen(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *i)
	if err != nil {
		return err
	}
	i.extraProperties = extraProperties
	i.rawJSON = json.RawMessage(data)
	return nil
}

func (i *IngestionEventTen) MarshalJSON() ([]byte, error) {
	type embed IngestionEventTen
	var marshaler = struct {
		embed
	}{
		embed: embed(*i),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (i *IngestionEventTen) String() string {
	if len(i.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(i.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(i); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", i)
}

type IngestionEventTenType string

const (
	IngestionEventTenTypeAgentCreate IngestionEventTenType = "agent-create"
)

func NewIngestionEventTenTypeFromString(s string) (IngestionEventTenType, error) {
	switch s {
	case "agent-create":
		return IngestionEventTenTypeAgentCreate, nil
	}
	var t IngestionEventTenType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (i IngestionEventTenType) Ptr() *IngestionEventTenType {
	return &i
}

var (
	ingestionEventThirteenFieldID        = big.NewInt(1 << 0)
	ingestionEventThirteenFieldTimestamp = big.NewInt(1 << 1)
	ingestionEventThirteenFieldMetadata  = big.NewInt(1 << 2)
	ingestionEventThirteenFieldBody      = big.NewInt(1 << 3)
	ingestionEventThirteenFieldType      = big.NewInt(1 << 4)
)

type IngestionEventThirteen struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}                 `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *CreateGenerationBody       `json:"body" url:"body"`
	Type     *IngestionEventThirteenType `json:"type,omitempty" url:"type,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (i *IngestionEventThirteen) GetID() string {
	if i == nil {
		return ""
	}
	return i.ID
}

func (i *IngestionEventThirteen) GetTimestamp() string {
	if i == nil {
		return ""
	}
	return i.Timestamp
}

func (i *IngestionEventThirteen) GetMetadata() interface{} {
	if i == nil {
		return nil
	}
	return i.Metadata
}

func (i *IngestionEventThirteen) GetBody() *CreateGenerationBody {
	if i == nil {
		return nil
	}
	return i.Body
}

func (i *IngestionEventThirteen) GetType() *IngestionEventThirteenType {
	if i == nil {
		return nil
	}
	return i.Type
}

func (i *IngestionEventThirteen) GetExtraProperties() map[string]interface{} {
	return i.extraProperties
}

func (i *IngestionEventThirteen) require(field *big.Int) {
	if i.explicitFields == nil {
		i.explicitFields = big.NewInt(0)
	}
	i.explicitFields.Or(i.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventThirteen) SetID(id string) {
	i.ID = id
	i.require(ingestionEventThirteenFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventThirteen) SetTimestamp(timestamp string) {
	i.Timestamp = timestamp
	i.require(ingestionEventThirteenFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventThirteen) SetMetadata(metadata interface{}) {
	i.Metadata = metadata
	i.require(ingestionEventThirteenFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventThirteen) SetBody(body *CreateGenerationBody) {
	i.Body = body
	i.require(ingestionEventThirteenFieldBody)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventThirteen) SetType(type_ *IngestionEventThirteenType) {
	i.Type = type_
	i.require(ingestionEventThirteenFieldType)
}

func (i *IngestionEventThirteen) UnmarshalJSON(data []byte) error {
	type unmarshaler IngestionEventThirteen
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*i = IngestionEventThirteen(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *i)
	if err != nil {
		return err
	}
	i.extraProperties = extraProperties
	i.rawJSON = json.RawMessage(data)
	return nil
}

func (i *IngestionEventThirteen) MarshalJSON() ([]byte, error) {
	type embed IngestionEventThirteen
	var marshaler = struct {
		embed
	}{
		embed: embed(*i),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (i *IngestionEventThirteen) String() string {
	if len(i.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(i.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(i); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", i)
}

type IngestionEventThirteenType string

const (
	IngestionEventThirteenTypeRetrieverCreate IngestionEventThirteenType = "retriever-create"
)

func NewIngestionEventThirteenTypeFromString(s string) (IngestionEventThirteenType, error) {
	switch s {
	case "retriever-create":
		return IngestionEventThirteenTypeRetrieverCreate, nil
	}
	var t IngestionEventThirteenType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (i IngestionEventThirteenType) Ptr() *IngestionEventThirteenType {
	return &i
}

var (
	ingestionEventThreeFieldID        = big.NewInt(1 << 0)
	ingestionEventThreeFieldTimestamp = big.NewInt(1 << 1)
	ingestionEventThreeFieldMetadata  = big.NewInt(1 << 2)
	ingestionEventThreeFieldBody      = big.NewInt(1 << 3)
	ingestionEventThreeFieldType      = big.NewInt(1 << 4)
)

type IngestionEventThree struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}              `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *UpdateSpanBody          `json:"body" url:"body"`
	Type     *IngestionEventThreeType `json:"type,omitempty" url:"type,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (i *IngestionEventThree) GetID() string {
	if i == nil {
		return ""
	}
	return i.ID
}

func (i *IngestionEventThree) GetTimestamp() string {
	if i == nil {
		return ""
	}
	return i.Timestamp
}

func (i *IngestionEventThree) GetMetadata() interface{} {
	if i == nil {
		return nil
	}
	return i.Metadata
}

func (i *IngestionEventThree) GetBody() *UpdateSpanBody {
	if i == nil {
		return nil
	}
	return i.Body
}

func (i *IngestionEventThree) GetType() *IngestionEventThreeType {
	if i == nil {
		return nil
	}
	return i.Type
}

func (i *IngestionEventThree) GetExtraProperties() map[string]interface{} {
	return i.extraProperties
}

func (i *IngestionEventThree) require(field *big.Int) {
	if i.explicitFields == nil {
		i.explicitFields = big.NewInt(0)
	}
	i.explicitFields.Or(i.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventThree) SetID(id string) {
	i.ID = id
	i.require(ingestionEventThreeFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventThree) SetTimestamp(timestamp string) {
	i.Timestamp = timestamp
	i.require(ingestionEventThreeFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventThree) SetMetadata(metadata interface{}) {
	i.Metadata = metadata
	i.require(ingestionEventThreeFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventThree) SetBody(body *UpdateSpanBody) {
	i.Body = body
	i.require(ingestionEventThreeFieldBody)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventThree) SetType(type_ *IngestionEventThreeType) {
	i.Type = type_
	i.require(ingestionEventThreeFieldType)
}

func (i *IngestionEventThree) UnmarshalJSON(data []byte) error {
	type unmarshaler IngestionEventThree
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*i = IngestionEventThree(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *i)
	if err != nil {
		return err
	}
	i.extraProperties = extraProperties
	i.rawJSON = json.RawMessage(data)
	return nil
}

func (i *IngestionEventThree) MarshalJSON() ([]byte, error) {
	type embed IngestionEventThree
	var marshaler = struct {
		embed
	}{
		embed: embed(*i),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (i *IngestionEventThree) String() string {
	if len(i.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(i.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(i); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", i)
}

type IngestionEventThreeType string

const (
	IngestionEventThreeTypeSpanUpdate IngestionEventThreeType = "span-update"
)

func NewIngestionEventThreeTypeFromString(s string) (IngestionEventThreeType, error) {
	switch s {
	case "span-update":
		return IngestionEventThreeTypeSpanUpdate, nil
	}
	var t IngestionEventThreeType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (i IngestionEventThreeType) Ptr() *IngestionEventThreeType {
	return &i
}

var (
	ingestionEventTwelveFieldID        = big.NewInt(1 << 0)
	ingestionEventTwelveFieldTimestamp = big.NewInt(1 << 1)
	ingestionEventTwelveFieldMetadata  = big.NewInt(1 << 2)
	ingestionEventTwelveFieldBody      = big.NewInt(1 << 3)
	ingestionEventTwelveFieldType      = big.NewInt(1 << 4)
)

type IngestionEventTwelve struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}               `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *CreateGenerationBody     `json:"body" url:"body"`
	Type     *IngestionEventTwelveType `json:"type,omitempty" url:"type,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (i *IngestionEventTwelve) GetID() string {
	if i == nil {
		return ""
	}
	return i.ID
}

func (i *IngestionEventTwelve) GetTimestamp() string {
	if i == nil {
		return ""
	}
	return i.Timestamp
}

func (i *IngestionEventTwelve) GetMetadata() interface{} {
	if i == nil {
		return nil
	}
	return i.Metadata
}

func (i *IngestionEventTwelve) GetBody() *CreateGenerationBody {
	if i == nil {
		return nil
	}
	return i.Body
}

func (i *IngestionEventTwelve) GetType() *IngestionEventTwelveType {
	if i == nil {
		return nil
	}
	return i.Type
}

func (i *IngestionEventTwelve) GetExtraProperties() map[string]interface{} {
	return i.extraProperties
}

func (i *IngestionEventTwelve) require(field *big.Int) {
	if i.explicitFields == nil {
		i.explicitFields = big.NewInt(0)
	}
	i.explicitFields.Or(i.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventTwelve) SetID(id string) {
	i.ID = id
	i.require(ingestionEventTwelveFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventTwelve) SetTimestamp(timestamp string) {
	i.Timestamp = timestamp
	i.require(ingestionEventTwelveFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventTwelve) SetMetadata(metadata interface{}) {
	i.Metadata = metadata
	i.require(ingestionEventTwelveFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventTwelve) SetBody(body *CreateGenerationBody) {
	i.Body = body
	i.require(ingestionEventTwelveFieldBody)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventTwelve) SetType(type_ *IngestionEventTwelveType) {
	i.Type = type_
	i.require(ingestionEventTwelveFieldType)
}

func (i *IngestionEventTwelve) UnmarshalJSON(data []byte) error {
	type unmarshaler IngestionEventTwelve
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*i = IngestionEventTwelve(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *i)
	if err != nil {
		return err
	}
	i.extraProperties = extraProperties
	i.rawJSON = json.RawMessage(data)
	return nil
}

func (i *IngestionEventTwelve) MarshalJSON() ([]byte, error) {
	type embed IngestionEventTwelve
	var marshaler = struct {
		embed
	}{
		embed: embed(*i),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (i *IngestionEventTwelve) String() string {
	if len(i.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(i.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(i); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", i)
}

type IngestionEventTwelveType string

const (
	IngestionEventTwelveTypeChainCreate IngestionEventTwelveType = "chain-create"
)

func NewIngestionEventTwelveTypeFromString(s string) (IngestionEventTwelveType, error) {
	switch s {
	case "chain-create":
		return IngestionEventTwelveTypeChainCreate, nil
	}
	var t IngestionEventTwelveType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (i IngestionEventTwelveType) Ptr() *IngestionEventTwelveType {
	return &i
}

var (
	ingestionEventTwoFieldID        = big.NewInt(1 << 0)
	ingestionEventTwoFieldTimestamp = big.NewInt(1 << 1)
	ingestionEventTwoFieldMetadata  = big.NewInt(1 << 2)
	ingestionEventTwoFieldBody      = big.NewInt(1 << 3)
	ingestionEventTwoFieldType      = big.NewInt(1 << 4)
)

type IngestionEventTwo struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}            `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *CreateSpanBody        `json:"body" url:"body"`
	Type     *IngestionEventTwoType `json:"type,omitempty" url:"type,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (i *IngestionEventTwo) GetID() string {
	if i == nil {
		return ""
	}
	return i.ID
}

func (i *IngestionEventTwo) GetTimestamp() string {
	if i == nil {
		return ""
	}
	return i.Timestamp
}

func (i *IngestionEventTwo) GetMetadata() interface{} {
	if i == nil {
		return nil
	}
	return i.Metadata
}

func (i *IngestionEventTwo) GetBody() *CreateSpanBody {
	if i == nil {
		return nil
	}
	return i.Body
}

func (i *IngestionEventTwo) GetType() *IngestionEventTwoType {
	if i == nil {
		return nil
	}
	return i.Type
}

func (i *IngestionEventTwo) GetExtraProperties() map[string]interface{} {
	return i.extraProperties
}

func (i *IngestionEventTwo) require(field *big.Int) {
	if i.explicitFields == nil {
		i.explicitFields = big.NewInt(0)
	}
	i.explicitFields.Or(i.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventTwo) SetID(id string) {
	i.ID = id
	i.require(ingestionEventTwoFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventTwo) SetTimestamp(timestamp string) {
	i.Timestamp = timestamp
	i.require(ingestionEventTwoFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventTwo) SetMetadata(metadata interface{}) {
	i.Metadata = metadata
	i.require(ingestionEventTwoFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventTwo) SetBody(body *CreateSpanBody) {
	i.Body = body
	i.require(ingestionEventTwoFieldBody)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventTwo) SetType(type_ *IngestionEventTwoType) {
	i.Type = type_
	i.require(ingestionEventTwoFieldType)
}

func (i *IngestionEventTwo) UnmarshalJSON(data []byte) error {
	type unmarshaler IngestionEventTwo
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*i = IngestionEventTwo(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *i)
	if err != nil {
		return err
	}
	i.extraProperties = extraProperties
	i.rawJSON = json.RawMessage(data)
	return nil
}

func (i *IngestionEventTwo) MarshalJSON() ([]byte, error) {
	type embed IngestionEventTwo
	var marshaler = struct {
		embed
	}{
		embed: embed(*i),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (i *IngestionEventTwo) String() string {
	if len(i.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(i.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(i); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", i)
}

type IngestionEventTwoType string

const (
	IngestionEventTwoTypeSpanCreate IngestionEventTwoType = "span-create"
)

func NewIngestionEventTwoTypeFromString(s string) (IngestionEventTwoType, error) {
	switch s {
	case "span-create":
		return IngestionEventTwoTypeSpanCreate, nil
	}
	var t IngestionEventTwoType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (i IngestionEventTwoType) Ptr() *IngestionEventTwoType {
	return &i
}

var (
	ingestionEventZeroFieldID        = big.NewInt(1 << 0)
	ingestionEventZeroFieldTimestamp = big.NewInt(1 << 1)
	ingestionEventZeroFieldMetadata  = big.NewInt(1 << 2)
	ingestionEventZeroFieldBody      = big.NewInt(1 << 3)
	ingestionEventZeroFieldType      = big.NewInt(1 << 4)
)

type IngestionEventZero struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}             `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *TraceBody              `json:"body" url:"body"`
	Type     *IngestionEventZeroType `json:"type,omitempty" url:"type,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (i *IngestionEventZero) GetID() string {
	if i == nil {
		return ""
	}
	return i.ID
}

func (i *IngestionEventZero) GetTimestamp() string {
	if i == nil {
		return ""
	}
	return i.Timestamp
}

func (i *IngestionEventZero) GetMetadata() interface{} {
	if i == nil {
		return nil
	}
	return i.Metadata
}

func (i *IngestionEventZero) GetBody() *TraceBody {
	if i == nil {
		return nil
	}
	return i.Body
}

func (i *IngestionEventZero) GetType() *IngestionEventZeroType {
	if i == nil {
		return nil
	}
	return i.Type
}

func (i *IngestionEventZero) GetExtraProperties() map[string]interface{} {
	return i.extraProperties
}

func (i *IngestionEventZero) require(field *big.Int) {
	if i.explicitFields == nil {
		i.explicitFields = big.NewInt(0)
	}
	i.explicitFields.Or(i.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventZero) SetID(id string) {
	i.ID = id
	i.require(ingestionEventZeroFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventZero) SetTimestamp(timestamp string) {
	i.Timestamp = timestamp
	i.require(ingestionEventZeroFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventZero) SetMetadata(metadata interface{}) {
	i.Metadata = metadata
	i.require(ingestionEventZeroFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventZero) SetBody(body *TraceBody) {
	i.Body = body
	i.require(ingestionEventZeroFieldBody)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionEventZero) SetType(type_ *IngestionEventZeroType) {
	i.Type = type_
	i.require(ingestionEventZeroFieldType)
}

func (i *IngestionEventZero) UnmarshalJSON(data []byte) error {
	type unmarshaler IngestionEventZero
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*i = IngestionEventZero(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *i)
	if err != nil {
		return err
	}
	i.extraProperties = extraProperties
	i.rawJSON = json.RawMessage(data)
	return nil
}

func (i *IngestionEventZero) MarshalJSON() ([]byte, error) {
	type embed IngestionEventZero
	var marshaler = struct {
		embed
	}{
		embed: embed(*i),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (i *IngestionEventZero) String() string {
	if len(i.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(i.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(i); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", i)
}

type IngestionEventZeroType string

const (
	IngestionEventZeroTypeTraceCreate IngestionEventZeroType = "trace-create"
)

func NewIngestionEventZeroTypeFromString(s string) (IngestionEventZeroType, error) {
	switch s {
	case "trace-create":
		return IngestionEventZeroTypeTraceCreate, nil
	}
	var t IngestionEventZeroType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (i IngestionEventZeroType) Ptr() *IngestionEventZeroType {
	return &i
}

var (
	ingestionResponseFieldSuccesses = big.NewInt(1 << 0)
	ingestionResponseFieldErrors    = big.NewInt(1 << 1)
)

type IngestionResponse struct {
	Successes []*IngestionSuccess `json:"successes" url:"successes"`
	Errors    []*IngestionError   `json:"errors" url:"errors"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (i *IngestionResponse) GetSuccesses() []*IngestionSuccess {
	if i == nil {
		return nil
	}
	return i.Successes
}

func (i *IngestionResponse) GetErrors() []*IngestionError {
	if i == nil {
		return nil
	}
	return i.Errors
}

func (i *IngestionResponse) GetExtraProperties() map[string]interface{} {
	return i.extraProperties
}

func (i *IngestionResponse) require(field *big.Int) {
	if i.explicitFields == nil {
		i.explicitFields = big.NewInt(0)
	}
	i.explicitFields.Or(i.explicitFields, field)
}

// SetSuccesses sets the Successes field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionResponse) SetSuccesses(successes []*IngestionSuccess) {
	i.Successes = successes
	i.require(ingestionResponseFieldSuccesses)
}

// SetErrors sets the Errors field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionResponse) SetErrors(errors []*IngestionError) {
	i.Errors = errors
	i.require(ingestionResponseFieldErrors)
}

func (i *IngestionResponse) UnmarshalJSON(data []byte) error {
	type unmarshaler IngestionResponse
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*i = IngestionResponse(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *i)
	if err != nil {
		return err
	}
	i.extraProperties = extraProperties
	i.rawJSON = json.RawMessage(data)
	return nil
}

func (i *IngestionResponse) MarshalJSON() ([]byte, error) {
	type embed IngestionResponse
	var marshaler = struct {
		embed
	}{
		embed: embed(*i),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (i *IngestionResponse) String() string {
	if len(i.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(i.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(i); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", i)
}

var (
	ingestionSuccessFieldID     = big.NewInt(1 << 0)
	ingestionSuccessFieldStatus = big.NewInt(1 << 1)
)

type IngestionSuccess struct {
	ID     string `json:"id" url:"id"`
	Status int    `json:"status" url:"status"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (i *IngestionSuccess) GetID() string {
	if i == nil {
		return ""
	}
	return i.ID
}

func (i *IngestionSuccess) GetStatus() int {
	if i == nil {
		return 0
	}
	return i.Status
}

func (i *IngestionSuccess) GetExtraProperties() map[string]interface{} {
	return i.extraProperties
}

func (i *IngestionSuccess) require(field *big.Int) {
	if i.explicitFields == nil {
		i.explicitFields = big.NewInt(0)
	}
	i.explicitFields.Or(i.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionSuccess) SetID(id string) {
	i.ID = id
	i.require(ingestionSuccessFieldID)
}

// SetStatus sets the Status field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (i *IngestionSuccess) SetStatus(status int) {
	i.Status = status
	i.require(ingestionSuccessFieldStatus)
}

func (i *IngestionSuccess) UnmarshalJSON(data []byte) error {
	type unmarshaler IngestionSuccess
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*i = IngestionSuccess(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *i)
	if err != nil {
		return err
	}
	i.extraProperties = extraProperties
	i.rawJSON = json.RawMessage(data)
	return nil
}

func (i *IngestionSuccess) MarshalJSON() ([]byte, error) {
	type embed IngestionSuccess
	var marshaler = struct {
		embed
	}{
		embed: embed(*i),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (i *IngestionSuccess) String() string {
	if len(i.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(i.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(i); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", i)
}

type IngestionUsage struct {
	Usage       *Usage
	OpenAiUsage *OpenAiUsage

	typ string
}

func (i *IngestionUsage) GetUsage() *Usage {
	if i == nil {
		return nil
	}
	return i.Usage
}

func (i *IngestionUsage) GetOpenAiUsage() *OpenAiUsage {
	if i == nil {
		return nil
	}
	return i.OpenAiUsage
}

func (i *IngestionUsage) UnmarshalJSON(data []byte) error {
	valueUsage := new(Usage)
	if err := json.Unmarshal(data, &valueUsage); err == nil {
		i.typ = "Usage"
		i.Usage = valueUsage
		return nil
	}
	valueOpenAiUsage := new(OpenAiUsage)
	if err := json.Unmarshal(data, &valueOpenAiUsage); err == nil {
		i.typ = "OpenAiUsage"
		i.OpenAiUsage = valueOpenAiUsage
		return nil
	}
	return fmt.Errorf("%s cannot be deserialized as a %T", data, i)
}

func (i IngestionUsage) MarshalJSON() ([]byte, error) {
	if i.typ == "Usage" || i.Usage != nil {
		return json.Marshal(i.Usage)
	}
	if i.typ == "OpenAiUsage" || i.OpenAiUsage != nil {
		return json.Marshal(i.OpenAiUsage)
	}
	return nil, fmt.Errorf("type %T does not include a non-empty union type", i)
}

type IngestionUsageVisitor interface {
	VisitUsage(*Usage) error
	VisitOpenAiUsage(*OpenAiUsage) error
}

func (i *IngestionUsage) Accept(visitor IngestionUsageVisitor) error {
	if i.typ == "Usage" || i.Usage != nil {
		return visitor.VisitUsage(i.Usage)
	}
	if i.typ == "OpenAiUsage" || i.OpenAiUsage != nil {
		return visitor.VisitOpenAiUsage(i.OpenAiUsage)
	}
	return fmt.Errorf("type %T does not include a non-empty union type", i)
}

type MapValue struct {
	StringOptional     *string
	IntegerOptional    *int
	BooleanOptional    *bool
	StringListOptional []string

	typ string
}

func (m *MapValue) GetStringOptional() *string {
	if m == nil {
		return nil
	}
	return m.StringOptional
}

func (m *MapValue) GetIntegerOptional() *int {
	if m == nil {
		return nil
	}
	return m.IntegerOptional
}

func (m *MapValue) GetBooleanOptional() *bool {
	if m == nil {
		return nil
	}
	return m.BooleanOptional
}

func (m *MapValue) GetStringListOptional() []string {
	if m == nil {
		return nil
	}
	return m.StringListOptional
}

func (m *MapValue) UnmarshalJSON(data []byte) error {
	var valueStringOptional *string
	if err := json.Unmarshal(data, &valueStringOptional); err == nil {
		m.typ = "StringOptional"
		m.StringOptional = valueStringOptional
		return nil
	}
	var valueIntegerOptional *int
	if err := json.Unmarshal(data, &valueIntegerOptional); err == nil {
		m.typ = "IntegerOptional"
		m.IntegerOptional = valueIntegerOptional
		return nil
	}
	var valueBooleanOptional *bool
	if err := json.Unmarshal(data, &valueBooleanOptional); err == nil {
		m.typ = "BooleanOptional"
		m.BooleanOptional = valueBooleanOptional
		return nil
	}
	var valueStringListOptional []string
	if err := json.Unmarshal(data, &valueStringListOptional); err == nil {
		m.typ = "StringListOptional"
		m.StringListOptional = valueStringListOptional
		return nil
	}
	return fmt.Errorf("%s cannot be deserialized as a %T", data, m)
}

func (m MapValue) MarshalJSON() ([]byte, error) {
	if m.typ == "StringOptional" || m.StringOptional != nil {
		return json.Marshal(m.StringOptional)
	}
	if m.typ == "IntegerOptional" || m.IntegerOptional != nil {
		return json.Marshal(m.IntegerOptional)
	}
	if m.typ == "BooleanOptional" || m.BooleanOptional != nil {
		return json.Marshal(m.BooleanOptional)
	}
	if m.typ == "StringListOptional" || m.StringListOptional != nil {
		return json.Marshal(m.StringListOptional)
	}
	return nil, fmt.Errorf("type %T does not include a non-empty union type", m)
}

type MapValueVisitor interface {
	VisitStringOptional(*string) error
	VisitIntegerOptional(*int) error
	VisitBooleanOptional(*bool) error
	VisitStringListOptional([]string) error
}

func (m *MapValue) Accept(visitor MapValueVisitor) error {
	if m.typ == "StringOptional" || m.StringOptional != nil {
		return visitor.VisitStringOptional(m.StringOptional)
	}
	if m.typ == "IntegerOptional" || m.IntegerOptional != nil {
		return visitor.VisitIntegerOptional(m.IntegerOptional)
	}
	if m.typ == "BooleanOptional" || m.BooleanOptional != nil {
		return visitor.VisitBooleanOptional(m.BooleanOptional)
	}
	if m.typ == "StringListOptional" || m.StringListOptional != nil {
		return visitor.VisitStringListOptional(m.StringListOptional)
	}
	return fmt.Errorf("type %T does not include a non-empty union type", m)
}

var (
	observationBodyFieldID                  = big.NewInt(1 << 0)
	observationBodyFieldTraceID             = big.NewInt(1 << 1)
	observationBodyFieldType                = big.NewInt(1 << 2)
	observationBodyFieldName                = big.NewInt(1 << 3)
	observationBodyFieldStartTime           = big.NewInt(1 << 4)
	observationBodyFieldEndTime             = big.NewInt(1 << 5)
	observationBodyFieldCompletionStartTime = big.NewInt(1 << 6)
	observationBodyFieldModel               = big.NewInt(1 << 7)
	observationBodyFieldModelParameters     = big.NewInt(1 << 8)
	observationBodyFieldInput               = big.NewInt(1 << 9)
	observationBodyFieldVersion             = big.NewInt(1 << 10)
	observationBodyFieldMetadata            = big.NewInt(1 << 11)
	observationBodyFieldOutput              = big.NewInt(1 << 12)
	observationBodyFieldUsage               = big.NewInt(1 << 13)
	observationBodyFieldLevel               = big.NewInt(1 << 14)
	observationBodyFieldStatusMessage       = big.NewInt(1 << 15)
	observationBodyFieldParentObservationID = big.NewInt(1 << 16)
	observationBodyFieldEnvironment         = big.NewInt(1 << 17)
)

type ObservationBody struct {
	ID                  *string              `json:"id,omitempty" url:"id,omitempty"`
	TraceID             *string              `json:"traceId,omitempty" url:"traceId,omitempty"`
	Type                ObservationType      `json:"type" url:"type"`
	Name                *string              `json:"name,omitempty" url:"name,omitempty"`
	StartTime           *time.Time           `json:"startTime,omitempty" url:"startTime,omitempty"`
	EndTime             *time.Time           `json:"endTime,omitempty" url:"endTime,omitempty"`
	CompletionStartTime *time.Time           `json:"completionStartTime,omitempty" url:"completionStartTime,omitempty"`
	Model               *string              `json:"model,omitempty" url:"model,omitempty"`
	ModelParameters     map[string]*MapValue `json:"modelParameters,omitempty" url:"modelParameters,omitempty"`
	Input               interface{}          `json:"input,omitempty" url:"input,omitempty"`
	Version             *string              `json:"version,omitempty" url:"version,omitempty"`
	Metadata            interface{}          `json:"metadata,omitempty" url:"metadata,omitempty"`
	Output              interface{}          `json:"output,omitempty" url:"output,omitempty"`
	Usage               *Usage               `json:"usage,omitempty" url:"usage,omitempty"`
	Level               *ObservationLevel    `json:"level,omitempty" url:"level,omitempty"`
	StatusMessage       *string              `json:"statusMessage,omitempty" url:"statusMessage,omitempty"`
	ParentObservationID *string              `json:"parentObservationId,omitempty" url:"parentObservationId,omitempty"`
	Environment         *string              `json:"environment,omitempty" url:"environment,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (o *ObservationBody) GetID() *string {
	if o == nil {
		return nil
	}
	return o.ID
}

func (o *ObservationBody) GetTraceID() *string {
	if o == nil {
		return nil
	}
	return o.TraceID
}

func (o *ObservationBody) GetType() ObservationType {
	if o == nil {
		return ""
	}
	return o.Type
}

func (o *ObservationBody) GetName() *string {
	if o == nil {
		return nil
	}
	return o.Name
}

func (o *ObservationBody) GetStartTime() *time.Time {
	if o == nil {
		return nil
	}
	return o.StartTime
}

func (o *ObservationBody) GetEndTime() *time.Time {
	if o == nil {
		return nil
	}
	return o.EndTime
}

func (o *ObservationBody) GetCompletionStartTime() *time.Time {
	if o == nil {
		return nil
	}
	return o.CompletionStartTime
}

func (o *ObservationBody) GetModel() *string {
	if o == nil {
		return nil
	}
	return o.Model
}

func (o *ObservationBody) GetModelParameters() map[string]*MapValue {
	if o == nil {
		return nil
	}
	return o.ModelParameters
}

func (o *ObservationBody) GetInput() interface{} {
	if o == nil {
		return nil
	}
	return o.Input
}

func (o *ObservationBody) GetVersion() *string {
	if o == nil {
		return nil
	}
	return o.Version
}

func (o *ObservationBody) GetMetadata() interface{} {
	if o == nil {
		return nil
	}
	return o.Metadata
}

func (o *ObservationBody) GetOutput() interface{} {
	if o == nil {
		return nil
	}
	return o.Output
}

func (o *ObservationBody) GetUsage() *Usage {
	if o == nil {
		return nil
	}
	return o.Usage
}

func (o *ObservationBody) GetLevel() *ObservationLevel {
	if o == nil {
		return nil
	}
	return o.Level
}

func (o *ObservationBody) GetStatusMessage() *string {
	if o == nil {
		return nil
	}
	return o.StatusMessage
}

func (o *ObservationBody) GetParentObservationID() *string {
	if o == nil {
		return nil
	}
	return o.ParentObservationID
}

func (o *ObservationBody) GetEnvironment() *string {
	if o == nil {
		return nil
	}
	return o.Environment
}

func (o *ObservationBody) GetExtraProperties() map[string]interface{} {
	return o.extraProperties
}

func (o *ObservationBody) require(field *big.Int) {
	if o.explicitFields == nil {
		o.explicitFields = big.NewInt(0)
	}
	o.explicitFields.Or(o.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *ObservationBody) SetID(id *string) {
	o.ID = id
	o.require(observationBodyFieldID)
}

// SetTraceID sets the TraceID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *ObservationBody) SetTraceID(traceID *string) {
	o.TraceID = traceID
	o.require(observationBodyFieldTraceID)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *ObservationBody) SetType(type_ ObservationType) {
	o.Type = type_
	o.require(observationBodyFieldType)
}

// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *ObservationBody) SetName(name *string) {
	o.Name = name
	o.require(observationBodyFieldName)
}

// SetStartTime sets the StartTime field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *ObservationBody) SetStartTime(startTime *time.Time) {
	o.StartTime = startTime
	o.require(observationBodyFieldStartTime)
}

// SetEndTime sets the EndTime field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *ObservationBody) SetEndTime(endTime *time.Time) {
	o.EndTime = endTime
	o.require(observationBodyFieldEndTime)
}

// SetCompletionStartTime sets the CompletionStartTime field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *ObservationBody) SetCompletionStartTime(completionStartTime *time.Time) {
	o.CompletionStartTime = completionStartTime
	o.require(observationBodyFieldCompletionStartTime)
}

// SetModel sets the Model field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *ObservationBody) SetModel(model *string) {
	o.Model = model
	o.require(observationBodyFieldModel)
}

// SetModelParameters sets the ModelParameters field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *ObservationBody) SetModelParameters(modelParameters map[string]*MapValue) {
	o.ModelParameters = modelParameters
	o.require(observationBodyFieldModelParameters)
}

// SetInput sets the Input field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *ObservationBody) SetInput(input interface{}) {
	o.Input = input
	o.require(observationBodyFieldInput)
}

// SetVersion sets the Version field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *ObservationBody) SetVersion(version *string) {
	o.Version = version
	o.require(observationBodyFieldVersion)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *ObservationBody) SetMetadata(metadata interface{}) {
	o.Metadata = metadata
	o.require(observationBodyFieldMetadata)
}

// SetOutput sets the Output field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *ObservationBody) SetOutput(output interface{}) {
	o.Output = output
	o.require(observationBodyFieldOutput)
}

// SetUsage sets the Usage field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *ObservationBody) SetUsage(usage *Usage) {
	o.Usage = usage
	o.require(observationBodyFieldUsage)
}

// SetLevel sets the Level field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *ObservationBody) SetLevel(level *ObservationLevel) {
	o.Level = level
	o.require(observationBodyFieldLevel)
}

// SetStatusMessage sets the StatusMessage field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *ObservationBody) SetStatusMessage(statusMessage *string) {
	o.StatusMessage = statusMessage
	o.require(observationBodyFieldStatusMessage)
}

// SetParentObservationID sets the ParentObservationID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *ObservationBody) SetParentObservationID(parentObservationID *string) {
	o.ParentObservationID = parentObservationID
	o.require(observationBodyFieldParentObservationID)
}

// SetEnvironment sets the Environment field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *ObservationBody) SetEnvironment(environment *string) {
	o.Environment = environment
	o.require(observationBodyFieldEnvironment)
}

func (o *ObservationBody) UnmarshalJSON(data []byte) error {
	type embed ObservationBody
	var unmarshaler = struct {
		embed
		StartTime           *internal.DateTime `json:"startTime,omitempty"`
		EndTime             *internal.DateTime `json:"endTime,omitempty"`
		CompletionStartTime *internal.DateTime `json:"completionStartTime,omitempty"`
	}{
		embed: embed(*o),
	}
	if err := json.Unmarshal(data, &unmarshaler); err != nil {
		return err
	}
	*o = ObservationBody(unmarshaler.embed)
	o.StartTime = unmarshaler.StartTime.TimePtr()
	o.EndTime = unmarshaler.EndTime.TimePtr()
	o.CompletionStartTime = unmarshaler.CompletionStartTime.TimePtr()
	extraProperties, err := internal.ExtractExtraProperties(data, *o)
	if err != nil {
		return err
	}
	o.extraProperties = extraProperties
	o.rawJSON = json.RawMessage(data)
	return nil
}

func (o *ObservationBody) MarshalJSON() ([]byte, error) {
	type embed ObservationBody
	var marshaler = struct {
		embed
		StartTime           *internal.DateTime `json:"startTime,omitempty"`
		EndTime             *internal.DateTime `json:"endTime,omitempty"`
		CompletionStartTime *internal.DateTime `json:"completionStartTime,omitempty"`
	}{
		embed:               embed(*o),
		StartTime:           internal.NewOptionalDateTime(o.StartTime),
		EndTime:             internal.NewOptionalDateTime(o.EndTime),
		CompletionStartTime: internal.NewOptionalDateTime(o.CompletionStartTime),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, o.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (o *ObservationBody) String() string {
	if len(o.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(o.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(o); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", o)
}

type ObservationType string

const (
	ObservationTypeSpan       ObservationType = "SPAN"
	ObservationTypeGeneration ObservationType = "GENERATION"
	ObservationTypeEvent      ObservationType = "EVENT"
	ObservationTypeAgent      ObservationType = "AGENT"
	ObservationTypeTool       ObservationType = "TOOL"
	ObservationTypeChain      ObservationType = "CHAIN"
	ObservationTypeRetriever  ObservationType = "RETRIEVER"
	ObservationTypeEvaluator  ObservationType = "EVALUATOR"
	ObservationTypeEmbedding  ObservationType = "EMBEDDING"
	ObservationTypeGuardrail  ObservationType = "GUARDRAIL"
)

func NewObservationTypeFromString(s string) (ObservationType, error) {
	switch s {
	case "SPAN":
		return ObservationTypeSpan, nil
	case "GENERATION":
		return ObservationTypeGeneration, nil
	case "EVENT":
		return ObservationTypeEvent, nil
	case "AGENT":
		return ObservationTypeAgent, nil
	case "TOOL":
		return ObservationTypeTool, nil
	case "CHAIN":
		return ObservationTypeChain, nil
	case "RETRIEVER":
		return ObservationTypeRetriever, nil
	case "EVALUATOR":
		return ObservationTypeEvaluator, nil
	case "EMBEDDING":
		return ObservationTypeEmbedding, nil
	case "GUARDRAIL":
		return ObservationTypeGuardrail, nil
	}
	var t ObservationType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (o ObservationType) Ptr() *ObservationType {
	return &o
}

// OpenAI Usage schema from (Chat-)Completion APIs
var (
	openAiCompletionUsageSchemaFieldPromptTokens            = big.NewInt(1 << 0)
	openAiCompletionUsageSchemaFieldCompletionTokens        = big.NewInt(1 << 1)
	openAiCompletionUsageSchemaFieldTotalTokens             = big.NewInt(1 << 2)
	openAiCompletionUsageSchemaFieldPromptTokensDetails     = big.NewInt(1 << 3)
	openAiCompletionUsageSchemaFieldCompletionTokensDetails = big.NewInt(1 << 4)
)

type OpenAiCompletionUsageSchema struct {
	PromptTokens            int             `json:"prompt_tokens" url:"prompt_tokens"`
	CompletionTokens        int             `json:"completion_tokens" url:"completion_tokens"`
	TotalTokens             int             `json:"total_tokens" url:"total_tokens"`
	PromptTokensDetails     map[string]*int `json:"prompt_tokens_details,omitempty" url:"prompt_tokens_details,omitempty"`
	CompletionTokensDetails map[string]*int `json:"completion_tokens_details,omitempty" url:"completion_tokens_details,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (o *OpenAiCompletionUsageSchema) GetPromptTokens() int {
	if o == nil {
		return 0
	}
	return o.PromptTokens
}

func (o *OpenAiCompletionUsageSchema) GetCompletionTokens() int {
	if o == nil {
		return 0
	}
	return o.CompletionTokens
}

func (o *OpenAiCompletionUsageSchema) GetTotalTokens() int {
	if o == nil {
		return 0
	}
	return o.TotalTokens
}

func (o *OpenAiCompletionUsageSchema) GetPromptTokensDetails() map[string]*int {
	if o == nil {
		return nil
	}
	return o.PromptTokensDetails
}

func (o *OpenAiCompletionUsageSchema) GetCompletionTokensDetails() map[string]*int {
	if o == nil {
		return nil
	}
	return o.CompletionTokensDetails
}

func (o *OpenAiCompletionUsageSchema) GetExtraProperties() map[string]interface{} {
	return o.extraProperties
}

func (o *OpenAiCompletionUsageSchema) require(field *big.Int) {
	if o.explicitFields == nil {
		o.explicitFields = big.NewInt(0)
	}
	o.explicitFields.Or(o.explicitFields, field)
}

// SetPromptTokens sets the PromptTokens field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OpenAiCompletionUsageSchema) SetPromptTokens(promptTokens int) {
	o.PromptTokens = promptTokens
	o.require(openAiCompletionUsageSchemaFieldPromptTokens)
}

// SetCompletionTokens sets the CompletionTokens field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OpenAiCompletionUsageSchema) SetCompletionTokens(completionTokens int) {
	o.CompletionTokens = completionTokens
	o.require(openAiCompletionUsageSchemaFieldCompletionTokens)
}

// SetTotalTokens sets the TotalTokens field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OpenAiCompletionUsageSchema) SetTotalTokens(totalTokens int) {
	o.TotalTokens = totalTokens
	o.require(openAiCompletionUsageSchemaFieldTotalTokens)
}

// SetPromptTokensDetails sets the PromptTokensDetails field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OpenAiCompletionUsageSchema) SetPromptTokensDetails(promptTokensDetails map[string]*int) {
	o.PromptTokensDetails = promptTokensDetails
	o.require(openAiCompletionUsageSchemaFieldPromptTokensDetails)
}

// SetCompletionTokensDetails sets the CompletionTokensDetails field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OpenAiCompletionUsageSchema) SetCompletionTokensDetails(completionTokensDetails map[string]*int) {
	o.CompletionTokensDetails = completionTokensDetails
	o.require(openAiCompletionUsageSchemaFieldCompletionTokensDetails)
}

func (o *OpenAiCompletionUsageSchema) UnmarshalJSON(data []byte) error {
	type unmarshaler OpenAiCompletionUsageSchema
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*o = OpenAiCompletionUsageSchema(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *o)
	if err != nil {
		return err
	}
	o.extraProperties = extraProperties
	o.rawJSON = json.RawMessage(data)
	return nil
}

func (o *OpenAiCompletionUsageSchema) MarshalJSON() ([]byte, error) {
	type embed OpenAiCompletionUsageSchema
	var marshaler = struct {
		embed
	}{
		embed: embed(*o),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, o.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (o *OpenAiCompletionUsageSchema) String() string {
	if len(o.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(o.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(o); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", o)
}

// OpenAI Usage schema from Response API
var (
	openAiResponseUsageSchemaFieldInputTokens         = big.NewInt(1 << 0)
	openAiResponseUsageSchemaFieldOutputTokens        = big.NewInt(1 << 1)
	openAiResponseUsageSchemaFieldTotalTokens         = big.NewInt(1 << 2)
	openAiResponseUsageSchemaFieldInputTokensDetails  = big.NewInt(1 << 3)
	openAiResponseUsageSchemaFieldOutputTokensDetails = big.NewInt(1 << 4)
)

type OpenAiResponseUsageSchema struct {
	InputTokens         int             `json:"input_tokens" url:"input_tokens"`
	OutputTokens        int             `json:"output_tokens" url:"output_tokens"`
	TotalTokens         int             `json:"total_tokens" url:"total_tokens"`
	InputTokensDetails  map[string]*int `json:"input_tokens_details,omitempty" url:"input_tokens_details,omitempty"`
	OutputTokensDetails map[string]*int `json:"output_tokens_details,omitempty" url:"output_tokens_details,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (o *OpenAiResponseUsageSchema) GetInputTokens() int {
	if o == nil {
		return 0
	}
	return o.InputTokens
}

func (o *OpenAiResponseUsageSchema) GetOutputTokens() int {
	if o == nil {
		return 0
	}
	return o.OutputTokens
}

func (o *OpenAiResponseUsageSchema) GetTotalTokens() int {
	if o == nil {
		return 0
	}
	return o.TotalTokens
}

func (o *OpenAiResponseUsageSchema) GetInputTokensDetails() map[string]*int {
	if o == nil {
		return nil
	}
	return o.InputTokensDetails
}

func (o *OpenAiResponseUsageSchema) GetOutputTokensDetails() map[string]*int {
	if o == nil {
		return nil
	}
	return o.OutputTokensDetails
}

func (o *OpenAiResponseUsageSchema) GetExtraProperties() map[string]interface{} {
	return o.extraProperties
}

func (o *OpenAiResponseUsageSchema) require(field *big.Int) {
	if o.explicitFields == nil {
		o.explicitFields = big.NewInt(0)
	}
	o.explicitFields.Or(o.explicitFields, field)
}

// SetInputTokens sets the InputTokens field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OpenAiResponseUsageSchema) SetInputTokens(inputTokens int) {
	o.InputTokens = inputTokens
	o.require(openAiResponseUsageSchemaFieldInputTokens)
}

// SetOutputTokens sets the OutputTokens field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OpenAiResponseUsageSchema) SetOutputTokens(outputTokens int) {
	o.OutputTokens = outputTokens
	o.require(openAiResponseUsageSchemaFieldOutputTokens)
}

// SetTotalTokens sets the TotalTokens field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OpenAiResponseUsageSchema) SetTotalTokens(totalTokens int) {
	o.TotalTokens = totalTokens
	o.require(openAiResponseUsageSchemaFieldTotalTokens)
}

// SetInputTokensDetails sets the InputTokensDetails field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OpenAiResponseUsageSchema) SetInputTokensDetails(inputTokensDetails map[string]*int) {
	o.InputTokensDetails = inputTokensDetails
	o.require(openAiResponseUsageSchemaFieldInputTokensDetails)
}

// SetOutputTokensDetails sets the OutputTokensDetails field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OpenAiResponseUsageSchema) SetOutputTokensDetails(outputTokensDetails map[string]*int) {
	o.OutputTokensDetails = outputTokensDetails
	o.require(openAiResponseUsageSchemaFieldOutputTokensDetails)
}

func (o *OpenAiResponseUsageSchema) UnmarshalJSON(data []byte) error {
	type unmarshaler OpenAiResponseUsageSchema
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*o = OpenAiResponseUsageSchema(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *o)
	if err != nil {
		return err
	}
	o.extraProperties = extraProperties
	o.rawJSON = json.RawMessage(data)
	return nil
}

func (o *OpenAiResponseUsageSchema) MarshalJSON() ([]byte, error) {
	type embed OpenAiResponseUsageSchema
	var marshaler = struct {
		embed
	}{
		embed: embed(*o),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, o.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (o *OpenAiResponseUsageSchema) String() string {
	if len(o.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(o.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(o); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", o)
}

// Usage interface of OpenAI for improved compatibility.
var (
	openAiUsageFieldPromptTokens     = big.NewInt(1 << 0)
	openAiUsageFieldCompletionTokens = big.NewInt(1 << 1)
	openAiUsageFieldTotalTokens      = big.NewInt(1 << 2)
)

type OpenAiUsage struct {
	PromptTokens     *int `json:"promptTokens,omitempty" url:"promptTokens,omitempty"`
	CompletionTokens *int `json:"completionTokens,omitempty" url:"completionTokens,omitempty"`
	TotalTokens      *int `json:"totalTokens,omitempty" url:"totalTokens,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (o *OpenAiUsage) GetPromptTokens() *int {
	if o == nil {
		return nil
	}
	return o.PromptTokens
}

func (o *OpenAiUsage) GetCompletionTokens() *int {
	if o == nil {
		return nil
	}
	return o.CompletionTokens
}

func (o *OpenAiUsage) GetTotalTokens() *int {
	if o == nil {
		return nil
	}
	return o.TotalTokens
}

func (o *OpenAiUsage) GetExtraProperties() map[string]interface{} {
	return o.extraProperties
}

func (o *OpenAiUsage) require(field *big.Int) {
	if o.explicitFields == nil {
		o.explicitFields = big.NewInt(0)
	}
	o.explicitFields.Or(o.explicitFields, field)
}

// SetPromptTokens sets the PromptTokens field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OpenAiUsage) SetPromptTokens(promptTokens *int) {
	o.PromptTokens = promptTokens
	o.require(openAiUsageFieldPromptTokens)
}

// SetCompletionTokens sets the CompletionTokens field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OpenAiUsage) SetCompletionTokens(completionTokens *int) {
	o.CompletionTokens = completionTokens
	o.require(openAiUsageFieldCompletionTokens)
}

// SetTotalTokens sets the TotalTokens field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OpenAiUsage) SetTotalTokens(totalTokens *int) {
	o.TotalTokens = totalTokens
	o.require(openAiUsageFieldTotalTokens)
}

func (o *OpenAiUsage) UnmarshalJSON(data []byte) error {
	type unmarshaler OpenAiUsage
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*o = OpenAiUsage(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *o)
	if err != nil {
		return err
	}
	o.extraProperties = extraProperties
	o.rawJSON = json.RawMessage(data)
	return nil
}

func (o *OpenAiUsage) MarshalJSON() ([]byte, error) {
	type embed OpenAiUsage
	var marshaler = struct {
		embed
	}{
		embed: embed(*o),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, o.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (o *OpenAiUsage) String() string {
	if len(o.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(o.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(o); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", o)
}

var (
	optionalObservationBodyFieldTraceID             = big.NewInt(1 << 0)
	optionalObservationBodyFieldName                = big.NewInt(1 << 1)
	optionalObservationBodyFieldStartTime           = big.NewInt(1 << 2)
	optionalObservationBodyFieldMetadata            = big.NewInt(1 << 3)
	optionalObservationBodyFieldInput               = big.NewInt(1 << 4)
	optionalObservationBodyFieldOutput              = big.NewInt(1 << 5)
	optionalObservationBodyFieldLevel               = big.NewInt(1 << 6)
	optionalObservationBodyFieldStatusMessage       = big.NewInt(1 << 7)
	optionalObservationBodyFieldParentObservationID = big.NewInt(1 << 8)
	optionalObservationBodyFieldVersion             = big.NewInt(1 << 9)
	optionalObservationBodyFieldEnvironment         = big.NewInt(1 << 10)
)

type OptionalObservationBody struct {
	TraceID             *string           `json:"traceId,omitempty" url:"traceId,omitempty"`
	Name                *string           `json:"name,omitempty" url:"name,omitempty"`
	StartTime           *time.Time        `json:"startTime,omitempty" url:"startTime,omitempty"`
	Metadata            interface{}       `json:"metadata,omitempty" url:"metadata,omitempty"`
	Input               interface{}       `json:"input,omitempty" url:"input,omitempty"`
	Output              interface{}       `json:"output,omitempty" url:"output,omitempty"`
	Level               *ObservationLevel `json:"level,omitempty" url:"level,omitempty"`
	StatusMessage       *string           `json:"statusMessage,omitempty" url:"statusMessage,omitempty"`
	ParentObservationID *string           `json:"parentObservationId,omitempty" url:"parentObservationId,omitempty"`
	Version             *string           `json:"version,omitempty" url:"version,omitempty"`
	Environment         *string           `json:"environment,omitempty" url:"environment,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (o *OptionalObservationBody) GetTraceID() *string {
	if o == nil {
		return nil
	}
	return o.TraceID
}

func (o *OptionalObservationBody) GetName() *string {
	if o == nil {
		return nil
	}
	return o.Name
}

func (o *OptionalObservationBody) GetStartTime() *time.Time {
	if o == nil {
		return nil
	}
	return o.StartTime
}

func (o *OptionalObservationBody) GetMetadata() interface{} {
	if o == nil {
		return nil
	}
	return o.Metadata
}

func (o *OptionalObservationBody) GetInput() interface{} {
	if o == nil {
		return nil
	}
	return o.Input
}

func (o *OptionalObservationBody) GetOutput() interface{} {
	if o == nil {
		return nil
	}
	return o.Output
}

func (o *OptionalObservationBody) GetLevel() *ObservationLevel {
	if o == nil {
		return nil
	}
	return o.Level
}

func (o *OptionalObservationBody) GetStatusMessage() *string {
	if o == nil {
		return nil
	}
	return o.StatusMessage
}

func (o *OptionalObservationBody) GetParentObservationID() *string {
	if o == nil {
		return nil
	}
	return o.ParentObservationID
}

func (o *OptionalObservationBody) GetVersion() *string {
	if o == nil {
		return nil
	}
	return o.Version
}

func (o *OptionalObservationBody) GetEnvironment() *string {
	if o == nil {
		return nil
	}
	return o.Environment
}

func (o *OptionalObservationBody) GetExtraProperties() map[string]interface{} {
	return o.extraProperties
}

func (o *OptionalObservationBody) require(field *big.Int) {
	if o.explicitFields == nil {
		o.explicitFields = big.NewInt(0)
	}
	o.explicitFields.Or(o.explicitFields, field)
}

// SetTraceID sets the TraceID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OptionalObservationBody) SetTraceID(traceID *string) {
	o.TraceID = traceID
	o.require(optionalObservationBodyFieldTraceID)
}

// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OptionalObservationBody) SetName(name *string) {
	o.Name = name
	o.require(optionalObservationBodyFieldName)
}

// SetStartTime sets the StartTime field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OptionalObservationBody) SetStartTime(startTime *time.Time) {
	o.StartTime = startTime
	o.require(optionalObservationBodyFieldStartTime)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OptionalObservationBody) SetMetadata(metadata interface{}) {
	o.Metadata = metadata
	o.require(optionalObservationBodyFieldMetadata)
}

// SetInput sets the Input field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OptionalObservationBody) SetInput(input interface{}) {
	o.Input = input
	o.require(optionalObservationBodyFieldInput)
}

// SetOutput sets the Output field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OptionalObservationBody) SetOutput(output interface{}) {
	o.Output = output
	o.require(optionalObservationBodyFieldOutput)
}

// SetLevel sets the Level field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OptionalObservationBody) SetLevel(level *ObservationLevel) {
	o.Level = level
	o.require(optionalObservationBodyFieldLevel)
}

// SetStatusMessage sets the StatusMessage field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OptionalObservationBody) SetStatusMessage(statusMessage *string) {
	o.StatusMessage = statusMessage
	o.require(optionalObservationBodyFieldStatusMessage)
}

// SetParentObservationID sets the ParentObservationID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OptionalObservationBody) SetParentObservationID(parentObservationID *string) {
	o.ParentObservationID = parentObservationID
	o.require(optionalObservationBodyFieldParentObservationID)
}

// SetVersion sets the Version field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OptionalObservationBody) SetVersion(version *string) {
	o.Version = version
	o.require(optionalObservationBodyFieldVersion)
}

// SetEnvironment sets the Environment field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OptionalObservationBody) SetEnvironment(environment *string) {
	o.Environment = environment
	o.require(optionalObservationBodyFieldEnvironment)
}

func (o *OptionalObservationBody) UnmarshalJSON(data []byte) error {
	type embed OptionalObservationBody
	var unmarshaler = struct {
		embed
		StartTime *internal.DateTime `json:"startTime,omitempty"`
	}{
		embed: embed(*o),
	}
	if err := json.Unmarshal(data, &unmarshaler); err != nil {
		return err
	}
	*o = OptionalObservationBody(unmarshaler.embed)
	o.StartTime = unmarshaler.StartTime.TimePtr()
	extraProperties, err := internal.ExtractExtraProperties(data, *o)
	if err != nil {
		return err
	}
	o.extraProperties = extraProperties
	o.rawJSON = json.RawMessage(data)
	return nil
}

func (o *OptionalObservationBody) MarshalJSON() ([]byte, error) {
	type embed OptionalObservationBody
	var marshaler = struct {
		embed
		StartTime *internal.DateTime `json:"startTime,omitempty"`
	}{
		embed:     embed(*o),
		StartTime: internal.NewOptionalDateTime(o.StartTime),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, o.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (o *OptionalObservationBody) String() string {
	if len(o.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(o.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(o); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", o)
}

var (
	scoreBodyFieldID            = big.NewInt(1 << 0)
	scoreBodyFieldTraceID       = big.NewInt(1 << 1)
	scoreBodyFieldSessionID     = big.NewInt(1 << 2)
	scoreBodyFieldObservationID = big.NewInt(1 << 3)
	scoreBodyFieldDatasetRunID  = big.NewInt(1 << 4)
	scoreBodyFieldName          = big.NewInt(1 << 5)
	scoreBodyFieldEnvironment   = big.NewInt(1 << 6)
	scoreBodyFieldQueueID       = big.NewInt(1 << 7)
	scoreBodyFieldValue         = big.NewInt(1 << 8)
	scoreBodyFieldComment       = big.NewInt(1 << 9)
	scoreBodyFieldMetadata      = big.NewInt(1 << 10)
	scoreBodyFieldDataType      = big.NewInt(1 << 11)
	scoreBodyFieldConfigID      = big.NewInt(1 << 12)
)

type ScoreBody struct {
	ID            *string `json:"id,omitempty" url:"id,omitempty"`
	TraceID       *string `json:"traceId,omitempty" url:"traceId,omitempty"`
	SessionID     *string `json:"sessionId,omitempty" url:"sessionId,omitempty"`
	ObservationID *string `json:"observationId,omitempty" url:"observationId,omitempty"`
	DatasetRunID  *string `json:"datasetRunId,omitempty" url:"datasetRunId,omitempty"`
	// The name of the score. Always overrides "output" for correction scores.
	Name        string  `json:"name" url:"name"`
	Environment *string `json:"environment,omitempty" url:"environment,omitempty"`
	// The annotation queue referenced by the score. Indicates if score was initially created while processing annotation queue.
	QueueID *string `json:"queueId,omitempty" url:"queueId,omitempty"`
	// The value of the score. Must be passed as string for categorical scores, and numeric for boolean and numeric scores. Boolean score values must equal either 1 or 0 (true or false)
	Value    *CreateScoreValue `json:"value" url:"value"`
	Comment  *string           `json:"comment,omitempty" url:"comment,omitempty"`
	Metadata interface{}       `json:"metadata,omitempty" url:"metadata,omitempty"`
	// When set, must match the score value's type. If not set, will be inferred from the score value or config
	DataType *ScoreDataType `json:"dataType,omitempty" url:"dataType,omitempty"`
	// Reference a score config on a score. When set, the score name must equal the config name and scores must comply with the config's range and data type. For categorical scores, the value must map to a config category. Numeric scores might be constrained by the score config's max and min values
	ConfigID *string `json:"configId,omitempty" url:"configId,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (s *ScoreBody) GetID() *string {
	if s == nil {
		return nil
	}
	return s.ID
}

func (s *ScoreBody) GetTraceID() *string {
	if s == nil {
		return nil
	}
	return s.TraceID
}

func (s *ScoreBody) GetSessionID() *string {
	if s == nil {
		return nil
	}
	return s.SessionID
}

func (s *ScoreBody) GetObservationID() *string {
	if s == nil {
		return nil
	}
	return s.ObservationID
}

func (s *ScoreBody) GetDatasetRunID() *string {
	if s == nil {
		return nil
	}
	return s.DatasetRunID
}

func (s *ScoreBody) GetName() string {
	if s == nil {
		return ""
	}
	return s.Name
}

func (s *ScoreBody) GetEnvironment() *string {
	if s == nil {
		return nil
	}
	return s.Environment
}

func (s *ScoreBody) GetQueueID() *string {
	if s == nil {
		return nil
	}
	return s.QueueID
}

func (s *ScoreBody) GetValue() *CreateScoreValue {
	if s == nil {
		return nil
	}
	return s.Value
}

func (s *ScoreBody) GetComment() *string {
	if s == nil {
		return nil
	}
	return s.Comment
}

func (s *ScoreBody) GetMetadata() interface{} {
	if s == nil {
		return nil
	}
	return s.Metadata
}

func (s *ScoreBody) GetDataType() *ScoreDataType {
	if s == nil {
		return nil
	}
	return s.DataType
}

func (s *ScoreBody) GetConfigID() *string {
	if s == nil {
		return nil
	}
	return s.ConfigID
}

func (s *ScoreBody) GetExtraProperties() map[string]interface{} {
	return s.extraProperties
}

func (s *ScoreBody) require(field *big.Int) {
	if s.explicitFields == nil {
		s.explicitFields = big.NewInt(0)
	}
	s.explicitFields.Or(s.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreBody) SetID(id *string) {
	s.ID = id
	s.require(scoreBodyFieldID)
}

// SetTraceID sets the TraceID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreBody) SetTraceID(traceID *string) {
	s.TraceID = traceID
	s.require(scoreBodyFieldTraceID)
}

// SetSessionID sets the SessionID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreBody) SetSessionID(sessionID *string) {
	s.SessionID = sessionID
	s.require(scoreBodyFieldSessionID)
}

// SetObservationID sets the ObservationID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreBody) SetObservationID(observationID *string) {
	s.ObservationID = observationID
	s.require(scoreBodyFieldObservationID)
}

// SetDatasetRunID sets the DatasetRunID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreBody) SetDatasetRunID(datasetRunID *string) {
	s.DatasetRunID = datasetRunID
	s.require(scoreBodyFieldDatasetRunID)
}

// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreBody) SetName(name string) {
	s.Name = name
	s.require(scoreBodyFieldName)
}

// SetEnvironment sets the Environment field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreBody) SetEnvironment(environment *string) {
	s.Environment = environment
	s.require(scoreBodyFieldEnvironment)
}

// SetQueueID sets the QueueID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreBody) SetQueueID(queueID *string) {
	s.QueueID = queueID
	s.require(scoreBodyFieldQueueID)
}

// SetValue sets the Value field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreBody) SetValue(value *CreateScoreValue) {
	s.Value = value
	s.require(scoreBodyFieldValue)
}

// SetComment sets the Comment field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreBody) SetComment(comment *string) {
	s.Comment = comment
	s.require(scoreBodyFieldComment)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreBody) SetMetadata(metadata interface{}) {
	s.Metadata = metadata
	s.require(scoreBodyFieldMetadata)
}

// SetDataType sets the DataType field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreBody) SetDataType(dataType *ScoreDataType) {
	s.DataType = dataType
	s.require(scoreBodyFieldDataType)
}

// SetConfigID sets the ConfigID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreBody) SetConfigID(configID *string) {
	s.ConfigID = configID
	s.require(scoreBodyFieldConfigID)
}

func (s *ScoreBody) UnmarshalJSON(data []byte) error {
	type unmarshaler ScoreBody
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*s = ScoreBody(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *s)
	if err != nil {
		return err
	}
	s.extraProperties = extraProperties
	s.rawJSON = json.RawMessage(data)
	return nil
}

func (s *ScoreBody) MarshalJSON() ([]byte, error) {
	type embed ScoreBody
	var marshaler = struct {
		embed
	}{
		embed: embed(*s),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (s *ScoreBody) String() string {
	if len(s.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(s.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(s); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", s)
}

var (
	scoreEventFieldID        = big.NewInt(1 << 0)
	scoreEventFieldTimestamp = big.NewInt(1 << 1)
	scoreEventFieldMetadata  = big.NewInt(1 << 2)
	scoreEventFieldBody      = big.NewInt(1 << 3)
)

type ScoreEvent struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *ScoreBody  `json:"body" url:"body"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (s *ScoreEvent) GetID() string {
	if s == nil {
		return ""
	}
	return s.ID
}

func (s *ScoreEvent) GetTimestamp() string {
	if s == nil {
		return ""
	}
	return s.Timestamp
}

func (s *ScoreEvent) GetMetadata() interface{} {
	if s == nil {
		return nil
	}
	return s.Metadata
}

func (s *ScoreEvent) GetBody() *ScoreBody {
	if s == nil {
		return nil
	}
	return s.Body
}

func (s *ScoreEvent) GetExtraProperties() map[string]interface{} {
	return s.extraProperties
}

func (s *ScoreEvent) require(field *big.Int) {
	if s.explicitFields == nil {
		s.explicitFields = big.NewInt(0)
	}
	s.explicitFields.Or(s.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreEvent) SetID(id string) {
	s.ID = id
	s.require(scoreEventFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreEvent) SetTimestamp(timestamp string) {
	s.Timestamp = timestamp
	s.require(scoreEventFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreEvent) SetMetadata(metadata interface{}) {
	s.Metadata = metadata
	s.require(scoreEventFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreEvent) SetBody(body *ScoreBody) {
	s.Body = body
	s.require(scoreEventFieldBody)
}

func (s *ScoreEvent) UnmarshalJSON(data []byte) error {
	type unmarshaler ScoreEvent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*s = ScoreEvent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *s)
	if err != nil {
		return err
	}
	s.extraProperties = extraProperties
	s.rawJSON = json.RawMessage(data)
	return nil
}

func (s *ScoreEvent) MarshalJSON() ([]byte, error) {
	type embed ScoreEvent
	var marshaler = struct {
		embed
	}{
		embed: embed(*s),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (s *ScoreEvent) String() string {
	if len(s.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(s.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(s); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", s)
}

var (
	sdkLogBodyFieldLog = big.NewInt(1 << 0)
)

type SdkLogBody struct {
	Log interface{} `json:"log" url:"log"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (s *SdkLogBody) GetLog() interface{} {
	if s == nil {
		return nil
	}
	return s.Log
}

func (s *SdkLogBody) GetExtraProperties() map[string]interface{} {
	return s.extraProperties
}

func (s *SdkLogBody) require(field *big.Int) {
	if s.explicitFields == nil {
		s.explicitFields = big.NewInt(0)
	}
	s.explicitFields.Or(s.explicitFields, field)
}

// SetLog sets the Log field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SdkLogBody) SetLog(log interface{}) {
	s.Log = log
	s.require(sdkLogBodyFieldLog)
}

func (s *SdkLogBody) UnmarshalJSON(data []byte) error {
	type unmarshaler SdkLogBody
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*s = SdkLogBody(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *s)
	if err != nil {
		return err
	}
	s.extraProperties = extraProperties
	s.rawJSON = json.RawMessage(data)
	return nil
}

func (s *SdkLogBody) MarshalJSON() ([]byte, error) {
	type embed SdkLogBody
	var marshaler = struct {
		embed
	}{
		embed: embed(*s),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (s *SdkLogBody) String() string {
	if len(s.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(s.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(s); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", s)
}

var (
	sdkLogEventFieldID        = big.NewInt(1 << 0)
	sdkLogEventFieldTimestamp = big.NewInt(1 << 1)
	sdkLogEventFieldMetadata  = big.NewInt(1 << 2)
	sdkLogEventFieldBody      = big.NewInt(1 << 3)
)

type SdkLogEvent struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *SdkLogBody `json:"body" url:"body"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (s *SdkLogEvent) GetID() string {
	if s == nil {
		return ""
	}
	return s.ID
}

func (s *SdkLogEvent) GetTimestamp() string {
	if s == nil {
		return ""
	}
	return s.Timestamp
}

func (s *SdkLogEvent) GetMetadata() interface{} {
	if s == nil {
		return nil
	}
	return s.Metadata
}

func (s *SdkLogEvent) GetBody() *SdkLogBody {
	if s == nil {
		return nil
	}
	return s.Body
}

func (s *SdkLogEvent) GetExtraProperties() map[string]interface{} {
	return s.extraProperties
}

func (s *SdkLogEvent) require(field *big.Int) {
	if s.explicitFields == nil {
		s.explicitFields = big.NewInt(0)
	}
	s.explicitFields.Or(s.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SdkLogEvent) SetID(id string) {
	s.ID = id
	s.require(sdkLogEventFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SdkLogEvent) SetTimestamp(timestamp string) {
	s.Timestamp = timestamp
	s.require(sdkLogEventFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SdkLogEvent) SetMetadata(metadata interface{}) {
	s.Metadata = metadata
	s.require(sdkLogEventFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SdkLogEvent) SetBody(body *SdkLogBody) {
	s.Body = body
	s.require(sdkLogEventFieldBody)
}

func (s *SdkLogEvent) UnmarshalJSON(data []byte) error {
	type unmarshaler SdkLogEvent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*s = SdkLogEvent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *s)
	if err != nil {
		return err
	}
	s.extraProperties = extraProperties
	s.rawJSON = json.RawMessage(data)
	return nil
}

func (s *SdkLogEvent) MarshalJSON() ([]byte, error) {
	type embed SdkLogEvent
	var marshaler = struct {
		embed
	}{
		embed: embed(*s),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (s *SdkLogEvent) String() string {
	if len(s.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(s.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(s); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", s)
}

var (
	traceBodyFieldID          = big.NewInt(1 << 0)
	traceBodyFieldTimestamp   = big.NewInt(1 << 1)
	traceBodyFieldName        = big.NewInt(1 << 2)
	traceBodyFieldUserID      = big.NewInt(1 << 3)
	traceBodyFieldInput       = big.NewInt(1 << 4)
	traceBodyFieldOutput      = big.NewInt(1 << 5)
	traceBodyFieldSessionID   = big.NewInt(1 << 6)
	traceBodyFieldRelease     = big.NewInt(1 << 7)
	traceBodyFieldVersion     = big.NewInt(1 << 8)
	traceBodyFieldMetadata    = big.NewInt(1 << 9)
	traceBodyFieldTags        = big.NewInt(1 << 10)
	traceBodyFieldEnvironment = big.NewInt(1 << 11)
	traceBodyFieldPublic      = big.NewInt(1 << 12)
)

type TraceBody struct {
	ID          *string     `json:"id,omitempty" url:"id,omitempty"`
	Timestamp   *time.Time  `json:"timestamp,omitempty" url:"timestamp,omitempty"`
	Name        *string     `json:"name,omitempty" url:"name,omitempty"`
	UserID      *string     `json:"userId,omitempty" url:"userId,omitempty"`
	Input       interface{} `json:"input,omitempty" url:"input,omitempty"`
	Output      interface{} `json:"output,omitempty" url:"output,omitempty"`
	SessionID   *string     `json:"sessionId,omitempty" url:"sessionId,omitempty"`
	Release     *string     `json:"release,omitempty" url:"release,omitempty"`
	Version     *string     `json:"version,omitempty" url:"version,omitempty"`
	Metadata    interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	Tags        []string    `json:"tags,omitempty" url:"tags,omitempty"`
	Environment *string     `json:"environment,omitempty" url:"environment,omitempty"`
	// Make trace publicly accessible via url
	Public *bool `json:"public,omitempty" url:"public,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (t *TraceBody) GetID() *string {
	if t == nil {
		return nil
	}
	return t.ID
}

func (t *TraceBody) GetTimestamp() *time.Time {
	if t == nil {
		return nil
	}
	return t.Timestamp
}

func (t *TraceBody) GetName() *string {
	if t == nil {
		return nil
	}
	return t.Name
}

func (t *TraceBody) GetUserID() *string {
	if t == nil {
		return nil
	}
	return t.UserID
}

func (t *TraceBody) GetInput() interface{} {
	if t == nil {
		return nil
	}
	return t.Input
}

func (t *TraceBody) GetOutput() interface{} {
	if t == nil {
		return nil
	}
	return t.Output
}

func (t *TraceBody) GetSessionID() *string {
	if t == nil {
		return nil
	}
	return t.SessionID
}

func (t *TraceBody) GetRelease() *string {
	if t == nil {
		return nil
	}
	return t.Release
}

func (t *TraceBody) GetVersion() *string {
	if t == nil {
		return nil
	}
	return t.Version
}

func (t *TraceBody) GetMetadata() interface{} {
	if t == nil {
		return nil
	}
	return t.Metadata
}

func (t *TraceBody) GetTags() []string {
	if t == nil {
		return nil
	}
	return t.Tags
}

func (t *TraceBody) GetEnvironment() *string {
	if t == nil {
		return nil
	}
	return t.Environment
}

func (t *TraceBody) GetPublic() *bool {
	if t == nil {
		return nil
	}
	return t.Public
}

func (t *TraceBody) GetExtraProperties() map[string]interface{} {
	return t.extraProperties
}

func (t *TraceBody) require(field *big.Int) {
	if t.explicitFields == nil {
		t.explicitFields = big.NewInt(0)
	}
	t.explicitFields.Or(t.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (t *TraceBody) SetID(id *string) {
	t.ID = id
	t.require(traceBodyFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (t *TraceBody) SetTimestamp(timestamp *time.Time) {
	t.Timestamp = timestamp
	t.require(traceBodyFieldTimestamp)
}

// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (t *TraceBody) SetName(name *string) {
	t.Name = name
	t.require(traceBodyFieldName)
}

// SetUserID sets the UserID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (t *TraceBody) SetUserID(userID *string) {
	t.UserID = userID
	t.require(traceBodyFieldUserID)
}

// SetInput sets the Input field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (t *TraceBody) SetInput(input interface{}) {
	t.Input = input
	t.require(traceBodyFieldInput)
}

// SetOutput sets the Output field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (t *TraceBody) SetOutput(output interface{}) {
	t.Output = output
	t.require(traceBodyFieldOutput)
}

// SetSessionID sets the SessionID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (t *TraceBody) SetSessionID(sessionID *string) {
	t.SessionID = sessionID
	t.require(traceBodyFieldSessionID)
}

// SetRelease sets the Release field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (t *TraceBody) SetRelease(release *string) {
	t.Release = release
	t.require(traceBodyFieldRelease)
}

// SetVersion sets the Version field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (t *TraceBody) SetVersion(version *string) {
	t.Version = version
	t.require(traceBodyFieldVersion)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (t *TraceBody) SetMetadata(metadata interface{}) {
	t.Metadata = metadata
	t.require(traceBodyFieldMetadata)
}

// SetTags sets the Tags field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (t *TraceBody) SetTags(tags []string) {
	t.Tags = tags
	t.require(traceBodyFieldTags)
}

// SetEnvironment sets the Environment field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (t *TraceBody) SetEnvironment(environment *string) {
	t.Environment = environment
	t.require(traceBodyFieldEnvironment)
}

// SetPublic sets the Public field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (t *TraceBody) SetPublic(public *bool) {
	t.Public = public
	t.require(traceBodyFieldPublic)
}

func (t *TraceBody) UnmarshalJSON(data []byte) error {
	type embed TraceBody
	var unmarshaler = struct {
		embed
		Timestamp *internal.DateTime `json:"timestamp,omitempty"`
	}{
		embed: embed(*t),
	}
	if err := json.Unmarshal(data, &unmarshaler); err != nil {
		return err
	}
	*t = TraceBody(unmarshaler.embed)
	t.Timestamp = unmarshaler.Timestamp.TimePtr()
	extraProperties, err := internal.ExtractExtraProperties(data, *t)
	if err != nil {
		return err
	}
	t.extraProperties = extraProperties
	t.rawJSON = json.RawMessage(data)
	return nil
}

func (t *TraceBody) MarshalJSON() ([]byte, error) {
	type embed TraceBody
	var marshaler = struct {
		embed
		Timestamp *internal.DateTime `json:"timestamp,omitempty"`
	}{
		embed:     embed(*t),
		Timestamp: internal.NewOptionalDateTime(t.Timestamp),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (t *TraceBody) String() string {
	if len(t.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(t.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(t); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", t)
}

var (
	traceEventFieldID        = big.NewInt(1 << 0)
	traceEventFieldTimestamp = big.NewInt(1 << 1)
	traceEventFieldMetadata  = big.NewInt(1 << 2)
	traceEventFieldBody      = big.NewInt(1 << 3)
)

type TraceEvent struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *TraceBody  `json:"body" url:"body"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (t *TraceEvent) GetID() string {
	if t == nil {
		return ""
	}
	return t.ID
}

func (t *TraceEvent) GetTimestamp() string {
	if t == nil {
		return ""
	}
	return t.Timestamp
}

func (t *TraceEvent) GetMetadata() interface{} {
	if t == nil {
		return nil
	}
	return t.Metadata
}

func (t *TraceEvent) GetBody() *TraceBody {
	if t == nil {
		return nil
	}
	return t.Body
}

func (t *TraceEvent) GetExtraProperties() map[string]interface{} {
	return t.extraProperties
}

func (t *TraceEvent) require(field *big.Int) {
	if t.explicitFields == nil {
		t.explicitFields = big.NewInt(0)
	}
	t.explicitFields.Or(t.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (t *TraceEvent) SetID(id string) {
	t.ID = id
	t.require(traceEventFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (t *TraceEvent) SetTimestamp(timestamp string) {
	t.Timestamp = timestamp
	t.require(traceEventFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (t *TraceEvent) SetMetadata(metadata interface{}) {
	t.Metadata = metadata
	t.require(traceEventFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (t *TraceEvent) SetBody(body *TraceBody) {
	t.Body = body
	t.require(traceEventFieldBody)
}

func (t *TraceEvent) UnmarshalJSON(data []byte) error {
	type unmarshaler TraceEvent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*t = TraceEvent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *t)
	if err != nil {
		return err
	}
	t.extraProperties = extraProperties
	t.rawJSON = json.RawMessage(data)
	return nil
}

func (t *TraceEvent) MarshalJSON() ([]byte, error) {
	type embed TraceEvent
	var marshaler = struct {
		embed
	}{
		embed: embed(*t),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (t *TraceEvent) String() string {
	if len(t.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(t.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(t); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", t)
}

var (
	updateEventBodyFieldTraceID             = big.NewInt(1 << 0)
	updateEventBodyFieldName                = big.NewInt(1 << 1)
	updateEventBodyFieldStartTime           = big.NewInt(1 << 2)
	updateEventBodyFieldMetadata            = big.NewInt(1 << 3)
	updateEventBodyFieldInput               = big.NewInt(1 << 4)
	updateEventBodyFieldOutput              = big.NewInt(1 << 5)
	updateEventBodyFieldLevel               = big.NewInt(1 << 6)
	updateEventBodyFieldStatusMessage       = big.NewInt(1 << 7)
	updateEventBodyFieldParentObservationID = big.NewInt(1 << 8)
	updateEventBodyFieldVersion             = big.NewInt(1 << 9)
	updateEventBodyFieldEnvironment         = big.NewInt(1 << 10)
	updateEventBodyFieldID                  = big.NewInt(1 << 11)
)

type UpdateEventBody struct {
	TraceID             *string           `json:"traceId,omitempty" url:"traceId,omitempty"`
	Name                *string           `json:"name,omitempty" url:"name,omitempty"`
	StartTime           *time.Time        `json:"startTime,omitempty" url:"startTime,omitempty"`
	Metadata            interface{}       `json:"metadata,omitempty" url:"metadata,omitempty"`
	Input               interface{}       `json:"input,omitempty" url:"input,omitempty"`
	Output              interface{}       `json:"output,omitempty" url:"output,omitempty"`
	Level               *ObservationLevel `json:"level,omitempty" url:"level,omitempty"`
	StatusMessage       *string           `json:"statusMessage,omitempty" url:"statusMessage,omitempty"`
	ParentObservationID *string           `json:"parentObservationId,omitempty" url:"parentObservationId,omitempty"`
	Version             *string           `json:"version,omitempty" url:"version,omitempty"`
	Environment         *string           `json:"environment,omitempty" url:"environment,omitempty"`
	ID                  string            `json:"id" url:"id"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (u *UpdateEventBody) GetTraceID() *string {
	if u == nil {
		return nil
	}
	return u.TraceID
}

func (u *UpdateEventBody) GetName() *string {
	if u == nil {
		return nil
	}
	return u.Name
}

func (u *UpdateEventBody) GetStartTime() *time.Time {
	if u == nil {
		return nil
	}
	return u.StartTime
}

func (u *UpdateEventBody) GetMetadata() interface{} {
	if u == nil {
		return nil
	}
	return u.Metadata
}

func (u *UpdateEventBody) GetInput() interface{} {
	if u == nil {
		return nil
	}
	return u.Input
}

func (u *UpdateEventBody) GetOutput() interface{} {
	if u == nil {
		return nil
	}
	return u.Output
}

func (u *UpdateEventBody) GetLevel() *ObservationLevel {
	if u == nil {
		return nil
	}
	return u.Level
}

func (u *UpdateEventBody) GetStatusMessage() *string {
	if u == nil {
		return nil
	}
	return u.StatusMessage
}

func (u *UpdateEventBody) GetParentObservationID() *string {
	if u == nil {
		return nil
	}
	return u.ParentObservationID
}

func (u *UpdateEventBody) GetVersion() *string {
	if u == nil {
		return nil
	}
	return u.Version
}

func (u *UpdateEventBody) GetEnvironment() *string {
	if u == nil {
		return nil
	}
	return u.Environment
}

func (u *UpdateEventBody) GetID() string {
	if u == nil {
		return ""
	}
	return u.ID
}

func (u *UpdateEventBody) GetExtraProperties() map[string]interface{} {
	return u.extraProperties
}

func (u *UpdateEventBody) require(field *big.Int) {
	if u.explicitFields == nil {
		u.explicitFields = big.NewInt(0)
	}
	u.explicitFields.Or(u.explicitFields, field)
}

// SetTraceID sets the TraceID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateEventBody) SetTraceID(traceID *string) {
	u.TraceID = traceID
	u.require(updateEventBodyFieldTraceID)
}

// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateEventBody) SetName(name *string) {
	u.Name = name
	u.require(updateEventBodyFieldName)
}

// SetStartTime sets the StartTime field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateEventBody) SetStartTime(startTime *time.Time) {
	u.StartTime = startTime
	u.require(updateEventBodyFieldStartTime)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateEventBody) SetMetadata(metadata interface{}) {
	u.Metadata = metadata
	u.require(updateEventBodyFieldMetadata)
}

// SetInput sets the Input field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateEventBody) SetInput(input interface{}) {
	u.Input = input
	u.require(updateEventBodyFieldInput)
}

// SetOutput sets the Output field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateEventBody) SetOutput(output interface{}) {
	u.Output = output
	u.require(updateEventBodyFieldOutput)
}

// SetLevel sets the Level field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateEventBody) SetLevel(level *ObservationLevel) {
	u.Level = level
	u.require(updateEventBodyFieldLevel)
}

// SetStatusMessage sets the StatusMessage field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateEventBody) SetStatusMessage(statusMessage *string) {
	u.StatusMessage = statusMessage
	u.require(updateEventBodyFieldStatusMessage)
}

// SetParentObservationID sets the ParentObservationID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateEventBody) SetParentObservationID(parentObservationID *string) {
	u.ParentObservationID = parentObservationID
	u.require(updateEventBodyFieldParentObservationID)
}

// SetVersion sets the Version field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateEventBody) SetVersion(version *string) {
	u.Version = version
	u.require(updateEventBodyFieldVersion)
}

// SetEnvironment sets the Environment field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateEventBody) SetEnvironment(environment *string) {
	u.Environment = environment
	u.require(updateEventBodyFieldEnvironment)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateEventBody) SetID(id string) {
	u.ID = id
	u.require(updateEventBodyFieldID)
}

func (u *UpdateEventBody) UnmarshalJSON(data []byte) error {
	type embed UpdateEventBody
	var unmarshaler = struct {
		embed
		StartTime *internal.DateTime `json:"startTime,omitempty"`
	}{
		embed: embed(*u),
	}
	if err := json.Unmarshal(data, &unmarshaler); err != nil {
		return err
	}
	*u = UpdateEventBody(unmarshaler.embed)
	u.StartTime = unmarshaler.StartTime.TimePtr()
	extraProperties, err := internal.ExtractExtraProperties(data, *u)
	if err != nil {
		return err
	}
	u.extraProperties = extraProperties
	u.rawJSON = json.RawMessage(data)
	return nil
}

func (u *UpdateEventBody) MarshalJSON() ([]byte, error) {
	type embed UpdateEventBody
	var marshaler = struct {
		embed
		StartTime *internal.DateTime `json:"startTime,omitempty"`
	}{
		embed:     embed(*u),
		StartTime: internal.NewOptionalDateTime(u.StartTime),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (u *UpdateEventBody) String() string {
	if len(u.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(u.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(u); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", u)
}

var (
	updateGenerationBodyFieldTraceID             = big.NewInt(1 << 0)
	updateGenerationBodyFieldName                = big.NewInt(1 << 1)
	updateGenerationBodyFieldStartTime           = big.NewInt(1 << 2)
	updateGenerationBodyFieldMetadata            = big.NewInt(1 << 3)
	updateGenerationBodyFieldInput               = big.NewInt(1 << 4)
	updateGenerationBodyFieldOutput              = big.NewInt(1 << 5)
	updateGenerationBodyFieldLevel               = big.NewInt(1 << 6)
	updateGenerationBodyFieldStatusMessage       = big.NewInt(1 << 7)
	updateGenerationBodyFieldParentObservationID = big.NewInt(1 << 8)
	updateGenerationBodyFieldVersion             = big.NewInt(1 << 9)
	updateGenerationBodyFieldEnvironment         = big.NewInt(1 << 10)
	updateGenerationBodyFieldID                  = big.NewInt(1 << 11)
	updateGenerationBodyFieldEndTime             = big.NewInt(1 << 12)
	updateGenerationBodyFieldCompletionStartTime = big.NewInt(1 << 13)
	updateGenerationBodyFieldModel               = big.NewInt(1 << 14)
	updateGenerationBodyFieldModelParameters     = big.NewInt(1 << 15)
	updateGenerationBodyFieldUsage               = big.NewInt(1 << 16)
	updateGenerationBodyFieldPromptName          = big.NewInt(1 << 17)
	updateGenerationBodyFieldUsageDetails        = big.NewInt(1 << 18)
	updateGenerationBodyFieldCostDetails         = big.NewInt(1 << 19)
	updateGenerationBodyFieldPromptVersion       = big.NewInt(1 << 20)
)

type UpdateGenerationBody struct {
	TraceID             *string              `json:"traceId,omitempty" url:"traceId,omitempty"`
	Name                *string              `json:"name,omitempty" url:"name,omitempty"`
	StartTime           *time.Time           `json:"startTime,omitempty" url:"startTime,omitempty"`
	Metadata            interface{}          `json:"metadata,omitempty" url:"metadata,omitempty"`
	Input               interface{}          `json:"input,omitempty" url:"input,omitempty"`
	Output              interface{}          `json:"output,omitempty" url:"output,omitempty"`
	Level               *ObservationLevel    `json:"level,omitempty" url:"level,omitempty"`
	StatusMessage       *string              `json:"statusMessage,omitempty" url:"statusMessage,omitempty"`
	ParentObservationID *string              `json:"parentObservationId,omitempty" url:"parentObservationId,omitempty"`
	Version             *string              `json:"version,omitempty" url:"version,omitempty"`
	Environment         *string              `json:"environment,omitempty" url:"environment,omitempty"`
	ID                  string               `json:"id" url:"id"`
	EndTime             *time.Time           `json:"endTime,omitempty" url:"endTime,omitempty"`
	CompletionStartTime *time.Time           `json:"completionStartTime,omitempty" url:"completionStartTime,omitempty"`
	Model               *string              `json:"model,omitempty" url:"model,omitempty"`
	ModelParameters     map[string]*MapValue `json:"modelParameters,omitempty" url:"modelParameters,omitempty"`
	Usage               *IngestionUsage      `json:"usage,omitempty" url:"usage,omitempty"`
	PromptName          *string              `json:"promptName,omitempty" url:"promptName,omitempty"`
	UsageDetails        *UsageDetails        `json:"usageDetails,omitempty" url:"usageDetails,omitempty"`
	CostDetails         map[string]*float64  `json:"costDetails,omitempty" url:"costDetails,omitempty"`
	PromptVersion       *int                 `json:"promptVersion,omitempty" url:"promptVersion,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (u *UpdateGenerationBody) GetTraceID() *string {
	if u == nil {
		return nil
	}
	return u.TraceID
}

func (u *UpdateGenerationBody) GetName() *string {
	if u == nil {
		return nil
	}
	return u.Name
}

func (u *UpdateGenerationBody) GetStartTime() *time.Time {
	if u == nil {
		return nil
	}
	return u.StartTime
}

func (u *UpdateGenerationBody) GetMetadata() interface{} {
	if u == nil {
		return nil
	}
	return u.Metadata
}

func (u *UpdateGenerationBody) GetInput() interface{} {
	if u == nil {
		return nil
	}
	return u.Input
}

func (u *UpdateGenerationBody) GetOutput() interface{} {
	if u == nil {
		return nil
	}
	return u.Output
}

func (u *UpdateGenerationBody) GetLevel() *ObservationLevel {
	if u == nil {
		return nil
	}
	return u.Level
}

func (u *UpdateGenerationBody) GetStatusMessage() *string {
	if u == nil {
		return nil
	}
	return u.StatusMessage
}

func (u *UpdateGenerationBody) GetParentObservationID() *string {
	if u == nil {
		return nil
	}
	return u.ParentObservationID
}

func (u *UpdateGenerationBody) GetVersion() *string {
	if u == nil {
		return nil
	}
	return u.Version
}

func (u *UpdateGenerationBody) GetEnvironment() *string {
	if u == nil {
		return nil
	}
	return u.Environment
}

func (u *UpdateGenerationBody) GetID() string {
	if u == nil {
		return ""
	}
	return u.ID
}

func (u *UpdateGenerationBody) GetEndTime() *time.Time {
	if u == nil {
		return nil
	}
	return u.EndTime
}

func (u *UpdateGenerationBody) GetCompletionStartTime() *time.Time {
	if u == nil {
		return nil
	}
	return u.CompletionStartTime
}

func (u *UpdateGenerationBody) GetModel() *string {
	if u == nil {
		return nil
	}
	return u.Model
}

func (u *UpdateGenerationBody) GetModelParameters() map[string]*MapValue {
	if u == nil {
		return nil
	}
	return u.ModelParameters
}

func (u *UpdateGenerationBody) GetUsage() *IngestionUsage {
	if u == nil {
		return nil
	}
	return u.Usage
}

func (u *UpdateGenerationBody) GetPromptName() *string {
	if u == nil {
		return nil
	}
	return u.PromptName
}

func (u *UpdateGenerationBody) GetUsageDetails() *UsageDetails {
	if u == nil {
		return nil
	}
	return u.UsageDetails
}

func (u *UpdateGenerationBody) GetCostDetails() map[string]*float64 {
	if u == nil {
		return nil
	}
	return u.CostDetails
}

func (u *UpdateGenerationBody) GetPromptVersion() *int {
	if u == nil {
		return nil
	}
	return u.PromptVersion
}

func (u *UpdateGenerationBody) GetExtraProperties() map[string]interface{} {
	return u.extraProperties
}

func (u *UpdateGenerationBody) require(field *big.Int) {
	if u.explicitFields == nil {
		u.explicitFields = big.NewInt(0)
	}
	u.explicitFields.Or(u.explicitFields, field)
}

// SetTraceID sets the TraceID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationBody) SetTraceID(traceID *string) {
	u.TraceID = traceID
	u.require(updateGenerationBodyFieldTraceID)
}

// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationBody) SetName(name *string) {
	u.Name = name
	u.require(updateGenerationBodyFieldName)
}

// SetStartTime sets the StartTime field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationBody) SetStartTime(startTime *time.Time) {
	u.StartTime = startTime
	u.require(updateGenerationBodyFieldStartTime)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationBody) SetMetadata(metadata interface{}) {
	u.Metadata = metadata
	u.require(updateGenerationBodyFieldMetadata)
}

// SetInput sets the Input field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationBody) SetInput(input interface{}) {
	u.Input = input
	u.require(updateGenerationBodyFieldInput)
}

// SetOutput sets the Output field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationBody) SetOutput(output interface{}) {
	u.Output = output
	u.require(updateGenerationBodyFieldOutput)
}

// SetLevel sets the Level field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationBody) SetLevel(level *ObservationLevel) {
	u.Level = level
	u.require(updateGenerationBodyFieldLevel)
}

// SetStatusMessage sets the StatusMessage field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationBody) SetStatusMessage(statusMessage *string) {
	u.StatusMessage = statusMessage
	u.require(updateGenerationBodyFieldStatusMessage)
}

// SetParentObservationID sets the ParentObservationID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationBody) SetParentObservationID(parentObservationID *string) {
	u.ParentObservationID = parentObservationID
	u.require(updateGenerationBodyFieldParentObservationID)
}

// SetVersion sets the Version field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationBody) SetVersion(version *string) {
	u.Version = version
	u.require(updateGenerationBodyFieldVersion)
}

// SetEnvironment sets the Environment field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationBody) SetEnvironment(environment *string) {
	u.Environment = environment
	u.require(updateGenerationBodyFieldEnvironment)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationBody) SetID(id string) {
	u.ID = id
	u.require(updateGenerationBodyFieldID)
}

// SetEndTime sets the EndTime field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationBody) SetEndTime(endTime *time.Time) {
	u.EndTime = endTime
	u.require(updateGenerationBodyFieldEndTime)
}

// SetCompletionStartTime sets the CompletionStartTime field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationBody) SetCompletionStartTime(completionStartTime *time.Time) {
	u.CompletionStartTime = completionStartTime
	u.require(updateGenerationBodyFieldCompletionStartTime)
}

// SetModel sets the Model field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationBody) SetModel(model *string) {
	u.Model = model
	u.require(updateGenerationBodyFieldModel)
}

// SetModelParameters sets the ModelParameters field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationBody) SetModelParameters(modelParameters map[string]*MapValue) {
	u.ModelParameters = modelParameters
	u.require(updateGenerationBodyFieldModelParameters)
}

// SetUsage sets the Usage field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationBody) SetUsage(usage *IngestionUsage) {
	u.Usage = usage
	u.require(updateGenerationBodyFieldUsage)
}

// SetPromptName sets the PromptName field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationBody) SetPromptName(promptName *string) {
	u.PromptName = promptName
	u.require(updateGenerationBodyFieldPromptName)
}

// SetUsageDetails sets the UsageDetails field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationBody) SetUsageDetails(usageDetails *UsageDetails) {
	u.UsageDetails = usageDetails
	u.require(updateGenerationBodyFieldUsageDetails)
}

// SetCostDetails sets the CostDetails field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationBody) SetCostDetails(costDetails map[string]*float64) {
	u.CostDetails = costDetails
	u.require(updateGenerationBodyFieldCostDetails)
}

// SetPromptVersion sets the PromptVersion field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationBody) SetPromptVersion(promptVersion *int) {
	u.PromptVersion = promptVersion
	u.require(updateGenerationBodyFieldPromptVersion)
}

func (u *UpdateGenerationBody) UnmarshalJSON(data []byte) error {
	type embed UpdateGenerationBody
	var unmarshaler = struct {
		embed
		StartTime           *internal.DateTime `json:"startTime,omitempty"`
		EndTime             *internal.DateTime `json:"endTime,omitempty"`
		CompletionStartTime *internal.DateTime `json:"completionStartTime,omitempty"`
	}{
		embed: embed(*u),
	}
	if err := json.Unmarshal(data, &unmarshaler); err != nil {
		return err
	}
	*u = UpdateGenerationBody(unmarshaler.embed)
	u.StartTime = unmarshaler.StartTime.TimePtr()
	u.EndTime = unmarshaler.EndTime.TimePtr()
	u.CompletionStartTime = unmarshaler.CompletionStartTime.TimePtr()
	extraProperties, err := internal.ExtractExtraProperties(data, *u)
	if err != nil {
		return err
	}
	u.extraProperties = extraProperties
	u.rawJSON = json.RawMessage(data)
	return nil
}

func (u *UpdateGenerationBody) MarshalJSON() ([]byte, error) {
	type embed UpdateGenerationBody
	var marshaler = struct {
		embed
		StartTime           *internal.DateTime `json:"startTime,omitempty"`
		EndTime             *internal.DateTime `json:"endTime,omitempty"`
		CompletionStartTime *internal.DateTime `json:"completionStartTime,omitempty"`
	}{
		embed:               embed(*u),
		StartTime:           internal.NewOptionalDateTime(u.StartTime),
		EndTime:             internal.NewOptionalDateTime(u.EndTime),
		CompletionStartTime: internal.NewOptionalDateTime(u.CompletionStartTime),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (u *UpdateGenerationBody) String() string {
	if len(u.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(u.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(u); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", u)
}

var (
	updateGenerationEventFieldID        = big.NewInt(1 << 0)
	updateGenerationEventFieldTimestamp = big.NewInt(1 << 1)
	updateGenerationEventFieldMetadata  = big.NewInt(1 << 2)
	updateGenerationEventFieldBody      = big.NewInt(1 << 3)
)

type UpdateGenerationEvent struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}           `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *UpdateGenerationBody `json:"body" url:"body"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (u *UpdateGenerationEvent) GetID() string {
	if u == nil {
		return ""
	}
	return u.ID
}

func (u *UpdateGenerationEvent) GetTimestamp() string {
	if u == nil {
		return ""
	}
	return u.Timestamp
}

func (u *UpdateGenerationEvent) GetMetadata() interface{} {
	if u == nil {
		return nil
	}
	return u.Metadata
}

func (u *UpdateGenerationEvent) GetBody() *UpdateGenerationBody {
	if u == nil {
		return nil
	}
	return u.Body
}

func (u *UpdateGenerationEvent) GetExtraProperties() map[string]interface{} {
	return u.extraProperties
}

func (u *UpdateGenerationEvent) require(field *big.Int) {
	if u.explicitFields == nil {
		u.explicitFields = big.NewInt(0)
	}
	u.explicitFields.Or(u.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationEvent) SetID(id string) {
	u.ID = id
	u.require(updateGenerationEventFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationEvent) SetTimestamp(timestamp string) {
	u.Timestamp = timestamp
	u.require(updateGenerationEventFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationEvent) SetMetadata(metadata interface{}) {
	u.Metadata = metadata
	u.require(updateGenerationEventFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateGenerationEvent) SetBody(body *UpdateGenerationBody) {
	u.Body = body
	u.require(updateGenerationEventFieldBody)
}

func (u *UpdateGenerationEvent) UnmarshalJSON(data []byte) error {
	type unmarshaler UpdateGenerationEvent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*u = UpdateGenerationEvent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *u)
	if err != nil {
		return err
	}
	u.extraProperties = extraProperties
	u.rawJSON = json.RawMessage(data)
	return nil
}

func (u *UpdateGenerationEvent) MarshalJSON() ([]byte, error) {
	type embed UpdateGenerationEvent
	var marshaler = struct {
		embed
	}{
		embed: embed(*u),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (u *UpdateGenerationEvent) String() string {
	if len(u.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(u.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(u); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", u)
}

var (
	updateObservationEventFieldID        = big.NewInt(1 << 0)
	updateObservationEventFieldTimestamp = big.NewInt(1 << 1)
	updateObservationEventFieldMetadata  = big.NewInt(1 << 2)
	updateObservationEventFieldBody      = big.NewInt(1 << 3)
)

type UpdateObservationEvent struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}      `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *ObservationBody `json:"body" url:"body"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (u *UpdateObservationEvent) GetID() string {
	if u == nil {
		return ""
	}
	return u.ID
}

func (u *UpdateObservationEvent) GetTimestamp() string {
	if u == nil {
		return ""
	}
	return u.Timestamp
}

func (u *UpdateObservationEvent) GetMetadata() interface{} {
	if u == nil {
		return nil
	}
	return u.Metadata
}

func (u *UpdateObservationEvent) GetBody() *ObservationBody {
	if u == nil {
		return nil
	}
	return u.Body
}

func (u *UpdateObservationEvent) GetExtraProperties() map[string]interface{} {
	return u.extraProperties
}

func (u *UpdateObservationEvent) require(field *big.Int) {
	if u.explicitFields == nil {
		u.explicitFields = big.NewInt(0)
	}
	u.explicitFields.Or(u.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateObservationEvent) SetID(id string) {
	u.ID = id
	u.require(updateObservationEventFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateObservationEvent) SetTimestamp(timestamp string) {
	u.Timestamp = timestamp
	u.require(updateObservationEventFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateObservationEvent) SetMetadata(metadata interface{}) {
	u.Metadata = metadata
	u.require(updateObservationEventFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateObservationEvent) SetBody(body *ObservationBody) {
	u.Body = body
	u.require(updateObservationEventFieldBody)
}

func (u *UpdateObservationEvent) UnmarshalJSON(data []byte) error {
	type unmarshaler UpdateObservationEvent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*u = UpdateObservationEvent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *u)
	if err != nil {
		return err
	}
	u.extraProperties = extraProperties
	u.rawJSON = json.RawMessage(data)
	return nil
}

func (u *UpdateObservationEvent) MarshalJSON() ([]byte, error) {
	type embed UpdateObservationEvent
	var marshaler = struct {
		embed
	}{
		embed: embed(*u),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (u *UpdateObservationEvent) String() string {
	if len(u.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(u.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(u); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", u)
}

var (
	updateSpanBodyFieldTraceID             = big.NewInt(1 << 0)
	updateSpanBodyFieldName                = big.NewInt(1 << 1)
	updateSpanBodyFieldStartTime           = big.NewInt(1 << 2)
	updateSpanBodyFieldMetadata            = big.NewInt(1 << 3)
	updateSpanBodyFieldInput               = big.NewInt(1 << 4)
	updateSpanBodyFieldOutput              = big.NewInt(1 << 5)
	updateSpanBodyFieldLevel               = big.NewInt(1 << 6)
	updateSpanBodyFieldStatusMessage       = big.NewInt(1 << 7)
	updateSpanBodyFieldParentObservationID = big.NewInt(1 << 8)
	updateSpanBodyFieldVersion             = big.NewInt(1 << 9)
	updateSpanBodyFieldEnvironment         = big.NewInt(1 << 10)
	updateSpanBodyFieldID                  = big.NewInt(1 << 11)
	updateSpanBodyFieldEndTime             = big.NewInt(1 << 12)
)

type UpdateSpanBody struct {
	TraceID             *string           `json:"traceId,omitempty" url:"traceId,omitempty"`
	Name                *string           `json:"name,omitempty" url:"name,omitempty"`
	StartTime           *time.Time        `json:"startTime,omitempty" url:"startTime,omitempty"`
	Metadata            interface{}       `json:"metadata,omitempty" url:"metadata,omitempty"`
	Input               interface{}       `json:"input,omitempty" url:"input,omitempty"`
	Output              interface{}       `json:"output,omitempty" url:"output,omitempty"`
	Level               *ObservationLevel `json:"level,omitempty" url:"level,omitempty"`
	StatusMessage       *string           `json:"statusMessage,omitempty" url:"statusMessage,omitempty"`
	ParentObservationID *string           `json:"parentObservationId,omitempty" url:"parentObservationId,omitempty"`
	Version             *string           `json:"version,omitempty" url:"version,omitempty"`
	Environment         *string           `json:"environment,omitempty" url:"environment,omitempty"`
	ID                  string            `json:"id" url:"id"`
	EndTime             *time.Time        `json:"endTime,omitempty" url:"endTime,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (u *UpdateSpanBody) GetTraceID() *string {
	if u == nil {
		return nil
	}
	return u.TraceID
}

func (u *UpdateSpanBody) GetName() *string {
	if u == nil {
		return nil
	}
	return u.Name
}

func (u *UpdateSpanBody) GetStartTime() *time.Time {
	if u == nil {
		return nil
	}
	return u.StartTime
}

func (u *UpdateSpanBody) GetMetadata() interface{} {
	if u == nil {
		return nil
	}
	return u.Metadata
}

func (u *UpdateSpanBody) GetInput() interface{} {
	if u == nil {
		return nil
	}
	return u.Input
}

func (u *UpdateSpanBody) GetOutput() interface{} {
	if u == nil {
		return nil
	}
	return u.Output
}

func (u *UpdateSpanBody) GetLevel() *ObservationLevel {
	if u == nil {
		return nil
	}
	return u.Level
}

func (u *UpdateSpanBody) GetStatusMessage() *string {
	if u == nil {
		return nil
	}
	return u.StatusMessage
}

func (u *UpdateSpanBody) GetParentObservationID() *string {
	if u == nil {
		return nil
	}
	return u.ParentObservationID
}

func (u *UpdateSpanBody) GetVersion() *string {
	if u == nil {
		return nil
	}
	return u.Version
}

func (u *UpdateSpanBody) GetEnvironment() *string {
	if u == nil {
		return nil
	}
	return u.Environment
}

func (u *UpdateSpanBody) GetID() string {
	if u == nil {
		return ""
	}
	return u.ID
}

func (u *UpdateSpanBody) GetEndTime() *time.Time {
	if u == nil {
		return nil
	}
	return u.EndTime
}

func (u *UpdateSpanBody) GetExtraProperties() map[string]interface{} {
	return u.extraProperties
}

func (u *UpdateSpanBody) require(field *big.Int) {
	if u.explicitFields == nil {
		u.explicitFields = big.NewInt(0)
	}
	u.explicitFields.Or(u.explicitFields, field)
}

// SetTraceID sets the TraceID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateSpanBody) SetTraceID(traceID *string) {
	u.TraceID = traceID
	u.require(updateSpanBodyFieldTraceID)
}

// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateSpanBody) SetName(name *string) {
	u.Name = name
	u.require(updateSpanBodyFieldName)
}

// SetStartTime sets the StartTime field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateSpanBody) SetStartTime(startTime *time.Time) {
	u.StartTime = startTime
	u.require(updateSpanBodyFieldStartTime)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateSpanBody) SetMetadata(metadata interface{}) {
	u.Metadata = metadata
	u.require(updateSpanBodyFieldMetadata)
}

// SetInput sets the Input field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateSpanBody) SetInput(input interface{}) {
	u.Input = input
	u.require(updateSpanBodyFieldInput)
}

// SetOutput sets the Output field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateSpanBody) SetOutput(output interface{}) {
	u.Output = output
	u.require(updateSpanBodyFieldOutput)
}

// SetLevel sets the Level field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateSpanBody) SetLevel(level *ObservationLevel) {
	u.Level = level
	u.require(updateSpanBodyFieldLevel)
}

// SetStatusMessage sets the StatusMessage field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateSpanBody) SetStatusMessage(statusMessage *string) {
	u.StatusMessage = statusMessage
	u.require(updateSpanBodyFieldStatusMessage)
}

// SetParentObservationID sets the ParentObservationID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateSpanBody) SetParentObservationID(parentObservationID *string) {
	u.ParentObservationID = parentObservationID
	u.require(updateSpanBodyFieldParentObservationID)
}

// SetVersion sets the Version field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateSpanBody) SetVersion(version *string) {
	u.Version = version
	u.require(updateSpanBodyFieldVersion)
}

// SetEnvironment sets the Environment field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateSpanBody) SetEnvironment(environment *string) {
	u.Environment = environment
	u.require(updateSpanBodyFieldEnvironment)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateSpanBody) SetID(id string) {
	u.ID = id
	u.require(updateSpanBodyFieldID)
}

// SetEndTime sets the EndTime field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateSpanBody) SetEndTime(endTime *time.Time) {
	u.EndTime = endTime
	u.require(updateSpanBodyFieldEndTime)
}

func (u *UpdateSpanBody) UnmarshalJSON(data []byte) error {
	type embed UpdateSpanBody
	var unmarshaler = struct {
		embed
		StartTime *internal.DateTime `json:"startTime,omitempty"`
		EndTime   *internal.DateTime `json:"endTime,omitempty"`
	}{
		embed: embed(*u),
	}
	if err := json.Unmarshal(data, &unmarshaler); err != nil {
		return err
	}
	*u = UpdateSpanBody(unmarshaler.embed)
	u.StartTime = unmarshaler.StartTime.TimePtr()
	u.EndTime = unmarshaler.EndTime.TimePtr()
	extraProperties, err := internal.ExtractExtraProperties(data, *u)
	if err != nil {
		return err
	}
	u.extraProperties = extraProperties
	u.rawJSON = json.RawMessage(data)
	return nil
}

func (u *UpdateSpanBody) MarshalJSON() ([]byte, error) {
	type embed UpdateSpanBody
	var marshaler = struct {
		embed
		StartTime *internal.DateTime `json:"startTime,omitempty"`
		EndTime   *internal.DateTime `json:"endTime,omitempty"`
	}{
		embed:     embed(*u),
		StartTime: internal.NewOptionalDateTime(u.StartTime),
		EndTime:   internal.NewOptionalDateTime(u.EndTime),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (u *UpdateSpanBody) String() string {
	if len(u.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(u.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(u); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", u)
}

var (
	updateSpanEventFieldID        = big.NewInt(1 << 0)
	updateSpanEventFieldTimestamp = big.NewInt(1 << 1)
	updateSpanEventFieldMetadata  = big.NewInt(1 << 2)
	updateSpanEventFieldBody      = big.NewInt(1 << 3)
)

type UpdateSpanEvent struct {
	// UUID v4 that identifies the event
	ID string `json:"id" url:"id"`
	// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
	Timestamp string `json:"timestamp" url:"timestamp"`
	// Optional. Metadata field used by the Langfuse SDKs for debugging.
	Metadata interface{}     `json:"metadata,omitempty" url:"metadata,omitempty"`
	Body     *UpdateSpanBody `json:"body" url:"body"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (u *UpdateSpanEvent) GetID() string {
	if u == nil {
		return ""
	}
	return u.ID
}

func (u *UpdateSpanEvent) GetTimestamp() string {
	if u == nil {
		return ""
	}
	return u.Timestamp
}

func (u *UpdateSpanEvent) GetMetadata() interface{} {
	if u == nil {
		return nil
	}
	return u.Metadata
}

func (u *UpdateSpanEvent) GetBody() *UpdateSpanBody {
	if u == nil {
		return nil
	}
	return u.Body
}

func (u *UpdateSpanEvent) GetExtraProperties() map[string]interface{} {
	return u.extraProperties
}

func (u *UpdateSpanEvent) require(field *big.Int) {
	if u.explicitFields == nil {
		u.explicitFields = big.NewInt(0)
	}
	u.explicitFields.Or(u.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateSpanEvent) SetID(id string) {
	u.ID = id
	u.require(updateSpanEventFieldID)
}

// SetTimestamp sets the Timestamp field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateSpanEvent) SetTimestamp(timestamp string) {
	u.Timestamp = timestamp
	u.require(updateSpanEventFieldTimestamp)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateSpanEvent) SetMetadata(metadata interface{}) {
	u.Metadata = metadata
	u.require(updateSpanEventFieldMetadata)
}

// SetBody sets the Body field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateSpanEvent) SetBody(body *UpdateSpanBody) {
	u.Body = body
	u.require(updateSpanEventFieldBody)
}

func (u *UpdateSpanEvent) UnmarshalJSON(data []byte) error {
	type unmarshaler UpdateSpanEvent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*u = UpdateSpanEvent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *u)
	if err != nil {
		return err
	}
	u.extraProperties = extraProperties
	u.rawJSON = json.RawMessage(data)
	return nil
}

func (u *UpdateSpanEvent) MarshalJSON() ([]byte, error) {
	type embed UpdateSpanEvent
	var marshaler = struct {
		embed
	}{
		embed: embed(*u),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (u *UpdateSpanEvent) String() string {
	if len(u.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(u.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(u); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", u)
}

type UsageDetails struct {
	StringIntegerMap            map[string]int
	OpenAiCompletionUsageSchema *OpenAiCompletionUsageSchema
	OpenAiResponseUsageSchema   *OpenAiResponseUsageSchema

	typ string
}

func (u *UsageDetails) GetStringIntegerMap() map[string]int {
	if u == nil {
		return nil
	}
	return u.StringIntegerMap
}

func (u *UsageDetails) GetOpenAiCompletionUsageSchema() *OpenAiCompletionUsageSchema {
	if u == nil {
		return nil
	}
	return u.OpenAiCompletionUsageSchema
}

func (u *UsageDetails) GetOpenAiResponseUsageSchema() *OpenAiResponseUsageSchema {
	if u == nil {
		return nil
	}
	return u.OpenAiResponseUsageSchema
}

func (u *UsageDetails) UnmarshalJSON(data []byte) error {
	var valueStringIntegerMap map[string]int
	if err := json.Unmarshal(data, &valueStringIntegerMap); err == nil {
		u.typ = "StringIntegerMap"
		u.StringIntegerMap = valueStringIntegerMap
		return nil
	}
	valueOpenAiCompletionUsageSchema := new(OpenAiCompletionUsageSchema)
	if err := json.Unmarshal(data, &valueOpenAiCompletionUsageSchema); err == nil {
		u.typ = "OpenAiCompletionUsageSchema"
		u.OpenAiCompletionUsageSchema = valueOpenAiCompletionUsageSchema
		return nil
	}
	valueOpenAiResponseUsageSchema := new(OpenAiResponseUsageSchema)
	if err := json.Unmarshal(data, &valueOpenAiResponseUsageSchema); err == nil {
		u.typ = "OpenAiResponseUsageSchema"
		u.OpenAiResponseUsageSchema = valueOpenAiResponseUsageSchema
		return nil
	}
	return fmt.Errorf("%s cannot be deserialized as a %T", data, u)
}

func (u UsageDetails) MarshalJSON() ([]byte, error) {
	if u.typ == "StringIntegerMap" || u.StringIntegerMap != nil {
		return json.Marshal(u.StringIntegerMap)
	}
	if u.typ == "OpenAiCompletionUsageSchema" || u.OpenAiCompletionUsageSchema != nil {
		return json.Marshal(u.OpenAiCompletionUsageSchema)
	}
	if u.typ == "OpenAiResponseUsageSchema" || u.OpenAiResponseUsageSchema != nil {
		return json.Marshal(u.OpenAiResponseUsageSchema)
	}
	return nil, fmt.Errorf("type %T does not include a non-empty union type", u)
}

type UsageDetailsVisitor interface {
	VisitStringIntegerMap(map[string]int) error
	VisitOpenAiCompletionUsageSchema(*OpenAiCompletionUsageSchema) error
	VisitOpenAiResponseUsageSchema(*OpenAiResponseUsageSchema) error
}

func (u *UsageDetails) Accept(visitor UsageDetailsVisitor) error {
	if u.typ == "StringIntegerMap" || u.StringIntegerMap != nil {
		return visitor.VisitStringIntegerMap(u.StringIntegerMap)
	}
	if u.typ == "OpenAiCompletionUsageSchema" || u.OpenAiCompletionUsageSchema != nil {
		return visitor.VisitOpenAiCompletionUsageSchema(u.OpenAiCompletionUsageSchema)
	}
	if u.typ == "OpenAiResponseUsageSchema" || u.OpenAiResponseUsageSchema != nil {
		return visitor.VisitOpenAiResponseUsageSchema(u.OpenAiResponseUsageSchema)
	}
	return fmt.Errorf("type %T does not include a non-empty union type", u)
}
