// 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 (
	createScoreConfigRequestFieldName        = big.NewInt(1 << 0)
	createScoreConfigRequestFieldDataType    = big.NewInt(1 << 1)
	createScoreConfigRequestFieldCategories  = big.NewInt(1 << 2)
	createScoreConfigRequestFieldMinValue    = big.NewInt(1 << 3)
	createScoreConfigRequestFieldMaxValue    = big.NewInt(1 << 4)
	createScoreConfigRequestFieldDescription = big.NewInt(1 << 5)
)

type CreateScoreConfigRequest struct {
	Name     string              `json:"name" url:"-"`
	DataType ScoreConfigDataType `json:"dataType" url:"-"`
	// Configure custom categories for categorical scores. Pass a list of objects with `label` and `value` properties. Categories are autogenerated for boolean configs and cannot be passed
	Categories []*ConfigCategory `json:"categories,omitempty" url:"-"`
	// Configure a minimum value for numerical scores. If not set, the minimum value defaults to -∞
	MinValue *float64 `json:"minValue,omitempty" url:"-"`
	// Configure a maximum value for numerical scores. If not set, the maximum value defaults to +∞
	MaxValue *float64 `json:"maxValue,omitempty" url:"-"`
	// Description is shown across the Langfuse UI and can be used to e.g. explain the config categories in detail, why a numeric range was set, or provide additional context on config name or usage
	Description *string `json:"description,omitempty" url:"-"`

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

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

// 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 *CreateScoreConfigRequest) SetName(name string) {
	c.Name = name
	c.require(createScoreConfigRequestFieldName)
}

// 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 (c *CreateScoreConfigRequest) SetDataType(dataType ScoreConfigDataType) {
	c.DataType = dataType
	c.require(createScoreConfigRequestFieldDataType)
}

// SetCategories sets the Categories field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateScoreConfigRequest) SetCategories(categories []*ConfigCategory) {
	c.Categories = categories
	c.require(createScoreConfigRequestFieldCategories)
}

// SetMinValue sets the MinValue field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateScoreConfigRequest) SetMinValue(minValue *float64) {
	c.MinValue = minValue
	c.require(createScoreConfigRequestFieldMinValue)
}

// SetMaxValue sets the MaxValue field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateScoreConfigRequest) SetMaxValue(maxValue *float64) {
	c.MaxValue = maxValue
	c.require(createScoreConfigRequestFieldMaxValue)
}

// SetDescription sets the Description field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateScoreConfigRequest) SetDescription(description *string) {
	c.Description = description
	c.require(createScoreConfigRequestFieldDescription)
}

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

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

var (
	scoreConfigsGetRequestFieldPage  = big.NewInt(1 << 0)
	scoreConfigsGetRequestFieldLimit = big.NewInt(1 << 1)
)

type ScoreConfigsGetRequest struct {
	// Page number, starts at 1.
	Page *int `json:"-" url:"page,omitempty"`
	// Limit of items per page. If you encounter api issues due to too large page sizes, try to reduce the limit
	Limit *int `json:"-" url:"limit,omitempty"`

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

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

// SetPage sets the Page field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreConfigsGetRequest) SetPage(page *int) {
	s.Page = page
	s.require(scoreConfigsGetRequestFieldPage)
}

// SetLimit sets the Limit field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreConfigsGetRequest) SetLimit(limit *int) {
	s.Limit = limit
	s.require(scoreConfigsGetRequestFieldLimit)
}

var (
	scoreConfigsGetByIDRequestFieldConfigID = big.NewInt(1 << 0)
)

type ScoreConfigsGetByIDRequest struct {
	// The unique langfuse identifier of a score config
	ConfigID string `json:"-" url:"-"`

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

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

// 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 *ScoreConfigsGetByIDRequest) SetConfigID(configID string) {
	s.ConfigID = configID
	s.require(scoreConfigsGetByIDRequestFieldConfigID)
}

var (
	configCategoryFieldValue = big.NewInt(1 << 0)
	configCategoryFieldLabel = big.NewInt(1 << 1)
)

