/
catalog_data_product_render_formatted_price_info_interface.go
176 lines (130 loc) · 4.78 KB
/
catalog_data_product_render_formatted_price_info_interface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
// Code generated by go-swagger; DO NOT EDIT.
package 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"
"github.com/go-openapi/validate"
)
// CatalogDataProductRenderFormattedPriceInfoInterface Formatted Price interface. Aggregate formatted html with price representations. E.g.: <span class="price">$9.00</span> Consider currency, rounding and html
//
// swagger:model catalog-data-product-render-formatted-price-info-interface
type CatalogDataProductRenderFormattedPriceInfoInterface struct {
// extension attributes
ExtensionAttributes CatalogDataProductRenderFormattedPriceInfoExtensionInterface `json:"extension_attributes,omitempty"`
// Html with final price
// Required: true
FinalPrice *string `json:"final_price"`
// Max price of a product
// Required: true
MaxPrice *string `json:"max_price"`
// Max regular price
// Required: true
MaxRegularPrice *string `json:"max_regular_price"`
// The minimal price of the product or variation
// Required: true
MinimalPrice *string `json:"minimal_price"`
// Minimal regular price
// Required: true
MinimalRegularPrice *string `json:"minimal_regular_price"`
// Price - is price of product without discounts and special price with taxes and fixed product tax
// Required: true
RegularPrice *string `json:"regular_price"`
// Special price
// Required: true
SpecialPrice *string `json:"special_price"`
}
// Validate validates this catalog data product render formatted price info interface
func (m *CatalogDataProductRenderFormattedPriceInfoInterface) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateFinalPrice(formats); err != nil {
res = append(res, err)
}
if err := m.validateMaxPrice(formats); err != nil {
res = append(res, err)
}
if err := m.validateMaxRegularPrice(formats); err != nil {
res = append(res, err)
}
if err := m.validateMinimalPrice(formats); err != nil {
res = append(res, err)
}
if err := m.validateMinimalRegularPrice(formats); err != nil {
res = append(res, err)
}
if err := m.validateRegularPrice(formats); err != nil {
res = append(res, err)
}
if err := m.validateSpecialPrice(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CatalogDataProductRenderFormattedPriceInfoInterface) validateFinalPrice(formats strfmt.Registry) error {
if err := validate.Required("final_price", "body", m.FinalPrice); err != nil {
return err
}
return nil
}
func (m *CatalogDataProductRenderFormattedPriceInfoInterface) validateMaxPrice(formats strfmt.Registry) error {
if err := validate.Required("max_price", "body", m.MaxPrice); err != nil {
return err
}
return nil
}
func (m *CatalogDataProductRenderFormattedPriceInfoInterface) validateMaxRegularPrice(formats strfmt.Registry) error {
if err := validate.Required("max_regular_price", "body", m.MaxRegularPrice); err != nil {
return err
}
return nil
}
func (m *CatalogDataProductRenderFormattedPriceInfoInterface) validateMinimalPrice(formats strfmt.Registry) error {
if err := validate.Required("minimal_price", "body", m.MinimalPrice); err != nil {
return err
}
return nil
}
func (m *CatalogDataProductRenderFormattedPriceInfoInterface) validateMinimalRegularPrice(formats strfmt.Registry) error {
if err := validate.Required("minimal_regular_price", "body", m.MinimalRegularPrice); err != nil {
return err
}
return nil
}
func (m *CatalogDataProductRenderFormattedPriceInfoInterface) validateRegularPrice(formats strfmt.Registry) error {
if err := validate.Required("regular_price", "body", m.RegularPrice); err != nil {
return err
}
return nil
}
func (m *CatalogDataProductRenderFormattedPriceInfoInterface) validateSpecialPrice(formats strfmt.Registry) error {
if err := validate.Required("special_price", "body", m.SpecialPrice); err != nil {
return err
}
return nil
}
// ContextValidate validates this catalog data product render formatted price info interface based on context it is used
func (m *CatalogDataProductRenderFormattedPriceInfoInterface) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *CatalogDataProductRenderFormattedPriceInfoInterface) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *CatalogDataProductRenderFormattedPriceInfoInterface) UnmarshalBinary(b []byte) error {
var res CatalogDataProductRenderFormattedPriceInfoInterface
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}