// Code generated by go-swagger; DO NOT EDIT. // All Code Copyright(c) 2018-2021 by Taxnexus, Inc. // 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 ( "context" "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 } // 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 } // 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 }