// 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 (
	promptsDeleteRequestFieldPromptName = big.NewInt(1 << 0)
	promptsDeleteRequestFieldLabel      = big.NewInt(1 << 1)
	promptsDeleteRequestFieldVersion    = big.NewInt(1 << 2)
)

type PromptsDeleteRequest struct {
	// The name of the prompt
	PromptName string `json:"-" url:"-"`
	// Optional label to filter deletion. If specified, deletes all prompt versions that have this label.
	Label *string `json:"-" url:"label,omitempty"`
	// Optional version to filter deletion. If specified, deletes only this specific version of the prompt.
	Version *int `json:"-" url:"version,omitempty"`

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

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

// 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 (p *PromptsDeleteRequest) SetPromptName(promptName string) {
	p.PromptName = promptName
	p.require(promptsDeleteRequestFieldPromptName)
}

// 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 (p *PromptsDeleteRequest) SetLabel(label *string) {
	p.Label = label
	p.require(promptsDeleteRequestFieldLabel)
}

// 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 (p *PromptsDeleteRequest) SetVersion(version *int) {
	p.Version = version
	p.require(promptsDeleteRequestFieldVersion)
}

var (
	promptsGetRequestFieldPromptName = big.NewInt(1 << 0)
	promptsGetRequestFieldVersion    = big.NewInt(1 << 1)
	promptsGetRequestFieldLabel      = big.NewInt(1 << 2)
)

type PromptsGetRequest struct {
	// The name of the prompt. If the prompt is in a folder (e.g., "folder/subfolder/prompt-name"),
	// the folder path must be URL encoded.
	PromptName string `json:"-" url:"-"`
	// Version of the prompt to be retrieved.
	Version *int `json:"-" url:"version,omitempty"`
	// Label of the prompt to be retrieved. Defaults to "production" if no label or version is set.
	Label *string `json:"-" url:"label,omitempty"`

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

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

// 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 (p *PromptsGetRequest) SetPromptName(promptName string) {
	p.PromptName = promptName
	p.require(promptsGetRequestFieldPromptName)
}

// 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 (p *PromptsGetRequest) SetVersion(version *int) {
	p.Version = version
	p.require(promptsGetRequestFieldVersion)
}

// 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 (p *PromptsGetRequest) SetLabel(label *string) {
	p.Label = label
	p.require(promptsGetRequestFieldLabel)
}

var (
	promptsListRequestFieldName          = big.NewInt(1 << 0)
	promptsListRequestFieldLabel         = big.NewInt(1 << 1)
	promptsListRequestFieldTag           = big.NewInt(1 << 2)
	promptsListRequestFieldPage          = big.NewInt(1 << 3)
	promptsListRequestFieldLimit         = big.NewInt(1 << 4)
	promptsListRequestFieldFromUpdatedAt = big.NewInt(1 << 5)
	promptsListRequestFieldToUpdatedAt   = big.NewInt(1 << 6)
)

type PromptsListRequest struct {
	Name  *string `json:"-" url:"name,omitempty"`
	Label *string `json:"-" url:"label,omitempty"`
	Tag   *string `json:"-" url:"tag,omitempty"`
	// page number, starts at 1
	Page *int `json:"-" url:"page,omitempty"`
	// limit of items per page
	Limit *int `json:"-" url:"limit,omitempty"`
	// Optional filter to only include prompt versions created/updated on or after a certain datetime (ISO 8601)
	FromUpdatedAt *time.Time `json:"-" url:"fromUpdatedAt,omitempty"`
	// Optional filter to only include prompt versions created/updated before a certain datetime (ISO 8601)
	ToUpdatedAt *time.Time `json:"-" url:"toUpdatedAt,omitempty"`

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

func (p *PromptsListRequest) require(field *big.Int) {
	if p.explicitFields == nil {
		p.explicitFields = big.NewInt(0)
	}
	p.explicitFields.Or(p.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 (p *PromptsListRequest) SetName(name *string) {
	p.Name = name
	p.require(promptsListRequestFieldName)
}

// 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 (p *PromptsListRequest) SetLabel(label *string) {
	p.Label = label
	p.require(promptsListRequestFieldLabel)
}

// SetTag sets the Tag field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (p *PromptsListRequest) SetTag(tag *string) {
	p.Tag = tag
	p.require(promptsListRequestFieldTag)
}

// 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 (p *PromptsListRequest) SetPage(page *int) {
	p.Page = page
	p.require(promptsListRequestFieldPage)
}

