// Package pattern provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.3.0 DO NOT EDIT.
package pattern

import (
	"time"

	coretypes "github.com/meshery/schemas/models/core"
	"github.com/meshery/schemas/models/v1beta1/component"
	"github.com/meshery/schemas/models/v1beta2/relationship"
)

type Trace struct {
	// ComponentsAdded List of new components added to the design.
	ComponentsAdded []component.ComponentDefinition `json:"componentsAdded" yaml:"componentsAdded"`

	// ComponentsRemoved List of components removed from the design.
	ComponentsRemoved []component.ComponentDefinition `json:"componentsRemoved" yaml:"componentsRemoved"`

	// ComponentsUpdated List of components updated in the design.
	ComponentsUpdated []component.ComponentDefinition `json:"componentsUpdated" yaml:"componentsUpdated"`

	// PolicyActions List of policy actions applied during the evaluation.
	PolicyActions []string `json:"policyActions" yaml:"policyActions"`

	// RelationshipsAdded List of new relationships added to the design.
	RelationshipsAdded []relationship.RelationshipDefinition `json:"relationshipsAdded" yaml:"relationshipsAdded"`

	// RelationshipsRemoved List of relationships removed from the design.
	RelationshipsRemoved []relationship.RelationshipDefinition `json:"relationshipsRemoved" yaml:"relationshipsRemoved"`

	// RelationshipsUpdated List of relationships updated in the design.
	RelationshipsUpdated []relationship.RelationshipDefinition `json:"relationshipsUpdated" yaml:"relationshipsUpdated"`
}

type Action struct {
	Op    string                 `json:"op"`
	Value map[string]interface{} `json:"value"`
}

// EvaluationResponse Schema for the response of a relationship evaluation process in Meshery
type EvaluationResponse struct {
	// Design Designs are your primary tool for collaborative authorship of your infrastructure, workflow, and processes.
	Design PatternFile `json:"design" yaml:"design"`

	// EvaluationHash Hash of the input parameters and configuration used for this evaluation. Useful for identifying duplicate evaluations or caching results.
	EvaluationHash *string        `json:"evaluationHash,omitempty" yaml:"evaluationHash"`
	SchemaVersion  coretypes.Text `json:"schemaVersion" yaml:"schemaVersion"`

	// Timestamp ISO 8601 formatted timestamp of when the evaluation was completed.
	Timestamp *time.Time `json:"timestamp,omitempty" yaml:"timestamp"`

	// Trace A detailed trace of the evaluation process, including actions taken and changes made.
	Trace Trace `json:"trace" yaml:"trace"`

	Actions []Action `json:"actions" yaml:"actions"`
}

type Options struct {
	// EnableTrace If true, include detailed trace information in the response
	EnableTrace *bool `json:"enableTrace,omitempty" yaml:"enableTrace"`

	// ReturnDiffOnly If true, only return the diff of changes instead of the complete updated design
	ReturnDiffOnly *bool `json:"returnDiffOnly,omitempty" yaml:"returnDiffOnly"`
}

// EvaluationRequest defines model for EvaluationRequest.
type EvaluationRequest struct {
	// Design Designs are your primary tool for collaborative authorship of your infrastructure, workflow, and processes.
	Design PatternFile `json:"design" yaml:"design"`

	// Options Optional parameters for the evaluation process
	Options *Options `json:"options,omitempty" yaml:"options"`
}
