-
Notifications
You must be signed in to change notification settings - Fork 2
/
o_b_write_domestic_standing_order_consent_response6_data_initiation.go
483 lines (382 loc) · 16.9 KB
/
o_b_write_domestic_standing_order_consent_response6_data_initiation.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
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
// 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"
)
// OBWriteDomesticStandingOrderConsentResponse6DataInitiation OBWriteDomesticStandingOrderConsentResponse6DataInitiation The Initiation payload is sent by the initiating party to the ASPSP. It is used to request movement of funds from the debtor account to a creditor for a domestic standing order.
//
// swagger:model OBWriteDomesticStandingOrderConsentResponse6DataInitiation
type OBWriteDomesticStandingOrderConsentResponse6DataInitiation struct {
// creditor account
// Required: true
CreditorAccount *OBWriteDomesticStandingOrderConsentResponse6DataInitiationCreditorAccount `json:"CreditorAccount" yaml:"CreditorAccount"`
// debtor account
DebtorAccount *OBWriteDomesticStandingOrderConsentResponse6DataInitiationDebtorAccount `json:"DebtorAccount,omitempty" yaml:"DebtorAccount,omitempty"`
// final payment amount
FinalPaymentAmount *OBWriteDomesticStandingOrderConsentResponse6DataInitiationFinalPaymentAmount `json:"FinalPaymentAmount,omitempty" yaml:"FinalPaymentAmount,omitempty"`
// The date on which the final payment for a Standing Order schedule will be made.All dates in the JSON payloads are represented in ISO 8601 date-time format.
// All date-time fields in responses must include the timezone. An example is below:
// 2017-04-05T10:43:07+00:00
// Format: date-time
// Format: date-time
FinalPaymentDateTime strfmt.DateTime `json:"FinalPaymentDateTime,omitempty" yaml:"FinalPaymentDateTime,omitempty"`
// first payment amount
// Required: true
FirstPaymentAmount *OBWriteDomesticStandingOrderConsentResponse6DataInitiationFirstPaymentAmount `json:"FirstPaymentAmount" yaml:"FirstPaymentAmount"`
// The date on which the first payment for a Standing Order schedule will be made.All dates in the JSON payloads are represented in ISO 8601 date-time format.
// All date-time fields in responses must include the timezone. An example is below:
// 2017-04-05T10:43:07+00:00
// Required: true
// Format: date-time
FirstPaymentDateTime strfmt.DateTime `json:"FirstPaymentDateTime" yaml:"FirstPaymentDateTime"`
// Individual Definitions:
// EvryDay - Every day
// EvryWorkgDay - Every working day
// IntrvlWkDay - An interval specified in weeks (01 to 09), and the day within the week (01 to 07)
// WkInMnthDay - A monthly interval, specifying the week of the month (01 to 05) and day within the week (01 to 07)
// IntrvlMnthDay - An interval specified in months (between 01 to 06, 12, 24), specifying the day within the month (-5 to -1, 1 to 31)
// QtrDay - Quarterly (either ENGLISH, SCOTTISH, or RECEIVED).
// ENGLISH = Paid on the 25th March, 24th June, 29th September and 25th December.
// SCOTTISH = Paid on the 2nd February, 15th May, 1st August and 11th November.
// RECEIVED = Paid on the 20th March, 19th June, 24th September and 20th December.
// Individual Patterns:
// EvryDay (ScheduleCode)
// EvryWorkgDay (ScheduleCode)
// IntrvlWkDay:IntervalInWeeks:DayInWeek (ScheduleCode + IntervalInWeeks + DayInWeek)
// WkInMnthDay:WeekInMonth:DayInWeek (ScheduleCode + WeekInMonth + DayInWeek)
// IntrvlMnthDay:IntervalInMonths:DayInMonth (ScheduleCode + IntervalInMonths + DayInMonth)
// QtrDay: + either (ENGLISH, SCOTTISH or RECEIVED) ScheduleCode + QuarterDay
// The regular expression for this element combines five smaller versions for each permitted pattern. To aid legibility - the components are presented individually here:
// EvryDay
// EvryWorkgDay
// IntrvlWkDay:0[1-9]:0[1-7]
// WkInMnthDay:0[1-5]:0[1-7]
// IntrvlMnthDay:(0[1-6]|12|24):(-0[1-5]|0[1-9]|[12][0-9]|3[01])
// QtrDay:(ENGLISH|SCOTTISH|RECEIVED)
// Full Regular Expression:
// ^(EvryDay)$|^(EvryWorkgDay)$|^(IntrvlWkDay:0[1-9]:0[1-7])$|^(WkInMnthDay:0[1-5]:0[1-7])$|^(IntrvlMnthDay:(0[1-6]|12|24):(-0[1-5]|0[1-9]|[12][0-9]|3[01]))$|^(QtrDay:(ENGLISH|SCOTTISH|RECEIVED))$
// Required: true
// Pattern: ^(EvryDay)$|^(EvryWorkgDay)$|^(IntrvlDay:((0[2-9])|([1-2][0-9])|3[0-1]))$|^(IntrvlWkDay:0[1-9]:0[1-7])$|^(WkInMnthDay:0[1-5]:0[1-7])$|^(IntrvlMnthDay:(0[1-6]|12|24):(-0[1-5]|0[1-9]|[12][0-9]|3[01]))$|^(QtrDay:(ENGLISH|SCOTTISH|RECEIVED))$
Frequency string `json:"Frequency" yaml:"Frequency"`
// Number of the payments that will be made in completing this frequency sequence including any executed since the sequence start date.
// Max Length: 35
// Min Length: 1
NumberOfPayments string `json:"NumberOfPayments,omitempty" yaml:"NumberOfPayments,omitempty"`
// recurring payment amount
RecurringPaymentAmount *OBWriteDomesticStandingOrderConsentResponse6DataInitiationRecurringPaymentAmount `json:"RecurringPaymentAmount,omitempty" yaml:"RecurringPaymentAmount,omitempty"`
// The date on which the first recurring payment for a Standing Order schedule will be made.
// Usage: This must be populated only if the first recurring date is different to the first payment date.All dates in the JSON payloads are represented in ISO 8601 date-time format.
// All date-time fields in responses must include the timezone. An example is below:
// 2017-04-05T10:43:07+00:00
// Format: date-time
// Format: date-time
RecurringPaymentDateTime strfmt.DateTime `json:"RecurringPaymentDateTime,omitempty" yaml:"RecurringPaymentDateTime,omitempty"`
// Unique reference, as assigned by the creditor, to unambiguously refer to the payment transaction.
// Usage: If available, the initiating party should provide this reference in the structured remittance information, to enable reconciliation by the creditor upon receipt of the amount of money.
// If the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.
// Max Length: 35
// Min Length: 1
Reference string `json:"Reference,omitempty" yaml:"Reference,omitempty"`
// supplementary data
SupplementaryData OBSupplementaryData1 `json:"SupplementaryData,omitempty" yaml:"SupplementaryData,omitempty"`
}
// Validate validates this o b write domestic standing order consent response6 data initiation
func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiation) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreditorAccount(formats); err != nil {
res = append(res, err)
}
if err := m.validateDebtorAccount(formats); err != nil {
res = append(res, err)
}
if err := m.validateFinalPaymentAmount(formats); err != nil {
res = append(res, err)
}
if err := m.validateFinalPaymentDateTime(formats); err != nil {
res = append(res, err)
}
if err := m.validateFirstPaymentAmount(formats); err != nil {
res = append(res, err)
}
if err := m.validateFirstPaymentDateTime(formats); err != nil {
res = append(res, err)
}
if err := m.validateFrequency(formats); err != nil {
res = append(res, err)
}
if err := m.validateNumberOfPayments(formats); err != nil {
res = append(res, err)
}
if err := m.validateRecurringPaymentAmount(formats); err != nil {
res = append(res, err)
}
if err := m.validateRecurringPaymentDateTime(formats); err != nil {
res = append(res, err)
}
if err := m.validateReference(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiation) validateCreditorAccount(formats strfmt.Registry) error {
if err := validate.Required("CreditorAccount", "body", m.CreditorAccount); err != nil {
return err
}
if m.CreditorAccount != nil {
if err := m.CreditorAccount.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("CreditorAccount")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("CreditorAccount")
}
return err
}
}
return nil
}
func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiation) validateDebtorAccount(formats strfmt.Registry) error {
if swag.IsZero(m.DebtorAccount) { // not required
return nil
}
if m.DebtorAccount != nil {
if err := m.DebtorAccount.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("DebtorAccount")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("DebtorAccount")
}
return err
}
}
return nil
}
func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiation) validateFinalPaymentAmount(formats strfmt.Registry) error {
if swag.IsZero(m.FinalPaymentAmount) { // not required
return nil
}
if m.FinalPaymentAmount != nil {
if err := m.FinalPaymentAmount.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("FinalPaymentAmount")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("FinalPaymentAmount")
}
return err
}
}
return nil
}
func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiation) validateFinalPaymentDateTime(formats strfmt.Registry) error {
if swag.IsZero(m.FinalPaymentDateTime) { // not required
return nil
}
if err := validate.FormatOf("FinalPaymentDateTime", "body", "date-time", m.FinalPaymentDateTime.String(), formats); err != nil {
return err
}
return nil
}
func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiation) validateFirstPaymentAmount(formats strfmt.Registry) error {
if err := validate.Required("FirstPaymentAmount", "body", m.FirstPaymentAmount); err != nil {
return err
}
if m.FirstPaymentAmount != nil {
if err := m.FirstPaymentAmount.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("FirstPaymentAmount")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("FirstPaymentAmount")
}
return err
}
}
return nil
}
func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiation) validateFirstPaymentDateTime(formats strfmt.Registry) error {
if err := validate.Required("FirstPaymentDateTime", "body", strfmt.DateTime(m.FirstPaymentDateTime)); err != nil {
return err
}
if err := validate.FormatOf("FirstPaymentDateTime", "body", "date-time", m.FirstPaymentDateTime.String(), formats); err != nil {
return err
}
return nil
}
func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiation) validateFrequency(formats strfmt.Registry) error {
if err := validate.RequiredString("Frequency", "body", m.Frequency); err != nil {
return err
}
if err := validate.Pattern("Frequency", "body", m.Frequency, `^(EvryDay)$|^(EvryWorkgDay)$|^(IntrvlDay:((0[2-9])|([1-2][0-9])|3[0-1]))$|^(IntrvlWkDay:0[1-9]:0[1-7])$|^(WkInMnthDay:0[1-5]:0[1-7])$|^(IntrvlMnthDay:(0[1-6]|12|24):(-0[1-5]|0[1-9]|[12][0-9]|3[01]))$|^(QtrDay:(ENGLISH|SCOTTISH|RECEIVED))$`); err != nil {
return err
}
return nil
}
func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiation) validateNumberOfPayments(formats strfmt.Registry) error {
if swag.IsZero(m.NumberOfPayments) { // not required
return nil
}
if err := validate.MinLength("NumberOfPayments", "body", m.NumberOfPayments, 1); err != nil {
return err
}
if err := validate.MaxLength("NumberOfPayments", "body", m.NumberOfPayments, 35); err != nil {
return err
}
return nil
}
func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiation) validateRecurringPaymentAmount(formats strfmt.Registry) error {
if swag.IsZero(m.RecurringPaymentAmount) { // not required
return nil
}
if m.RecurringPaymentAmount != nil {
if err := m.RecurringPaymentAmount.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("RecurringPaymentAmount")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("RecurringPaymentAmount")
}
return err
}
}
return nil
}
func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiation) validateRecurringPaymentDateTime(formats strfmt.Registry) error {
if swag.IsZero(m.RecurringPaymentDateTime) { // not required
return nil
}
if err := validate.FormatOf("RecurringPaymentDateTime", "body", "date-time", m.RecurringPaymentDateTime.String(), formats); err != nil {
return err
}
return nil
}
func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiation) validateReference(formats strfmt.Registry) error {
if swag.IsZero(m.Reference) { // not required
return nil
}
if err := validate.MinLength("Reference", "body", m.Reference, 1); err != nil {
return err
}
if err := validate.MaxLength("Reference", "body", m.Reference, 35); err != nil {
return err
}
return nil
}
// ContextValidate validate this o b write domestic standing order consent response6 data initiation based on the context it is used
func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateCreditorAccount(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateDebtorAccount(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateFinalPaymentAmount(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateFirstPaymentAmount(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRecurringPaymentAmount(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiation) contextValidateCreditorAccount(ctx context.Context, formats strfmt.Registry) error {
if m.CreditorAccount != nil {
if err := m.CreditorAccount.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("CreditorAccount")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("CreditorAccount")
}
return err
}
}
return nil
}
func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiation) contextValidateDebtorAccount(ctx context.Context, formats strfmt.Registry) error {
if m.DebtorAccount != nil {
if swag.IsZero(m.DebtorAccount) { // not required
return nil
}
if err := m.DebtorAccount.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("DebtorAccount")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("DebtorAccount")
}
return err
}
}
return nil
}
func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiation) contextValidateFinalPaymentAmount(ctx context.Context, formats strfmt.Registry) error {
if m.FinalPaymentAmount != nil {
if swag.IsZero(m.FinalPaymentAmount) { // not required
return nil
}
if err := m.FinalPaymentAmount.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("FinalPaymentAmount")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("FinalPaymentAmount")
}
return err
}
}
return nil
}
func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiation) contextValidateFirstPaymentAmount(ctx context.Context, formats strfmt.Registry) error {
if m.FirstPaymentAmount != nil {
if err := m.FirstPaymentAmount.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("FirstPaymentAmount")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("FirstPaymentAmount")
}
return err
}
}
return nil
}
func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiation) contextValidateRecurringPaymentAmount(ctx context.Context, formats strfmt.Registry) error {
if m.RecurringPaymentAmount != nil {
if swag.IsZero(m.RecurringPaymentAmount) { // not required
return nil
}
if err := m.RecurringPaymentAmount.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("RecurringPaymentAmount")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("RecurringPaymentAmount")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiation) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiation) UnmarshalBinary(b []byte) error {
var res OBWriteDomesticStandingOrderConsentResponse6DataInitiation
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}