189 lines
4.7 KiB
Go
189 lines
4.7 KiB
Go
// 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 metrc_gw_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"
|
|
"strconv"
|
|
|
|
"github.com/go-openapi/errors"
|
|
"github.com/go-openapi/strfmt"
|
|
"github.com/go-openapi/swag"
|
|
)
|
|
|
|
// SalesDelivery sales delivery
|
|
//
|
|
// swagger:model SalesDelivery
|
|
type SalesDelivery struct {
|
|
|
|
// driver name
|
|
// Example: John Doe
|
|
DriverName string `json:"DriverName,omitempty"`
|
|
|
|
// driver occupational license number
|
|
// Example: 1
|
|
DriverOccupationalLicenseNumber string `json:"DriverOccupationalLicenseNumber,omitempty"`
|
|
|
|
// driver vehicle license number
|
|
// Example: 1
|
|
DriverVehicleLicenseNumber string `json:"DriverVehicleLicenseNumber,omitempty"`
|
|
|
|
// estimated arrival date time
|
|
// Example: 2017-04-04T13:00:00.000
|
|
EstimatedArrivalDateTime string `json:"EstimatedArrivalDateTime,omitempty"`
|
|
|
|
// estimated departure date time
|
|
// Example: 2017-04-04T11:00:00.000
|
|
EstimatedDepartureDateTime string `json:"EstimatedDepartureDateTime,omitempty"`
|
|
|
|
// Id
|
|
// Example: 51
|
|
ID float64 `json:"Id,omitempty"`
|
|
|
|
// phone number for questions
|
|
// Example: +1-123-456-7890
|
|
PhoneNumberForQuestions string `json:"PhoneNumberForQuestions,omitempty"`
|
|
|
|
// planned route
|
|
// Example: Drive to destination.
|
|
PlannedRoute string `json:"PlannedRoute,omitempty"`
|
|
|
|
// recipient address city
|
|
// Example: Denver
|
|
RecipientAddressCity string `json:"RecipientAddressCity,omitempty"`
|
|
|
|
// recipient address postal code
|
|
// Example: 11111
|
|
RecipientAddressPostalCode string `json:"RecipientAddressPostalCode,omitempty"`
|
|
|
|
// recipient address state
|
|
// Example: CO
|
|
RecipientAddressState string `json:"RecipientAddressState,omitempty"`
|
|
|
|
// recipient address street1
|
|
// Example: 1 Someplace Road
|
|
RecipientAddressStreet1 string `json:"RecipientAddressStreet1,omitempty"`
|
|
|
|
// recipient address street2
|
|
// Example: Ste 9
|
|
RecipientAddressStreet2 string `json:"RecipientAddressStreet2,omitempty"`
|
|
|
|
// sales customer type
|
|
// Example: Consumer
|
|
SalesCustomerType string `json:"SalesCustomerType,omitempty"`
|
|
|
|
// sales date time
|
|
// Example: 2017-04-04T10:10:19.000
|
|
SalesDateTime string `json:"SalesDateTime,omitempty"`
|
|
|
|
// transactions
|
|
Transactions []*Transaction `json:"Transactions"`
|
|
|
|
// vehicle license plate number
|
|
// Example: 000000
|
|
VehicleLicensePlateNumber string `json:"VehicleLicensePlateNumber,omitempty"`
|
|
|
|
// vehicle make
|
|
// Example: Car
|
|
VehicleMake string `json:"VehicleMake,omitempty"`
|
|
|
|
// vehicle model
|
|
// Example: Small
|
|
VehicleModel string `json:"VehicleModel,omitempty"`
|
|
}
|
|
|
|
// Validate validates this sales delivery
|
|
func (m *SalesDelivery) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := m.validateTransactions(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *SalesDelivery) validateTransactions(formats strfmt.Registry) error {
|
|
if swag.IsZero(m.Transactions) { // not required
|
|
return nil
|
|
}
|
|
|
|
for i := 0; i < len(m.Transactions); i++ {
|
|
if swag.IsZero(m.Transactions[i]) { // not required
|
|
continue
|
|
}
|
|
|
|
if m.Transactions[i] != nil {
|
|
if err := m.Transactions[i].Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("Transactions" + "." + strconv.Itoa(i))
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// ContextValidate validate this sales delivery based on the context it is used
|
|
func (m *SalesDelivery) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := m.contextValidateTransactions(ctx, formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *SalesDelivery) contextValidateTransactions(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
for i := 0; i < len(m.Transactions); i++ {
|
|
|
|
if m.Transactions[i] != nil {
|
|
if err := m.Transactions[i].ContextValidate(ctx, formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("Transactions" + "." + strconv.Itoa(i))
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (m *SalesDelivery) MarshalBinary() ([]byte, error) {
|
|
if m == nil {
|
|
return nil, nil
|
|
}
|
|
return swag.WriteJSON(m)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (m *SalesDelivery) UnmarshalBinary(b []byte) error {
|
|
var res SalesDelivery
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*m = res
|
|
return nil
|
|
}
|