/
o_b_write_international_standing_order_consent6.go
2102 lines (1656 loc) · 68.1 KB
/
o_b_write_international_standing_order_consent6.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
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// 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"
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// OBWriteInternationalStandingOrderConsent6 o b write international standing order consent6
//
// swagger:model OBWriteInternationalStandingOrderConsent6
type OBWriteInternationalStandingOrderConsent6 struct {
// data
// Required: true
Data *OBWriteInternationalStandingOrderConsent6Data `json:"Data"`
// risk
// Required: true
Risk *OBRisk1 `json:"Risk"`
}
// Validate validates this o b write international standing order consent6
func (m *OBWriteInternationalStandingOrderConsent6) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateData(formats); err != nil {
res = append(res, err)
}
if err := m.validateRisk(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6) validateData(formats strfmt.Registry) error {
if err := validate.Required("Data", "body", m.Data); err != nil {
return err
}
if m.Data != nil {
if err := m.Data.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data")
}
return err
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6) validateRisk(formats strfmt.Registry) error {
if err := validate.Required("Risk", "body", m.Risk); err != nil {
return err
}
if m.Risk != nil {
if err := m.Risk.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Risk")
}
return err
}
}
return nil
}
// ContextValidate validate this o b write international standing order consent6 based on the context it is used
func (m *OBWriteInternationalStandingOrderConsent6) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateData(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRisk(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
if m.Data != nil {
if err := m.Data.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data")
}
return err
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6) contextValidateRisk(ctx context.Context, formats strfmt.Registry) error {
if m.Risk != nil {
if err := m.Risk.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Risk")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *OBWriteInternationalStandingOrderConsent6) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *OBWriteInternationalStandingOrderConsent6) UnmarshalBinary(b []byte) error {
var res OBWriteInternationalStandingOrderConsent6
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// OBWriteInternationalStandingOrderConsent6Data o b write international standing order consent6 data
//
// swagger:model OBWriteInternationalStandingOrderConsent6Data
type OBWriteInternationalStandingOrderConsent6Data struct {
// authorisation
Authorisation *OBWriteInternationalStandingOrderConsent6DataAuthorisation `json:"Authorisation,omitempty"`
// initiation
// Required: true
Initiation *OBWriteInternationalStandingOrderConsent6DataInitiation `json:"Initiation"`
// Specifies the Open Banking service request types.
// Required: true
// Enum: [Create]
Permission *string `json:"Permission"`
// Specifies to share the refund account details with PISP
// Enum: [No Yes]
ReadRefundAccount string `json:"ReadRefundAccount,omitempty"`
// s c a support data
SCASupportData *OBWriteInternationalStandingOrderConsent6DataSCASupportData `json:"SCASupportData,omitempty"`
}
// Validate validates this o b write international standing order consent6 data
func (m *OBWriteInternationalStandingOrderConsent6Data) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAuthorisation(formats); err != nil {
res = append(res, err)
}
if err := m.validateInitiation(formats); err != nil {
res = append(res, err)
}
if err := m.validatePermission(formats); err != nil {
res = append(res, err)
}
if err := m.validateReadRefundAccount(formats); err != nil {
res = append(res, err)
}
if err := m.validateSCASupportData(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6Data) validateAuthorisation(formats strfmt.Registry) error {
if swag.IsZero(m.Authorisation) { // not required
return nil
}
if m.Authorisation != nil {
if err := m.Authorisation.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + "Authorisation")
}
return err
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6Data) validateInitiation(formats strfmt.Registry) error {
if err := validate.Required("Data"+"."+"Initiation", "body", m.Initiation); err != nil {
return err
}
if m.Initiation != nil {
if err := m.Initiation.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + "Initiation")
}
return err
}
}
return nil
}
var oBWriteInternationalStandingOrderConsent6DataTypePermissionPropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["Create"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
oBWriteInternationalStandingOrderConsent6DataTypePermissionPropEnum = append(oBWriteInternationalStandingOrderConsent6DataTypePermissionPropEnum, v)
}
}
const (
// OBWriteInternationalStandingOrderConsent6DataPermissionCreate captures enum value "Create"
OBWriteInternationalStandingOrderConsent6DataPermissionCreate string = "Create"
)
// prop value enum
func (m *OBWriteInternationalStandingOrderConsent6Data) validatePermissionEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, oBWriteInternationalStandingOrderConsent6DataTypePermissionPropEnum, true); err != nil {
return err
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6Data) validatePermission(formats strfmt.Registry) error {
if err := validate.Required("Data"+"."+"Permission", "body", m.Permission); err != nil {
return err
}
// value enum
if err := m.validatePermissionEnum("Data"+"."+"Permission", "body", *m.Permission); err != nil {
return err
}
return nil
}
var oBWriteInternationalStandingOrderConsent6DataTypeReadRefundAccountPropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["No","Yes"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
oBWriteInternationalStandingOrderConsent6DataTypeReadRefundAccountPropEnum = append(oBWriteInternationalStandingOrderConsent6DataTypeReadRefundAccountPropEnum, v)
}
}
const (
// OBWriteInternationalStandingOrderConsent6DataReadRefundAccountNo captures enum value "No"
OBWriteInternationalStandingOrderConsent6DataReadRefundAccountNo string = "No"
// OBWriteInternationalStandingOrderConsent6DataReadRefundAccountYes captures enum value "Yes"
OBWriteInternationalStandingOrderConsent6DataReadRefundAccountYes string = "Yes"
)
// prop value enum
func (m *OBWriteInternationalStandingOrderConsent6Data) validateReadRefundAccountEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, oBWriteInternationalStandingOrderConsent6DataTypeReadRefundAccountPropEnum, true); err != nil {
return err
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6Data) validateReadRefundAccount(formats strfmt.Registry) error {
if swag.IsZero(m.ReadRefundAccount) { // not required
return nil
}
// value enum
if err := m.validateReadRefundAccountEnum("Data"+"."+"ReadRefundAccount", "body", m.ReadRefundAccount); err != nil {
return err
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6Data) validateSCASupportData(formats strfmt.Registry) error {
if swag.IsZero(m.SCASupportData) { // not required
return nil
}
if m.SCASupportData != nil {
if err := m.SCASupportData.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + "SCASupportData")
}
return err
}
}
return nil
}
// ContextValidate validate this o b write international standing order consent6 data based on the context it is used
func (m *OBWriteInternationalStandingOrderConsent6Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateAuthorisation(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateInitiation(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateSCASupportData(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6Data) contextValidateAuthorisation(ctx context.Context, formats strfmt.Registry) error {
if m.Authorisation != nil {
if err := m.Authorisation.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + "Authorisation")
}
return err
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6Data) contextValidateInitiation(ctx context.Context, formats strfmt.Registry) error {
if m.Initiation != nil {
if err := m.Initiation.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + "Initiation")
}
return err
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6Data) contextValidateSCASupportData(ctx context.Context, formats strfmt.Registry) error {
if m.SCASupportData != nil {
if err := m.SCASupportData.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + "SCASupportData")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *OBWriteInternationalStandingOrderConsent6Data) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *OBWriteInternationalStandingOrderConsent6Data) UnmarshalBinary(b []byte) error {
var res OBWriteInternationalStandingOrderConsent6Data
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// OBWriteInternationalStandingOrderConsent6DataAuthorisation The authorisation type request from the TPP.
//
// swagger:model OBWriteInternationalStandingOrderConsent6DataAuthorisation
type OBWriteInternationalStandingOrderConsent6DataAuthorisation struct {
// Type of authorisation flow requested.
// Required: true
// Enum: [Any Single]
AuthorisationType *string `json:"AuthorisationType"`
// Date and time at which the requested authorisation flow must be completed.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
CompletionDateTime strfmt.DateTime `json:"CompletionDateTime,omitempty"`
}
// Validate validates this o b write international standing order consent6 data authorisation
func (m *OBWriteInternationalStandingOrderConsent6DataAuthorisation) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAuthorisationType(formats); err != nil {
res = append(res, err)
}
if err := m.validateCompletionDateTime(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
var oBWriteInternationalStandingOrderConsent6DataAuthorisationTypeAuthorisationTypePropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["Any","Single"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
oBWriteInternationalStandingOrderConsent6DataAuthorisationTypeAuthorisationTypePropEnum = append(oBWriteInternationalStandingOrderConsent6DataAuthorisationTypeAuthorisationTypePropEnum, v)
}
}
const (
// OBWriteInternationalStandingOrderConsent6DataAuthorisationAuthorisationTypeAny captures enum value "Any"
OBWriteInternationalStandingOrderConsent6DataAuthorisationAuthorisationTypeAny string = "Any"
// OBWriteInternationalStandingOrderConsent6DataAuthorisationAuthorisationTypeSingle captures enum value "Single"
OBWriteInternationalStandingOrderConsent6DataAuthorisationAuthorisationTypeSingle string = "Single"
)
// prop value enum
func (m *OBWriteInternationalStandingOrderConsent6DataAuthorisation) validateAuthorisationTypeEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, oBWriteInternationalStandingOrderConsent6DataAuthorisationTypeAuthorisationTypePropEnum, true); err != nil {
return err
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6DataAuthorisation) validateAuthorisationType(formats strfmt.Registry) error {
if err := validate.Required("Data"+"."+"Authorisation"+"."+"AuthorisationType", "body", m.AuthorisationType); err != nil {
return err
}
// value enum
if err := m.validateAuthorisationTypeEnum("Data"+"."+"Authorisation"+"."+"AuthorisationType", "body", *m.AuthorisationType); err != nil {
return err
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6DataAuthorisation) validateCompletionDateTime(formats strfmt.Registry) error {
if swag.IsZero(m.CompletionDateTime) { // not required
return nil
}
if err := validate.FormatOf("Data"+"."+"Authorisation"+"."+"CompletionDateTime", "body", "date-time", m.CompletionDateTime.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validates this o b write international standing order consent6 data authorisation based on context it is used
func (m *OBWriteInternationalStandingOrderConsent6DataAuthorisation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *OBWriteInternationalStandingOrderConsent6DataAuthorisation) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *OBWriteInternationalStandingOrderConsent6DataAuthorisation) UnmarshalBinary(b []byte) error {
var res OBWriteInternationalStandingOrderConsent6DataAuthorisation
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// OBWriteInternationalStandingOrderConsent6DataInitiation 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 an international standing order.
//
// swagger:model OBWriteInternationalStandingOrderConsent6DataInitiation
type OBWriteInternationalStandingOrderConsent6DataInitiation struct {
// charge bearer
ChargeBearer OBChargeBearerType1Code `json:"ChargeBearer,omitempty"`
// creditor
Creditor *OBWriteInternationalStandingOrderConsent6DataInitiationCreditor `json:"Creditor,omitempty"`
// creditor account
// Required: true
CreditorAccount *OBWriteInternationalStandingOrderConsent6DataInitiationCreditorAccount `json:"CreditorAccount"`
// creditor agent
CreditorAgent *OBWriteInternationalStandingOrderConsent6DataInitiationCreditorAgent `json:"CreditorAgent,omitempty"`
// Specifies the currency of the to be transferred amount, which is different from the currency of the debtor's account.
// Required: true
// Pattern: ^[A-Z]{3,3}$
CurrencyOfTransfer *string `json:"CurrencyOfTransfer"`
// debtor account
DebtorAccount *OBWriteInternationalStandingOrderConsent6DataInitiationDebtorAccount `json:"DebtorAccount,omitempty"`
// Country in which Credit Account is domiciled. Code to identify a country, a dependency, or another area of particular geopolitical interest, on the basis of country names obtained from the United Nations (ISO 3166, Alpha-2 code).
// Pattern: [A-Z]{2,2}
DestinationCountryCode string `json:"DestinationCountryCode,omitempty"`
// Specifies the purpose of an international payment, when there is no corresponding 4 character code available in the ISO20022 list of Purpose Codes.
// Max Length: 140
// Min Length: 1
ExtendedPurpose string `json:"ExtendedPurpose,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
FinalPaymentDateTime strfmt.DateTime `json:"FinalPaymentDateTime,omitempty"`
// 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"`
// 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"`
// instructed amount
// Required: true
InstructedAmount *OBWriteInternationalStandingOrderConsent6DataInitiationInstructedAmount `json:"InstructedAmount"`
// 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"`
// Specifies the external purpose code in the format of character string with a maximum length of 4 characters.
// The list of valid codes is an external code list published separately.
// External code sets can be downloaded from www.iso20022.org.
// Max Length: 4
// Min Length: 1
Purpose string `json:"Purpose,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"`
// supplementary data
SupplementaryData OBSupplementaryData1 `json:"SupplementaryData,omitempty"`
}
// Validate validates this o b write international standing order consent6 data initiation
func (m *OBWriteInternationalStandingOrderConsent6DataInitiation) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateChargeBearer(formats); err != nil {
res = append(res, err)
}
if err := m.validateCreditor(formats); err != nil {
res = append(res, err)
}
if err := m.validateCreditorAccount(formats); err != nil {
res = append(res, err)
}
if err := m.validateCreditorAgent(formats); err != nil {
res = append(res, err)
}
if err := m.validateCurrencyOfTransfer(formats); err != nil {
res = append(res, err)
}
if err := m.validateDebtorAccount(formats); err != nil {
res = append(res, err)
}
if err := m.validateDestinationCountryCode(formats); err != nil {
res = append(res, err)
}
if err := m.validateExtendedPurpose(formats); err != nil {
res = append(res, err)
}
if err := m.validateFinalPaymentDateTime(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.validateInstructedAmount(formats); err != nil {
res = append(res, err)
}
if err := m.validateNumberOfPayments(formats); err != nil {
res = append(res, err)
}
if err := m.validatePurpose(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 *OBWriteInternationalStandingOrderConsent6DataInitiation) validateChargeBearer(formats strfmt.Registry) error {
if swag.IsZero(m.ChargeBearer) { // not required
return nil
}
if err := m.ChargeBearer.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + "Initiation" + "." + "ChargeBearer")
}
return err
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6DataInitiation) validateCreditor(formats strfmt.Registry) error {
if swag.IsZero(m.Creditor) { // not required
return nil
}
if m.Creditor != nil {
if err := m.Creditor.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + "Initiation" + "." + "Creditor")
}
return err
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6DataInitiation) validateCreditorAccount(formats strfmt.Registry) error {
if err := validate.Required("Data"+"."+"Initiation"+"."+"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("Data" + "." + "Initiation" + "." + "CreditorAccount")
}
return err
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6DataInitiation) validateCreditorAgent(formats strfmt.Registry) error {
if swag.IsZero(m.CreditorAgent) { // not required
return nil
}
if m.CreditorAgent != nil {
if err := m.CreditorAgent.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + "Initiation" + "." + "CreditorAgent")
}
return err
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6DataInitiation) validateCurrencyOfTransfer(formats strfmt.Registry) error {
if err := validate.Required("Data"+"."+"Initiation"+"."+"CurrencyOfTransfer", "body", m.CurrencyOfTransfer); err != nil {
return err
}
if err := validate.Pattern("Data"+"."+"Initiation"+"."+"CurrencyOfTransfer", "body", *m.CurrencyOfTransfer, `^[A-Z]{3,3}$`); err != nil {
return err
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6DataInitiation) 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("Data" + "." + "Initiation" + "." + "DebtorAccount")
}
return err
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6DataInitiation) validateDestinationCountryCode(formats strfmt.Registry) error {
if swag.IsZero(m.DestinationCountryCode) { // not required
return nil
}
if err := validate.Pattern("Data"+"."+"Initiation"+"."+"DestinationCountryCode", "body", m.DestinationCountryCode, `[A-Z]{2,2}`); err != nil {
return err
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6DataInitiation) validateExtendedPurpose(formats strfmt.Registry) error {
if swag.IsZero(m.ExtendedPurpose) { // not required
return nil
}
if err := validate.MinLength("Data"+"."+"Initiation"+"."+"ExtendedPurpose", "body", m.ExtendedPurpose, 1); err != nil {
return err
}
if err := validate.MaxLength("Data"+"."+"Initiation"+"."+"ExtendedPurpose", "body", m.ExtendedPurpose, 140); err != nil {
return err
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6DataInitiation) validateFinalPaymentDateTime(formats strfmt.Registry) error {
if swag.IsZero(m.FinalPaymentDateTime) { // not required
return nil
}
if err := validate.FormatOf("Data"+"."+"Initiation"+"."+"FinalPaymentDateTime", "body", "date-time", m.FinalPaymentDateTime.String(), formats); err != nil {
return err
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6DataInitiation) validateFirstPaymentDateTime(formats strfmt.Registry) error {
if err := validate.Required("Data"+"."+"Initiation"+"."+"FirstPaymentDateTime", "body", m.FirstPaymentDateTime); err != nil {
return err
}
if err := validate.FormatOf("Data"+"."+"Initiation"+"."+"FirstPaymentDateTime", "body", "date-time", m.FirstPaymentDateTime.String(), formats); err != nil {
return err
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6DataInitiation) validateFrequency(formats strfmt.Registry) error {
if err := validate.Required("Data"+"."+"Initiation"+"."+"Frequency", "body", m.Frequency); err != nil {
return err
}
if err := validate.Pattern("Data"+"."+"Initiation"+"."+"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 *OBWriteInternationalStandingOrderConsent6DataInitiation) validateInstructedAmount(formats strfmt.Registry) error {
if err := validate.Required("Data"+"."+"Initiation"+"."+"InstructedAmount", "body", m.InstructedAmount); err != nil {
return err
}
if m.InstructedAmount != nil {
if err := m.InstructedAmount.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + "Initiation" + "." + "InstructedAmount")
}
return err
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6DataInitiation) validateNumberOfPayments(formats strfmt.Registry) error {
if swag.IsZero(m.NumberOfPayments) { // not required
return nil
}
if err := validate.MinLength("Data"+"."+"Initiation"+"."+"NumberOfPayments", "body", m.NumberOfPayments, 1); err != nil {
return err
}
if err := validate.MaxLength("Data"+"."+"Initiation"+"."+"NumberOfPayments", "body", m.NumberOfPayments, 35); err != nil {
return err
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6DataInitiation) validatePurpose(formats strfmt.Registry) error {
if swag.IsZero(m.Purpose) { // not required
return nil
}
if err := validate.MinLength("Data"+"."+"Initiation"+"."+"Purpose", "body", m.Purpose, 1); err != nil {
return err
}
if err := validate.MaxLength("Data"+"."+"Initiation"+"."+"Purpose", "body", m.Purpose, 4); err != nil {
return err
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6DataInitiation) validateReference(formats strfmt.Registry) error {
if swag.IsZero(m.Reference) { // not required
return nil
}
if err := validate.MinLength("Data"+"."+"Initiation"+"."+"Reference", "body", m.Reference, 1); err != nil {
return err
}
if err := validate.MaxLength("Data"+"."+"Initiation"+"."+"Reference", "body", m.Reference, 35); err != nil {
return err
}
return nil
}
// ContextValidate validate this o b write international standing order consent6 data initiation based on the context it is used
func (m *OBWriteInternationalStandingOrderConsent6DataInitiation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateChargeBearer(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateCreditor(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateCreditorAccount(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateCreditorAgent(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateDebtorAccount(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateInstructedAmount(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6DataInitiation) contextValidateChargeBearer(ctx context.Context, formats strfmt.Registry) error {
if err := m.ChargeBearer.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + "Initiation" + "." + "ChargeBearer")
}
return err
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6DataInitiation) contextValidateCreditor(ctx context.Context, formats strfmt.Registry) error {
if m.Creditor != nil {
if err := m.Creditor.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + "Initiation" + "." + "Creditor")
}
return err
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderConsent6DataInitiation) contextValidateCreditorAccount(ctx context.Context, formats strfmt.Registry) error {
if m.CreditorAccount != nil {