// 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 (
	createDatasetRequestFieldName                 = big.NewInt(1 << 0)
	createDatasetRequestFieldDescription          = big.NewInt(1 << 1)
	createDatasetRequestFieldMetadata             = big.NewInt(1 << 2)
	createDatasetRequestFieldInputSchema          = big.NewInt(1 << 3)
	createDatasetRequestFieldExpectedOutputSchema = big.NewInt(1 << 4)
)

type CreateDatasetRequest struct {
	Name        string      `json:"name" url:"-"`
	Description *string     `json:"description,omitempty" url:"-"`
	Metadata    interface{} `json:"metadata,omitempty" url:"-"`
	// JSON Schema for validating dataset item inputs. When set, all new and existing dataset items will be validated against this schema.
	InputSchema interface{} `json:"inputSchema,omitempty" url:"-"`
	// JSON Schema for validating dataset item expected outputs. When set, all new and existing dataset items will be validated against this schema.
	ExpectedOutputSchema interface{} `json:"expectedOutputSchema,omitempty" url:"-"`

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

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

// 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 *CreateDatasetRequest) SetDescription(description *string) {
	c.Description = description
	c.require(createDatasetRequestFieldDescription)
}

// 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 *CreateDatasetRequest) SetMetadata(metadata interface{}) {
	c.Metadata = metadata
	c.require(createDatasetRequestFieldMetadata)
}

// SetInputSchema sets the InputSchema field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateDatasetRequest) SetInputSchema(inputSchema interface{}) {
	c.InputSchema = inputSchema
	c.require(createDatasetRequestFieldInputSchema)
}

// SetExpectedOutputSchema sets the ExpectedOutputSchema field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateDatasetRequest) SetExpectedOutputSchema(expectedOutputSchema interface{}) {
	c.ExpectedOutputSchema = expectedOutputSchema
	c.require(createDatasetRequestFieldExpectedOutputSchema)
}

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

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

var (
	datasetsDeleteRunRequestFieldDatasetName = big.NewInt(1 << 0)
	datasetsDeleteRunRequestFieldRunName     = big.NewInt(1 << 1)
)

type DatasetsDeleteRunRequest struct {
	DatasetName string `json:"-" url:"-"`
	RunName     string `json:"-" url:"-"`

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

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

// SetDatasetName sets the DatasetName field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DatasetsDeleteRunRequest) SetDatasetName(datasetName string) {
	d.DatasetName = datasetName
	d.require(datasetsDeleteRunRequestFieldDatasetName)
}

// SetRunName sets the RunName field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DatasetsDeleteRunRequest) SetRunName(runName string) {
	d.RunName = runName
	d.require(datasetsDeleteRunRequestFieldRunName)
}

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

type DatasetsGetRequest struct {
	DatasetName string `json:"-" url:"-"`

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

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

// SetDatasetName sets the DatasetName field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DatasetsGetRequest) SetDatasetName(datasetName string) {
	d.DatasetName = datasetName
	d.require(datasetsGetRequestFieldDatasetName)
}

var (
	datasetsGetRunRequestFieldDatasetName = big.NewInt(1 << 0)
	datasetsGetRunRequestFieldRunName     = big.NewInt(1 << 1)
)

type DatasetsGetRunRequest struct {
	DatasetName string `json:"-" url:"-"`
	RunName     string `json:"-" url:"-"`

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

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

// SetDatasetName sets the DatasetName field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DatasetsGetRunRequest) SetDatasetName(datasetName string) {
	d.DatasetName = datasetName
	d.require(datasetsGetRunRequestFieldDatasetName)
}

// SetRunName sets the RunName field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DatasetsGetRunRequest) SetRunName(runName string) {
	d.RunName = runName
	d.require(datasetsGetRunRequestFieldRunName)
}

var (
	datasetsGetRunsRequestFieldDatasetName = big.NewInt(1 << 0)
	datasetsGetRunsRequestFieldPage        = big.NewInt(1 << 1)
	datasetsGetRunsRequestFieldLimit       = big.NewInt(1 << 2)
)

