-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxsd_ebay.go
202 lines (172 loc) · 4.08 KB
/
xsd_ebay.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
package main
// type EbValidator interface {
// NoCall() bool
// AllValuesExcept() (string, bool)
// OnlyTheseValues() (string, bool)
// MaxLength() (string, bool)
// MaxOccurs() (int, bool)
// Min() (string, bool)
// Max() (string, bool)
// Default() (string, bool)
// }
type EbAppInfo struct {
MaxDepth int
MinOccurs int
//PresentDetails
EbMaxOccurs
EbAllValuesExcept
EbOnlyTheseValues
EbMaxLength
EbMin
EbMax
EbDefault
EbListBasedOn
EbNoCalls
PresentDetails string
CallInfo []ebCallInfo
CallName string
SeeLink []ebSeeLink
Summary string
RelatedCalls []string
DeprecationVersion int
DeprecationDetails string
EndOfLifeVersion int
UseInstead *string
}
type ebCallInfo struct {
EbMaxOccurs
EbAllValuesExcept
EbOnlyTheseValues
EbMaxLength
EbMin
EbMax
EbDefault
EbNoCalls
AllCalls *string
CallName []string
Details string
Context string
AllCallsExcept string
RequiredInput string
Returned string
Summary string
SeeLink ebSeeLink
}
type ebSeeLink struct {
Title string
URL string
}
type EbNoCalls struct {
LNoCalls *string `xml:"noCalls"`
UNoCalls *string `xml:"NoCalls"`
}
func (n EbNoCalls) NoCall() bool {
if n.LNoCalls != nil {
return true
}
return n.UNoCalls != nil
}
type EbAllValuesExcept struct {
LowerAllValuesExcept *string `xml:"allValuesExcept"`
UpperAllValuesExcept *string `xml:"AllValuesExcept"`
}
func (n EbAllValuesExcept) AllValuesExcept() (string, bool) {
if n.LowerAllValuesExcept != nil && *n.LowerAllValuesExcept != "" {
return *n.LowerAllValuesExcept, true
}
if n.UpperAllValuesExcept != nil && *n.UpperAllValuesExcept != "" {
return *n.UpperAllValuesExcept, true
}
return "", false
}
type EbOnlyTheseValues struct {
LOnlyTheseValues *string `xml:"onlyTheseValues"`
UOnlyTheseValues *string `xml:"OnlyTheseValues"`
}
func (n EbOnlyTheseValues) OnlyTheseValues() (string, bool) {
if n.LOnlyTheseValues != nil && *n.LOnlyTheseValues != "" {
return *n.LOnlyTheseValues, true
}
if n.UOnlyTheseValues != nil && *n.UOnlyTheseValues != "" {
return *n.UOnlyTheseValues, true
}
return "", false
}
type EbMaxLength struct {
LMaxLength *string `xml:"maxLength"`
UMaxLength *string `xml:"MaxLength"`
}
func (n EbMaxLength) MaxLength() (string, bool) {
if n.LMaxLength != nil && *n.LMaxLength != "" {
return *n.LMaxLength, true
}
if n.UMaxLength != nil && *n.UMaxLength != "" {
return *n.UMaxLength, true
}
return "", false
}
type EbListBasedOn struct {
LowerCaseListBasedOn *string `xml:"listBasedOn"`
UpperCaseListBasedOn *string `xml:"ListBasedOn"`
}
func (n EbListBasedOn) ListBasedOn() (string, bool) {
if n.LowerCaseListBasedOn != nil && *n.LowerCaseListBasedOn != "" {
return *n.LowerCaseListBasedOn, true
}
if n.UpperCaseListBasedOn != nil && *n.UpperCaseListBasedOn != "" {
return *n.UpperCaseListBasedOn, true
}
return "", false
}
type EbMaxOccurs struct {
LowerCaseMaxOccurs *int `xml:"maxOccurs"`
UpperCaseMaxOccurs *int `xml:"MaxOccurs"`
}
func (n EbMaxOccurs) MaxOccurs() (int, bool) {
if n.LowerCaseMaxOccurs != nil {
return *n.LowerCaseMaxOccurs, true
}
if n.UpperCaseMaxOccurs != nil {
return *n.UpperCaseMaxOccurs, true
}
return 0, false
}
type EbMin struct {
LowerMin *string `xml:"min"`
UpperMin *string `xml:"Min"`
}
func (n EbMin) Min() (string, bool) {
if n.LowerMin != nil && *n.LowerMin != "" {
return *n.LowerMin, true
}
if n.UpperMin != nil && *n.UpperMin != "" {
return *n.UpperMin, true
}
return "", false
}
type EbMax struct {
LowerMax *string `xml:"max"`
UpperMax *string `xml:"Max"`
}
func (n EbMax) Max() (string, bool) {
if n.LowerMax != nil && *n.LowerMax != "" {
return *n.LowerMax, true
}
if n.UpperMax != nil && *n.UpperMax != "" {
return *n.UpperMax, true
}
return "", false
}
type EbDefault struct {
LowerDefault *string `xml:"default"`
UpperDefault *string `xml:"Default"`
}
func (n EbDefault) Default() (string, bool) {
if n.LowerDefault != nil && *n.LowerDefault != "" {
return *n.LowerDefault, true
}
if n.UpperDefault != nil && *n.UpperDefault != "" {
return *n.UpperDefault, true
}
return "", false
}