type ConfigCategory struct {
	Value float64 `json:"value" url:"value"`
	Label string  `json:"label" url:"label"`

	// 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 *ConfigCategory) GetValue() float64 {
	if c == nil {
		return 0
	}
	return c.Value
}

func (c *ConfigCategory) GetLabel() string {
	if c == nil {
		return ""
	}
	return c.Label
}

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

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

// 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 (c *ConfigCategory) SetValue(value float64) {
	c.Value = value
	c.require(configCategoryFieldValue)
}

// SetLabel sets the Label field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConfigCategory) SetLabel(label string) {
	c.Label = label
	c.require(configCategoryFieldLabel)
}

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

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

func (c *ConfigCategory) 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)
}

// Configuration for a score
var (
	scoreConfigFieldID          = big.NewInt(1 << 0)
	scoreConfigFieldName        = big.NewInt(1 << 1)
	scoreConfigFieldCreatedAt   = big.NewInt(1 << 2)
	scoreConfigFieldUpdatedAt   = big.NewInt(1 << 3)
	scoreConfigFieldProjectID   = big.NewInt(1 << 4)
	scoreConfigFieldDataType    = big.NewInt(1 << 5)
	scoreConfigFieldIsArchived  = big.NewInt(1 << 6)
	scoreConfigFieldMinValue    = big.NewInt(1 << 7)
	scoreConfigFieldMaxValue    = big.NewInt(1 << 8)
	scoreConfigFieldCategories  = big.NewInt(1 << 9)
	scoreConfigFieldDescription = big.NewInt(1 << 10)
)

