mirror of https://github.com/vernonkeenan/lib
163 lines
4.1 KiB
Go
163 lines
4.1 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/validate"
|
|
)
|
|
|
|
// PortfolioEnrichmentInputFact One bounded Account input supplied by an authoritative Account snapshot or an operator fact sheet
|
|
//
|
|
// swagger:model PortfolioEnrichmentInputFact
|
|
type PortfolioEnrichmentInputFact struct {
|
|
|
|
// name
|
|
// Required: true
|
|
// Max Length: 120
|
|
// Pattern: ^[a-z][a-z0-9_]{0,119}$
|
|
Name *string `json:"Name"`
|
|
|
|
// source type
|
|
// Required: true
|
|
// Enum: ["authoritative_account","operator_fact_sheet"]
|
|
SourceType *string `json:"SourceType"`
|
|
|
|
// value
|
|
// Required: true
|
|
// Max Length: 20000
|
|
// Min Length: 1
|
|
Value *string `json:"Value"`
|
|
}
|
|
|
|
// Validate validates this portfolio enrichment input fact
|
|
func (m *PortfolioEnrichmentInputFact) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := m.validateName(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateSourceType(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateValue(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *PortfolioEnrichmentInputFact) validateName(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("Name", "body", m.Name); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := validate.MaxLength("Name", "body", *m.Name, 120); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := validate.Pattern("Name", "body", *m.Name, `^[a-z][a-z0-9_]{0,119}$`); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
var portfolioEnrichmentInputFactTypeSourceTypePropEnum []any
|
|
|
|
func init() {
|
|
var res []string
|
|
if err := json.Unmarshal([]byte(`["authoritative_account","operator_fact_sheet"]`), &res); err != nil {
|
|
panic(err)
|
|
}
|
|
for _, v := range res {
|
|
portfolioEnrichmentInputFactTypeSourceTypePropEnum = append(portfolioEnrichmentInputFactTypeSourceTypePropEnum, v)
|
|
}
|
|
}
|
|
|
|
const (
|
|
|
|
// PortfolioEnrichmentInputFactSourceTypeAuthoritativeAccount captures enum value "authoritative_account"
|
|
PortfolioEnrichmentInputFactSourceTypeAuthoritativeAccount string = "authoritative_account"
|
|
|
|
// PortfolioEnrichmentInputFactSourceTypeOperatorFactSheet captures enum value "operator_fact_sheet"
|
|
PortfolioEnrichmentInputFactSourceTypeOperatorFactSheet string = "operator_fact_sheet"
|
|
)
|
|
|
|
// prop value enum
|
|
func (m *PortfolioEnrichmentInputFact) validateSourceTypeEnum(path, location string, value string) error {
|
|
if err := validate.EnumCase(path, location, value, portfolioEnrichmentInputFactTypeSourceTypePropEnum, true); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *PortfolioEnrichmentInputFact) validateSourceType(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("SourceType", "body", m.SourceType); err != nil {
|
|
return err
|
|
}
|
|
|
|
// value enum
|
|
if err := m.validateSourceTypeEnum("SourceType", "body", *m.SourceType); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *PortfolioEnrichmentInputFact) validateValue(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("Value", "body", m.Value); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := validate.MinLength("Value", "body", *m.Value, 1); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := validate.MaxLength("Value", "body", *m.Value, 20000); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// ContextValidate validates this portfolio enrichment input fact based on context it is used
|
|
func (m *PortfolioEnrichmentInputFact) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (m *PortfolioEnrichmentInputFact) MarshalBinary() ([]byte, error) {
|
|
if m == nil {
|
|
return nil, nil
|
|
}
|
|
return jsonutils.WriteJSON(m)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (m *PortfolioEnrichmentInputFact) UnmarshalBinary(b []byte) error {
|
|
var res PortfolioEnrichmentInputFact
|
|
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*m = res
|
|
return nil
|
|
}
|