type DatasetsGetRunsRequest struct {
	DatasetName string `json:"-" url:"-"`
	// page number, starts at 1
	Page *int `json:"-" url:"page,omitempty"`
	// limit of items per page
	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 (d *DatasetsGetRunsRequest) require(field *big.Int) {
	if d.explicitFields == nil {
		d.explicitFields = big.NewInt(0)
	}
	d.explicitFields.Or(d.explicitFields, field)
}

// SetDatasetName sets the DatasetName field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DatasetsGetRunsRequest) SetDatasetName(datasetName string) {
	d.DatasetName = datasetName
	d.require(datasetsGetRunsRequestFieldDatasetName)
}

// 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 (d *DatasetsGetRunsRequest) SetPage(page *int) {
	d.Page = page
	d.require(datasetsGetRunsRequestFieldPage)
}

// 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 (d *DatasetsGetRunsRequest) SetLimit(limit *int) {
	d.Limit = limit
	d.require(datasetsGetRunsRequestFieldLimit)
}

var (
	datasetsListRequestFieldPage  = big.NewInt(1 << 0)
	datasetsListRequestFieldLimit = big.NewInt(1 << 1)
)

type DatasetsListRequest struct {
	// page number, starts at 1
	Page *int `json:"-" url:"page,omitempty"`
	// limit of items per page
	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 (d *DatasetsListRequest) require(field *big.Int) {
	if d.explicitFields == nil {
		d.explicitFields = big.NewInt(0)
	}
	d.explicitFields.Or(d.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 (d *DatasetsListRequest) SetPage(page *int) {
	d.Page = page
	d.require(datasetsListRequestFieldPage)
}

// 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 (d *DatasetsListRequest) SetLimit(limit *int) {
	d.Limit = limit
	d.require(datasetsListRequestFieldLimit)
}

var (
	datasetFieldID                   = big.NewInt(1 << 0)
	datasetFieldName                 = big.NewInt(1 << 1)
	datasetFieldDescription          = big.NewInt(1 << 2)
	datasetFieldMetadata             = big.NewInt(1 << 3)
	datasetFieldInputSchema          = big.NewInt(1 << 4)
	datasetFieldExpectedOutputSchema = big.NewInt(1 << 5)
	datasetFieldProjectID            = big.NewInt(1 << 6)
	datasetFieldCreatedAt            = big.NewInt(1 << 7)
	datasetFieldUpdatedAt            = big.NewInt(1 << 8)
)

type Dataset struct {
	ID   string `json:"id" url:"id"`
	Name string `json:"name" url:"name"`
	// Description of the dataset
	Description *string     `json:"description,omitempty" url:"description,omitempty"`
	Metadata    interface{} `json:"metadata" url:"metadata"`
	// JSON Schema for validating dataset item inputs
	InputSchema interface{} `json:"inputSchema,omitempty" url:"inputSchema,omitempty"`
	// JSON Schema for validating dataset item expected outputs
	ExpectedOutputSchema interface{} `json:"expectedOutputSchema,omitempty" url:"expectedOutputSchema,omitempty"`
	ProjectID            string      `json:"projectId" url:"projectId"`
	CreatedAt            time.Time   `json:"createdAt" url:"createdAt"`
	UpdatedAt            time.Time   `json:"updatedAt" url:"updatedAt"`

	// 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 (d *Dataset) GetID() string {
	if d == nil {
		return ""
	}
	return d.ID
}

func (d *Dataset) GetName() string {
	if d == nil {
		return ""
	}
	return d.Name
}

func (d *Dataset) GetDescription() *string {
	if d == nil {
		return nil
	}
	return d.Description
}

func (d *Dataset) GetMetadata() interface{} {
	if d == nil {
		return nil
	}
	return d.Metadata
}

func (d *Dataset) GetInputSchema() interface{} {
	if d == nil {
		return nil
	}
	return d.InputSchema
}

func (d *Dataset) GetExpectedOutputSchema() interface{} {
	if d == nil {
		return nil
	}
	return d.ExpectedOutputSchema
}

func (d *Dataset) GetProjectID() string {
	if d == nil {
		return ""
	}
	return d.ProjectID
}

func (d *Dataset) GetCreatedAt() time.Time {
	if d == nil {
		return time.Time{}
	}
	return d.CreatedAt
}

func (d *Dataset) GetUpdatedAt() time.Time {
	if d == nil {
		return time.Time{}
	}
	return d.UpdatedAt
}

func (d *Dataset) GetExtraProperties() map[string]interface{} {
	return d.extraProperties
}

func (d *Dataset) require(field *big.Int) {
	if d.explicitFields == nil {
		d.explicitFields = big.NewInt(0)
	}
	d.explicitFields.Or(d.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 (d *Dataset) SetID(id string) {
	d.ID = id
	d.require(datasetFieldID)
}

// 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 (d *Dataset) SetName(name string) {
	d.Name = name
	d.require(datasetFieldName)
}

// 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 (d *Dataset) SetDescription(description *string) {
	d.Description = description
	d.require(datasetFieldDescription)
}

// 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 (d *Dataset) SetMetadata(metadata interface{}) {
	d.Metadata = metadata
	d.require(datasetFieldMetadata)
}

// SetInputSchema sets the InputSchema field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *Dataset) SetInputSchema(inputSchema interface{}) {
	d.InputSchema = inputSchema
	d.require(datasetFieldInputSchema)
}