// 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 (p *PromptsListRequest) SetLimit(limit *int) {
	p.Limit = limit
	p.require(promptsListRequestFieldLimit)
}

// SetFromUpdatedAt sets the FromUpdatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (p *PromptsListRequest) SetFromUpdatedAt(fromUpdatedAt *time.Time) {
	p.FromUpdatedAt = fromUpdatedAt
	p.require(promptsListRequestFieldFromUpdatedAt)
}

// SetToUpdatedAt sets the ToUpdatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (p *PromptsListRequest) SetToUpdatedAt(toUpdatedAt *time.Time) {
	p.ToUpdatedAt = toUpdatedAt
	p.require(promptsListRequestFieldToUpdatedAt)
}

var (
	createChatPromptRequestFieldName          = big.NewInt(1 << 0)
	createChatPromptRequestFieldPrompt        = big.NewInt(1 << 1)
	createChatPromptRequestFieldConfig        = big.NewInt(1 << 2)
	createChatPromptRequestFieldLabels        = big.NewInt(1 << 3)
	createChatPromptRequestFieldTags          = big.NewInt(1 << 4)
	createChatPromptRequestFieldCommitMessage = big.NewInt(1 << 5)
)

type CreateChatPromptRequest struct {
	Name   string                         `json:"name" url:"name"`
	Prompt []*ChatMessageWithPlaceholders `json:"prompt" url:"prompt"`
	Config interface{}                    `json:"config,omitempty" url:"config,omitempty"`
	// List of deployment labels of this prompt version.
	Labels []string `json:"labels,omitempty" url:"labels,omitempty"`
	// List of tags to apply to all versions of this prompt.
	Tags []string `json:"tags,omitempty" url:"tags,omitempty"`
	// Commit message for this prompt version.
	CommitMessage *string `json:"commitMessage,omitempty" url:"commitMessage,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 *CreateChatPromptRequest) GetName() string {
	if c == nil {
		return ""
	}
	return c.Name
}

func (c *CreateChatPromptRequest) GetPrompt() []*ChatMessageWithPlaceholders {
	if c == nil {
		return nil
	}
	return c.Prompt
}

func (c *CreateChatPromptRequest) GetConfig() interface{} {
	if c == nil {
		return nil
	}
	return c.Config
}

func (c *CreateChatPromptRequest) GetLabels() []string {
	if c == nil {
		return nil
	}
	return c.Labels
}

func (c *CreateChatPromptRequest) GetTags() []string {
	if c == nil {
		return nil
	}
	return c.Tags
}

func (c *CreateChatPromptRequest) GetCommitMessage() *string {
	if c == nil {
		return nil
	}
	return c.CommitMessage
}

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

func (c *CreateChatPromptRequest) 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 *CreateChatPromptRequest) SetName(name string) {
	c.Name = name
	c.require(createChatPromptRequestFieldName)
}

// SetPrompt sets the Prompt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateChatPromptRequest) SetPrompt(prompt []*ChatMessageWithPlaceholders) {
	c.Prompt = prompt
	c.require(createChatPromptRequestFieldPrompt)
}

// SetConfig sets the Config field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateChatPromptRequest) SetConfig(config interface{}) {
	c.Config = config
	c.require(createChatPromptRequestFieldConfig)
}

// SetLabels sets the Labels field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateChatPromptRequest) SetLabels(labels []string) {
	c.Labels = labels
	c.require(createChatPromptRequestFieldLabels)
}

// 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 (c *CreateChatPromptRequest) SetTags(tags []string) {
	c.Tags = tags
	c.require(createChatPromptRequestFieldTags)
}

// SetCommitMessage sets the CommitMessage field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateChatPromptRequest) SetCommitMessage(commitMessage *string) {
	c.CommitMessage = commitMessage
	c.require(createChatPromptRequestFieldCommitMessage)
}

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

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

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

type CreatePromptRequest struct {
	CreatePromptRequestZero *CreatePromptRequestZero
	CreatePromptRequestOne  *CreatePromptRequestOne

	typ string
}

func (c *CreatePromptRequest) GetCreatePromptRequestZero() *CreatePromptRequestZero {
	if c == nil {
		return nil
	}
	return c.CreatePromptRequestZero
}

func (c *CreatePromptRequest) GetCreatePromptRequestOne() *CreatePromptRequestOne {
	if c == nil {
		return nil
	}
	return c.CreatePromptRequestOne
}

func (c *CreatePromptRequest) UnmarshalJSON(data []byte) error {
	valueCreatePromptRequestZero := new(CreatePromptRequestZero)
	if err := json.Unmarshal(data, &valueCreatePromptRequestZero); err == nil {
		c.typ = "CreatePromptRequestZero"
		c.CreatePromptRequestZero = valueCreatePromptRequestZero
		return nil
	}
	valueCreatePromptRequestOne := new(CreatePromptRequestOne)
	if err := json.Unmarshal(data, &valueCreatePromptRequestOne); err == nil {
		c.typ = "CreatePromptRequestOne"
		c.CreatePromptRequestOne = valueCreatePromptRequestOne
		return nil
	}
	return fmt.Errorf("%s cannot be deserialized as a %T", data, c)
}

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

type CreatePromptRequestVisitor interface {
	VisitCreatePromptRequestZero(*CreatePromptRequestZero) error
	VisitCreatePromptRequestOne(*CreatePromptRequestOne) error
}

func (c *CreatePromptRequest) Accept(visitor CreatePromptRequestVisitor) error {
	if c.typ == "CreatePromptRequestZero" || c.CreatePromptRequestZero != nil {
		return visitor.VisitCreatePromptRequestZero(c.CreatePromptRequestZero)
	}
	if c.typ == "CreatePromptRequestOne" || c.CreatePromptRequestOne != nil {
		return visitor.VisitCreatePromptRequestOne(c.CreatePromptRequestOne)
	}
	return fmt.Errorf("type %T does not include a non-empty union type", c)
}

var (
	createPromptRequestOneFieldName          = big.NewInt(1 << 0)
	createPromptRequestOneFieldPrompt        = big.NewInt(1 << 1)
	createPromptRequestOneFieldConfig        = big.NewInt(1 << 2)
	createPromptRequestOneFieldLabels        = big.NewInt(1 << 3)
	createPromptRequestOneFieldTags          = big.NewInt(1 << 4)
	createPromptRequestOneFieldCommitMessage = big.NewInt(1 << 5)
	createPromptRequestOneFieldType          = big.NewInt(1 << 6)
)

type CreatePromptRequestOne struct {
	Name   string      `json:"name" url:"name"`
	Prompt string      `json:"prompt" url:"prompt"`
	Config interface{} `json:"config,omitempty" url:"config,omitempty"`
	// List of deployment labels of this prompt version.
	Labels []string `json:"labels,omitempty" url:"labels,omitempty"`
	// List of tags to apply to all versions of this prompt.
	Tags []string `json:"tags,omitempty" url:"tags,omitempty"`
	// Commit message for this prompt version.
	CommitMessage *string                     `json:"commitMessage,omitempty" url:"commitMessage,omitempty"`
	Type          *CreatePromptRequestOneType `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 (c *CreatePromptRequestOne) GetName() string {
	if c == nil {
		return ""
	}
	return c.Name
}

func (c *CreatePromptRequestOne) GetPrompt() string {
	if c == nil {
		return ""
	}
	return c.Prompt
}

func (c *CreatePromptRequestOne) GetConfig() interface{} {
	if c == nil {
		return nil
	}
	return c.Config
}

func (c *CreatePromptRequestOne) GetLabels() []string {
	if c == nil {
		return nil
	}
	return c.Labels
}

func (c *CreatePromptRequestOne) GetTags() []string {
	if c == nil {
		return nil
	}
	return c.Tags
}

func (c *CreatePromptRequestOne) GetCommitMessage() *string {
	if c == nil {
		return nil
	}
	return c.CommitMessage
}

func (c *CreatePromptRequestOne) GetType() *CreatePromptRequestOneType {
	if c == nil {
		return nil
	}
	return c.Type
}

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

func (c *CreatePromptRequestOne) 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 *CreatePromptRequestOne) SetName(name string) {
	c.Name = name
	c.require(createPromptRequestOneFieldName)
}