type ScoreConfig struct {
	ID        string              `json:"id" url:"id"`
	Name      string              `json:"name" url:"name"`
	CreatedAt time.Time           `json:"createdAt" url:"createdAt"`
	UpdatedAt time.Time           `json:"updatedAt" url:"updatedAt"`
	ProjectID string              `json:"projectId" url:"projectId"`
	DataType  ScoreConfigDataType `json:"dataType" url:"dataType"`
	// Whether the score config is archived. Defaults to false
	IsArchived bool `json:"isArchived" url:"isArchived"`
	// Sets minimum value for numerical scores. If not set, the minimum value defaults to -∞
	MinValue *float64 `json:"minValue,omitempty" url:"minValue,omitempty"`
	// Sets maximum value for numerical scores. If not set, the maximum value defaults to +∞
	MaxValue *float64 `json:"maxValue,omitempty" url:"maxValue,omitempty"`
	// Configures custom categories for categorical scores
	Categories []*ConfigCategory `json:"categories,omitempty" url:"categories,omitempty"`
	// Description of the score config
	Description *string `json:"description,omitempty" url:"description,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 *ScoreConfig) GetID() string {
	if s == nil {
		return ""
	}
	return s.ID
}

func (s *ScoreConfig) GetName() string {
	if s == nil {
		return ""
	}
	return s.Name
}

func (s *ScoreConfig) GetCreatedAt() time.Time {
	if s == nil {
		return time.Time{}
	}
	return s.CreatedAt
}

func (s *ScoreConfig) GetUpdatedAt() time.Time {
	if s == nil {
		return time.Time{}
	}
	return s.UpdatedAt
}

func (s *ScoreConfig) GetProjectID() string {
	if s == nil {
		return ""
	}
	return s.ProjectID
}

func (s *ScoreConfig) GetDataType() ScoreConfigDataType {
	if s == nil {
		return ""
	}
	return s.DataType
}

func (s *ScoreConfig) GetIsArchived() bool {
	if s == nil {
		return false
	}
	return s.IsArchived
}

func (s *ScoreConfig) GetMinValue() *float64 {
	if s == nil {
		return nil
	}
	return s.MinValue
}

func (s *ScoreConfig) GetMaxValue() *float64 {
	if s == nil {
		return nil
	}
	return s.MaxValue
}

func (s *ScoreConfig) GetCategories() []*ConfigCategory {
	if s == nil {
		return nil
	}
	return s.Categories
}

func (s *ScoreConfig) GetDescription() *string {
	if s == nil {
		return nil
	}
	return s.Description
}

func (s *ScoreConfig) GetExtraProperties() map[string]interface{} {
	return s.extraProperties
}

func (s *ScoreConfig) 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 *ScoreConfig) SetID(id string) {
	s.ID = id
	s.require(scoreConfigFieldID)
}

// 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 *ScoreConfig) SetName(name string) {
	s.Name = name
	s.require(scoreConfigFieldName)
}

// SetCreatedAt sets the CreatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreConfig) SetCreatedAt(createdAt time.Time) {
	s.CreatedAt = createdAt
	s.require(scoreConfigFieldCreatedAt)
}

// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreConfig) SetUpdatedAt(updatedAt time.Time) {
	s.UpdatedAt = updatedAt
	s.require(scoreConfigFieldUpdatedAt)
}

// SetProjectID sets the ProjectID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreConfig) SetProjectID(projectID string) {
	s.ProjectID = projectID
	s.require(scoreConfigFieldProjectID)
}

// 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 *ScoreConfig) SetDataType(dataType ScoreConfigDataType) {
	s.DataType = dataType
	s.require(scoreConfigFieldDataType)
}

// SetIsArchived sets the IsArchived field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreConfig) SetIsArchived(isArchived bool) {
	s.IsArchived = isArchived
	s.require(scoreConfigFieldIsArchived)
}

// SetMinValue sets the MinValue field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreConfig) SetMinValue(minValue *float64) {
	s.MinValue = minValue
	s.require(scoreConfigFieldMinValue)
}

// SetMaxValue sets the MaxValue field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreConfig) SetMaxValue(maxValue *float64) {
	s.MaxValue = maxValue
	s.require(scoreConfigFieldMaxValue)
}

// SetCategories sets the Categories field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreConfig) SetCategories(categories []*ConfigCategory) {
	s.Categories = categories
	s.require(scoreConfigFieldCategories)
}

// SetDescription sets the Description field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreConfig) SetDescription(description *string) {
	s.Description = description
	s.require(scoreConfigFieldDescription)
}

func (s *ScoreConfig) UnmarshalJSON(data []byte) error {
	type embed ScoreConfig
	var unmarshaler = struct {
		embed
		CreatedAt *internal.DateTime `json:"createdAt"`
		UpdatedAt *internal.DateTime `json:"updatedAt"`
	}{
		embed: embed(*s),
	}
	if err := json.Unmarshal(data, &unmarshaler); err != nil {
		return err
	}
	*s = ScoreConfig(unmarshaler.embed)
	s.CreatedAt = unmarshaler.CreatedAt.Time()
	s.UpdatedAt = unmarshaler.UpdatedAt.Time()
	extraProperties, err := internal.ExtractExtraProperties(data, *s)
	if err != nil {
		return err
	}
	s.extraProperties = extraProperties
	s.rawJSON = json.RawMessage(data)
	return nil
}

func (s *ScoreConfig) MarshalJSON() ([]byte, error) {
	type embed ScoreConfig
	var marshaler = struct {
		embed
		CreatedAt *internal.DateTime `json:"createdAt"`
		UpdatedAt *internal.DateTime `json:"updatedAt"`
	}{
		embed:     embed(*s),
		CreatedAt: internal.NewDateTime(s.CreatedAt),
		UpdatedAt: internal.NewDateTime(s.UpdatedAt),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (s *ScoreConfig) 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)
}

type ScoreConfigDataType string

const (
	ScoreConfigDataTypeNumeric     ScoreConfigDataType = "NUMERIC"
	ScoreConfigDataTypeBoolean     ScoreConfigDataType = "BOOLEAN"
	ScoreConfigDataTypeCategorical ScoreConfigDataType = "CATEGORICAL"
)

func NewScoreConfigDataTypeFromString(s string) (ScoreConfigDataType, error) {
	switch s {
	case "NUMERIC":
		return ScoreConfigDataTypeNumeric, nil
	case "BOOLEAN":
		return ScoreConfigDataTypeBoolean, nil
	case "CATEGORICAL":
		return ScoreConfigDataTypeCategorical, nil
	}
	var t ScoreConfigDataType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (s ScoreConfigDataType) Ptr() *ScoreConfigDataType {
	return &s
}

var (
	scoreConfigsFieldData = big.NewInt(1 << 0)
	scoreConfigsFieldMeta = big.NewInt(1 << 1)
)

type ScoreConfigs struct {
	Data []*ScoreConfig     `json:"data" url:"data"`
	Meta *UtilsMetaResponse `json:"meta" url:"meta"`

	// 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 *ScoreConfigs) GetData() []*ScoreConfig {
	if s == nil {
		return nil
	}
	return s.Data
}

func (s *ScoreConfigs) GetMeta() *UtilsMetaResponse {
	if s == nil {
		return nil
	}
	return s.Meta
}

func (s *ScoreConfigs) GetExtraProperties() map[string]interface{} {
	return s.extraProperties
}

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

// SetData sets the Data field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreConfigs) SetData(data []*ScoreConfig) {
	s.Data = data
	s.require(scoreConfigsFieldData)
}

// SetMeta sets the Meta field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScoreConfigs) SetMeta(meta *UtilsMetaResponse) {
	s.Meta = meta
	s.require(scoreConfigsFieldMeta)
}

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

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

func (s *ScoreConfigs) 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 (
	updateScoreConfigRequestFieldConfigID    = big.NewInt(1 << 0)
	updateScoreConfigRequestFieldIsArchived  = big.NewInt(1 << 1)
	updateScoreConfigRequestFieldName        = big.NewInt(1 << 2)
	updateScoreConfigRequestFieldCategories  = big.NewInt(1 << 3)
	updateScoreConfigRequestFieldMinValue    = big.NewInt(1 << 4)
	updateScoreConfigRequestFieldMaxValue    = big.NewInt(1 << 5)
	updateScoreConfigRequestFieldDescription = big.NewInt(1 << 6)
)

type UpdateScoreConfigRequest struct {
	// The unique langfuse identifier of a score config
	ConfigID string `json:"-" url:"-"`
	// The status of the score config showing if it is archived or not
	IsArchived *bool `json:"isArchived,omitempty" url:"-"`
	// The name of the score config
	Name *string `json:"name,omitempty" url:"-"`
	// Configure custom categories for categorical scores. Pass a list of objects with `label` and `value` properties. Categories are autogenerated for boolean configs and cannot be passed
	Categories []*ConfigCategory `json:"categories,omitempty" url:"-"`
	// Configure a minimum value for numerical scores. If not set, the minimum value defaults to -∞
	MinValue *float64 `json:"minValue,omitempty" url:"-"`
	// Configure a maximum value for numerical scores. If not set, the maximum value defaults to +∞
	MaxValue *float64 `json:"maxValue,omitempty" url:"-"`
	// Description is shown across the Langfuse UI and can be used to e.g. explain the config categories in detail, why a numeric range was set, or provide additional context on config name or usage
	Description *string `json:"description,omitempty" url:"-"`

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

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

// 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 (u *UpdateScoreConfigRequest) SetConfigID(configID string) {
	u.ConfigID = configID
	u.require(updateScoreConfigRequestFieldConfigID)
}

// SetIsArchived sets the IsArchived field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateScoreConfigRequest) SetIsArchived(isArchived *bool) {
	u.IsArchived = isArchived
	u.require(updateScoreConfigRequestFieldIsArchived)
}

// 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 *UpdateScoreConfigRequest) SetName(name *string) {
	u.Name = name
	u.require(updateScoreConfigRequestFieldName)
}

// SetCategories sets the Categories field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateScoreConfigRequest) SetCategories(categories []*ConfigCategory) {
	u.Categories = categories
	u.require(updateScoreConfigRequestFieldCategories)
}

// SetMinValue sets the MinValue field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateScoreConfigRequest) SetMinValue(minValue *float64) {
	u.MinValue = minValue
	u.require(updateScoreConfigRequestFieldMinValue)
}

// SetMaxValue sets the MaxValue field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateScoreConfigRequest) SetMaxValue(maxValue *float64) {
	u.MaxValue = maxValue
	u.require(updateScoreConfigRequestFieldMaxValue)
}

// SetDescription sets the Description field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateScoreConfigRequest) SetDescription(description *string) {
	u.Description = description
	u.require(updateScoreConfigRequestFieldDescription)
}

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

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