// SetExpectedOutputSchema sets the ExpectedOutputSchema field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *Dataset) SetExpectedOutputSchema(expectedOutputSchema interface{}) {
	d.ExpectedOutputSchema = expectedOutputSchema
	d.require(datasetFieldExpectedOutputSchema)
}

// 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 (d *Dataset) SetProjectID(projectID string) {
	d.ProjectID = projectID
	d.require(datasetFieldProjectID)
}

// 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 (d *Dataset) SetCreatedAt(createdAt time.Time) {
	d.CreatedAt = createdAt
	d.require(datasetFieldCreatedAt)
}

// 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 (d *Dataset) SetUpdatedAt(updatedAt time.Time) {
	d.UpdatedAt = updatedAt
	d.require(datasetFieldUpdatedAt)
}

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

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

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

var (
	datasetRunFieldID          = big.NewInt(1 << 0)
	datasetRunFieldName        = big.NewInt(1 << 1)
	datasetRunFieldDescription = big.NewInt(1 << 2)
	datasetRunFieldMetadata    = big.NewInt(1 << 3)
	datasetRunFieldDatasetID   = big.NewInt(1 << 4)
	datasetRunFieldDatasetName = big.NewInt(1 << 5)
	datasetRunFieldCreatedAt   = big.NewInt(1 << 6)
	datasetRunFieldUpdatedAt   = big.NewInt(1 << 7)
)

type DatasetRun struct {
	// Unique identifier of the dataset run
	ID string `json:"id" url:"id"`
	// Name of the dataset run
	Name string `json:"name" url:"name"`
	// Description of the run
	Description *string     `json:"description,omitempty" url:"description,omitempty"`
	Metadata    interface{} `json:"metadata" url:"metadata"`
	// Id of the associated dataset
	DatasetID string `json:"datasetId" url:"datasetId"`
	// Name of the associated dataset
	DatasetName string `json:"datasetName" url:"datasetName"`
	// The date and time when the dataset run was created
	CreatedAt time.Time `json:"createdAt" url:"createdAt"`
	// The date and time when the dataset run was last updated
	UpdatedAt time.Time `json:"updatedAt" url:"updatedAt"`

	// 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 (d *DatasetRun) GetID() string {
	if d == nil {
		return ""
	}
	return d.ID
}

func (d *DatasetRun) GetName() string {
	if d == nil {
		return ""
	}
	return d.Name
}

func (d *DatasetRun) GetDescription() *string {
	if d == nil {
		return nil
	}
	return d.Description
}

func (d *DatasetRun) GetMetadata() interface{} {
	if d == nil {
		return nil
	}
	return d.Metadata
}

func (d *DatasetRun) GetDatasetID() string {
	if d == nil {
		return ""
	}
	return d.DatasetID
}

func (d *DatasetRun) GetDatasetName() string {
	if d == nil {
		return ""
	}
	return d.DatasetName
}

func (d *DatasetRun) GetCreatedAt() time.Time {
	if d == nil {
		return time.Time{}
	}
	return d.CreatedAt
}

