// Code generated by go-swagger; DO NOT EDIT. // All Code Copyright(c) 2018-2021 by Taxnexus, Inc. // 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 // // swagger:model Contact 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"` // 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"` // Taxnexus Enrollment Status EnrollmentStatus string `json:"EnrollmentStatus,omitempty"` // 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"` // Taxnexus Record Id ID string `json:"ID,omitempty"` // Does this contact have bounced emails? IsEmailBounced bool `json:"IsEmailBounced,omitempty"` // Is Provisioned? IsProvisioned bool `json:"IsProvisioned,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"` // Level Level string `json:"Level,omitempty"` // LinkedIn Page LinkedIn string `json:"LinkedIn,omitempty"` // mailing address MailingAddress *Address `json:"MailingAddress,omitempty"` // Mailing Lists MailingLists string `json:"MailingLists,omitempty"` // Mobile Phone MobilePhone string `json:"MobilePhone,omitempty"` // Full Name Name string `json:"Name,omitempty"` // 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"` // Recruiting Status RecruitingStatus string `json:"RecruitingStatus,omitempty"` // External reference to this contact, if any Ref string `json:"Ref,omitempty"` // Reports To Contact ID ReportsToID string `json:"ReportsToID,omitempty"` // Contact Salutation Salutation string `json:"Salutation,omitempty"` // The Contact Status Status string `json:"Status,omitempty"` // Tenant Identifier TenantID string `json:"TenantID,omitempty"` // Contact Title Title string `json:"Title,omitempty"` // Contact Type Type string `json:"Type,omitempty"` } // 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") } 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") } 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") } 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") } 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 }