lib/api/sfgate/sfgate_models/industry.go

175 lines
4.2 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 sfgate_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-03-28 17:47:34 +00:00
"strconv"
2022-09-05 00:01:32 +00:00
2023-03-28 17:47:34 +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"
)
// Industry An industry that is being researched
//
// swagger:model Industry
type Industry struct {
2023-03-28 17:47:34 +00:00
// The AccountIDs of the Companies in this Industry
Companies []string `json:"Companies"`
// The list of Products in this industry
CompanyProducts []*CompanyProduct `json:"CompanyProducts"`
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
// Industry Description
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
// 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
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
// The hierarchical level of this Industry
2023-04-15 14:27:18 +00:00
Level *string `json:"Level,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
// Industry Name
2023-04-15 14:27:18 +00:00
Name *string `json:"Name,omitempty"`
2022-09-05 00:01:32 +00:00
// The ID of the Parent Industry
2023-04-15 14:27:18 +00:00
ParentIndustryID *string `json:"ParentIndustryID,omitempty"`
2022-09-05 00:01:32 +00:00
// The full path of this industry, including Parent
2023-04-15 14:27:18 +00:00
Path *string `json:"Path,omitempty"`
2022-09-05 00:01:32 +00:00
2023-04-08 03:04:13 +00:00
// Is this industry a Product Category?
2023-04-15 14:27:18 +00:00
ProductCategory *bool `json:"ProductCategory,omitempty"`
2023-04-08 03:04:13 +00:00
2022-09-05 00:01:32 +00:00
// The URL of the corresponding page on the CMS
2023-04-15 14:27:18 +00:00
SiteURL *string `json:"SiteURL,omitempty"`
2022-09-05 00:01:32 +00:00
// The CMS Slug for this Industry
2023-04-15 14:27:18 +00:00
Slug *string `json:"Slug,omitempty"`
2023-03-28 17:47:34 +00:00
// TagLine
2023-04-15 14:27:18 +00:00
TagLine *string `json:"TagLine,omitempty"`
2022-09-05 00:01:32 +00:00
}
// Validate validates this industry
func (m *Industry) Validate(formats strfmt.Registry) error {
2023-03-28 17:47:34 +00:00
var res []error
if err := m.validateCompanyProducts(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Industry) validateCompanyProducts(formats strfmt.Registry) error {
if swag.IsZero(m.CompanyProducts) { // not required
return nil
}
for i := 0; i < len(m.CompanyProducts); i++ {
if swag.IsZero(m.CompanyProducts[i]) { // not required
continue
}
if m.CompanyProducts[i] != nil {
if err := m.CompanyProducts[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("CompanyProducts" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("CompanyProducts" + "." + strconv.Itoa(i))
}
return err
}
}
}
2022-09-05 00:01:32 +00:00
return nil
}
2023-03-28 17:47:34 +00:00
// ContextValidate validate this industry based on the context it is used
2022-09-05 00:01:32 +00:00
func (m *Industry) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
2023-03-28 17:47:34 +00:00
var res []error
if err := m.contextValidateCompanyProducts(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Industry) contextValidateCompanyProducts(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.CompanyProducts); i++ {
if m.CompanyProducts[i] != nil {
if err := m.CompanyProducts[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("CompanyProducts" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("CompanyProducts" + "." + strconv.Itoa(i))
}
return err
}
}
}
2022-09-05 00:01:32 +00:00
return nil
}
// MarshalBinary interface implementation
func (m *Industry) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Industry) UnmarshalBinary(b []byte) error {
var res Industry
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}