-
Notifications
You must be signed in to change notification settings - Fork 0
/
colr.003.001.04.xsd.go
387 lines (320 loc) · 18.4 KB
/
colr.003.001.04.xsd.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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
// Code generated by download. DO NOT EDIT.
package iso20022_colr_003_001_04
import (
"bytes"
"encoding/xml"
"time"
)
type ActiveCurrencyAndAmount struct {
Value float64 `xml:",chardata"`
Ccy ActiveCurrencyCode `xml:"Ccy,attr"`
}
// Must match the pattern [A-Z]{3,3}
type ActiveCurrencyCode string
type AggregatedIndependentAmount1 struct {
Trad IndependentAmount1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Trad,omitempty"`
ValAtRsk IndependentAmount1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 ValAtRsk,omitempty"`
NetOpnPos IndependentAmount1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 NetOpnPos,omitempty"`
OthrAmt []IndependentAmount2 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 OthrAmt,omitempty"`
}
type Agreement4 struct {
AgrmtDtls Max140Text `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 AgrmtDtls"`
AgrmtId Max140Text `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 AgrmtId,omitempty"`
AgrmtDt ISODate `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 AgrmtDt"`
BaseCcy ActiveCurrencyCode `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 BaseCcy"`
AgrmtFrmwk AgreementFramework1Choice `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 AgrmtFrmwk,omitempty"`
}
type AgreementFramework1Choice struct {
AgrmtFrmwk AgreementFramework1Code `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 AgrmtFrmwk,omitempty"`
PrtryId GenericIdentification30 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 PrtryId,omitempty"`
}
// May be one of FBAA, BBAA, DERV, ISDA, NONR
type AgreementFramework1Code string
// Must match the pattern [A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}
type AnyBICIdentifier string
type Collateral1 struct {
VartnMrgn MarginCollateral1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 VartnMrgn"`
SgrtdIndpdntAmt MarginCollateral1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 SgrtdIndpdntAmt,omitempty"`
}
type CollateralAccount2 struct {
Id Max35Text `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Id"`
Tp CollateralAccountIdentificationType2Choice `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Tp,omitempty"`
Nm Max70Text `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Nm,omitempty"`
}
type CollateralAccountIdentificationType2Choice struct {
Tp CollateralAccountType1Code `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Tp,omitempty"`
Prtry GenericIdentification36 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Prtry,omitempty"`
}
// May be one of HOUS, CLIE, LIPR, MGIN, DFLT
type CollateralAccountType1Code string
type CollateralBalance1Choice struct {
TtlColl ActiveCurrencyAndAmount `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 TtlColl,omitempty"`
CollDtls Collateral1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 CollDtls,omitempty"`
SgrtdIndpdntAmt MarginCollateral1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 SgrtdIndpdntAmt,omitempty"`
}
type CollateralMovement9 struct {
CollTp CollateralType1Code `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 CollTp"`
Dt ISODate `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Dt,omitempty"`
}
// May be one of CASH, SECU, LCRE, OTHR
type CollateralType1Code string
// Must match the pattern [A-Z]{2,2}
type CountryCode string
type DateAndDateTimeChoice struct {
Dt ISODate `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Dt,omitempty"`
DtTm ISODateTime `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 DtTm,omitempty"`
}
type Document struct {
MrgnCallReq MarginCallRequestV04 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 MrgnCallReq"`
}
// Must match the pattern [a-zA-Z0-9]{4}
type Exact4AlphaNumericText string
type ExpectedCollateral2 struct {
VartnMrgn ExpectedCollateralMovement2 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 VartnMrgn"`
SgrtdIndpdntAmt ExpectedCollateralMovement2 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 SgrtdIndpdntAmt,omitempty"`
}
type ExpectedCollateral2Choice struct {
XpctdCollDtls ExpectedCollateral2 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 XpctdCollDtls,omitempty"`
SgrtdIndpdntAmt ExpectedCollateralMovement2 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 SgrtdIndpdntAmt,omitempty"`
}
type ExpectedCollateralMovement2 struct {
Dlvry []CollateralMovement9 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Dlvry,omitempty"`
Rtr []CollateralMovement9 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Rtr,omitempty"`
}
// May be one of GROS, NET1
type ExposureConventionType1Code string
// May be one of BFWD, PAYM, CCPC, COMM, CRDS, CRTL, CRSP, CCIR, CRPR, EQUI, EQPT, EQUS, EXTD, EXPT, FIXI, FORX, FORW, FUTR, OPTN, LIQU, OTCD, REPO, RVPO, SLOA, SBSC, SCRP, SLEB, SHSL, SCIR, SCIE, SWPT, TBAS, TRBD, TRCP
type ExposureType5Code string
type GenericIdentification30 struct {
Id Exact4AlphaNumericText `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Id"`
Issr Max35Text `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Issr"`
SchmeNm Max35Text `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 SchmeNm,omitempty"`
}
type GenericIdentification36 struct {
Id Max35Text `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Id"`
Issr Max35Text `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Issr"`
SchmeNm Max35Text `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 SchmeNm,omitempty"`
}
type ISODate time.Time
func (t *ISODate) UnmarshalText(text []byte) error {
return (*xsdDate)(t).UnmarshalText(text)
}
func (t ISODate) MarshalText() ([]byte, error) {
return xsdDate(t).MarshalText()
}
type ISODateTime time.Time
func (t *ISODateTime) UnmarshalText(text []byte) error {
return (*xsdDateTime)(t).UnmarshalText(text)
}
func (t ISODateTime) MarshalText() ([]byte, error) {
return xsdDateTime(t).MarshalText()
}
type IndependentAmount1 struct {
Amt ActiveCurrencyAndAmount `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Amt"`
Cnvntn IndependentAmountConventionType1Code `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Cnvntn"`
}
type IndependentAmount2 struct {
Desc Max140Text `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Desc,omitempty"`
Amt ActiveCurrencyAndAmount `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Amt"`
Cnvntn IndependentAmountConventionType1Code `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Cnvntn"`
}
// May be one of NBTR, NATR, SEGR
type IndependentAmountConventionType1Code string
type Margin1 struct {
VartnMrgn VariationMargin1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 VartnMrgn"`
SgrtdIndpdntAmtMrgn SegregatedIndependentAmountMargin1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 SgrtdIndpdntAmtMrgn,omitempty"`
}
type MarginCall1 struct {
XpsdAmtPtyA ActiveCurrencyAndAmount `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 XpsdAmtPtyA,omitempty"`
XpsdAmtPtyB ActiveCurrencyAndAmount `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 XpsdAmtPtyB,omitempty"`
XpsrCnvntn ExposureConventionType1Code `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 XpsrCnvntn,omitempty"`
IndpdntAmtPtyA AggregatedIndependentAmount1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 IndpdntAmtPtyA,omitempty"`
IndpdntAmtPtyB AggregatedIndependentAmount1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 IndpdntAmtPtyB,omitempty"`
MrgnTerms MarginTerms1Choice `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 MrgnTerms,omitempty"`
CollBal CollateralBalance1Choice `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 CollBal,omitempty"`
}
type MarginCall2 struct {
CollAcctId CollateralAccount2 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 CollAcctId,omitempty"`
MrgnCallRslt MarginCallResult3 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 MrgnCallRslt"`
MrgnDtlDueToA MarginCall1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 MrgnDtlDueToA,omitempty"`
MrgnDtlDueToB MarginCall1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 MrgnDtlDueToB,omitempty"`
RqrmntDtlsDueToA MarginRequirement1Choice `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 RqrmntDtlsDueToA,omitempty"`
RqrmntDtlsDueToB MarginRequirement1Choice `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 RqrmntDtlsDueToB,omitempty"`
XpctdCollDueToA ExpectedCollateral2Choice `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 XpctdCollDueToA,omitempty"`
XpctdCollDueToB ExpectedCollateral2Choice `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 XpctdCollDueToB,omitempty"`
}
type MarginCallRequestV04 struct {
TxId Max35Text `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 TxId"`
Oblgtn Obligation4 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Oblgtn"`
Agrmt Agreement4 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Agrmt,omitempty"`
MrgnCallRslt MarginCallResult3 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 MrgnCallRslt"`
MrgnDtlsDueToA MarginCall1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 MrgnDtlsDueToA,omitempty"`
MrgnDtlsDueToB MarginCall1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 MrgnDtlsDueToB,omitempty"`
RqrmntDtlsDueToA MarginRequirement1Choice `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 RqrmntDtlsDueToA,omitempty"`
RqrmntDtlsDueToB MarginRequirement1Choice `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 RqrmntDtlsDueToB,omitempty"`
XpctdCollDueToA ExpectedCollateral2Choice `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 XpctdCollDueToA,omitempty"`
XpctdCollDueToB ExpectedCollateral2Choice `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 XpctdCollDueToB,omitempty"`
MrgnCallDtls []MarginCall2 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 MrgnCallDtls,omitempty"`
SplmtryData []SupplementaryData1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 SplmtryData,omitempty"`
}
type MarginCallResult2 struct {
VartnMrgnRslt Result1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 VartnMrgnRslt"`
SgrtdIndpdntAmt Result1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 SgrtdIndpdntAmt,omitempty"`
}
type MarginCallResult2Choice struct {
MrgnCallRsltDtls MarginCallResult2 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 MrgnCallRsltDtls,omitempty"`
MrgnCallAmt Result1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 MrgnCallAmt,omitempty"`
SgrtdIndpdntAmt Result1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 SgrtdIndpdntAmt,omitempty"`
}
type MarginCallResult3 struct {
DfltFndAmt ActiveCurrencyAndAmount `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 DfltFndAmt,omitempty"`
MrgnCallRslt MarginCallResult2Choice `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 MrgnCallRslt"`
}
type MarginCollateral1 struct {
HeldByPtyA ActiveCurrencyAndAmount `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 HeldByPtyA,omitempty"`
HeldByPtyB ActiveCurrencyAndAmount `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 HeldByPtyB,omitempty"`
PrrAgrdToPtyA ActiveCurrencyAndAmount `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 PrrAgrdToPtyA,omitempty"`
PrrAgrdToPtyB ActiveCurrencyAndAmount `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 PrrAgrdToPtyB,omitempty"`
InTrnstToPtyA ActiveCurrencyAndAmount `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 InTrnstToPtyA,omitempty"`
InTrnstToPtyB ActiveCurrencyAndAmount `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 InTrnstToPtyB,omitempty"`
}
type MarginRequirement1 struct {
DlvrMrgnAmt ActiveCurrencyAndAmount `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 DlvrMrgnAmt,omitempty"`
RtrMrgnAmt ActiveCurrencyAndAmount `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 RtrMrgnAmt,omitempty"`
}
type MarginRequirement1Choice struct {
MrgnRqrmnt Requirement1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 MrgnRqrmnt,omitempty"`
SgrtdIndpdntAmtRqrmnt MarginRequirement1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 SgrtdIndpdntAmtRqrmnt,omitempty"`
}
type MarginTerms1Choice struct {
MrgnDtls Margin1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 MrgnDtls,omitempty"`
SgrtdIndpdntAmtMrgn SegregatedIndependentAmountMargin1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 SgrtdIndpdntAmtMrgn,omitempty"`
}
// May be no more than 140 items long
type Max140Text string
// May be no more than 16 items long
type Max16Text string
// May be no more than 210 items long
type Max210Text string
// May be no more than 350 items long
type Max350Text string
// May be no more than 35 items long
type Max35Text string
// May be no more than 70 items long
type Max70Text string
type NameAndAddress6 struct {
Nm Max70Text `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Nm"`
Adr PostalAddress2 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Adr"`
}
type Obligation4 struct {
PtyA PartyIdentification100Choice `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 PtyA"`
SvcgPtyA PartyIdentification100Choice `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 SvcgPtyA,omitempty"`
PtyB PartyIdentification100Choice `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 PtyB"`
SvcgPtyB PartyIdentification100Choice `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 SvcgPtyB,omitempty"`
CollAcctId CollateralAccount2 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 CollAcctId,omitempty"`
XpsrTp ExposureType5Code `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 XpsrTp,omitempty"`
ValtnDt DateAndDateTimeChoice `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 ValtnDt"`
}
type PartyIdentification100Choice struct {
AnyBIC AnyBICIdentifier `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 AnyBIC,omitempty"`
PrtryId GenericIdentification36 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 PrtryId,omitempty"`
NmAndAdr NameAndAddress6 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 NmAndAdr,omitempty"`
}
type PostalAddress2 struct {
StrtNm Max70Text `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 StrtNm,omitempty"`
PstCdId Max16Text `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 PstCdId"`
TwnNm Max35Text `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 TwnNm"`
CtrySubDvsn Max35Text `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 CtrySubDvsn,omitempty"`
Ctry CountryCode `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Ctry"`
}
type Requirement1 struct {
VartnMrgnRqrmnt MarginRequirement1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 VartnMrgnRqrmnt"`
SgrtdIndpdntAmtRqrmnt MarginRequirement1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 SgrtdIndpdntAmtRqrmnt,omitempty"`
}
type Result1 struct {
DueToPtyA ActiveCurrencyAndAmount `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 DueToPtyA,omitempty"`
DueToPtyB ActiveCurrencyAndAmount `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 DueToPtyB,omitempty"`
AddtlInf Max210Text `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 AddtlInf,omitempty"`
}
// May be one of DRDW, DRUP, NONE, CLSR
type RoundingMethod1Code string
type SegregatedIndependentAmountMargin1 struct {
MinTrfAmt ActiveCurrencyAndAmount `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 MinTrfAmt"`
RndgAmt ActiveCurrencyAndAmount `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 RndgAmt,omitempty"`
RndgMtd RoundingMethod1Code `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 RndgMtd,omitempty"`
}
type SupplementaryData1 struct {
PlcAndNm Max350Text `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 PlcAndNm,omitempty"`
Envlp SupplementaryDataEnvelope1 `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 Envlp"`
}
type SupplementaryDataEnvelope1 struct {
Item string `xml:",any"`
}
// May be one of SECU, UNSE
type ThresholdType1Code string
type VariationMargin1 struct {
ThrshldAmt ActiveCurrencyAndAmount `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 ThrshldAmt"`
ThrshldTp ThresholdType1Code `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 ThrshldTp,omitempty"`
MinTrfAmt ActiveCurrencyAndAmount `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 MinTrfAmt"`
RndgAmt ActiveCurrencyAndAmount `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 RndgAmt"`
RndgMtd RoundingMethod1Code `xml:"urn:iso:std:iso:20022:tech:xsd:colr.003.001.04 RndgMtd"`
}
type xsdDate time.Time
func (t *xsdDate) UnmarshalText(text []byte) error {
return _unmarshalTime(text, (*time.Time)(t), "2006-01-02")
}
func (t xsdDate) MarshalText() ([]byte, error) {
return _marshalTime((time.Time)(t), "2006-01-02")
}
func (t xsdDate) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
if (time.Time)(t).IsZero() {
return nil
}
m, err := t.MarshalText()
if err != nil {
return err
}
return e.EncodeElement(m, start)
}
func (t xsdDate) MarshalXMLAttr(name xml.Name) (xml.Attr, error) {
if (time.Time)(t).IsZero() {
return xml.Attr{}, nil
}
m, err := t.MarshalText()
return xml.Attr{Name: name, Value: string(m)}, err
}
func _unmarshalTime(text []byte, t *time.Time, format string) (err error) {
s := string(bytes.TrimSpace(text))
*t, err = time.Parse(format, s)
if _, ok := err.(*time.ParseError); ok {
*t, err = time.Parse(format+"Z07:00", s)
}
return err
}
func _marshalTime(t time.Time, format string) ([]byte, error) {
return []byte(t.Format(format + "Z07:00")), nil
}
type xsdDateTime time.Time
func (t *xsdDateTime) UnmarshalText(text []byte) error {
return _unmarshalTime(text, (*time.Time)(t), "2006-01-02T15:04:05.999999999")
}
func (t xsdDateTime) MarshalText() ([]byte, error) {
return _marshalTime((time.Time)(t), "2006-01-02T15:04:05.999999999")
}
func (t xsdDateTime) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
if (time.Time)(t).IsZero() {
return nil
}
m, err := t.MarshalText()
if err != nil {
return err
}
return e.EncodeElement(m, start)
}
func (t xsdDateTime) MarshalXMLAttr(name xml.Name) (xml.Attr, error) {
if (time.Time)(t).IsZero() {
return xml.Attr{}, nil
}
m, err := t.MarshalText()
return xml.Attr{Name: name, Value: string(m)}, err
}