func (d *DatasetRun) GetUpdatedAt() time.Time {
	if d == nil {
		return time.Time{}
	}
	return d.UpdatedAt
}

func (d *DatasetRun) GetExtraProperties() map[string]interface{} {
	return d.extraProperties
}

func (d *DatasetRun) require(field *big.Int) {
	if d.explicitFields == nil {
		d.explicitFields = big.NewInt(0)
	}
	d.explicitFields.Or(d.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 (d *DatasetRun) SetID(id string) {
	d.ID = id
	d.require(datasetRunFieldID)
}

// 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 (d *DatasetRun) SetName(name string) {
	d.Name = name
	d.require(datasetRunFieldName)
}

// 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 (d *DatasetRun) SetDescription(description *string) {
	d.Description = description
	d.require(datasetRunFieldDescription)
}

// 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 (d *DatasetRun) SetMetadata(metadata interface{}) {
	d.Metadata = metadata
	d.require(datasetRunFieldMetadata)
}

// SetDatasetID sets the DatasetID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DatasetRun) SetDatasetID(datasetID string) {
	d.DatasetID = datasetID
	d.require(datasetRunFieldDatasetID)
}

// SetDatasetName sets the DatasetName field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DatasetRun) SetDatasetName(datasetName string) {
	d.DatasetName = datasetName
	d.require(datasetRunFieldDatasetName)
}

// 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 (d *DatasetRun) SetCreatedAt(createdAt time.Time) {
	d.CreatedAt = createdAt
	d.require(datasetRunFieldCreatedAt)
}

// 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 (d *DatasetRun) SetUpdatedAt(updatedAt time.Time) {
	d.UpdatedAt = updatedAt
	d.require(datasetRunFieldUpdatedAt)
}

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

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

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

var (
	datasetRunWithItemsFieldID              = big.NewInt(1 << 0)
	datasetRunWithItemsFieldName            = big.NewInt(1 << 1)
	datasetRunWithItemsFieldDescription     = big.NewInt(1 << 2)
	datasetRunWithItemsFieldMetadata        = big.NewInt(1 << 3)
	datasetRunWithItemsFieldDatasetID       = big.NewInt(1 << 4)
	datasetRunWithItemsFieldDatasetName     = big.NewInt(1 << 5)
	datasetRunWithItemsFieldCreatedAt       = big.NewInt(1 << 6)
	datasetRunWithItemsFieldUpdatedAt       = big.NewInt(1 << 7)
	datasetRunWithItemsFieldDatasetRunItems = big.NewInt(1 << 8)
)

type DatasetRunWithItems struct {
	// Unique identifier of the dataset run
	ID string `json:"id" url:"id"`
	// Name of the dataset run
	Name string `json:"name" url:"name"`
	// Description of the run
	Description *string     `json:"description,omitempty" url:"description,omitempty"`
	Metadata    interface{} `json:"metadata" url:"metadata"`
	// Id of the associated dataset
	DatasetID string `json:"datasetId" url:"datasetId"`
	// Name of the associated dataset
	DatasetName string `json:"datasetName" url:"datasetName"`
	// The date and time when the dataset run was created
	CreatedAt time.Time `json:"createdAt" url:"createdAt"`
	// The date and time when the dataset run was last updated
	UpdatedAt       time.Time         `json:"updatedAt" url:"updatedAt"`
	DatasetRunItems []*DatasetRunItem `json:"datasetRunItems" url:"datasetRunItems"`

	// 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 (d *DatasetRunWithItems) GetID() string {
	if d == nil {
		return ""
	}
	return d.ID
}

func (d *DatasetRunWithItems) GetName() string {
	if d == nil {
		return ""
	}
	return d.Name
}

func (d *DatasetRunWithItems) GetDescription() *string {
	if d == nil {
		return nil
	}
	return d.Description
}

func (d *DatasetRunWithItems) GetMetadata() interface{} {
	if d == nil {
		return nil
	}
	return d.Metadata
}

func (d *DatasetRunWithItems) GetDatasetID() string {
	if d == nil {
		return ""
	}
	return d.DatasetID
}

