mirror of https://github.com/vernonkeenan/lib
198 lines
5.0 KiB
Go
198 lines
5.0 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"
|
|
stderrors "errors"
|
|
|
|
"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"
|
|
)
|
|
|
|
// PortfolioEnrichmentRunRequest Minimal browser-independent request for one Account portfolio research run with optional bounded portfolio_operator_facts.v1 discovery context; Research resolves the authoritative input snapshot and owns the fact digest, fact source, provider, model, prompt, tenant, actor, lifecycle, matching, action, and save-path fields
|
|
//
|
|
// swagger:model PortfolioEnrichmentRunRequest
|
|
type PortfolioEnrichmentRunRequest struct {
|
|
|
|
// account base version
|
|
// Required: true
|
|
// Format: date-time
|
|
AccountBaseVersion *strfmt.DateTime `json:"AccountBaseVersion"`
|
|
|
|
// account ID
|
|
// Required: true
|
|
// Format: uuid
|
|
AccountID *strfmt.UUID `json:"AccountID"`
|
|
|
|
// idempotency key
|
|
// Required: true
|
|
// Max Length: 120
|
|
// Min Length: 16
|
|
// Pattern: ^[A-Za-z0-9_-]+$
|
|
IdempotencyKey *string `json:"IdempotencyKey"`
|
|
|
|
// operator facts
|
|
OperatorFacts *PortfolioOperatorFacts `json:"OperatorFacts,omitempty"`
|
|
}
|
|
|
|
// Validate validates this portfolio enrichment run request
|
|
func (m *PortfolioEnrichmentRunRequest) 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.validateIdempotencyKey(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateOperatorFacts(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *PortfolioEnrichmentRunRequest) 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 *PortfolioEnrichmentRunRequest) validateAccountID(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("AccountID", "body", m.AccountID); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := validate.FormatOf("AccountID", "body", "uuid", m.AccountID.String(), formats); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *PortfolioEnrichmentRunRequest) validateIdempotencyKey(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("IdempotencyKey", "body", m.IdempotencyKey); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := validate.MinLength("IdempotencyKey", "body", *m.IdempotencyKey, 16); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := validate.MaxLength("IdempotencyKey", "body", *m.IdempotencyKey, 120); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := validate.Pattern("IdempotencyKey", "body", *m.IdempotencyKey, `^[A-Za-z0-9_-]+$`); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *PortfolioEnrichmentRunRequest) validateOperatorFacts(formats strfmt.Registry) error {
|
|
if typeutils.IsZero(m.OperatorFacts) { // not required
|
|
return nil
|
|
}
|
|
|
|
if m.OperatorFacts != nil {
|
|
if err := m.OperatorFacts.Validate(formats); err != nil {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("OperatorFacts")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
return ce.ValidateName("OperatorFacts")
|
|
}
|
|
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// ContextValidate validate this portfolio enrichment run request based on the context it is used
|
|
func (m *PortfolioEnrichmentRunRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := m.contextValidateOperatorFacts(ctx, formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *PortfolioEnrichmentRunRequest) contextValidateOperatorFacts(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
if m.OperatorFacts != nil {
|
|
|
|
if typeutils.IsZero(m.OperatorFacts) { // not required
|
|
return nil
|
|
}
|
|
|
|
if err := m.OperatorFacts.ContextValidate(ctx, formats); err != nil {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("OperatorFacts")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
return ce.ValidateName("OperatorFacts")
|
|
}
|
|
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (m *PortfolioEnrichmentRunRequest) MarshalBinary() ([]byte, error) {
|
|
if m == nil {
|
|
return nil, nil
|
|
}
|
|
return jsonutils.WriteJSON(m)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (m *PortfolioEnrichmentRunRequest) UnmarshalBinary(b []byte) error {
|
|
var res PortfolioEnrichmentRunRequest
|
|
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*m = res
|
|
return nil
|
|
}
|