lib/api/research/research_models/company_product.go

178 lines
4.1 KiB
Go
Raw Normal View History

2022-09-05 00:01:32 +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 research_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-04-06 01:28:58 +00:00
"strconv"
2022-09-05 00:01:32 +00:00
"github.com/go-openapi/errors"
2022-09-05 00:01:32 +00:00
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// CompanyProduct A software product or service vended by a Company
//
// swagger:model CompanyProduct
type CompanyProduct struct {
2023-03-28 17:47:34 +00:00
// ID of the Company that owns this Product
2023-04-15 14:27:18 +00:00
AccountID *string `json:"AccountID,omitempty"`
2022-09-05 00:01:32 +00:00
2023-05-28 16:22:37 +00:00
// Salesforce AppExchange URL
AppExchange *string `json:"AppExchange,omitempty"`
2022-09-05 00:01:32 +00:00
// Created By User ID
2023-04-15 14:27:18 +00:00
CreatedByID *string `json:"CreatedByID,omitempty"`
2022-09-05 00:01:32 +00:00
// Created Date
2023-04-15 14:27:18 +00:00
CreatedDate *string `json:"CreatedDate,omitempty"`
2022-09-05 00:01:32 +00:00
// Description of product
2023-04-15 14:27:18 +00:00
Description *string `json:"Description,omitempty"`
2022-09-05 00:01:32 +00:00
2023-03-28 17:47:34 +00:00
// Full Description of product
2023-04-15 14:27:18 +00:00
FullDescription *string `json:"FullDescription,omitempty"`
2023-03-28 17:47:34 +00:00
// Record Id
2022-09-05 00:01:32 +00:00
ID string `json:"ID,omitempty"`
// Image Alt Text
2023-04-15 14:27:18 +00:00
ImageAltText *string `json:"ImageAltText,omitempty"`
2023-03-28 17:47:34 +00:00
// Image URL
2023-04-15 14:27:18 +00:00
ImageURL *string `json:"ImageURL,omitempty"`
2023-03-28 17:47:34 +00:00
2023-04-06 01:28:58 +00:00
// Industries
Industries []*Industry `json:"Industries"`
2023-03-28 17:47:34 +00:00
2022-09-05 00:01:32 +00:00
// Last Modified By User ID
2023-04-15 14:27:18 +00:00
LastModifiedByID *string `json:"LastModifiedByID,omitempty"`
2022-09-05 00:01:32 +00:00
// Last Modified Date
2023-04-15 14:27:18 +00:00
LastModifiedDate *string `json:"LastModifiedDate,omitempty"`
2022-09-05 00:01:32 +00:00
2023-03-28 17:47:34 +00:00
// Logo
2023-04-15 14:27:18 +00:00
Logo *string `json:"Logo,omitempty"`
2023-03-28 17:47:34 +00:00
2022-09-05 00:01:32 +00:00
// Product Name
2023-04-15 14:27:18 +00:00
Name *string `json:"Name,omitempty"`
2022-09-05 00:01:32 +00:00
// Product Video ID
2023-04-15 14:27:18 +00:00
ProductVideoID *string `json:"ProductVideoID,omitempty"`
2023-03-28 17:47:34 +00:00
// Published
2023-04-15 14:27:18 +00:00
Published *bool `json:"Published,omitempty"`
2023-03-28 17:47:34 +00:00
// Salesforce Specific
2023-04-15 14:27:18 +00:00
SalesforceSpecific *bool `json:"SalesforceSpecific,omitempty"`
2023-03-28 17:47:34 +00:00
// Slug
2023-04-15 14:27:18 +00:00
Slug *string `json:"Slug,omitempty"`
2023-03-28 17:47:34 +00:00
2022-09-05 00:01:32 +00:00
// TagLine
2023-04-15 14:27:18 +00:00
TagLine *string `json:"TagLine,omitempty"`
2022-09-05 00:01:32 +00:00
// Website
2023-04-15 14:27:18 +00:00
URL *string `json:"URL,omitempty"`
2022-09-05 00:01:32 +00:00
}
// Validate validates this company product
func (m *CompanyProduct) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateIndustries(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CompanyProduct) validateIndustries(formats strfmt.Registry) error {
if swag.IsZero(m.Industries) { // not required
return nil
}
2023-04-06 01:28:58 +00:00
for i := 0; i < len(m.Industries); i++ {
if swag.IsZero(m.Industries[i]) { // not required
continue
}
if m.Industries[i] != nil {
if err := m.Industries[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Industries" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Industries" + "." + strconv.Itoa(i))
}
return err
}
}
2023-04-06 01:28:58 +00:00
}
2022-09-05 00:01:32 +00:00
return nil
}
// ContextValidate validate this company product based on the context it is used
2022-09-05 00:01:32 +00:00
func (m *CompanyProduct) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateIndustries(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CompanyProduct) contextValidateIndustries(ctx context.Context, formats strfmt.Registry) error {
2023-04-06 01:28:58 +00:00
for i := 0; i < len(m.Industries); i++ {
if m.Industries[i] != nil {
if err := m.Industries[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Industries" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Industries" + "." + strconv.Itoa(i))
}
return err
}
}
2023-04-06 01:28:58 +00:00
}
2022-09-05 00:01:32 +00:00
return nil
}
// MarshalBinary interface implementation
func (m *CompanyProduct) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *CompanyProduct) UnmarshalBinary(b []byte) error {
var res CompanyProduct
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}