mirror of https://github.com/vernonkeenan/lib
1103 lines
26 KiB
Go
1103 lines
26 KiB
Go
|
|
// Code generated by go-swagger; DO NOT EDIT.
|
||
|
|
|
||
|
|
// (c) 2012-2020 by Taxnexus, Inc.
|
||
|
|
// All rights reserved worldwide.
|
||
|
|
// Proprietary product; unlicensed use is not allowed
|
||
|
|
|
||
|
|
package research_models
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
"encoding/json"
|
||
|
|
stderrors "errors"
|
||
|
|
"strconv"
|
||
|
|
|
||
|
|
"github.com/go-openapi/errors"
|
||
|
|
"github.com/go-openapi/strfmt"
|
||
|
|
"github.com/go-openapi/swag/jsonutils"
|
||
|
|
"github.com/go-openapi/swag/typeutils"
|
||
|
|
"github.com/go-openapi/validate"
|
||
|
|
)
|
||
|
|
|
||
|
|
// PortfolioEnrichmentRun Account-scoped portfolio_enrichment.v1 research result containing Product and Service candidates together; it is immutable evidence and never an authoritative write or publication
|
||
|
|
//
|
||
|
|
// swagger:model PortfolioEnrichmentRun
|
||
|
|
type PortfolioEnrichmentRun struct {
|
||
|
|
|
||
|
|
// account base version
|
||
|
|
// Required: true
|
||
|
|
// Format: date-time
|
||
|
|
AccountBaseVersion *strfmt.DateTime `json:"AccountBaseVersion"`
|
||
|
|
|
||
|
|
// account ID
|
||
|
|
// Required: true
|
||
|
|
// Max Length: 64
|
||
|
|
// Min Length: 1
|
||
|
|
// Pattern: ^[A-Za-z0-9_-]+$
|
||
|
|
AccountID *string `json:"AccountID"`
|
||
|
|
|
||
|
|
// completed date
|
||
|
|
// Format: date-time
|
||
|
|
CompletedDate strfmt.DateTime `json:"CompletedDate,omitempty"`
|
||
|
|
|
||
|
|
// coverage
|
||
|
|
// Required: true
|
||
|
|
Coverage *PortfolioEnrichmentCoverage `json:"Coverage"`
|
||
|
|
|
||
|
|
// created date
|
||
|
|
// Required: true
|
||
|
|
// Format: date-time
|
||
|
|
CreatedDate *strfmt.DateTime `json:"CreatedDate"`
|
||
|
|
|
||
|
|
// disclosure
|
||
|
|
// Required: true
|
||
|
|
// Enum: ["Live research evidence: operator review required before any save.","Simulation: operator review required before any save."]
|
||
|
|
Disclosure *string `json:"Disclosure"`
|
||
|
|
|
||
|
|
// execution mode
|
||
|
|
// Required: true
|
||
|
|
// Enum: ["live","simulation"]
|
||
|
|
ExecutionMode *string `json:"ExecutionMode"`
|
||
|
|
|
||
|
|
// executive summary
|
||
|
|
ExecutiveSummary *PortfolioEnrichmentSummary `json:"ExecutiveSummary,omitempty"`
|
||
|
|
|
||
|
|
// failure code
|
||
|
|
// Max Length: 80
|
||
|
|
FailureCode string `json:"FailureCode,omitempty"`
|
||
|
|
|
||
|
|
// ID
|
||
|
|
// Required: true
|
||
|
|
// Format: uuid
|
||
|
|
ID *strfmt.UUID `json:"ID"`
|
||
|
|
|
||
|
|
// input
|
||
|
|
// Required: true
|
||
|
|
Input *PortfolioEnrichmentInput `json:"Input"`
|
||
|
|
|
||
|
|
// model
|
||
|
|
// Required: true
|
||
|
|
// Max Length: 80
|
||
|
|
// Min Length: 1
|
||
|
|
Model *string `json:"Model"`
|
||
|
|
|
||
|
|
// noteworthy observations
|
||
|
|
// Required: true
|
||
|
|
// Max Items: 100
|
||
|
|
NoteworthyObservations []*PortfolioEnrichmentRunObservation `json:"NoteworthyObservations"`
|
||
|
|
|
||
|
|
// products
|
||
|
|
// Required: true
|
||
|
|
// Max Items: 250
|
||
|
|
Products []*PortfolioEnrichmentCandidate `json:"Products"`
|
||
|
|
|
||
|
|
// prompt version
|
||
|
|
// Required: true
|
||
|
|
// Max Length: 80
|
||
|
|
// Min Length: 1
|
||
|
|
PromptVersion *string `json:"PromptVersion"`
|
||
|
|
|
||
|
|
// protocol version
|
||
|
|
// Required: true
|
||
|
|
// Enum: ["portfolio_enrichment.v1"]
|
||
|
|
ProtocolVersion *string `json:"ProtocolVersion"`
|
||
|
|
|
||
|
|
// provider
|
||
|
|
// Required: true
|
||
|
|
// Max Length: 40
|
||
|
|
// Min Length: 1
|
||
|
|
Provider *string `json:"Provider"`
|
||
|
|
|
||
|
|
// provider response ID
|
||
|
|
// Max Length: 120
|
||
|
|
ProviderResponseID string `json:"ProviderResponseID,omitempty"`
|
||
|
|
|
||
|
|
// queries
|
||
|
|
// Required: true
|
||
|
|
// Max Items: 50
|
||
|
|
Queries []*PortfolioEnrichmentQueryEvidence `json:"Queries"`
|
||
|
|
|
||
|
|
// requested by ID
|
||
|
|
// Required: true
|
||
|
|
// Format: uuid
|
||
|
|
RequestedByID *strfmt.UUID `json:"RequestedByID"`
|
||
|
|
|
||
|
|
// services
|
||
|
|
// Required: true
|
||
|
|
// Max Items: 250
|
||
|
|
Services []*PortfolioEnrichmentCandidate `json:"Services"`
|
||
|
|
|
||
|
|
// started date
|
||
|
|
// Required: true
|
||
|
|
// Format: date-time
|
||
|
|
StartedDate *strfmt.DateTime `json:"StartedDate"`
|
||
|
|
|
||
|
|
// status
|
||
|
|
// Required: true
|
||
|
|
// Enum: ["running","completed","failed"]
|
||
|
|
Status *string `json:"Status"`
|
||
|
|
|
||
|
|
// tenant ID
|
||
|
|
// Required: true
|
||
|
|
// Format: uuid
|
||
|
|
TenantID *strfmt.UUID `json:"TenantID"`
|
||
|
|
|
||
|
|
// warnings
|
||
|
|
// Required: true
|
||
|
|
// Max Items: 100
|
||
|
|
Warnings []string `json:"Warnings"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// Validate validates this portfolio enrichment run
|
||
|
|
func (m *PortfolioEnrichmentRun) Validate(formats strfmt.Registry) error {
|
||
|
|
var res []error
|
||
|
|
|
||
|
|
if err := m.validateAccountBaseVersion(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateAccountID(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateCompletedDate(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateCoverage(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateCreatedDate(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateDisclosure(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateExecutionMode(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateExecutiveSummary(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateFailureCode(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateID(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateInput(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateModel(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateNoteworthyObservations(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateProducts(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validatePromptVersion(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateProtocolVersion(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateProvider(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateProviderResponseID(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateQueries(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateRequestedByID(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateServices(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateStartedDate(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateStatus(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateTenantID(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateWarnings(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if len(res) > 0 {
|
||
|
|
return errors.CompositeValidationError(res...)
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateAccountBaseVersion(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("AccountBaseVersion", "body", m.AccountBaseVersion); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.FormatOf("AccountBaseVersion", "body", "date-time", m.AccountBaseVersion.String(), formats); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateAccountID(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("AccountID", "body", m.AccountID); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.MinLength("AccountID", "body", *m.AccountID, 1); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.MaxLength("AccountID", "body", *m.AccountID, 64); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.Pattern("AccountID", "body", *m.AccountID, `^[A-Za-z0-9_-]+$`); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateCompletedDate(formats strfmt.Registry) error {
|
||
|
|
if typeutils.IsZero(m.CompletedDate) { // not required
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.FormatOf("CompletedDate", "body", "date-time", m.CompletedDate.String(), formats); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateCoverage(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("Coverage", "body", m.Coverage); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if m.Coverage != nil {
|
||
|
|
if err := m.Coverage.Validate(formats); err != nil {
|
||
|
|
ve := new(errors.Validation)
|
||
|
|
if stderrors.As(err, &ve) {
|
||
|
|
return ve.ValidateName("Coverage")
|
||
|
|
}
|
||
|
|
ce := new(errors.CompositeError)
|
||
|
|
if stderrors.As(err, &ce) {
|
||
|
|
return ce.ValidateName("Coverage")
|
||
|
|
}
|
||
|
|
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateCreatedDate(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("CreatedDate", "body", m.CreatedDate); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.FormatOf("CreatedDate", "body", "date-time", m.CreatedDate.String(), formats); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
var portfolioEnrichmentRunTypeDisclosurePropEnum []any
|
||
|
|
|
||
|
|
func init() {
|
||
|
|
var res []string
|
||
|
|
if err := json.Unmarshal([]byte(`["Live research evidence: operator review required before any save.","Simulation: operator review required before any save."]`), &res); err != nil {
|
||
|
|
panic(err)
|
||
|
|
}
|
||
|
|
for _, v := range res {
|
||
|
|
portfolioEnrichmentRunTypeDisclosurePropEnum = append(portfolioEnrichmentRunTypeDisclosurePropEnum, v)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
const (
|
||
|
|
|
||
|
|
// PortfolioEnrichmentRunDisclosureLiveResearchEvidenceOperatorReviewRequiredBeforeAnySaveDot captures enum value "Live research evidence: operator review required before any save."
|
||
|
|
PortfolioEnrichmentRunDisclosureLiveResearchEvidenceOperatorReviewRequiredBeforeAnySaveDot string = "Live research evidence: operator review required before any save."
|
||
|
|
|
||
|
|
// PortfolioEnrichmentRunDisclosureSimulationOperatorReviewRequiredBeforeAnySaveDot captures enum value "Simulation: operator review required before any save."
|
||
|
|
PortfolioEnrichmentRunDisclosureSimulationOperatorReviewRequiredBeforeAnySaveDot string = "Simulation: operator review required before any save."
|
||
|
|
)
|
||
|
|
|
||
|
|
// prop value enum
|
||
|
|
func (m *PortfolioEnrichmentRun) validateDisclosureEnum(path, location string, value string) error {
|
||
|
|
if err := validate.EnumCase(path, location, value, portfolioEnrichmentRunTypeDisclosurePropEnum, true); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateDisclosure(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("Disclosure", "body", m.Disclosure); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
// value enum
|
||
|
|
if err := m.validateDisclosureEnum("Disclosure", "body", *m.Disclosure); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
var portfolioEnrichmentRunTypeExecutionModePropEnum []any
|
||
|
|
|
||
|
|
func init() {
|
||
|
|
var res []string
|
||
|
|
if err := json.Unmarshal([]byte(`["live","simulation"]`), &res); err != nil {
|
||
|
|
panic(err)
|
||
|
|
}
|
||
|
|
for _, v := range res {
|
||
|
|
portfolioEnrichmentRunTypeExecutionModePropEnum = append(portfolioEnrichmentRunTypeExecutionModePropEnum, v)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
const (
|
||
|
|
|
||
|
|
// PortfolioEnrichmentRunExecutionModeLive captures enum value "live"
|
||
|
|
PortfolioEnrichmentRunExecutionModeLive string = "live"
|
||
|
|
|
||
|
|
// PortfolioEnrichmentRunExecutionModeSimulation captures enum value "simulation"
|
||
|
|
PortfolioEnrichmentRunExecutionModeSimulation string = "simulation"
|
||
|
|
)
|
||
|
|
|
||
|
|
// prop value enum
|
||
|
|
func (m *PortfolioEnrichmentRun) validateExecutionModeEnum(path, location string, value string) error {
|
||
|
|
if err := validate.EnumCase(path, location, value, portfolioEnrichmentRunTypeExecutionModePropEnum, true); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateExecutionMode(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("ExecutionMode", "body", m.ExecutionMode); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
// value enum
|
||
|
|
if err := m.validateExecutionModeEnum("ExecutionMode", "body", *m.ExecutionMode); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateExecutiveSummary(formats strfmt.Registry) error {
|
||
|
|
if typeutils.IsZero(m.ExecutiveSummary) { // not required
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
if m.ExecutiveSummary != nil {
|
||
|
|
if err := m.ExecutiveSummary.Validate(formats); err != nil {
|
||
|
|
ve := new(errors.Validation)
|
||
|
|
if stderrors.As(err, &ve) {
|
||
|
|
return ve.ValidateName("ExecutiveSummary")
|
||
|
|
}
|
||
|
|
ce := new(errors.CompositeError)
|
||
|
|
if stderrors.As(err, &ce) {
|
||
|
|
return ce.ValidateName("ExecutiveSummary")
|
||
|
|
}
|
||
|
|
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateFailureCode(formats strfmt.Registry) error {
|
||
|
|
if typeutils.IsZero(m.FailureCode) { // not required
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.MaxLength("FailureCode", "body", m.FailureCode, 80); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateID(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("ID", "body", m.ID); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.FormatOf("ID", "body", "uuid", m.ID.String(), formats); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateInput(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("Input", "body", m.Input); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if m.Input != nil {
|
||
|
|
if err := m.Input.Validate(formats); err != nil {
|
||
|
|
ve := new(errors.Validation)
|
||
|
|
if stderrors.As(err, &ve) {
|
||
|
|
return ve.ValidateName("Input")
|
||
|
|
}
|
||
|
|
ce := new(errors.CompositeError)
|
||
|
|
if stderrors.As(err, &ce) {
|
||
|
|
return ce.ValidateName("Input")
|
||
|
|
}
|
||
|
|
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateModel(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("Model", "body", m.Model); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.MinLength("Model", "body", *m.Model, 1); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.MaxLength("Model", "body", *m.Model, 80); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateNoteworthyObservations(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("NoteworthyObservations", "body", m.NoteworthyObservations); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
iNoteworthyObservationsSize := int64(len(m.NoteworthyObservations))
|
||
|
|
|
||
|
|
if err := validate.MaxItems("NoteworthyObservations", "body", iNoteworthyObservationsSize, 100); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
for i := 0; i < len(m.NoteworthyObservations); i++ {
|
||
|
|
if typeutils.IsZero(m.NoteworthyObservations[i]) { // not required
|
||
|
|
continue
|
||
|
|
}
|
||
|
|
|
||
|
|
if m.NoteworthyObservations[i] != nil {
|
||
|
|
if err := m.NoteworthyObservations[i].Validate(formats); err != nil {
|
||
|
|
ve := new(errors.Validation)
|
||
|
|
if stderrors.As(err, &ve) {
|
||
|
|
return ve.ValidateName("NoteworthyObservations" + "." + strconv.Itoa(i))
|
||
|
|
}
|
||
|
|
ce := new(errors.CompositeError)
|
||
|
|
if stderrors.As(err, &ce) {
|
||
|
|
return ce.ValidateName("NoteworthyObservations" + "." + strconv.Itoa(i))
|
||
|
|
}
|
||
|
|
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateProducts(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("Products", "body", m.Products); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
iProductsSize := int64(len(m.Products))
|
||
|
|
|
||
|
|
if err := validate.MaxItems("Products", "body", iProductsSize, 250); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
for i := 0; i < len(m.Products); i++ {
|
||
|
|
if typeutils.IsZero(m.Products[i]) { // not required
|
||
|
|
continue
|
||
|
|
}
|
||
|
|
|
||
|
|
if m.Products[i] != nil {
|
||
|
|
if err := m.Products[i].Validate(formats); err != nil {
|
||
|
|
ve := new(errors.Validation)
|
||
|
|
if stderrors.As(err, &ve) {
|
||
|
|
return ve.ValidateName("Products" + "." + strconv.Itoa(i))
|
||
|
|
}
|
||
|
|
ce := new(errors.CompositeError)
|
||
|
|
if stderrors.As(err, &ce) {
|
||
|
|
return ce.ValidateName("Products" + "." + strconv.Itoa(i))
|
||
|
|
}
|
||
|
|
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validatePromptVersion(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("PromptVersion", "body", m.PromptVersion); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.MinLength("PromptVersion", "body", *m.PromptVersion, 1); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.MaxLength("PromptVersion", "body", *m.PromptVersion, 80); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
var portfolioEnrichmentRunTypeProtocolVersionPropEnum []any
|
||
|
|
|
||
|
|
func init() {
|
||
|
|
var res []string
|
||
|
|
if err := json.Unmarshal([]byte(`["portfolio_enrichment.v1"]`), &res); err != nil {
|
||
|
|
panic(err)
|
||
|
|
}
|
||
|
|
for _, v := range res {
|
||
|
|
portfolioEnrichmentRunTypeProtocolVersionPropEnum = append(portfolioEnrichmentRunTypeProtocolVersionPropEnum, v)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
const (
|
||
|
|
|
||
|
|
// PortfolioEnrichmentRunProtocolVersionPortfolioEnrichmentDotV1 captures enum value "portfolio_enrichment.v1"
|
||
|
|
PortfolioEnrichmentRunProtocolVersionPortfolioEnrichmentDotV1 string = "portfolio_enrichment.v1"
|
||
|
|
)
|
||
|
|
|
||
|
|
// prop value enum
|
||
|
|
func (m *PortfolioEnrichmentRun) validateProtocolVersionEnum(path, location string, value string) error {
|
||
|
|
if err := validate.EnumCase(path, location, value, portfolioEnrichmentRunTypeProtocolVersionPropEnum, true); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateProtocolVersion(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("ProtocolVersion", "body", m.ProtocolVersion); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
// value enum
|
||
|
|
if err := m.validateProtocolVersionEnum("ProtocolVersion", "body", *m.ProtocolVersion); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateProvider(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("Provider", "body", m.Provider); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.MinLength("Provider", "body", *m.Provider, 1); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.MaxLength("Provider", "body", *m.Provider, 40); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateProviderResponseID(formats strfmt.Registry) error {
|
||
|
|
if typeutils.IsZero(m.ProviderResponseID) { // not required
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.MaxLength("ProviderResponseID", "body", m.ProviderResponseID, 120); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateQueries(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("Queries", "body", m.Queries); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
iQueriesSize := int64(len(m.Queries))
|
||
|
|
|
||
|
|
if err := validate.MaxItems("Queries", "body", iQueriesSize, 50); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
for i := 0; i < len(m.Queries); i++ {
|
||
|
|
if typeutils.IsZero(m.Queries[i]) { // not required
|
||
|
|
continue
|
||
|
|
}
|
||
|
|
|
||
|
|
if m.Queries[i] != nil {
|
||
|
|
if err := m.Queries[i].Validate(formats); err != nil {
|
||
|
|
ve := new(errors.Validation)
|
||
|
|
if stderrors.As(err, &ve) {
|
||
|
|
return ve.ValidateName("Queries" + "." + strconv.Itoa(i))
|
||
|
|
}
|
||
|
|
ce := new(errors.CompositeError)
|
||
|
|
if stderrors.As(err, &ce) {
|
||
|
|
return ce.ValidateName("Queries" + "." + strconv.Itoa(i))
|
||
|
|
}
|
||
|
|
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateRequestedByID(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("RequestedByID", "body", m.RequestedByID); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.FormatOf("RequestedByID", "body", "uuid", m.RequestedByID.String(), formats); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateServices(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("Services", "body", m.Services); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
iServicesSize := int64(len(m.Services))
|
||
|
|
|
||
|
|
if err := validate.MaxItems("Services", "body", iServicesSize, 250); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
for i := 0; i < len(m.Services); i++ {
|
||
|
|
if typeutils.IsZero(m.Services[i]) { // not required
|
||
|
|
continue
|
||
|
|
}
|
||
|
|
|
||
|
|
if m.Services[i] != nil {
|
||
|
|
if err := m.Services[i].Validate(formats); err != nil {
|
||
|
|
ve := new(errors.Validation)
|
||
|
|
if stderrors.As(err, &ve) {
|
||
|
|
return ve.ValidateName("Services" + "." + strconv.Itoa(i))
|
||
|
|
}
|
||
|
|
ce := new(errors.CompositeError)
|
||
|
|
if stderrors.As(err, &ce) {
|
||
|
|
return ce.ValidateName("Services" + "." + strconv.Itoa(i))
|
||
|
|
}
|
||
|
|
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateStartedDate(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("StartedDate", "body", m.StartedDate); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.FormatOf("StartedDate", "body", "date-time", m.StartedDate.String(), formats); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
var portfolioEnrichmentRunTypeStatusPropEnum []any
|
||
|
|
|
||
|
|
func init() {
|
||
|
|
var res []string
|
||
|
|
if err := json.Unmarshal([]byte(`["running","completed","failed"]`), &res); err != nil {
|
||
|
|
panic(err)
|
||
|
|
}
|
||
|
|
for _, v := range res {
|
||
|
|
portfolioEnrichmentRunTypeStatusPropEnum = append(portfolioEnrichmentRunTypeStatusPropEnum, v)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
const (
|
||
|
|
|
||
|
|
// PortfolioEnrichmentRunStatusRunning captures enum value "running"
|
||
|
|
PortfolioEnrichmentRunStatusRunning string = "running"
|
||
|
|
|
||
|
|
// PortfolioEnrichmentRunStatusCompleted captures enum value "completed"
|
||
|
|
PortfolioEnrichmentRunStatusCompleted string = "completed"
|
||
|
|
|
||
|
|
// PortfolioEnrichmentRunStatusFailed captures enum value "failed"
|
||
|
|
PortfolioEnrichmentRunStatusFailed string = "failed"
|
||
|
|
)
|
||
|
|
|
||
|
|
// prop value enum
|
||
|
|
func (m *PortfolioEnrichmentRun) validateStatusEnum(path, location string, value string) error {
|
||
|
|
if err := validate.EnumCase(path, location, value, portfolioEnrichmentRunTypeStatusPropEnum, true); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateStatus(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("Status", "body", m.Status); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
// value enum
|
||
|
|
if err := m.validateStatusEnum("Status", "body", *m.Status); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateTenantID(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("TenantID", "body", m.TenantID); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.FormatOf("TenantID", "body", "uuid", m.TenantID.String(), formats); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) validateWarnings(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("Warnings", "body", m.Warnings); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
iWarningsSize := int64(len(m.Warnings))
|
||
|
|
|
||
|
|
if err := validate.MaxItems("Warnings", "body", iWarningsSize, 100); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
for i := 0; i < len(m.Warnings); i++ {
|
||
|
|
|
||
|
|
if err := validate.MinLength("Warnings"+"."+strconv.Itoa(i), "body", m.Warnings[i], 1); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.MaxLength("Warnings"+"."+strconv.Itoa(i), "body", m.Warnings[i], 1000); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// ContextValidate validate this portfolio enrichment run based on the context it is used
|
||
|
|
func (m *PortfolioEnrichmentRun) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||
|
|
var res []error
|
||
|
|
|
||
|
|
if err := m.contextValidateCoverage(ctx, formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.contextValidateExecutiveSummary(ctx, formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.contextValidateInput(ctx, formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.contextValidateNoteworthyObservations(ctx, formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.contextValidateProducts(ctx, formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.contextValidateQueries(ctx, formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.contextValidateServices(ctx, formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if len(res) > 0 {
|
||
|
|
return errors.CompositeValidationError(res...)
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) contextValidateCoverage(ctx context.Context, formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if m.Coverage != nil {
|
||
|
|
|
||
|
|
if err := m.Coverage.ContextValidate(ctx, formats); err != nil {
|
||
|
|
ve := new(errors.Validation)
|
||
|
|
if stderrors.As(err, &ve) {
|
||
|
|
return ve.ValidateName("Coverage")
|
||
|
|
}
|
||
|
|
ce := new(errors.CompositeError)
|
||
|
|
if stderrors.As(err, &ce) {
|
||
|
|
return ce.ValidateName("Coverage")
|
||
|
|
}
|
||
|
|
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) contextValidateExecutiveSummary(ctx context.Context, formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if m.ExecutiveSummary != nil {
|
||
|
|
|
||
|
|
if typeutils.IsZero(m.ExecutiveSummary) { // not required
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.ExecutiveSummary.ContextValidate(ctx, formats); err != nil {
|
||
|
|
ve := new(errors.Validation)
|
||
|
|
if stderrors.As(err, &ve) {
|
||
|
|
return ve.ValidateName("ExecutiveSummary")
|
||
|
|
}
|
||
|
|
ce := new(errors.CompositeError)
|
||
|
|
if stderrors.As(err, &ce) {
|
||
|
|
return ce.ValidateName("ExecutiveSummary")
|
||
|
|
}
|
||
|
|
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) contextValidateInput(ctx context.Context, formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if m.Input != nil {
|
||
|
|
|
||
|
|
if err := m.Input.ContextValidate(ctx, formats); err != nil {
|
||
|
|
ve := new(errors.Validation)
|
||
|
|
if stderrors.As(err, &ve) {
|
||
|
|
return ve.ValidateName("Input")
|
||
|
|
}
|
||
|
|
ce := new(errors.CompositeError)
|
||
|
|
if stderrors.As(err, &ce) {
|
||
|
|
return ce.ValidateName("Input")
|
||
|
|
}
|
||
|
|
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) contextValidateNoteworthyObservations(ctx context.Context, formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
for i := 0; i < len(m.NoteworthyObservations); i++ {
|
||
|
|
|
||
|
|
if m.NoteworthyObservations[i] != nil {
|
||
|
|
|
||
|
|
if typeutils.IsZero(m.NoteworthyObservations[i]) { // not required
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.NoteworthyObservations[i].ContextValidate(ctx, formats); err != nil {
|
||
|
|
ve := new(errors.Validation)
|
||
|
|
if stderrors.As(err, &ve) {
|
||
|
|
return ve.ValidateName("NoteworthyObservations" + "." + strconv.Itoa(i))
|
||
|
|
}
|
||
|
|
ce := new(errors.CompositeError)
|
||
|
|
if stderrors.As(err, &ce) {
|
||
|
|
return ce.ValidateName("NoteworthyObservations" + "." + strconv.Itoa(i))
|
||
|
|
}
|
||
|
|
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) contextValidateProducts(ctx context.Context, formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
for i := 0; i < len(m.Products); i++ {
|
||
|
|
|
||
|
|
if m.Products[i] != nil {
|
||
|
|
|
||
|
|
if typeutils.IsZero(m.Products[i]) { // not required
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.Products[i].ContextValidate(ctx, formats); err != nil {
|
||
|
|
ve := new(errors.Validation)
|
||
|
|
if stderrors.As(err, &ve) {
|
||
|
|
return ve.ValidateName("Products" + "." + strconv.Itoa(i))
|
||
|
|
}
|
||
|
|
ce := new(errors.CompositeError)
|
||
|
|
if stderrors.As(err, &ce) {
|
||
|
|
return ce.ValidateName("Products" + "." + strconv.Itoa(i))
|
||
|
|
}
|
||
|
|
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) contextValidateQueries(ctx context.Context, formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
for i := 0; i < len(m.Queries); i++ {
|
||
|
|
|
||
|
|
if m.Queries[i] != nil {
|
||
|
|
|
||
|
|
if typeutils.IsZero(m.Queries[i]) { // not required
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.Queries[i].ContextValidate(ctx, formats); err != nil {
|
||
|
|
ve := new(errors.Validation)
|
||
|
|
if stderrors.As(err, &ve) {
|
||
|
|
return ve.ValidateName("Queries" + "." + strconv.Itoa(i))
|
||
|
|
}
|
||
|
|
ce := new(errors.CompositeError)
|
||
|
|
if stderrors.As(err, &ce) {
|
||
|
|
return ce.ValidateName("Queries" + "." + strconv.Itoa(i))
|
||
|
|
}
|
||
|
|
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioEnrichmentRun) contextValidateServices(ctx context.Context, formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
for i := 0; i < len(m.Services); i++ {
|
||
|
|
|
||
|
|
if m.Services[i] != nil {
|
||
|
|
|
||
|
|
if typeutils.IsZero(m.Services[i]) { // not required
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.Services[i].ContextValidate(ctx, formats); err != nil {
|
||
|
|
ve := new(errors.Validation)
|
||
|
|
if stderrors.As(err, &ve) {
|
||
|
|
return ve.ValidateName("Services" + "." + strconv.Itoa(i))
|
||
|
|
}
|
||
|
|
ce := new(errors.CompositeError)
|
||
|
|
if stderrors.As(err, &ce) {
|
||
|
|
return ce.ValidateName("Services" + "." + strconv.Itoa(i))
|
||
|
|
}
|
||
|
|
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// MarshalBinary interface implementation
|
||
|
|
func (m *PortfolioEnrichmentRun) MarshalBinary() ([]byte, error) {
|
||
|
|
if m == nil {
|
||
|
|
return nil, nil
|
||
|
|
}
|
||
|
|
return jsonutils.WriteJSON(m)
|
||
|
|
}
|
||
|
|
|
||
|
|
// UnmarshalBinary interface implementation
|
||
|
|
func (m *PortfolioEnrichmentRun) UnmarshalBinary(b []byte) error {
|
||
|
|
var res PortfolioEnrichmentRun
|
||
|
|
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
*m = res
|
||
|
|
return nil
|
||
|
|
}
|