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 sf_gate_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"
|
|
|
|
)
|
|
|
|
|
|
|
|
// PricebookEntry pricebook entry
|
|
|
|
//
|
|
|
|
// swagger:model PricebookEntry
|
|
|
|
type PricebookEntry struct {
|
|
|
|
|
|
|
|
// Active
|
|
|
|
Accountid string `json:"accountid,omitempty"`
|
|
|
|
|
|
|
|
// Created By
|
|
|
|
Agentid string `json:"agentid,omitempty"`
|
|
|
|
|
|
|
|
// Record Id
|
|
|
|
ID string `json:"id,omitempty"`
|
|
|
|
|
|
|
|
// pricebook
|
|
|
|
Pricebook *Pricebook `json:"pricebook,omitempty"`
|
|
|
|
|
|
|
|
// procuct
|
|
|
|
Procuct *Product `json:"procuct,omitempty"`
|
|
|
|
|
|
|
|
// Product Code
|
|
|
|
Productcode string `json:"productcode,omitempty"`
|
|
|
|
|
|
|
|
// tenant identifier
|
|
|
|
Tenantid string `json:"tenantid,omitempty"`
|
|
|
|
|
|
|
|
// List Price
|
|
|
|
Unitprice float64 `json:"unitprice,omitempty"`
|
|
|
|
|
|
|
|
// Use Standard Price
|
|
|
|
Usestandardprice bool `json:"usestandardprice,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// Validate validates this pricebook entry
|
|
|
|
func (m *PricebookEntry) Validate(formats strfmt.Registry) error {
|
|
|
|
var res []error
|
|
|
|
|
|
|
|
if err := m.validatePricebook(formats); err != nil {
|
|
|
|
res = append(res, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := m.validateProcuct(formats); err != nil {
|
|
|
|
res = append(res, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(res) > 0 {
|
|
|
|
return errors.CompositeValidationError(res...)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *PricebookEntry) validatePricebook(formats strfmt.Registry) error {
|
|
|
|
if swag.IsZero(m.Pricebook) { // not required
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
if m.Pricebook != nil {
|
|
|
|
if err := m.Pricebook.Validate(formats); err != nil {
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
return ve.ValidateName("pricebook")
|
|
|
|
}
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *PricebookEntry) validateProcuct(formats strfmt.Registry) error {
|
|
|
|
if swag.IsZero(m.Procuct) { // not required
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
if m.Procuct != nil {
|
|
|
|
if err := m.Procuct.Validate(formats); err != nil {
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
return ve.ValidateName("procuct")
|
|
|
|
}
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2021-02-09 16:56:57 +00:00
|
|
|
// ContextValidate validate this pricebook entry based on the context it is used
|
|
|
|
func (m *PricebookEntry) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
var res []error
|
|
|
|
|
|
|
|
if err := m.contextValidatePricebook(ctx, formats); err != nil {
|
|
|
|
res = append(res, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := m.contextValidateProcuct(ctx, formats); err != nil {
|
|
|
|
res = append(res, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(res) > 0 {
|
|
|
|
return errors.CompositeValidationError(res...)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *PricebookEntry) contextValidatePricebook(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
|
|
|
|
if m.Pricebook != nil {
|
|
|
|
if err := m.Pricebook.ContextValidate(ctx, formats); err != nil {
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
return ve.ValidateName("pricebook")
|
|
|
|
}
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *PricebookEntry) contextValidateProcuct(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
|
|
|
|
if m.Procuct != nil {
|
|
|
|
if err := m.Procuct.ContextValidate(ctx, formats); err != nil {
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
return ve.ValidateName("procuct")
|
|
|
|
}
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2021-01-08 17:40:28 +00:00
|
|
|
// MarshalBinary interface implementation
|
|
|
|
func (m *PricebookEntry) MarshalBinary() ([]byte, error) {
|
|
|
|
if m == nil {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
return swag.WriteJSON(m)
|
|
|
|
}
|
|
|
|
|
|
|
|
// UnmarshalBinary interface implementation
|
|
|
|
func (m *PricebookEntry) UnmarshalBinary(b []byte) error {
|
|
|
|
var res PricebookEntry
|
|
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
*m = res
|
|
|
|
return nil
|
|
|
|
}
|