/
o_b_write_international_standing_order_response7.go
3023 lines (2376 loc) · 91.7 KB
/
o_b_write_international_standing_order_response7.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"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// OBWriteInternationalStandingOrderResponse7 o b write international standing order response7
//
// swagger:model OBWriteInternationalStandingOrderResponse7
type OBWriteInternationalStandingOrderResponse7 struct {
// data
// Required: true
Data *OBWriteInternationalStandingOrderResponse7Data `json:"Data"`
// links
Links *Links `json:"Links,omitempty"`
// meta
Meta *Meta `json:"Meta,omitempty"`
}
// Validate validates this o b write international standing order response7
func (m *OBWriteInternationalStandingOrderResponse7) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateData(formats); err != nil {
res = append(res, err)
}
if err := m.validateLinks(formats); err != nil {
res = append(res, err)
}
if err := m.validateMeta(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7) 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 *OBWriteInternationalStandingOrderResponse7) validateLinks(formats strfmt.Registry) error {
if swag.IsZero(m.Links) { // not required
return nil
}
if m.Links != nil {
if err := m.Links.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Links")
}
return err
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
if m.Meta != nil {
if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta")
}
return err
}
}
return nil
}
// ContextValidate validate this o b write international standing order response7 based on the context it is used
func (m *OBWriteInternationalStandingOrderResponse7) 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.contextValidateLinks(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMeta(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7) 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 *OBWriteInternationalStandingOrderResponse7) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error {
if m.Links != nil {
if err := m.Links.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Links")
}
return err
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
if m.Meta != nil {
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *OBWriteInternationalStandingOrderResponse7) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *OBWriteInternationalStandingOrderResponse7) UnmarshalBinary(b []byte) error {
var res OBWriteInternationalStandingOrderResponse7
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// OBWriteInternationalStandingOrderResponse7Data o b write international standing order response7 data
//
// swagger:model OBWriteInternationalStandingOrderResponse7Data
type OBWriteInternationalStandingOrderResponse7Data struct {
// charges
Charges []*OBWriteInternationalStandingOrderResponse7DataChargesItems0 `json:"Charges"`
// OB: Unique identification as assigned by the ASPSP to uniquely identify the consent resource.
// Required: true
// Max Length: 128
// Min Length: 1
ConsentID *string `json:"ConsentId"`
// Date and time at which the resource was created.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
CreationDateTime *strfmt.DateTime `json:"CreationDateTime"`
// debtor
Debtor *OBDebtorIdentification1 `json:"Debtor,omitempty"`
// initiation
// Required: true
Initiation *OBWriteInternationalStandingOrderResponse7DataInitiation `json:"Initiation"`
// OB: Unique identification as assigned by the ASPSP to uniquely identify the international standing order resource.
// Required: true
// Max Length: 40
// Min Length: 1
InternationalStandingOrderID *string `json:"InternationalStandingOrderId"`
// multi authorisation
MultiAuthorisation *OBWriteInternationalStandingOrderResponse7DataMultiAuthorisation `json:"MultiAuthorisation,omitempty"`
// refund
Refund *OBWriteInternationalStandingOrderResponse7DataRefund `json:"Refund,omitempty"`
// Specifies the status of resource in code form.
// Required: true
// Enum: [Cancelled InitiationCompleted InitiationFailed InitiationPending]
Status *string `json:"Status"`
// Date and time at which the resource status was updated.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
StatusUpdateDateTime *strfmt.DateTime `json:"StatusUpdateDateTime"`
}
// Validate validates this o b write international standing order response7 data
func (m *OBWriteInternationalStandingOrderResponse7Data) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCharges(formats); err != nil {
res = append(res, err)
}
if err := m.validateConsentID(formats); err != nil {
res = append(res, err)
}
if err := m.validateCreationDateTime(formats); err != nil {
res = append(res, err)
}
if err := m.validateDebtor(formats); err != nil {
res = append(res, err)
}
if err := m.validateInitiation(formats); err != nil {
res = append(res, err)
}
if err := m.validateInternationalStandingOrderID(formats); err != nil {
res = append(res, err)
}
if err := m.validateMultiAuthorisation(formats); err != nil {
res = append(res, err)
}
if err := m.validateRefund(formats); err != nil {
res = append(res, err)
}
if err := m.validateStatus(formats); err != nil {
res = append(res, err)
}
if err := m.validateStatusUpdateDateTime(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7Data) validateCharges(formats strfmt.Registry) error {
if swag.IsZero(m.Charges) { // not required
return nil
}
for i := 0; i < len(m.Charges); i++ {
if swag.IsZero(m.Charges[i]) { // not required
continue
}
if m.Charges[i] != nil {
if err := m.Charges[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + "Charges" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7Data) validateConsentID(formats strfmt.Registry) error {
if err := validate.Required("Data"+"."+"ConsentId", "body", m.ConsentID); err != nil {
return err
}
if err := validate.MinLength("Data"+"."+"ConsentId", "body", *m.ConsentID, 1); err != nil {
return err
}
if err := validate.MaxLength("Data"+"."+"ConsentId", "body", *m.ConsentID, 128); err != nil {
return err
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7Data) validateCreationDateTime(formats strfmt.Registry) error {
if err := validate.Required("Data"+"."+"CreationDateTime", "body", m.CreationDateTime); err != nil {
return err
}
if err := validate.FormatOf("Data"+"."+"CreationDateTime", "body", "date-time", m.CreationDateTime.String(), formats); err != nil {
return err
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7Data) validateDebtor(formats strfmt.Registry) error {
if swag.IsZero(m.Debtor) { // not required
return nil
}
if m.Debtor != nil {
if err := m.Debtor.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + "Debtor")
}
return err
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7Data) 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
}
func (m *OBWriteInternationalStandingOrderResponse7Data) validateInternationalStandingOrderID(formats strfmt.Registry) error {
if err := validate.Required("Data"+"."+"InternationalStandingOrderId", "body", m.InternationalStandingOrderID); err != nil {
return err
}
if err := validate.MinLength("Data"+"."+"InternationalStandingOrderId", "body", *m.InternationalStandingOrderID, 1); err != nil {
return err
}
if err := validate.MaxLength("Data"+"."+"InternationalStandingOrderId", "body", *m.InternationalStandingOrderID, 40); err != nil {
return err
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7Data) validateMultiAuthorisation(formats strfmt.Registry) error {
if swag.IsZero(m.MultiAuthorisation) { // not required
return nil
}
if m.MultiAuthorisation != nil {
if err := m.MultiAuthorisation.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + "MultiAuthorisation")
}
return err
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7Data) validateRefund(formats strfmt.Registry) error {
if swag.IsZero(m.Refund) { // not required
return nil
}
if m.Refund != nil {
if err := m.Refund.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + "Refund")
}
return err
}
}
return nil
}
var oBWriteInternationalStandingOrderResponse7DataTypeStatusPropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["Cancelled","InitiationCompleted","InitiationFailed","InitiationPending"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
oBWriteInternationalStandingOrderResponse7DataTypeStatusPropEnum = append(oBWriteInternationalStandingOrderResponse7DataTypeStatusPropEnum, v)
}
}
const (
// OBWriteInternationalStandingOrderResponse7DataStatusCancelled captures enum value "Cancelled"
OBWriteInternationalStandingOrderResponse7DataStatusCancelled string = "Cancelled"
// OBWriteInternationalStandingOrderResponse7DataStatusInitiationCompleted captures enum value "InitiationCompleted"
OBWriteInternationalStandingOrderResponse7DataStatusInitiationCompleted string = "InitiationCompleted"
// OBWriteInternationalStandingOrderResponse7DataStatusInitiationFailed captures enum value "InitiationFailed"
OBWriteInternationalStandingOrderResponse7DataStatusInitiationFailed string = "InitiationFailed"
// OBWriteInternationalStandingOrderResponse7DataStatusInitiationPending captures enum value "InitiationPending"
OBWriteInternationalStandingOrderResponse7DataStatusInitiationPending string = "InitiationPending"
)
// prop value enum
func (m *OBWriteInternationalStandingOrderResponse7Data) validateStatusEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, oBWriteInternationalStandingOrderResponse7DataTypeStatusPropEnum, true); err != nil {
return err
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7Data) validateStatus(formats strfmt.Registry) error {
if err := validate.Required("Data"+"."+"Status", "body", m.Status); err != nil {
return err
}
// value enum
if err := m.validateStatusEnum("Data"+"."+"Status", "body", *m.Status); err != nil {
return err
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7Data) validateStatusUpdateDateTime(formats strfmt.Registry) error {
if err := validate.Required("Data"+"."+"StatusUpdateDateTime", "body", m.StatusUpdateDateTime); err != nil {
return err
}
if err := validate.FormatOf("Data"+"."+"StatusUpdateDateTime", "body", "date-time", m.StatusUpdateDateTime.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validate this o b write international standing order response7 data based on the context it is used
func (m *OBWriteInternationalStandingOrderResponse7Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateCharges(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateDebtor(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateInitiation(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMultiAuthorisation(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRefund(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7Data) contextValidateCharges(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Charges); i++ {
if m.Charges[i] != nil {
if err := m.Charges[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + "Charges" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7Data) contextValidateDebtor(ctx context.Context, formats strfmt.Registry) error {
if m.Debtor != nil {
if err := m.Debtor.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + "Debtor")
}
return err
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7Data) 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 *OBWriteInternationalStandingOrderResponse7Data) contextValidateMultiAuthorisation(ctx context.Context, formats strfmt.Registry) error {
if m.MultiAuthorisation != nil {
if err := m.MultiAuthorisation.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + "MultiAuthorisation")
}
return err
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7Data) contextValidateRefund(ctx context.Context, formats strfmt.Registry) error {
if m.Refund != nil {
if err := m.Refund.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + "Refund")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *OBWriteInternationalStandingOrderResponse7Data) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *OBWriteInternationalStandingOrderResponse7Data) UnmarshalBinary(b []byte) error {
var res OBWriteInternationalStandingOrderResponse7Data
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// OBWriteInternationalStandingOrderResponse7DataChargesItems0 Set of elements used to provide details of a charge for the payment initiation.
//
// swagger:model OBWriteInternationalStandingOrderResponse7DataChargesItems0
type OBWriteInternationalStandingOrderResponse7DataChargesItems0 struct {
// amount
// Required: true
Amount *OBActiveOrHistoricCurrencyAndAmount `json:"Amount"`
// charge bearer
// Required: true
ChargeBearer *OBChargeBearerType1Code `json:"ChargeBearer"`
// type
// Required: true
Type *OBExternalPaymentChargeType1Code `json:"Type"`
}
// Validate validates this o b write international standing order response7 data charges items0
func (m *OBWriteInternationalStandingOrderResponse7DataChargesItems0) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAmount(formats); err != nil {
res = append(res, err)
}
if err := m.validateChargeBearer(formats); err != nil {
res = append(res, err)
}
if err := m.validateType(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7DataChargesItems0) validateAmount(formats strfmt.Registry) error {
if err := validate.Required("Amount", "body", m.Amount); err != nil {
return err
}
if m.Amount != nil {
if err := m.Amount.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Amount")
}
return err
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7DataChargesItems0) validateChargeBearer(formats strfmt.Registry) error {
if err := validate.Required("ChargeBearer", "body", m.ChargeBearer); err != nil {
return err
}
if err := validate.Required("ChargeBearer", "body", m.ChargeBearer); err != nil {
return err
}
if m.ChargeBearer != nil {
if err := m.ChargeBearer.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ChargeBearer")
}
return err
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7DataChargesItems0) validateType(formats strfmt.Registry) error {
if err := validate.Required("Type", "body", m.Type); err != nil {
return err
}
if err := validate.Required("Type", "body", m.Type); err != nil {
return err
}
if m.Type != nil {
if err := m.Type.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Type")
}
return err
}
}
return nil
}
// ContextValidate validate this o b write international standing order response7 data charges items0 based on the context it is used
func (m *OBWriteInternationalStandingOrderResponse7DataChargesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateAmount(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateChargeBearer(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateType(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7DataChargesItems0) contextValidateAmount(ctx context.Context, formats strfmt.Registry) error {
if m.Amount != nil {
if err := m.Amount.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Amount")
}
return err
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7DataChargesItems0) contextValidateChargeBearer(ctx context.Context, formats strfmt.Registry) error {
if m.ChargeBearer != nil {
if err := m.ChargeBearer.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ChargeBearer")
}
return err
}
}
return nil
}
func (m *OBWriteInternationalStandingOrderResponse7DataChargesItems0) contextValidateType(ctx context.Context, formats strfmt.Registry) error {
if m.Type != nil {
if err := m.Type.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Type")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *OBWriteInternationalStandingOrderResponse7DataChargesItems0) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *OBWriteInternationalStandingOrderResponse7DataChargesItems0) UnmarshalBinary(b []byte) error {
var res OBWriteInternationalStandingOrderResponse7DataChargesItems0
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// OBWriteInternationalStandingOrderResponse7DataInitiation 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 OBWriteInternationalStandingOrderResponse7DataInitiation
type OBWriteInternationalStandingOrderResponse7DataInitiation struct {
// charge bearer
ChargeBearer OBChargeBearerType1Code `json:"ChargeBearer,omitempty"`
// creditor
Creditor *OBWriteInternationalStandingOrderResponse7DataInitiationCreditor `json:"Creditor,omitempty"`
// creditor account
// Required: true
CreditorAccount *OBWriteInternationalStandingOrderResponse7DataInitiationCreditorAccount `json:"CreditorAccount"`
// creditor agent
CreditorAgent *OBWriteInternationalStandingOrderResponse7DataInitiationCreditorAgent `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 *OBWriteInternationalStandingOrderResponse7DataInitiationDebtorAccount `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 *OBWriteInternationalStandingOrderResponse7DataInitiationInstructedAmount `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 response7 data initiation
func (m *OBWriteInternationalStandingOrderResponse7DataInitiation) 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 *OBWriteInternationalStandingOrderResponse7DataInitiation) 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 *OBWriteInternationalStandingOrderResponse7DataInitiation) 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")