mirror of https://github.com/vernonkeenan/lib
183 lines
4.7 KiB
Go
183 lines
4.7 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"
|
|
)
|
|
|
|
// EnrichmentRunRequest Browser-independent request for one governed Account, shared-catalog Company Product, or tenant-owned Company Service research profile; prompts, provider, model, and field allowlists remain server-owned
|
|
//
|
|
// swagger:model EnrichmentRunRequest
|
|
type EnrichmentRunRequest struct {
|
|
|
|
// base version
|
|
// Required: true
|
|
// Format: date-time
|
|
BaseVersion *strfmt.DateTime `json:"BaseVersion"`
|
|
|
|
// idempotency key
|
|
// Required: true
|
|
// Max Length: 120
|
|
// Min Length: 1
|
|
IdempotencyKey *string `json:"IdempotencyKey"`
|
|
|
|
// subject ID
|
|
// Required: true
|
|
// Format: uuid
|
|
SubjectID *strfmt.UUID `json:"SubjectID"`
|
|
|
|
// subject type
|
|
// Required: true
|
|
// Enum: ["account","company_product","company_service"]
|
|
SubjectType *string `json:"SubjectType"`
|
|
}
|
|
|
|
// Validate validates this enrichment run request
|
|
func (m *EnrichmentRunRequest) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := m.validateBaseVersion(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateIdempotencyKey(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateSubjectID(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateSubjectType(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *EnrichmentRunRequest) validateBaseVersion(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("BaseVersion", "body", m.BaseVersion); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := validate.FormatOf("BaseVersion", "body", "date-time", m.BaseVersion.String(), formats); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *EnrichmentRunRequest) 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, 1); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := validate.MaxLength("IdempotencyKey", "body", *m.IdempotencyKey, 120); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *EnrichmentRunRequest) validateSubjectID(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("SubjectID", "body", m.SubjectID); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := validate.FormatOf("SubjectID", "body", "uuid", m.SubjectID.String(), formats); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
var enrichmentRunRequestTypeSubjectTypePropEnum []any
|
|
|
|
func init() {
|
|
var res []string
|
|
if err := json.Unmarshal([]byte(`["account","company_product","company_service"]`), &res); err != nil {
|
|
panic(err)
|
|
}
|
|
for _, v := range res {
|
|
enrichmentRunRequestTypeSubjectTypePropEnum = append(enrichmentRunRequestTypeSubjectTypePropEnum, v)
|
|
}
|
|
}
|
|
|
|
const (
|
|
|
|
// EnrichmentRunRequestSubjectTypeAccount captures enum value "account"
|
|
EnrichmentRunRequestSubjectTypeAccount string = "account"
|
|
|
|
// EnrichmentRunRequestSubjectTypeCompanyProduct captures enum value "company_product"
|
|
EnrichmentRunRequestSubjectTypeCompanyProduct string = "company_product"
|
|
|
|
// EnrichmentRunRequestSubjectTypeCompanyService captures enum value "company_service"
|
|
EnrichmentRunRequestSubjectTypeCompanyService string = "company_service"
|
|
)
|
|
|
|
// prop value enum
|
|
func (m *EnrichmentRunRequest) validateSubjectTypeEnum(path, location string, value string) error {
|
|
if err := validate.EnumCase(path, location, value, enrichmentRunRequestTypeSubjectTypePropEnum, true); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *EnrichmentRunRequest) validateSubjectType(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("SubjectType", "body", m.SubjectType); err != nil {
|
|
return err
|
|
}
|
|
|
|
// value enum
|
|
if err := m.validateSubjectTypeEnum("SubjectType", "body", *m.SubjectType); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// ContextValidate validates this enrichment run request based on context it is used
|
|
func (m *EnrichmentRunRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (m *EnrichmentRunRequest) MarshalBinary() ([]byte, error) {
|
|
if m == nil {
|
|
return nil, nil
|
|
}
|
|
return jsonutils.WriteJSON(m)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (m *EnrichmentRunRequest) UnmarshalBinary(b []byte) error {
|
|
var res EnrichmentRunRequest
|
|
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*m = res
|
|
return nil
|
|
}
|