mirror of https://github.com/vernonkeenan/lib
461 lines
12 KiB
Go
461 lines
12 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"
|
||
|
|
|
||
|
|
"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"
|
||
|
|
)
|
||
|
|
|
||
|
|
// PortfolioReconciliationReceipt Bounded immutable evidence for one Discovery-mode authoritative create or compare-and-swap update. It exposes only safe attribution identifiers and never credentials, request tokens, provider response IDs, source bodies, or policy reasons.
|
||
|
|
//
|
||
|
|
// swagger:model PortfolioReconciliationReceipt
|
||
|
|
type PortfolioReconciliationReceipt struct {
|
||
|
|
|
||
|
|
// action
|
||
|
|
// Required: true
|
||
|
|
// Enum: ["create","update"]
|
||
|
|
Action *string `json:"Action"`
|
||
|
|
|
||
|
|
// actor user ID
|
||
|
|
// Required: true
|
||
|
|
// Format: uuid
|
||
|
|
ActorUserID *strfmt.UUID `json:"ActorUserID"`
|
||
|
|
|
||
|
|
// candidate ID
|
||
|
|
// Required: true
|
||
|
|
// Format: uuid
|
||
|
|
CandidateID *strfmt.UUID `json:"CandidateID"`
|
||
|
|
|
||
|
|
// client principal ID
|
||
|
|
// Required: true
|
||
|
|
// Format: uuid
|
||
|
|
ClientPrincipalID *strfmt.UUID `json:"ClientPrincipalID"`
|
||
|
|
|
||
|
|
// Stable service-principal label, never a credential value
|
||
|
|
// Required: true
|
||
|
|
// Max Length: 80
|
||
|
|
// Min Length: 1
|
||
|
|
// Pattern: ^[A-Za-z0-9._:-]+$
|
||
|
|
ClientPrincipalKey *string `json:"ClientPrincipalKey"`
|
||
|
|
|
||
|
|
// created date
|
||
|
|
// Required: true
|
||
|
|
// Format: date-time
|
||
|
|
CreatedDate *strfmt.DateTime `json:"CreatedDate"`
|
||
|
|
|
||
|
|
// entity type
|
||
|
|
// Required: true
|
||
|
|
// Enum: ["company_product","company_service"]
|
||
|
|
EntityType *string `json:"EntityType"`
|
||
|
|
|
||
|
|
// ID
|
||
|
|
// Required: true
|
||
|
|
// Format: uuid
|
||
|
|
ID *strfmt.UUID `json:"ID"`
|
||
|
|
|
||
|
|
// mode
|
||
|
|
// Required: true
|
||
|
|
// Enum: ["discovery"]
|
||
|
|
Mode *string `json:"Mode"`
|
||
|
|
|
||
|
|
// policy revision
|
||
|
|
// Required: true
|
||
|
|
// Minimum: 1
|
||
|
|
PolicyRevision *int64 `json:"PolicyRevision"`
|
||
|
|
|
||
|
|
// run ID
|
||
|
|
// Required: true
|
||
|
|
// Format: uuid
|
||
|
|
RunID *strfmt.UUID `json:"RunID"`
|
||
|
|
|
||
|
|
// Exact authoritative version checked before an update; omitted for create
|
||
|
|
// Format: date-time
|
||
|
|
TargetBeforeVersion strfmt.DateTime `json:"TargetBeforeVersion,omitempty"`
|
||
|
|
|
||
|
|
// target ID
|
||
|
|
// Required: true
|
||
|
|
// Format: uuid
|
||
|
|
TargetID *strfmt.UUID `json:"TargetID"`
|
||
|
|
|
||
|
|
// target result version
|
||
|
|
// Required: true
|
||
|
|
// Format: date-time
|
||
|
|
TargetResultVersion *strfmt.DateTime `json:"TargetResultVersion"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// Validate validates this portfolio reconciliation receipt
|
||
|
|
func (m *PortfolioReconciliationReceipt) Validate(formats strfmt.Registry) error {
|
||
|
|
var res []error
|
||
|
|
|
||
|
|
if err := m.validateAction(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateActorUserID(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateCandidateID(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateClientPrincipalID(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateClientPrincipalKey(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateCreatedDate(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateEntityType(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateID(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateMode(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validatePolicyRevision(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateRunID(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateTargetBeforeVersion(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateTargetID(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateTargetResultVersion(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if len(res) > 0 {
|
||
|
|
return errors.CompositeValidationError(res...)
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
var portfolioReconciliationReceiptTypeActionPropEnum []any
|
||
|
|
|
||
|
|
func init() {
|
||
|
|
var res []string
|
||
|
|
if err := json.Unmarshal([]byte(`["create","update"]`), &res); err != nil {
|
||
|
|
panic(err)
|
||
|
|
}
|
||
|
|
for _, v := range res {
|
||
|
|
portfolioReconciliationReceiptTypeActionPropEnum = append(portfolioReconciliationReceiptTypeActionPropEnum, v)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
const (
|
||
|
|
|
||
|
|
// PortfolioReconciliationReceiptActionCreate captures enum value "create"
|
||
|
|
PortfolioReconciliationReceiptActionCreate string = "create"
|
||
|
|
|
||
|
|
// PortfolioReconciliationReceiptActionUpdate captures enum value "update"
|
||
|
|
PortfolioReconciliationReceiptActionUpdate string = "update"
|
||
|
|
)
|
||
|
|
|
||
|
|
// prop value enum
|
||
|
|
func (m *PortfolioReconciliationReceipt) validateActionEnum(path, location string, value string) error {
|
||
|
|
if err := validate.EnumCase(path, location, value, portfolioReconciliationReceiptTypeActionPropEnum, true); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioReconciliationReceipt) validateAction(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("Action", "body", m.Action); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
// value enum
|
||
|
|
if err := m.validateActionEnum("Action", "body", *m.Action); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioReconciliationReceipt) validateActorUserID(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("ActorUserID", "body", m.ActorUserID); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.FormatOf("ActorUserID", "body", "uuid", m.ActorUserID.String(), formats); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioReconciliationReceipt) validateCandidateID(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("CandidateID", "body", m.CandidateID); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.FormatOf("CandidateID", "body", "uuid", m.CandidateID.String(), formats); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioReconciliationReceipt) validateClientPrincipalID(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("ClientPrincipalID", "body", m.ClientPrincipalID); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.FormatOf("ClientPrincipalID", "body", "uuid", m.ClientPrincipalID.String(), formats); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioReconciliationReceipt) validateClientPrincipalKey(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("ClientPrincipalKey", "body", m.ClientPrincipalKey); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.MinLength("ClientPrincipalKey", "body", *m.ClientPrincipalKey, 1); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.MaxLength("ClientPrincipalKey", "body", *m.ClientPrincipalKey, 80); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.Pattern("ClientPrincipalKey", "body", *m.ClientPrincipalKey, `^[A-Za-z0-9._:-]+$`); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioReconciliationReceipt) 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 portfolioReconciliationReceiptTypeEntityTypePropEnum []any
|
||
|
|
|
||
|
|
func init() {
|
||
|
|
var res []string
|
||
|
|
if err := json.Unmarshal([]byte(`["company_product","company_service"]`), &res); err != nil {
|
||
|
|
panic(err)
|
||
|
|
}
|
||
|
|
for _, v := range res {
|
||
|
|
portfolioReconciliationReceiptTypeEntityTypePropEnum = append(portfolioReconciliationReceiptTypeEntityTypePropEnum, v)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
const (
|
||
|
|
|
||
|
|
// PortfolioReconciliationReceiptEntityTypeCompanyProduct captures enum value "company_product"
|
||
|
|
PortfolioReconciliationReceiptEntityTypeCompanyProduct string = "company_product"
|
||
|
|
|
||
|
|
// PortfolioReconciliationReceiptEntityTypeCompanyService captures enum value "company_service"
|
||
|
|
PortfolioReconciliationReceiptEntityTypeCompanyService string = "company_service"
|
||
|
|
)
|
||
|
|
|
||
|
|
// prop value enum
|
||
|
|
func (m *PortfolioReconciliationReceipt) validateEntityTypeEnum(path, location string, value string) error {
|
||
|
|
if err := validate.EnumCase(path, location, value, portfolioReconciliationReceiptTypeEntityTypePropEnum, true); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioReconciliationReceipt) validateEntityType(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("EntityType", "body", m.EntityType); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
// value enum
|
||
|
|
if err := m.validateEntityTypeEnum("EntityType", "body", *m.EntityType); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioReconciliationReceipt) 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 portfolioReconciliationReceiptTypeModePropEnum []any
|
||
|
|
|
||
|
|
func init() {
|
||
|
|
var res []string
|
||
|
|
if err := json.Unmarshal([]byte(`["discovery"]`), &res); err != nil {
|
||
|
|
panic(err)
|
||
|
|
}
|
||
|
|
for _, v := range res {
|
||
|
|
portfolioReconciliationReceiptTypeModePropEnum = append(portfolioReconciliationReceiptTypeModePropEnum, v)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
const (
|
||
|
|
|
||
|
|
// PortfolioReconciliationReceiptModeDiscovery captures enum value "discovery"
|
||
|
|
PortfolioReconciliationReceiptModeDiscovery string = "discovery"
|
||
|
|
)
|
||
|
|
|
||
|
|
// prop value enum
|
||
|
|
func (m *PortfolioReconciliationReceipt) validateModeEnum(path, location string, value string) error {
|
||
|
|
if err := validate.EnumCase(path, location, value, portfolioReconciliationReceiptTypeModePropEnum, true); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioReconciliationReceipt) validateMode(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("Mode", "body", m.Mode); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
// value enum
|
||
|
|
if err := m.validateModeEnum("Mode", "body", *m.Mode); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioReconciliationReceipt) validatePolicyRevision(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("PolicyRevision", "body", m.PolicyRevision); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.MinimumInt("PolicyRevision", "body", *m.PolicyRevision, 1, false); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioReconciliationReceipt) validateRunID(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("RunID", "body", m.RunID); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.FormatOf("RunID", "body", "uuid", m.RunID.String(), formats); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioReconciliationReceipt) validateTargetBeforeVersion(formats strfmt.Registry) error {
|
||
|
|
if typeutils.IsZero(m.TargetBeforeVersion) { // not required
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.FormatOf("TargetBeforeVersion", "body", "date-time", m.TargetBeforeVersion.String(), formats); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioReconciliationReceipt) validateTargetID(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("TargetID", "body", m.TargetID); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.FormatOf("TargetID", "body", "uuid", m.TargetID.String(), formats); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *PortfolioReconciliationReceipt) validateTargetResultVersion(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("TargetResultVersion", "body", m.TargetResultVersion); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.FormatOf("TargetResultVersion", "body", "date-time", m.TargetResultVersion.String(), formats); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// ContextValidate validates this portfolio reconciliation receipt based on context it is used
|
||
|
|
func (m *PortfolioReconciliationReceipt) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// MarshalBinary interface implementation
|
||
|
|
func (m *PortfolioReconciliationReceipt) MarshalBinary() ([]byte, error) {
|
||
|
|
if m == nil {
|
||
|
|
return nil, nil
|
||
|
|
}
|
||
|
|
return jsonutils.WriteJSON(m)
|
||
|
|
}
|
||
|
|
|
||
|
|
// UnmarshalBinary interface implementation
|
||
|
|
func (m *PortfolioReconciliationReceipt) UnmarshalBinary(b []byte) error {
|
||
|
|
var res PortfolioReconciliationReceipt
|
||
|
|
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
*m = res
|
||
|
|
return nil
|
||
|
|
}
|