lib/api/workflow/workflow_models/outgoing_email_message.go

150 lines
3.3 KiB
Go
Raw Permalink Normal View History

2021-01-08 17:40:28 +00:00
// Code generated by go-swagger; DO NOT EDIT.
2021-01-19 16:58:40 +00:00
// All Code Copyright(c) 2018-2021 by Taxnexus, Inc.
2021-01-08 17:40:28 +00:00
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package workflow_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
2021-02-09 16:56:57 +00:00
"context"
2021-01-08 17:40:28 +00:00
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// OutgoingEmailMessage A new email message to be sent
//
// swagger:model OutgoingEmailMessage
type OutgoingEmailMessage struct {
// b c c address
BCCAddress string `json:"BCCAddress,omitempty"`
// c c address
CCAddress string `json:"CCAddress,omitempty"`
// email message ID
EmailMessageID string `json:"EmailMessageID,omitempty"`
// email template ID
EmailTemplateID string `json:"EmailTemplateID,omitempty"`
// external ID
ExternalID string `json:"ExternalID,omitempty"`
// from contact ID
FromContactID string `json:"FromContactID,omitempty"`
// from name
FromName string `json:"FromName,omitempty"`
// HTML
HTML string `json:"HTML,omitempty"`
// headers
Headers *Headers `json:"Headers,omitempty"`
// ID
ID string `json:"ID,omitempty"`
// subject
Subject string `json:"Subject,omitempty"`
// text
Text string `json:"Text,omitempty"`
// to address
ToAddress string `json:"ToAddress,omitempty"`
// to name
ToName string `json:"ToName,omitempty"`
// validated from address
ValidatedFromAddress string `json:"ValidatedFromAddress,omitempty"`
// who ID
WhoID string `json:"WhoID,omitempty"`
}
// Validate validates this outgoing email message
func (m *OutgoingEmailMessage) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateHeaders(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *OutgoingEmailMessage) validateHeaders(formats strfmt.Registry) error {
if swag.IsZero(m.Headers) { // not required
return nil
}
if m.Headers != nil {
if err := m.Headers.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Headers")
}
return err
}
}
return nil
}
2021-02-09 16:56:57 +00:00
// ContextValidate validate this outgoing email message based on the context it is used
func (m *OutgoingEmailMessage) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateHeaders(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *OutgoingEmailMessage) contextValidateHeaders(ctx context.Context, formats strfmt.Registry) error {
if m.Headers != nil {
if err := m.Headers.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Headers")
}
return err
}
}
return nil
}
2021-01-08 17:40:28 +00:00
// MarshalBinary interface implementation
func (m *OutgoingEmailMessage) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *OutgoingEmailMessage) UnmarshalBinary(b []byte) error {
var res OutgoingEmailMessage
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}