// SetPrompt sets the Prompt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreatePromptRequestOne) SetPrompt(prompt string) {
	c.Prompt = prompt
	c.require(createPromptRequestOneFieldPrompt)
}

// SetConfig sets the Config field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreatePromptRequestOne) SetConfig(config interface{}) {
	c.Config = config
	c.require(createPromptRequestOneFieldConfig)
}

// SetLabels sets the Labels field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreatePromptRequestOne) SetLabels(labels []string) {
	c.Labels = labels
	c.require(createPromptRequestOneFieldLabels)
}

// 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 (c *CreatePromptRequestOne) SetTags(tags []string) {
	c.Tags = tags
	c.require(createPromptRequestOneFieldTags)
}

// SetCommitMessage sets the CommitMessage field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreatePromptRequestOne) SetCommitMessage(commitMessage *string) {
	c.CommitMessage = commitMessage
	c.require(createPromptRequestOneFieldCommitMessage)
}

// 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 (c *CreatePromptRequestOne) SetType(type_ *CreatePromptRequestOneType) {
	c.Type = type_
	c.require(createPromptRequestOneFieldType)
}

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

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

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

type CreatePromptRequestOneType string

const (
	CreatePromptRequestOneTypeText CreatePromptRequestOneType = "text"
)

func NewCreatePromptRequestOneTypeFromString(s string) (CreatePromptRequestOneType, error) {
	switch s {
	case "text":
		return CreatePromptRequestOneTypeText, nil
	}
	var t CreatePromptRequestOneType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (c CreatePromptRequestOneType) Ptr() *CreatePromptRequestOneType {
	return &c
}

var (
	createPromptRequestZeroFieldName          = big.NewInt(1 << 0)
	createPromptRequestZeroFieldPrompt        = big.NewInt(1 << 1)
	createPromptRequestZeroFieldConfig        = big.NewInt(1 << 2)
	createPromptRequestZeroFieldLabels        = big.NewInt(1 << 3)
	createPromptRequestZeroFieldTags          = big.NewInt(1 << 4)
	createPromptRequestZeroFieldCommitMessage = big.NewInt(1 << 5)
	createPromptRequestZeroFieldType          = big.NewInt(1 << 6)
)

type CreatePromptRequestZero struct {
	Name   string                         `json:"name" url:"name"`
	Prompt []*ChatMessageWithPlaceholders `json:"prompt" url:"prompt"`
	Config interface{}                    `json:"config,omitempty" url:"config,omitempty"`
	// List of deployment labels of this prompt version.
	Labels []string `json:"labels,omitempty" url:"labels,omitempty"`
	// List of tags to apply to all versions of this prompt.
	Tags []string `json:"tags,omitempty" url:"tags,omitempty"`
	// Commit message for this prompt version.
	CommitMessage *string                      `json:"commitMessage,omitempty" url:"commitMessage,omitempty"`
	Type          *CreatePromptRequestZeroType `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 (c *CreatePromptRequestZero) GetName() string {
	if c == nil {
		return ""
	}
	return c.Name
}

func (c *CreatePromptRequestZero) GetPrompt() []*ChatMessageWithPlaceholders {
	if c == nil {
		return nil
	}
	return c.Prompt
}

func (c *CreatePromptRequestZero) GetConfig() interface{} {
	if c == nil {
		return nil
	}
	return c.Config
}

func (c *CreatePromptRequestZero) GetLabels() []string {
	if c == nil {
		return nil
	}
	return c.Labels
}

func (c *CreatePromptRequestZero) GetTags() []string {
	if c == nil {
		return nil
	}
	return c.Tags
}

func (c *CreatePromptRequestZero) GetCommitMessage() *string {
	if c == nil {
		return nil
	}
	return c.CommitMessage
}

func (c *CreatePromptRequestZero) GetType() *CreatePromptRequestZeroType {
	if c == nil {
		return nil
	}
	return c.Type
}

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

func (c *CreatePromptRequestZero) 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 *CreatePromptRequestZero) SetName(name string) {
	c.Name = name
	c.require(createPromptRequestZeroFieldName)
}

// SetPrompt sets the Prompt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreatePromptRequestZero) SetPrompt(prompt []*ChatMessageWithPlaceholders) {
	c.Prompt = prompt
	c.require(createPromptRequestZeroFieldPrompt)
}

// SetConfig sets the Config field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreatePromptRequestZero) SetConfig(config interface{}) {
	c.Config = config
	c.require(createPromptRequestZeroFieldConfig)
}

// SetLabels sets the Labels field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreatePromptRequestZero) SetLabels(labels []string) {
	c.Labels = labels
	c.require(createPromptRequestZeroFieldLabels)
}

// 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 (c *CreatePromptRequestZero) SetTags(tags []string) {
	c.Tags = tags
	c.require(createPromptRequestZeroFieldTags)
}

// SetCommitMessage sets the CommitMessage field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreatePromptRequestZero) SetCommitMessage(commitMessage *string) {
	c.CommitMessage = commitMessage
	c.require(createPromptRequestZeroFieldCommitMessage)
}

// 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 (c *CreatePromptRequestZero) SetType(type_ *CreatePromptRequestZeroType) {
	c.Type = type_
	c.require(createPromptRequestZeroFieldType)
}

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

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

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

type CreatePromptRequestZeroType string

const (
	CreatePromptRequestZeroTypeChat CreatePromptRequestZeroType = "chat"
)

func NewCreatePromptRequestZeroTypeFromString(s string) (CreatePromptRequestZeroType, error) {
	switch s {
	case "chat":
		return CreatePromptRequestZeroTypeChat, nil
	}
	var t CreatePromptRequestZeroType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (c CreatePromptRequestZeroType) Ptr() *CreatePromptRequestZeroType {
	return &c
}

var (
	createTextPromptRequestFieldName          = big.NewInt(1 << 0)
	createTextPromptRequestFieldPrompt        = big.NewInt(1 << 1)
	createTextPromptRequestFieldConfig        = big.NewInt(1 << 2)
	createTextPromptRequestFieldLabels        = big.NewInt(1 << 3)
	createTextPromptRequestFieldTags          = big.NewInt(1 << 4)
	createTextPromptRequestFieldCommitMessage = big.NewInt(1 << 5)
)

type CreateTextPromptRequest struct {
	Name   string      `json:"name" url:"name"`
	Prompt string      `json:"prompt" url:"prompt"`
	Config interface{} `json:"config,omitempty" url:"config,omitempty"`
	// List of deployment labels of this prompt version.
	Labels []string `json:"labels,omitempty" url:"labels,omitempty"`
	// List of tags to apply to all versions of this prompt.
	Tags []string `json:"tags,omitempty" url:"tags,omitempty"`
	// Commit message for this prompt version.
	CommitMessage *string `json:"commitMessage,omitempty" url:"commitMessage,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 *CreateTextPromptRequest) GetName() string {
	if c == nil {
		return ""
	}
	return c.Name
}

func (c *CreateTextPromptRequest) GetPrompt() string {
	if c == nil {
		return ""
	}
	return c.Prompt
}

func (c *CreateTextPromptRequest) GetConfig() interface{} {
	if c == nil {
		return nil
	}
	return c.Config
}

func (c *CreateTextPromptRequest) GetLabels() []string {
	if c == nil {
		return nil
	}
	return c.Labels
}

func (c *CreateTextPromptRequest) GetTags() []string {
	if c == nil {
		return nil
	}
	return c.Tags
}

func (c *CreateTextPromptRequest) GetCommitMessage() *string {
	if c == nil {
		return nil
	}
	return c.CommitMessage
}

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

func (c *CreateTextPromptRequest) 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 *CreateTextPromptRequest) SetName(name string) {
	c.Name = name
	c.require(createTextPromptRequestFieldName)
}

