mirror of https://github.com/vernonkeenan/lib
213 lines
5.9 KiB
Go
213 lines
5.9 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"
|
|
"strconv"
|
|
|
|
"github.com/go-openapi/errors"
|
|
"github.com/go-openapi/strfmt"
|
|
"github.com/go-openapi/swag/jsonutils"
|
|
"github.com/go-openapi/validate"
|
|
)
|
|
|
|
// PortfolioEnrichmentQueryEvidence One bounded public-web search fact used to derive coverage; the adapter verifies QueryText against the provider web-search trace
|
|
//
|
|
// swagger:model PortfolioEnrichmentQueryEvidence
|
|
type PortfolioEnrichmentQueryEvidence struct {
|
|
|
|
// ID
|
|
// Required: true
|
|
// Format: uuid
|
|
ID *strfmt.UUID `json:"ID"`
|
|
|
|
// purpose
|
|
// Required: true
|
|
// Enum: ["portfolio_overview","product_catalog","service_catalog","launches_changes","retirements_staleness","classification"]
|
|
Purpose *string `json:"Purpose"`
|
|
|
|
// query text
|
|
// Required: true
|
|
// Max Length: 512
|
|
// Min Length: 1
|
|
QueryText *string `json:"QueryText"`
|
|
|
|
// source IDs
|
|
// Required: true
|
|
// Max Items: 50
|
|
// Min Items: 1
|
|
// Unique: true
|
|
SourceIDs []strfmt.UUID `json:"SourceIDs"`
|
|
}
|
|
|
|
// Validate validates this portfolio enrichment query evidence
|
|
func (m *PortfolioEnrichmentQueryEvidence) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := m.validateID(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validatePurpose(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateQueryText(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateSourceIDs(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *PortfolioEnrichmentQueryEvidence) 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
|
|
}
|
|
|
|
var portfolioEnrichmentQueryEvidenceTypePurposePropEnum []any
|
|
|
|
func init() {
|
|
var res []string
|
|
if err := json.Unmarshal([]byte(`["portfolio_overview","product_catalog","service_catalog","launches_changes","retirements_staleness","classification"]`), &res); err != nil {
|
|
panic(err)
|
|
}
|
|
for _, v := range res {
|
|
portfolioEnrichmentQueryEvidenceTypePurposePropEnum = append(portfolioEnrichmentQueryEvidenceTypePurposePropEnum, v)
|
|
}
|
|
}
|
|
|
|
const (
|
|
|
|
// PortfolioEnrichmentQueryEvidencePurposePortfolioOverview captures enum value "portfolio_overview"
|
|
PortfolioEnrichmentQueryEvidencePurposePortfolioOverview string = "portfolio_overview"
|
|
|
|
// PortfolioEnrichmentQueryEvidencePurposeProductCatalog captures enum value "product_catalog"
|
|
PortfolioEnrichmentQueryEvidencePurposeProductCatalog string = "product_catalog"
|
|
|
|
// PortfolioEnrichmentQueryEvidencePurposeServiceCatalog captures enum value "service_catalog"
|
|
PortfolioEnrichmentQueryEvidencePurposeServiceCatalog string = "service_catalog"
|
|
|
|
// PortfolioEnrichmentQueryEvidencePurposeLaunchesChanges captures enum value "launches_changes"
|
|
PortfolioEnrichmentQueryEvidencePurposeLaunchesChanges string = "launches_changes"
|
|
|
|
// PortfolioEnrichmentQueryEvidencePurposeRetirementsStaleness captures enum value "retirements_staleness"
|
|
PortfolioEnrichmentQueryEvidencePurposeRetirementsStaleness string = "retirements_staleness"
|
|
|
|
// PortfolioEnrichmentQueryEvidencePurposeClassification captures enum value "classification"
|
|
PortfolioEnrichmentQueryEvidencePurposeClassification string = "classification"
|
|
)
|
|
|
|
// prop value enum
|
|
func (m *PortfolioEnrichmentQueryEvidence) validatePurposeEnum(path, location string, value string) error {
|
|
if err := validate.EnumCase(path, location, value, portfolioEnrichmentQueryEvidenceTypePurposePropEnum, true); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *PortfolioEnrichmentQueryEvidence) validatePurpose(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("Purpose", "body", m.Purpose); err != nil {
|
|
return err
|
|
}
|
|
|
|
// value enum
|
|
if err := m.validatePurposeEnum("Purpose", "body", *m.Purpose); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *PortfolioEnrichmentQueryEvidence) validateQueryText(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("QueryText", "body", m.QueryText); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := validate.MinLength("QueryText", "body", *m.QueryText, 1); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := validate.MaxLength("QueryText", "body", *m.QueryText, 512); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *PortfolioEnrichmentQueryEvidence) validateSourceIDs(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("SourceIDs", "body", m.SourceIDs); err != nil {
|
|
return err
|
|
}
|
|
|
|
iSourceIDsSize := int64(len(m.SourceIDs))
|
|
|
|
if err := validate.MinItems("SourceIDs", "body", iSourceIDsSize, 1); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := validate.MaxItems("SourceIDs", "body", iSourceIDsSize, 50); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := validate.UniqueItems("SourceIDs", "body", m.SourceIDs); err != nil {
|
|
return err
|
|
}
|
|
|
|
for i := 0; i < len(m.SourceIDs); i++ {
|
|
|
|
if err := validate.FormatOf("SourceIDs"+"."+strconv.Itoa(i), "body", "uuid", m.SourceIDs[i].String(), formats); err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// ContextValidate validates this portfolio enrichment query evidence based on context it is used
|
|
func (m *PortfolioEnrichmentQueryEvidence) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (m *PortfolioEnrichmentQueryEvidence) MarshalBinary() ([]byte, error) {
|
|
if m == nil {
|
|
return nil, nil
|
|
}
|
|
return jsonutils.WriteJSON(m)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (m *PortfolioEnrichmentQueryEvidence) UnmarshalBinary(b []byte) error {
|
|
var res PortfolioEnrichmentQueryEvidence
|
|
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*m = res
|
|
return nil
|
|
}
|