lib/api/members/members_models/email_message.go

175 lines
3.9 KiB
Go
Raw Normal View History

2023-09-12 03:49:57 +00:00
// Code generated by go-swagger; DO NOT EDIT.
2023-09-23 17:19:44 +00:00
// (c) 2012-2023 by Vernon Keenan
2023-09-12 03:49:57 +00:00
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
2023-09-23 17:19:44 +00:00
package members_models
2023-09-12 03:49:57 +00:00
// 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"
)
// EmailMessage email message
//
2023-09-23 17:19:44 +00:00
// swagger:model emailMessage
2023-09-12 03:49:57 +00:00
type EmailMessage struct {
// b c c address
2023-09-23 17:19:44 +00:00
BCCAddress *string `json:"BCCAddress,omitempty"`
2023-09-12 03:49:57 +00:00
// c c address
2023-09-23 17:19:44 +00:00
CCAddress *string `json:"CCAddress,omitempty"`
2023-09-12 03:49:57 +00:00
// created by ID
2023-09-23 17:19:44 +00:00
CreatedByID *string `json:"CreatedByID,omitempty"`
2023-09-12 03:49:57 +00:00
// created date
2023-09-23 17:19:44 +00:00
CreatedDate *string `json:"CreatedDate,omitempty"`
2023-09-12 03:49:57 +00:00
// from address
2023-09-23 17:19:44 +00:00
FromAddress *string `json:"FromAddress,omitempty"`
2023-09-12 03:49:57 +00:00
// from name
2023-09-23 17:19:44 +00:00
FromName *string `json:"FromName,omitempty"`
2023-09-12 03:49:57 +00:00
// HTML
2023-09-23 17:19:44 +00:00
HTML *string `json:"HTML,omitempty"`
2023-09-12 03:49:57 +00:00
// has attachment
2023-09-23 17:19:44 +00:00
HasAttachment *bool `json:"HasAttachment,omitempty"`
2023-09-12 03:49:57 +00:00
// headers
Headers *Headers `json:"Headers,omitempty"`
// ID
ID string `json:"ID,omitempty"`
// incoming
2023-09-23 17:19:44 +00:00
Incoming *bool `json:"Incoming,omitempty"`
2023-09-12 03:49:57 +00:00
// last modified by ID
2023-09-23 17:19:44 +00:00
LastModifiedByID *string `json:"LastModifiedByID,omitempty"`
2023-09-12 03:49:57 +00:00
// last modified date
2023-09-23 17:19:44 +00:00
LastModifiedDate *string `json:"LastModifiedDate,omitempty"`
2023-09-12 03:49:57 +00:00
// message date
2023-09-23 17:19:44 +00:00
MessageDate *string `json:"MessageDate,omitempty"`
2023-09-12 03:49:57 +00:00
// message identifier
2023-09-23 17:19:44 +00:00
MessageIdentifier *string `json:"MessageIdentifier,omitempty"`
2023-09-12 03:49:57 +00:00
2023-09-23 17:19:44 +00:00
// outgoing email ID
OutgoingEmailID *string `json:"OutgoingEmailID,omitempty"`
2023-09-12 03:49:57 +00:00
// reply to email message ID
2023-09-23 17:19:44 +00:00
ReplyToEmailMessageID *string `json:"ReplyToEmailMessageID,omitempty"`
2023-09-12 03:49:57 +00:00
// status
2023-09-23 17:19:44 +00:00
Status *string `json:"Status,omitempty"`
2023-09-12 03:49:57 +00:00
// subject
2023-09-23 17:19:44 +00:00
Subject *string `json:"Subject,omitempty"`
2023-09-12 03:49:57 +00:00
2023-09-23 17:19:44 +00:00
// text body
TextBody *string `json:"TextBody,omitempty"`
2023-09-12 03:49:57 +00:00
// thread identifier
2023-09-23 17:19:44 +00:00
ThreadIdentifier *string `json:"ThreadIdentifier,omitempty"`
2023-09-12 03:49:57 +00:00
// to address
2023-09-23 17:19:44 +00:00
ToAddress *string `json:"ToAddress,omitempty"`
2023-09-12 03:49:57 +00:00
2023-09-23 17:19:44 +00:00
// to name
ToName *string `json:"ToName,omitempty"`
2023-09-12 03:49:57 +00:00
}
// Validate validates this email message
func (m *EmailMessage) 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 *EmailMessage) 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")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Headers")
}
return err
}
}
return nil
}
// ContextValidate validate this email message based on the context it is used
func (m *EmailMessage) 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 *EmailMessage) 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")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Headers")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *EmailMessage) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *EmailMessage) UnmarshalBinary(b []byte) error {
var res EmailMessage
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}