// SetPrompt sets the Prompt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateTextPromptRequest) SetPrompt(prompt string) {
	c.Prompt = prompt
	c.require(createTextPromptRequestFieldPrompt)
}

// SetConfig sets the Config field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateTextPromptRequest) SetConfig(config interface{}) {
	c.Config = config
	c.require(createTextPromptRequestFieldConfig)
}

// SetLabels sets the Labels field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateTextPromptRequest) SetLabels(labels []string) {
	c.Labels = labels
	c.require(createTextPromptRequestFieldLabels)
}

// 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 (c *CreateTextPromptRequest) SetTags(tags []string) {
	c.Tags = tags
	c.require(createTextPromptRequestFieldTags)
}

// SetCommitMessage sets the CommitMessage field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateTextPromptRequest) SetCommitMessage(commitMessage *string) {
	c.CommitMessage = commitMessage
	c.require(createTextPromptRequestFieldCommitMessage)
}

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

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

func (c *CreateTextPromptRequest) 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 (
	promptMetaFieldName          = big.NewInt(1 << 0)
	promptMetaFieldType          = big.NewInt(1 << 1)
	promptMetaFieldVersions      = big.NewInt(1 << 2)
	promptMetaFieldLabels        = big.NewInt(1 << 3)
	promptMetaFieldTags          = big.NewInt(1 << 4)
	promptMetaFieldLastUpdatedAt = big.NewInt(1 << 5)
	promptMetaFieldLastConfig    = big.NewInt(1 << 6)
)

