lib/api/crm/crm_models/lead.go

190 lines
4.0 KiB
Go
Raw Normal View History

2021-07-31 03:05:02 +00:00
// Code generated by go-swagger; DO NOT EDIT.
2021-08-05 19:37:53 +00:00
// (c) 2012-2020 by Taxnexus, Inc.
2021-07-31 03:05:02 +00:00
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package crm_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"
)
// Lead lead
//
2023-04-06 01:28:58 +00:00
// swagger:model lead
2021-07-31 03:05:02 +00:00
type Lead struct {
// address
Address *Address `json:"Address,omitempty"`
// Company
2023-04-15 14:27:18 +00:00
Company *string `json:"Company,omitempty"`
2021-07-31 03:05:02 +00:00
// Created By User ID
2023-04-15 14:27:18 +00:00
CreatedByID *string `json:"CreatedByID,omitempty"`
2021-07-31 03:05:02 +00:00
// Created Date
2023-04-15 14:27:18 +00:00
CreatedDate *string `json:"CreatedDate,omitempty"`
2021-07-31 03:05:02 +00:00
// Description
2023-04-15 14:27:18 +00:00
Description *string `json:"Description,omitempty"`
2021-07-31 03:05:02 +00:00
// Email
2023-04-15 14:27:18 +00:00
Email *string `json:"Email,omitempty"`
2021-07-31 03:05:02 +00:00
// First Name
2023-04-15 14:27:18 +00:00
FirstName *string `json:"FirstName,omitempty"`
2021-07-31 03:05:02 +00:00
2023-03-28 17:47:34 +00:00
// Record Id
2021-07-31 03:05:02 +00:00
ID string `json:"ID,omitempty"`
// Last Modified By User ID
2023-04-15 14:27:18 +00:00
LastModifiedByID *string `json:"LastModifiedByID,omitempty"`
2021-07-31 03:05:02 +00:00
// Last Modified Date
2023-04-15 14:27:18 +00:00
LastModifiedDate *string `json:"LastModifiedDate,omitempty"`
2021-07-31 03:05:02 +00:00
// Last Name
2023-04-15 14:27:18 +00:00
LastName *string `json:"LastName,omitempty"`
2021-07-31 03:05:02 +00:00
// Mobile
2023-04-15 14:27:18 +00:00
MobilePhone *string `json:"MobilePhone,omitempty"`
2021-07-31 03:05:02 +00:00
// Name
2023-04-15 14:27:18 +00:00
Name *string `json:"Name,omitempty"`
2021-07-31 03:05:02 +00:00
// LeadBasic Owner
2023-04-15 14:27:18 +00:00
OwnerID *string `json:"OwnerId,omitempty"`
2021-07-31 03:05:02 +00:00
// Partner Account
2023-04-15 14:27:18 +00:00
PartnerAccountID *string `json:"PartnerAccountId,omitempty"`
2021-07-31 03:05:02 +00:00
// Phone
2023-04-15 14:27:18 +00:00
Phone *string `json:"Phone,omitempty"`
2021-07-31 03:05:02 +00:00
// Product
2023-04-15 14:27:18 +00:00
ProductID *string `json:"ProductID,omitempty"`
2021-07-31 03:05:02 +00:00
// referer_url
2023-04-15 14:27:18 +00:00
RefererURL *string `json:"RefererURL,omitempty"`
2021-07-31 03:05:02 +00:00
// LeadBasic Status
2023-04-15 14:27:18 +00:00
Status *string `json:"Status,omitempty"`
2021-07-31 03:05:02 +00:00
// Tenant Identifier
2023-04-15 14:27:18 +00:00
TenantID *string `json:"TenantID,omitempty"`
2021-07-31 03:05:02 +00:00
// Title
2023-04-15 14:27:18 +00:00
Title *string `json:"Title,omitempty"`
2021-07-31 03:05:02 +00:00
// Type
2023-04-15 14:27:18 +00:00
Type *string `json:"Type,omitempty"`
2021-07-31 03:05:02 +00:00
// utm_campaign
2023-04-15 14:27:18 +00:00
UTMCampaign *string `json:"UTMCampaign,omitempty"`
2021-07-31 03:05:02 +00:00
// utm_content
2023-04-15 14:27:18 +00:00
UTMContent *string `json:"UTMContent,omitempty"`
2021-07-31 03:05:02 +00:00
// utm_medium
2023-04-15 14:27:18 +00:00
UTMMedium *string `json:"UTMMedium,omitempty"`
2021-07-31 03:05:02 +00:00
// utm_source
2023-04-15 14:27:18 +00:00
UTMSource *string `json:"UTMSource,omitempty"`
2021-07-31 03:05:02 +00:00
// utm_term
2023-04-15 14:27:18 +00:00
UTMTerm *string `json:"UTMTerm,omitempty"`
2021-07-31 03:05:02 +00:00
// Website
2023-04-15 14:27:18 +00:00
Website *string `json:"Website,omitempty"`
2021-07-31 03:05:02 +00:00
}
// Validate validates this lead
func (m *Lead) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAddress(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Lead) validateAddress(formats strfmt.Registry) error {
if swag.IsZero(m.Address) { // not required
return nil
}
if m.Address != nil {
if err := m.Address.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Address")
2022-05-28 19:45:41 +00:00
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Address")
2021-07-31 03:05:02 +00:00
}
return err
}
}
return nil
}
// ContextValidate validate this lead based on the context it is used
func (m *Lead) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateAddress(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Lead) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error {
if m.Address != nil {
if err := m.Address.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Address")
2022-05-28 19:45:41 +00:00
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Address")
2021-07-31 03:05:02 +00:00
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *Lead) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Lead) UnmarshalBinary(b []byte) error {
var res Lead
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}