func (d *DatasetRunWithItems) GetDatasetName() string {
	if d == nil {
		return ""
	}
	return d.DatasetName
}

func (d *DatasetRunWithItems) GetCreatedAt() time.Time {
	if d == nil {
		return time.Time{}
	}
	return d.CreatedAt
}

func (d *DatasetRunWithItems) GetUpdatedAt() time.Time {
	if d == nil {
		return time.Time{}
	}
	return d.UpdatedAt
}

func (d *DatasetRunWithItems) GetDatasetRunItems() []*DatasetRunItem {
	if d == nil {
		return nil
	}
	return d.DatasetRunItems
}

func (d *DatasetRunWithItems) GetExtraProperties() map[string]interface{} {
	return d.extraProperties
}

func (d *DatasetRunWithItems) require(field *big.Int) {
	if d.explicitFields == nil {
		d.explicitFields = big.NewInt(0)
	}
	d.explicitFields.Or(d.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 (d *DatasetRunWithItems) SetID(id string) {
	d.ID = id
	d.require(datasetRunWithItemsFieldID)
}

// 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 (d *DatasetRunWithItems) SetName(name string) {
	d.Name = name
	d.require(datasetRunWithItemsFieldName)
}

// 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 (d *DatasetRunWithItems) SetDescription(description *string) {
	d.Description = description
	d.require(datasetRunWithItemsFieldDescription)
}

// 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 (d *DatasetRunWithItems) SetMetadata(metadata interface{}) {
	d.Metadata = metadata
	d.require(datasetRunWithItemsFieldMetadata)
}

// SetDatasetID sets the DatasetID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DatasetRunWithItems) SetDatasetID(datasetID string) {
	d.DatasetID = datasetID
	d.require(datasetRunWithItemsFieldDatasetID)
}

// SetDatasetName sets the DatasetName field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DatasetRunWithItems) SetDatasetName(datasetName string) {
	d.DatasetName = datasetName
	d.require(datasetRunWithItemsFieldDatasetName)
}

// 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 (d *DatasetRunWithItems) SetCreatedAt(createdAt time.Time) {
	d.CreatedAt = createdAt
	d.require(datasetRunWithItemsFieldCreatedAt)
}

// 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 (d *DatasetRunWithItems) SetUpdatedAt(updatedAt time.Time) {
	d.UpdatedAt = updatedAt
	d.require(datasetRunWithItemsFieldUpdatedAt)
}

// SetDatasetRunItems sets the DatasetRunItems field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DatasetRunWithItems) SetDatasetRunItems(datasetRunItems []*DatasetRunItem) {
	d.DatasetRunItems = datasetRunItems
	d.require(datasetRunWithItemsFieldDatasetRunItems)
}

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

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

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

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

type DeleteDatasetRunResponse struct {
	Message string `json:"message" url:"message"`

	// 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 (d *DeleteDatasetRunResponse) GetMessage() string {
	if d == nil {
		return ""
	}
	return d.Message
}

func (d *DeleteDatasetRunResponse) GetExtraProperties() map[string]interface{} {
	return d.extraProperties
}

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

// 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 (d *DeleteDatasetRunResponse) SetMessage(message string) {
	d.Message = message
	d.require(deleteDatasetRunResponseFieldMessage)
}

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

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

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

var (
	paginatedDatasetRunsFieldData = big.NewInt(1 << 0)
	paginatedDatasetRunsFieldMeta = big.NewInt(1 << 1)
)

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

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

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

func (p *PaginatedDatasetRuns) 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 *PaginatedDatasetRuns) SetData(data []*DatasetRun) {
	p.Data = data
	p.require(paginatedDatasetRunsFieldData)
}

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

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

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

func (p *PaginatedDatasetRuns) 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 (
	paginatedDatasetsFieldData = big.NewInt(1 << 0)
	paginatedDatasetsFieldMeta = big.NewInt(1 << 1)
)

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

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

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

func (p *PaginatedDatasets) 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 *PaginatedDatasets) SetData(data []*Dataset) {
	p.Data = data
	p.require(paginatedDatasetsFieldData)
}

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

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

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

func (p *PaginatedDatasets) 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)
}