type PromptMeta struct {
	Name string `json:"name" url:"name"`
	// Indicates whether the prompt is a text or chat prompt.
	Type          PromptType  `json:"type" url:"type"`
	Versions      []int       `json:"versions" url:"versions"`
	Labels        []string    `json:"labels" url:"labels"`
	Tags          []string    `json:"tags" url:"tags"`
	LastUpdatedAt time.Time   `json:"lastUpdatedAt" url:"lastUpdatedAt"`
	LastConfig    interface{} `json:"lastConfig" url:"lastConfig"`

	// 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 (p *PromptMeta) GetName() string {
	if p == nil {
		return ""
	}
	return p.Name
}

func (p *PromptMeta) GetType() PromptType {
	if p == nil {
		return ""
	}
	return p.Type
}

func (p *PromptMeta) GetVersions() []int {
	if p == nil {
		return nil
	}
	return p.Versions
}

func (p *PromptMeta) GetLabels() []string {
	if p == nil {
		return nil
	}
	return p.Labels
}

func (p *PromptMeta) GetTags() []string {
	if p == nil {
		return nil
	}
	return p.Tags
}

func (p *PromptMeta) GetLastUpdatedAt() time.Time {
	if p == nil {
		return time.Time{}
	}
	return p.LastUpdatedAt
}

