lib/api/members/members_models/research_project.go

334 lines
7.7 KiB
Go
Raw Normal View History

2023-03-28 17:47:34 +00:00
// 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 members_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
2023-05-19 23:55:12 +00:00
"strconv"
2023-03-28 17:47:34 +00:00
2023-05-19 23:55:12 +00:00
"github.com/go-openapi/errors"
2023-03-28 17:47:34 +00:00
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// ResearchProject research project
//
2023-05-13 16:46:48 +00:00
// swagger:model researchProject
2023-03-28 17:47:34 +00:00
type ResearchProject struct {
// account ID
2023-04-15 14:27:18 +00:00
AccountID *string `json:"AccountID,omitempty"`
2023-03-28 17:47:34 +00:00
2023-05-19 23:55:12 +00:00
// companies
Companies []*ResearchProjectCompany `json:"Companies"`
2023-03-28 17:47:34 +00:00
// created by ID
2023-04-15 14:27:18 +00:00
CreatedByID *string `json:"CreatedByID,omitempty"`
2023-03-28 17:47:34 +00:00
// created date
CreatedDate *string `json:"CreatedDate,omitempty"`
// description
2023-04-15 14:27:18 +00:00
Description *string `json:"Description,omitempty"`
2023-03-28 17:47:34 +00:00
2023-05-19 23:55:12 +00:00
// documents
Documents []*ResearchProjectDocument `json:"Documents"`
2023-03-28 17:47:34 +00:00
// ID
ID string `json:"ID,omitempty"`
2023-05-13 16:46:48 +00:00
// image alt text
ImageAltText *string `json:"ImageAltText,omitempty"`
// image URL
ImageURL *string `json:"ImageURL,omitempty"`
2023-03-28 17:47:34 +00:00
// last modified by ID
2023-04-15 14:27:18 +00:00
LastModifiedByID *string `json:"LastModifiedByID,omitempty"`
2023-03-28 17:47:34 +00:00
// last modified date
LastModifiedDate *string `json:"LastModifiedDate,omitempty"`
2023-05-13 16:46:48 +00:00
// logo
Logo *string `json:"Logo,omitempty"`
2023-03-28 17:47:34 +00:00
// name
2023-04-15 14:27:18 +00:00
Name *string `json:"Name,omitempty"`
2023-03-28 17:47:34 +00:00
2023-05-19 23:55:12 +00:00
// products
Products []*ResearchProjectProduct `json:"Products"`
2023-05-13 16:46:48 +00:00
// slug
Slug *string `json:"Slug,omitempty"`
2023-03-28 17:47:34 +00:00
// tenant ID
2023-04-15 14:27:18 +00:00
TenantID *string `json:"TenantID,omitempty"`
2023-03-28 17:47:34 +00:00
2023-05-19 23:55:12 +00:00
// topics
Topics []*ResearchProjectTopic `json:"Topics"`
2023-03-28 17:47:34 +00:00
// user ID
2023-04-15 14:27:18 +00:00
UserID *string `json:"UserID,omitempty"`
2023-03-28 17:47:34 +00:00
}
// Validate validates this research project
func (m *ResearchProject) Validate(formats strfmt.Registry) error {
2023-05-19 23:55:12 +00:00
var res []error
if err := m.validateCompanies(formats); err != nil {
res = append(res, err)
}
if err := m.validateDocuments(formats); err != nil {
res = append(res, err)
}
if err := m.validateProducts(formats); err != nil {
res = append(res, err)
}
if err := m.validateTopics(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ResearchProject) validateCompanies(formats strfmt.Registry) error {
if swag.IsZero(m.Companies) { // not required
return nil
}
for i := 0; i < len(m.Companies); i++ {
if swag.IsZero(m.Companies[i]) { // not required
continue
}
if m.Companies[i] != nil {
if err := m.Companies[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Companies" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Companies" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *ResearchProject) validateDocuments(formats strfmt.Registry) error {
if swag.IsZero(m.Documents) { // not required
return nil
}
for i := 0; i < len(m.Documents); i++ {
if swag.IsZero(m.Documents[i]) { // not required
continue
}
if m.Documents[i] != nil {
if err := m.Documents[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Documents" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Documents" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *ResearchProject) validateProducts(formats strfmt.Registry) error {
if swag.IsZero(m.Products) { // not required
return nil
}
for i := 0; i < len(m.Products); i++ {
if swag.IsZero(m.Products[i]) { // not required
continue
}
if m.Products[i] != nil {
if err := m.Products[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Products" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Products" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *ResearchProject) validateTopics(formats strfmt.Registry) error {
if swag.IsZero(m.Topics) { // not required
return nil
}
for i := 0; i < len(m.Topics); i++ {
if swag.IsZero(m.Topics[i]) { // not required
continue
}
if m.Topics[i] != nil {
if err := m.Topics[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Topics" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Topics" + "." + strconv.Itoa(i))
}
return err
}
}
}
2023-03-28 17:47:34 +00:00
return nil
}
2023-05-19 23:55:12 +00:00
// ContextValidate validate this research project based on the context it is used
2023-03-28 17:47:34 +00:00
func (m *ResearchProject) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
2023-05-19 23:55:12 +00:00
var res []error
if err := m.contextValidateCompanies(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateDocuments(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateProducts(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateTopics(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ResearchProject) contextValidateCompanies(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Companies); i++ {
if m.Companies[i] != nil {
if err := m.Companies[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Companies" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Companies" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *ResearchProject) contextValidateDocuments(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Documents); i++ {
if m.Documents[i] != nil {
if err := m.Documents[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Documents" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Documents" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *ResearchProject) contextValidateProducts(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Products); i++ {
if m.Products[i] != nil {
if err := m.Products[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Products" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Products" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *ResearchProject) contextValidateTopics(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Topics); i++ {
if m.Topics[i] != nil {
if err := m.Topics[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Topics" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Topics" + "." + strconv.Itoa(i))
}
return err
}
}
}
2023-03-28 17:47:34 +00:00
return nil
}
// MarshalBinary interface implementation
func (m *ResearchProject) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ResearchProject) UnmarshalBinary(b []byte) error {
var res ResearchProject
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}