lib/api/research/research_models/company_service.go

251 lines
5.8 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// 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"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// CompanyService A service performed by a Company
//
// swagger:model companyService
type CompanyService struct {
// Account Email
AccountEmail *string `json:"AccountEmail,omitempty"`
// ID of the Company that owns this Service
AccountID string `json:"AccountID,omitempty"`
// Account Logo
AccountLogo *string `json:"AccountLogo,omitempty"`
// Account Name
AccountName *string `json:"AccountName,omitempty"`
// Account Number
AccountNumber *string `json:"AccountNumber,omitempty"`
// Account Publish
AccountPublish *bool `json:"AccountPublish,omitempty"`
// Account Slug
AccountSlug *string `json:"AccountSlug,omitempty"`
// Account Website
AccountWebsite *string `json:"AccountWebsite,omitempty"`
// Salesforce AppExchange URL
AppExchange *string `json:"AppExchange,omitempty"`
// The channels associated with the track (Multiselect Picklist).
Channels *string `json:"Channels,omitempty"`
// Created By User ID
CreatedByID *string `json:"CreatedByID,omitempty"`
// Created Date
CreatedDate *string `json:"CreatedDate,omitempty"`
// Description of service
Description *string `json:"Description,omitempty"`
// Full Description of service
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 []*Industry `json:"Industries"`
// Last Modified By User ID
LastModifiedByID *string `json:"LastModifiedByID,omitempty"`
// Last Modified Date
LastModifiedDate *string `json:"LastModifiedDate,omitempty"`
// Logo
Logo *string `json:"Logo,omitempty"`
// Service Name
Name *string `json:"Name,omitempty"`
// Owner ID
OwnerID *string `json:"OwnerID,omitempty"`
// Published
Published *bool `json:"Published,omitempty"`
// Salesforce Specific
SalesforceSpecific *bool `json:"SalesforceSpecific,omitempty"`
// Service Video ID
ServiceVideoID *string `json:"ServiceVideoID,omitempty"`
// Slug
Slug *string `json:"Slug,omitempty"`
// Tag Line
TagLine *string `json:"TagLine,omitempty"`
// URL
URL *string `json:"URL,omitempty"`
// user
User *User `json:"User,omitempty"`
}
// Validate validates this company service
func (m *CompanyService) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateIndustries(formats); err != nil {
res = append(res, err)
}
if err := m.validateUser(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CompanyService) validateIndustries(formats strfmt.Registry) error {
if swag.IsZero(m.Industries) { // not required
return nil
}
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
}
}
}
return nil
}
func (m *CompanyService) validateUser(formats strfmt.Registry) error {
if swag.IsZero(m.User) { // not required
return nil
}
if m.User != nil {
if err := m.User.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("User")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("User")
}
return err
}
}
return nil
}
// ContextValidate validate this company service based on the context it is used
func (m *CompanyService) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateIndustries(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateUser(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CompanyService) contextValidateIndustries(ctx context.Context, formats strfmt.Registry) error {
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
}
}
}
return nil
}
func (m *CompanyService) contextValidateUser(ctx context.Context, formats strfmt.Registry) error {
if m.User != nil {
if err := m.User.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("User")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("User")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *CompanyService) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *CompanyService) UnmarshalBinary(b []byte) error {
var res CompanyService
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}