lib/api/research/research_models/company_product.go

253 lines
5.9 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
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"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 {
// ID of the Company that owns this Product
AccountID string `json:"AccountID,omitempty"`
// Created By User ID
CreatedByID string `json:"CreatedByID,omitempty"`
// Created Date
CreatedDate string `json:"CreatedDate,omitempty"`
// Description of product
Description string `json:"Description,omitempty"`
// Full Description of product
FullDescription string `json:"FullDescription,omitempty"`
// Record Id
ID string `json:"ID,omitempty"`
// Image Alt Text
ImageAltText string `json:"ImageAltText,omitempty"`
// Image URL
ImageURL string `json:"ImageURL,omitempty"`
// industries
Industries *CompanyProductIndustries `json:"Industries,omitempty"`
// Last Modified By User ID
LastModifiedByID string `json:"LastModifiedByID,omitempty"`
// Last Modified Date
LastModifiedDate string `json:"LastModifiedDate,omitempty"`
// Logo
Logo string `json:"Logo,omitempty"`
// Product Name
Name string `json:"Name,omitempty"`
// Product Video ID
ProductVideoID string `json:"ProductVideoID,omitempty"`
// Published
Published bool `json:"Published,omitempty"`
// Salesforce Specific
SalesforceSpecific bool `json:"SalesforceSpecific,omitempty"`
// Slug
Slug string `json:"Slug,omitempty"`
// TagLine
TagLine string `json:"TagLine,omitempty"`
// Website
URL string `json:"URL,omitempty"`
}
// 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
}
if m.Industries != nil {
if err := m.Industries.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Industries")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Industries")
}
return err
}
}
return nil
}
// ContextValidate validate this company product based on the context it is used
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 {
if m.Industries != nil {
if err := m.Industries.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Industries")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Industries")
}
return err
}
}
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
}
// CompanyProductIndustries Industries
//
// swagger:model CompanyProductIndustries
type CompanyProductIndustries struct {
// items
Items *Industry `json:"items,omitempty"`
}
// Validate validates this company product industries
func (m *CompanyProductIndustries) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateItems(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CompanyProductIndustries) validateItems(formats strfmt.Registry) error {
if swag.IsZero(m.Items) { // not required
return nil
}
if m.Items != nil {
if err := m.Items.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Industries" + "." + "items")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Industries" + "." + "items")
}
return err
}
}
return nil
}
// ContextValidate validate this company product industries based on the context it is used
func (m *CompanyProductIndustries) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateItems(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CompanyProductIndustries) contextValidateItems(ctx context.Context, formats strfmt.Registry) error {
if m.Items != nil {
if err := m.Items.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Industries" + "." + "items")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Industries" + "." + "items")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *CompanyProductIndustries) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *CompanyProductIndustries) UnmarshalBinary(b []byte) error {
var res CompanyProductIndustries
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}