lib/api/crm/crm_models/contract.go

242 lines
5.8 KiB
Go
Raw Normal View History

2022-05-28 19:45:41 +00:00
// 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 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"
)
// Contract contract
//
2023-04-06 01:28:58 +00:00
// swagger:model contract
2022-05-28 19:45:41 +00:00
type Contract struct {
// Account
2023-04-15 14:27:18 +00:00
AccountID *string `json:"AccountID,omitempty"`
2022-05-28 19:45:41 +00:00
// Activated By
2023-04-15 14:27:18 +00:00
ActivatedByID *string `json:"ActivatedByID,omitempty"`
2022-05-28 19:45:41 +00:00
// Activated Date
2023-04-15 14:27:18 +00:00
ActivatedDate *string `json:"ActivatedDate,omitempty"`
2022-05-28 19:45:41 +00:00
2023-04-06 01:28:58 +00:00
// billing address
2022-05-28 19:45:41 +00:00
BillingAddress *Address `json:"BillingAddress,omitempty"`
// Billing Contact
2023-04-15 14:27:18 +00:00
BillingContactID *string `json:"BillingContactID,omitempty"`
2022-05-28 19:45:41 +00:00
// Company Signed Date
2023-04-15 14:27:18 +00:00
CompanySignedDate *string `json:"CompanySignedDate,omitempty"`
2022-05-28 19:45:41 +00:00
// Company Signed By
2023-04-15 14:27:18 +00:00
CompanySignedID *string `json:"CompanySignedID,omitempty"`
2022-05-28 19:45:41 +00:00
// Contract Number
2023-04-15 14:27:18 +00:00
ContractNumber *string `json:"ContractNumber,omitempty"`
2022-05-28 19:45:41 +00:00
// Contract Term (months)
2023-04-15 14:27:18 +00:00
ContractTerm *float64 `json:"ContractTerm,omitempty"`
2022-05-28 19:45:41 +00:00
// Created By User ID
2023-04-15 14:27:18 +00:00
CreatedByID *string `json:"CreatedByID,omitempty"`
2022-05-28 19:45:41 +00:00
// Created Date
2023-04-15 14:27:18 +00:00
CreatedDate *string `json:"CreatedDate,omitempty"`
2022-05-28 19:45:41 +00:00
// Customer Signed Date
2023-04-15 14:27:18 +00:00
CustomerSignedDate *string `json:"CustomerSignedDate,omitempty"`
2022-05-28 19:45:41 +00:00
// Customer Signed By
2023-04-15 14:27:18 +00:00
CustomerSignedID *string `json:"CustomerSignedID,omitempty"`
2022-05-28 19:45:41 +00:00
// Customer Signed Title
2023-04-15 14:27:18 +00:00
CustomerSignedTitle *string `json:"CustomerSignedTitle,omitempty"`
2022-05-28 19:45:41 +00:00
// End User
2023-04-15 14:27:18 +00:00
DefaultEndUserID *string `json:"DefaultEndUserID,omitempty"`
2022-05-28 19:45:41 +00:00
// Description
2023-04-15 14:27:18 +00:00
Description *string `json:"Description,omitempty"`
2022-05-28 19:45:41 +00:00
// Contract End Date
2023-04-15 14:27:18 +00:00
EndDate *string `json:"EndDate,omitempty"`
2022-05-28 19:45:41 +00:00
2023-04-06 01:28:58 +00:00
// End User
2023-04-15 14:27:18 +00:00
EndUserID *string `json:"EndUserID,omitempty"`
2023-04-06 01:28:58 +00:00
2022-05-28 19:45:41 +00:00
// Hourly Rate
2023-04-15 14:27:18 +00:00
HourlyRate *float64 `json:"HourlyRate,omitempty"`
2022-05-28 19:45:41 +00:00
2023-04-15 14:27:18 +00:00
// Record Id
2022-05-28 19:45:41 +00:00
ID string `json:"ID,omitempty"`
// Last Modified By User ID
2023-04-15 14:27:18 +00:00
LastModifiedByID *string `json:"LastModifiedByID,omitempty"`
2022-05-28 19:45:41 +00:00
// Last Modified Date
2023-04-15 14:27:18 +00:00
LastModifiedDate *string `json:"LastModifiedDate,omitempty"`
2022-05-28 19:45:41 +00:00
// Contract Name
2023-04-15 14:27:18 +00:00
Name *string `json:"Name,omitempty"`
2022-05-28 19:45:41 +00:00
// Payment Method
2023-04-15 14:27:18 +00:00
PaymentMethodID *string `json:"PaymentMethodID,omitempty"`
2022-05-28 19:45:41 +00:00
// Payment Terms
2023-04-15 14:27:18 +00:00
PaymentTerms *string `json:"PaymentTerms,omitempty"`
2022-05-28 19:45:41 +00:00
// Perpetual Agreement?
2023-04-15 14:27:18 +00:00
Perpetual *bool `json:"Perpetual,omitempty"`
2022-05-28 19:45:41 +00:00
2023-04-06 01:28:58 +00:00
// shipping address
2022-05-28 19:45:41 +00:00
ShippingAddress *Address `json:"ShippingAddress,omitempty"`
// Shipping Contact
2023-04-15 14:27:18 +00:00
ShippingContactID *string `json:"ShippingContactID,omitempty"`
2022-05-28 19:45:41 +00:00
// Contract Start Date
2023-04-15 14:27:18 +00:00
StartDate *string `json:"StartDate,omitempty"`
2022-05-28 19:45:41 +00:00
// Status
2023-04-15 14:27:18 +00:00
Status *string `json:"Status,omitempty"`
2022-05-28 19:45:41 +00:00
// Tenant Identifier
2023-04-15 14:27:18 +00:00
TenantID *string `json:"TenantID,omitempty"`
2022-05-28 19:45:41 +00:00
}
// Validate validates this contract
func (m *Contract) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateBillingAddress(formats); err != nil {
res = append(res, err)
}
if err := m.validateShippingAddress(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Contract) validateBillingAddress(formats strfmt.Registry) error {
if swag.IsZero(m.BillingAddress) { // not required
return nil
}
if m.BillingAddress != nil {
if err := m.BillingAddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("BillingAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("BillingAddress")
}
return err
}
}
return nil
}
func (m *Contract) validateShippingAddress(formats strfmt.Registry) error {
if swag.IsZero(m.ShippingAddress) { // not required
return nil
}
if m.ShippingAddress != nil {
if err := m.ShippingAddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ShippingAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ShippingAddress")
}
return err
}
}
return nil
}
// ContextValidate validate this contract based on the context it is used
func (m *Contract) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateBillingAddress(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateShippingAddress(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Contract) contextValidateBillingAddress(ctx context.Context, formats strfmt.Registry) error {
if m.BillingAddress != nil {
if err := m.BillingAddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("BillingAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("BillingAddress")
}
return err
}
}
return nil
}
func (m *Contract) contextValidateShippingAddress(ctx context.Context, formats strfmt.Registry) error {
if m.ShippingAddress != nil {
if err := m.ShippingAddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ShippingAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ShippingAddress")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *Contract) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Contract) UnmarshalBinary(b []byte) error {
var res Contract
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}