func (p *PromptMeta) GetLastConfig() interface{} {
	if p == nil {
		return nil
	}
	return p.LastConfig
}

func (p *PromptMeta) GetExtraProperties() map[string]interface{} {
	return p.extraProperties
}

func (p *PromptMeta) require(field *big.Int) {
	if p.explicitFields == nil {
		p.explicitFields = big.NewInt(0)
	}
	p.explicitFields.Or(p.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 (p *PromptMeta) SetName(name string) {
	p.Name = name
	p.require(promptMetaFieldName)
}

// 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 (p *PromptMeta) SetType(type_ PromptType) {
	p.Type = type_
	p.require(promptMetaFieldType)
}

// SetVersions sets the Versions field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (p *PromptMeta) SetVersions(versions []int) {
	p.Versions = versions
	p.require(promptMetaFieldVersions)
}

// SetLabels sets the Labels field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (p *PromptMeta) SetLabels(labels []string) {
	p.Labels = labels
	p.require(promptMetaFieldLabels)
}

// 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 (p *PromptMeta) SetTags(tags []string) {
	p.Tags = tags
	p.require(promptMetaFieldTags)
}

// SetLastUpdatedAt sets the LastUpdatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (p *PromptMeta) SetLastUpdatedAt(lastUpdatedAt time.Time) {
	p.LastUpdatedAt = lastUpdatedAt
	p.require(promptMetaFieldLastUpdatedAt)
}

