lib/api/crm/crm_models/contact.go

275 lines
6.4 KiB
Go
Raw Permalink 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"
)
// Contact contact
//
2023-04-06 01:28:58 +00:00
// swagger:model contact
2021-07-31 03:05:02 +00:00
type Contact struct {
// The primary account ID of this contact
AccountID string `json:"AccountID,omitempty"`
// Assistant Name
AssistantName string `json:"AssistantName,omitempty"`
// Asst. Phone
AssistantPhone string `json:"AssistantPhone,omitempty"`
// Birthdate
BirthDate string `json:"BirthDate,omitempty"`
// Created By User ID
CreatedByID string `json:"CreatedByID,omitempty"`
// Created Date
CreatedDate string `json:"CreatedDate,omitempty"`
2023-03-28 17:47:34 +00:00
// crunchbase URL
CrunchbaseURL string `json:"CrunchbaseURL,omitempty"`
2021-07-31 03:05:02 +00:00
// Department
Department string `json:"Department,omitempty"`
// Description
Description string `json:"Description,omitempty"`
// Do Not Call?
DoNotCall bool `json:"DoNotCall,omitempty"`
// Email address
Email string `json:"Email,omitempty"`
// Email Bounce Date
EmailBounceDate string `json:"EmailBounceDate,omitempty"`
// Email Bounce Reason
EmailBouncedReason string `json:"EmailBouncedReason,omitempty"`
2023-04-06 01:28:58 +00:00
// Facebook Page
Facebook string `json:"Facebook,omitempty"`
2021-07-31 03:05:02 +00:00
// Fax Number
Fax string `json:"Fax,omitempty"`
// First Name
FirstName string `json:"FirstName,omitempty"`
// Email Opt Out
HasOptedOutOfEmail bool `json:"HasOptedOutOfEmail,omitempty"`
// Fax Opt Out
HasOptedOutOfFax bool `json:"HasOptedOutOfFax,omitempty"`
// Home Phone
HomePhone string `json:"HomePhone,omitempty"`
2023-03-28 17:47:34 +00:00
// Record Id
2021-07-31 03:05:02 +00:00
ID string `json:"ID,omitempty"`
// Does this contact have bounced emails?
IsEmailBounced bool `json:"IsEmailBounced,omitempty"`
// Last Modified By User ID
LastModifiedByID string `json:"LastModifiedByID,omitempty"`
// Last Modified Date
LastModifiedDate string `json:"LastModifiedDate,omitempty"`
// Last Name
LastName string `json:"LastName,omitempty"`
// Lead Source
LeadSource string `json:"LeadSource,omitempty"`
// LinkedIn Page
LinkedIn string `json:"LinkedIn,omitempty"`
// mailing address
MailingAddress *Address `json:"MailingAddress,omitempty"`
// Mobile Phone
MobilePhone string `json:"MobilePhone,omitempty"`
// Full Name
Name string `json:"Name,omitempty"`
2022-09-07 00:16:25 +00:00
// number investments
NumberInvestments float64 `json:"NumberInvestments,omitempty"`
2021-07-31 03:05:02 +00:00
// other address
OtherAddress *Address `json:"OtherAddress,omitempty"`
// Other Phone
OtherPhone string `json:"OtherPhone,omitempty"`
// The User ID of the user who owns this Contact
OwnerID string `json:"OwnerID,omitempty"`
// Personal Email Address for this Contact
PersonalEmail string `json:"PersonalEmail,omitempty"`
// Phone Number
Phone string `json:"Phone,omitempty"`
// URL of a photograph of this User
PhotoURL string `json:"PhotoURL,omitempty"`
2023-03-28 17:47:34 +00:00
// Reports To
ReportsToID string `json:"ReportsToID,omitempty"`
// Salutation
Salutation string `json:"Salutation,omitempty"`
// Slug
Slug string `json:"Slug,omitempty"`
2021-07-31 03:05:02 +00:00
// Tenant Identifier
TenantID string `json:"TenantID,omitempty"`
// Contact Title
Title string `json:"Title,omitempty"`
2022-09-07 00:16:25 +00:00
// Twitter URL
Twitter string `json:"Twitter,omitempty"`
2021-07-31 03:05:02 +00:00
}
// Validate validates this contact
func (m *Contact) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateMailingAddress(formats); err != nil {
res = append(res, err)
}
if err := m.validateOtherAddress(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Contact) validateMailingAddress(formats strfmt.Registry) error {
if swag.IsZero(m.MailingAddress) { // not required
return nil
}
if m.MailingAddress != nil {
if err := m.MailingAddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("MailingAddress")
2022-05-28 19:45:41 +00:00
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("MailingAddress")
2021-07-31 03:05:02 +00:00
}
return err
}
}
return nil
}
func (m *Contact) validateOtherAddress(formats strfmt.Registry) error {
if swag.IsZero(m.OtherAddress) { // not required
return nil
}
if m.OtherAddress != nil {
if err := m.OtherAddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("OtherAddress")
2022-05-28 19:45:41 +00:00
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("OtherAddress")
2021-07-31 03:05:02 +00:00
}
return err
}
}
return nil
}
// ContextValidate validate this contact based on the context it is used
func (m *Contact) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateMailingAddress(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateOtherAddress(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Contact) contextValidateMailingAddress(ctx context.Context, formats strfmt.Registry) error {
if m.MailingAddress != nil {
if err := m.MailingAddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("MailingAddress")
2022-05-28 19:45:41 +00:00
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("MailingAddress")
2021-07-31 03:05:02 +00:00
}
return err
}
}
return nil
}
func (m *Contact) contextValidateOtherAddress(ctx context.Context, formats strfmt.Registry) error {
if m.OtherAddress != nil {
if err := m.OtherAddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("OtherAddress")
2022-05-28 19:45:41 +00:00
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("OtherAddress")
2021-07-31 03:05:02 +00:00
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *Contact) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Contact) UnmarshalBinary(b []byte) error {
var res Contact
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}