mirror of https://github.com/vernonkeenan/lib
218 lines
5.0 KiB
Go
218 lines
5.0 KiB
Go
|
|
// Code generated by go-swagger; DO NOT EDIT.
|
||
|
|
|
||
|
|
// (c) 2012-2020 by Taxnexus, Inc.
|
||
|
|
// All rights reserved worldwide.
|
||
|
|
// Proprietary product; unlicensed use is not allowed
|
||
|
|
|
||
|
|
package members_models
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
|
||
|
|
"github.com/go-openapi/errors"
|
||
|
|
"github.com/go-openapi/strfmt"
|
||
|
|
"github.com/go-openapi/swag/jsonutils"
|
||
|
|
"github.com/go-openapi/swag/typeutils"
|
||
|
|
"github.com/go-openapi/validate"
|
||
|
|
)
|
||
|
|
|
||
|
|
// AuditFields audit fields
|
||
|
|
//
|
||
|
|
// swagger:model AuditFields
|
||
|
|
type AuditFields struct {
|
||
|
|
|
||
|
|
// created by Id
|
||
|
|
// Read Only: true
|
||
|
|
// Format: uuid
|
||
|
|
CreatedByID *strfmt.UUID `json:"createdById,omitempty"`
|
||
|
|
|
||
|
|
// created date
|
||
|
|
// Read Only: true
|
||
|
|
// Format: date-time
|
||
|
|
CreatedDate *strfmt.DateTime `json:"createdDate,omitempty"`
|
||
|
|
|
||
|
|
// Server-generated on create; required in collection PUT bodies.
|
||
|
|
// Format: uuid
|
||
|
|
ID strfmt.UUID `json:"id,omitempty"`
|
||
|
|
|
||
|
|
// last modified by Id
|
||
|
|
// Read Only: true
|
||
|
|
// Format: uuid
|
||
|
|
LastModifiedByID *strfmt.UUID `json:"lastModifiedById,omitempty"`
|
||
|
|
|
||
|
|
// last modified date
|
||
|
|
// Read Only: true
|
||
|
|
// Format: date-time
|
||
|
|
LastModifiedDate *strfmt.DateTime `json:"lastModifiedDate,omitempty"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// Validate validates this audit fields
|
||
|
|
func (m *AuditFields) Validate(formats strfmt.Registry) error {
|
||
|
|
var res []error
|
||
|
|
|
||
|
|
if err := m.validateCreatedByID(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateCreatedDate(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateID(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateLastModifiedByID(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.validateLastModifiedDate(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if len(res) > 0 {
|
||
|
|
return errors.CompositeValidationError(res...)
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *AuditFields) validateCreatedByID(formats strfmt.Registry) error {
|
||
|
|
if typeutils.IsZero(m.CreatedByID) { // not required
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.FormatOf("createdById", "body", "uuid", m.CreatedByID.String(), formats); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *AuditFields) validateCreatedDate(formats strfmt.Registry) error {
|
||
|
|
if typeutils.IsZero(m.CreatedDate) { // not required
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.FormatOf("createdDate", "body", "date-time", m.CreatedDate.String(), formats); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *AuditFields) validateID(formats strfmt.Registry) error {
|
||
|
|
if typeutils.IsZero(m.ID) { // not required
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *AuditFields) validateLastModifiedByID(formats strfmt.Registry) error {
|
||
|
|
if typeutils.IsZero(m.LastModifiedByID) { // not required
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.FormatOf("lastModifiedById", "body", "uuid", m.LastModifiedByID.String(), formats); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *AuditFields) validateLastModifiedDate(formats strfmt.Registry) error {
|
||
|
|
if typeutils.IsZero(m.LastModifiedDate) { // not required
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := validate.FormatOf("lastModifiedDate", "body", "date-time", m.LastModifiedDate.String(), formats); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// ContextValidate validate this audit fields based on the context it is used
|
||
|
|
func (m *AuditFields) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||
|
|
var res []error
|
||
|
|
|
||
|
|
if err := m.contextValidateCreatedByID(ctx, formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.contextValidateCreatedDate(ctx, formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.contextValidateLastModifiedByID(ctx, formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := m.contextValidateLastModifiedDate(ctx, formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if len(res) > 0 {
|
||
|
|
return errors.CompositeValidationError(res...)
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *AuditFields) contextValidateCreatedByID(ctx context.Context, formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.ReadOnly(ctx, "createdById", "body", m.CreatedByID); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *AuditFields) contextValidateCreatedDate(ctx context.Context, formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.ReadOnly(ctx, "createdDate", "body", m.CreatedDate); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *AuditFields) contextValidateLastModifiedByID(ctx context.Context, formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.ReadOnly(ctx, "lastModifiedById", "body", m.LastModifiedByID); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *AuditFields) contextValidateLastModifiedDate(ctx context.Context, formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.ReadOnly(ctx, "lastModifiedDate", "body", m.LastModifiedDate); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// MarshalBinary interface implementation
|
||
|
|
func (m *AuditFields) MarshalBinary() ([]byte, error) {
|
||
|
|
if m == nil {
|
||
|
|
return nil, nil
|
||
|
|
}
|
||
|
|
return jsonutils.WriteJSON(m)
|
||
|
|
}
|
||
|
|
|
||
|
|
// UnmarshalBinary interface implementation
|
||
|
|
func (m *AuditFields) UnmarshalBinary(b []byte) error {
|
||
|
|
var res AuditFields
|
||
|
|
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
*m = res
|
||
|
|
return nil
|
||
|
|
}
|