// SetLastConfig sets the LastConfig field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (p *PromptMeta) SetLastConfig(lastConfig interface{}) {
	p.LastConfig = lastConfig
	p.require(promptMetaFieldLastConfig)
}

func (p *PromptMeta) UnmarshalJSON(data []byte) error {
	type embed PromptMeta
	var unmarshaler = struct {
		embed
		LastUpdatedAt *internal.DateTime `json:"lastUpdatedAt"`
	}{
		embed: embed(*p),
	}
	if err := json.Unmarshal(data, &unmarshaler); err != nil {
		return err
	}
	*p = PromptMeta(unmarshaler.embed)
	p.LastUpdatedAt = unmarshaler.LastUpdatedAt.Time()
	extraProperties, err := internal.ExtractExtraProperties(data, *p)
	if err != nil {
		return err
	}
	p.extraProperties = extraProperties
	p.rawJSON = json.RawMessage(data)
	return nil
}

func (p *PromptMeta) MarshalJSON() ([]byte, error) {
	type embed PromptMeta
	var marshaler = struct {
		embed
		LastUpdatedAt *internal.DateTime `json:"lastUpdatedAt"`
	}{
		embed:         embed(*p),
		LastUpdatedAt: internal.NewDateTime(p.LastUpdatedAt),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields)
	return json.Marshal(explicitMarshaler)
}

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

var (
	promptMetaListResponseFieldData = big.NewInt(1 << 0)
	promptMetaListResponseFieldMeta = big.NewInt(1 << 1)
)

type PromptMetaListResponse struct {
	Data []*PromptMeta      `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 (p *PromptMetaListResponse) GetData() []*PromptMeta {
	if p == nil {
		return nil
	}
	return p.Data
}

func (p *PromptMetaListResponse) GetMeta() *UtilsMetaResponse {
	if p == nil {
		return nil
	}
	return p.Meta
}

func (p *PromptMetaListResponse) GetExtraProperties() map[string]interface{} {
	return p.extraProperties
}

func (p *PromptMetaListResponse) require(field *big.Int) {
	if p.explicitFields == nil {
		p.explicitFields = big.NewInt(0)
	}
	p.explicitFields.Or(p.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 (p *PromptMetaListResponse) SetData(data []*PromptMeta) {
	p.Data = data
	p.require(promptMetaListResponseFieldData)
}

// 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 (p *PromptMetaListResponse) SetMeta(meta *UtilsMetaResponse) {
	p.Meta = meta
	p.require(promptMetaListResponseFieldMeta)
}

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

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

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

type PromptType string

const (
	PromptTypeChat PromptType = "chat"
	PromptTypeText PromptType = "text"
)

func NewPromptTypeFromString(s string) (PromptType, error) {
	switch s {
	case "chat":
		return PromptTypeChat, nil
	case "text":
		return PromptTypeText, nil
	}
	var t PromptType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (p PromptType) Ptr() *PromptType {
	return &p
}
