/
parameter_model.go
116 lines (91 loc) · 4.68 KB
/
parameter_model.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
// 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/strfmt"
"github.com/go-openapi/swag"
)
// ParameterModel An extra property that can change the behavior of tax transactions.
// Example: {"category":"Lodging","dataType":"NumericMeasured","helpText":"Please enter the number of nights the customer stayed in your lodging; whole numbers only.","helpUrl":"www.example.com/lodging","id":12345,"isNeededForCalculation":true,"isNeededForClassification":false,"isNeededForReturns":false,"label":"lodging","name":"NumberOfNights","prompt":"Lodging Number of Nights","regularExpression":"\\d*","serviceTypes":["AvaLodging"]}
//
// swagger:model ParameterModel
type ParameterModel struct {
// The type of parameter as determined by its application, e.g. Product, Transaction, Calculated
AttributeType string `json:"attributeType,omitempty"`
// DEPRECATED - Date: 07/25/2018, Version: 18.7, Message: This field is deprecated and will return null.
// The category grouping of this parameter. When your user interface displays a large number of parameters, they should
// be grouped by their category value.
// Example: Lodging
Category string `json:"category,omitempty"`
// The data type of the property.
// Example: NumericMeasured
DataType string `json:"dataType,omitempty"`
// Help text to be shown to the user when they are filling out this parameter. Help text may include HTML links to additional
// content with more information about a parameter.
// Example: Please enter the number of nights the customer stayed in your lodging; whole numbers only.
HelpText string `json:"helpText,omitempty"`
// A help url that provides more information about the parameter
// Example: www.example.com/lodging
HelpURL string `json:"helpUrl,omitempty"`
// The unique ID number of this property.
// Example: 12345
ID int64 `json:"id,omitempty"`
// This field identifies if parameter is needed for calculation
// Example: true
IsNeededForCalculation bool `json:"isNeededForCalculation,omitempty"`
// This field identifies if parameter is needed for classification
// Example: false
IsNeededForClassification bool `json:"isNeededForClassification,omitempty"`
// This field identifies if parameter is needed for returns
// Example: false
IsNeededForReturns bool `json:"isNeededForReturns,omitempty"`
// Label that helps the user to identify a parameter
// Example: lodging
Label string `json:"label,omitempty"`
// The unit of measurement type of the parameter
MeasurementType string `json:"measurementType,omitempty"`
// The name of the property. To use this property, add a field on the `parameters` object of a [CreateTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/) call.
// Example: NumberOfNights
Name string `json:"name,omitempty"`
// DEPRECATED - Date: 07/25/2018, Version: 18.7, Message: This field is deprecated and will return null.
// The prompt you should use when displaying this parameter to a user. For example, if your user interface displays a
// parameter in a text box, this is the label you should use to identify that text box.
// Example: Lodging Number of Nights
Prompt string `json:"prompt,omitempty"`
// DEPRECATED - Date: 07/25/2018, Version: 18.7, Message: This field is deprecated and will return null.
// If your user interface permits client-side validation of parameters, this string is a regular expression you can use
// to validate the user's data entry prior to submitting a tax request.
// Example: \\d*
RegularExpression string `json:"regularExpression,omitempty"`
// A list of service types to which this parameter applies.
// Example: ["AvaLodging"]
ServiceTypes []string `json:"serviceTypes"`
// If the parameter is of enumeration data type, then this list will be populated with all of the possible enumeration values.
Values []string `json:"values"`
}
// Validate validates this parameter model
func (m *ParameterModel) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this parameter model based on context it is used
func (m *ParameterModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *ParameterModel) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ParameterModel) UnmarshalBinary(b []byte) error {
var res ParameterModel
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}