forked from wechatpay-apiv3/wechatpay-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
2254 lines (1843 loc) · 61.5 KB
/
models.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
// Copyright 2021 Tencent Inc. All rights reserved.
//
// 微工卡接口文档
//
// 服务商通过本API文档提供的接口,查询商户和微工卡的授权关系、生成预授权的token口令、核身预下单、核身结果的查询等。
//
// API version: 1.5.2
// Code generated by WechatPay APIv3 Generator based on [OpenAPI Generator](https://openapi-generator.tech); DO NOT EDIT.
package payrollcard
import (
"encoding/json"
"fmt"
"time"
)
// AuthType
type AuthType string
func (e AuthType) Ptr() *AuthType {
return &e
}
// Enums of AuthType
const (
AUTHTYPE_INFORMATION_AUTHORIZATION_TYPE AuthType = "INFORMATION_AUTHORIZATION_TYPE"
AUTHTYPE_FUND_AUTHORIZATION_TYPE AuthType = "FUND_AUTHORIZATION_TYPE"
AUTHTYPE_INFORMATION_AND_FUND_AUTHORIZATION_TYPE AuthType = "INFORMATION_AND_FUND_AUTHORIZATION_TYPE"
)
// AuthenticationEntity
type AuthenticationEntity struct {
// 服务商商户号
Mchid *string `json:"mchid"`
// 特约商户商户号
SubMchid *string `json:"sub_mchid"`
// 用户OpenID
Openid *string `json:"openid"`
// 核身渠道,发起核身时的来源渠道,如通过小程序,硬件设备等
AuthenticateScene *AuthenticationScene `json:"authenticate_scene"`
// 核身渠道标识,用于定位渠道具体来源,如果是扫码打卡渠道标识就是具体的小程序AppID,若是硬件设备,则是设备的序列号等
AuthenticateSource *string `json:"authenticate_source"`
// 项目名称
ProjectName *string `json:"project_name"`
// 该工人所属的用工企业,由商户核身下单时传入
EmployerName *string `json:"employer_name"`
// 核身状态
AuthenticateState *AuthenticationState `json:"authenticate_state"`
// 核身时间,遵循RFC3339标准格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。
AuthenticateTime *string `json:"authenticate_time,omitempty"`
// 商户系统内部的商家核身单号,要求此参数只能由数字、大小写字母组成,在服务商内部唯一
AuthenticateNumber *string `json:"authenticate_number"`
// 结果为核身失败时的原因描述,仅在失败记录返回
AuthenticateFailedReason *string `json:"authenticate_failed_reason,omitempty"`
// 核身类型
AuthenticateType *AuthenticationType `json:"authenticate_type,omitempty"`
}
func (o AuthenticationEntity) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Mchid == nil {
return nil, fmt.Errorf("field `Mchid` is required and must be specified in AuthenticationEntity")
}
toSerialize["mchid"] = o.Mchid
if o.SubMchid == nil {
return nil, fmt.Errorf("field `SubMchid` is required and must be specified in AuthenticationEntity")
}
toSerialize["sub_mchid"] = o.SubMchid
if o.Openid == nil {
return nil, fmt.Errorf("field `Openid` is required and must be specified in AuthenticationEntity")
}
toSerialize["openid"] = o.Openid
if o.AuthenticateScene == nil {
return nil, fmt.Errorf("field `AuthenticateScene` is required and must be specified in AuthenticationEntity")
}
toSerialize["authenticate_scene"] = o.AuthenticateScene
if o.AuthenticateSource == nil {
return nil, fmt.Errorf("field `AuthenticateSource` is required and must be specified in AuthenticationEntity")
}
toSerialize["authenticate_source"] = o.AuthenticateSource
if o.ProjectName == nil {
return nil, fmt.Errorf("field `ProjectName` is required and must be specified in AuthenticationEntity")
}
toSerialize["project_name"] = o.ProjectName
if o.EmployerName == nil {
return nil, fmt.Errorf("field `EmployerName` is required and must be specified in AuthenticationEntity")
}
toSerialize["employer_name"] = o.EmployerName
if o.AuthenticateState == nil {
return nil, fmt.Errorf("field `AuthenticateState` is required and must be specified in AuthenticationEntity")
}
toSerialize["authenticate_state"] = o.AuthenticateState
if o.AuthenticateTime != nil {
toSerialize["authenticate_time"] = o.AuthenticateTime
}
if o.AuthenticateNumber == nil {
return nil, fmt.Errorf("field `AuthenticateNumber` is required and must be specified in AuthenticationEntity")
}
toSerialize["authenticate_number"] = o.AuthenticateNumber
if o.AuthenticateFailedReason != nil {
toSerialize["authenticate_failed_reason"] = o.AuthenticateFailedReason
}
if o.AuthenticateType != nil {
toSerialize["authenticate_type"] = o.AuthenticateType
}
return json.Marshal(toSerialize)
}
func (o AuthenticationEntity) String() string {
var ret string
if o.Mchid == nil {
ret += "Mchid:<nil>, "
} else {
ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid)
}
if o.SubMchid == nil {
ret += "SubMchid:<nil>, "
} else {
ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
}
if o.Openid == nil {
ret += "Openid:<nil>, "
} else {
ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
}
if o.AuthenticateScene == nil {
ret += "AuthenticateScene:<nil>, "
} else {
ret += fmt.Sprintf("AuthenticateScene:%v, ", *o.AuthenticateScene)
}
if o.AuthenticateSource == nil {
ret += "AuthenticateSource:<nil>, "
} else {
ret += fmt.Sprintf("AuthenticateSource:%v, ", *o.AuthenticateSource)
}
if o.ProjectName == nil {
ret += "ProjectName:<nil>, "
} else {
ret += fmt.Sprintf("ProjectName:%v, ", *o.ProjectName)
}
if o.EmployerName == nil {
ret += "EmployerName:<nil>, "
} else {
ret += fmt.Sprintf("EmployerName:%v, ", *o.EmployerName)
}
if o.AuthenticateState == nil {
ret += "AuthenticateState:<nil>, "
} else {
ret += fmt.Sprintf("AuthenticateState:%v, ", *o.AuthenticateState)
}
if o.AuthenticateTime == nil {
ret += "AuthenticateTime:<nil>, "
} else {
ret += fmt.Sprintf("AuthenticateTime:%v, ", *o.AuthenticateTime)
}
if o.AuthenticateNumber == nil {
ret += "AuthenticateNumber:<nil>, "
} else {
ret += fmt.Sprintf("AuthenticateNumber:%v, ", *o.AuthenticateNumber)
}
if o.AuthenticateFailedReason == nil {
ret += "AuthenticateFailedReason:<nil>, "
} else {
ret += fmt.Sprintf("AuthenticateFailedReason:%v, ", *o.AuthenticateFailedReason)
}
if o.AuthenticateType == nil {
ret += "AuthenticateType:<nil>"
} else {
ret += fmt.Sprintf("AuthenticateType:%v", *o.AuthenticateType)
}
return fmt.Sprintf("AuthenticationEntity{%s}", ret)
}
func (o AuthenticationEntity) Clone() *AuthenticationEntity {
ret := AuthenticationEntity{}
if o.Mchid != nil {
ret.Mchid = new(string)
*ret.Mchid = *o.Mchid
}
if o.SubMchid != nil {
ret.SubMchid = new(string)
*ret.SubMchid = *o.SubMchid
}
if o.Openid != nil {
ret.Openid = new(string)
*ret.Openid = *o.Openid
}
if o.AuthenticateScene != nil {
ret.AuthenticateScene = new(AuthenticationScene)
*ret.AuthenticateScene = *o.AuthenticateScene
}
if o.AuthenticateSource != nil {
ret.AuthenticateSource = new(string)
*ret.AuthenticateSource = *o.AuthenticateSource
}
if o.ProjectName != nil {
ret.ProjectName = new(string)
*ret.ProjectName = *o.ProjectName
}
if o.EmployerName != nil {
ret.EmployerName = new(string)
*ret.EmployerName = *o.EmployerName
}
if o.AuthenticateState != nil {
ret.AuthenticateState = new(AuthenticationState)
*ret.AuthenticateState = *o.AuthenticateState
}
if o.AuthenticateTime != nil {
ret.AuthenticateTime = new(string)
*ret.AuthenticateTime = *o.AuthenticateTime
}
if o.AuthenticateNumber != nil {
ret.AuthenticateNumber = new(string)
*ret.AuthenticateNumber = *o.AuthenticateNumber
}
if o.AuthenticateFailedReason != nil {
ret.AuthenticateFailedReason = new(string)
*ret.AuthenticateFailedReason = *o.AuthenticateFailedReason
}
if o.AuthenticateType != nil {
ret.AuthenticateType = new(AuthenticationType)
*ret.AuthenticateType = *o.AuthenticateType
}
return &ret
}
// AuthenticationScene
type AuthenticationScene string
func (e AuthenticationScene) Ptr() *AuthenticationScene {
return &e
}
// Enums of AuthenticationScene
const (
AUTHENTICATIONSCENE_MINI_APP AuthenticationScene = "FROM_MINI_APP"
AUTHENTICATIONSCENE_HARDWARE AuthenticationScene = "FROM_HARDWARE"
)
// AuthenticationState
type AuthenticationState string
func (e AuthenticationState) Ptr() *AuthenticationState {
return &e
}
// Enums of AuthenticationState
const (
AUTHENTICATIONSTATE_PROCESSING AuthenticationState = "AUTHENTICATE_PROCESSING"
AUTHENTICATIONSTATE_SUCCESS AuthenticationState = "AUTHENTICATE_SUCCESS"
AUTHENTICATIONSTATE_FAILED AuthenticationState = "AUTHENTICATE_FAILED"
)
// AuthenticationType
type AuthenticationType string
func (e AuthenticationType) Ptr() *AuthenticationType {
return &e
}
// Enums of AuthenticationType
const (
AUTHENTICATIONTYPE_NORMAL AuthenticationType = "NORMAL"
AUTHENTICATIONTYPE_SIGN_IN AuthenticationType = "SIGN_IN"
AUTHENTICATIONTYPE_INSURANCE AuthenticationType = "INSURANCE"
AUTHENTICATIONTYPE_CONTRACT AuthenticationType = "CONTRACT"
)
// BusinessType
type BusinessType string
func (e BusinessType) Ptr() *BusinessType {
return &e
}
// Enums of BusinessType
const (
BUSINESSTYPE_UNDEFINE BusinessType = "UNDEFINE"
BUSINESSTYPE_PROMOTION BusinessType = "PROMOTION"
)
// CreateTokenRequest
type CreateTokenRequest struct {
// 用户OpenID
Openid *string `json:"openid"`
// 当输入服务商AppID时,会校验其与服务商商户号的绑定关系。 服务商AppID和与特约商户AppID至少输入一个,且必须要有拉起微工卡小程序时使用的AppID。
Appid *string `json:"appid,omitempty"`
// 特约商户号
SubMchid *string `json:"sub_mchid"`
// 当输入特约商户AppID时,会校验其与特约商户号的绑定关系。 服务商AppID和与特约商户AppID至少输入一个,且必须要有拉起微工卡小程序时使用的AppID。
SubAppid *string `json:"sub_appid,omitempty"`
// 用户实名信息,按照APIV3标准加密该字段
UserName *string `json:"user_name" encryption:"EM_APIV3"`
// 用户证件号,按照APIV3标准加密该字段
IdCardNumber *string `json:"id_card_number" encryption:"EM_APIV3"`
// 微工卡服务仅支持用于与商户有用工关系的用户,需明确用工类型;参考值:长期用工:LONG_TERM_EMPLOYMENT,短期用工:SHORT_TERM_EMPLOYMENT,合作关系:COOPERATION_EMPLOYMENT
EmploymentType *EmploymentType `json:"employment_type,omitempty"`
}
func (o CreateTokenRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Openid == nil {
return nil, fmt.Errorf("field `Openid` is required and must be specified in CreateTokenRequest")
}
toSerialize["openid"] = o.Openid
if o.Appid != nil {
toSerialize["appid"] = o.Appid
}
if o.SubMchid == nil {
return nil, fmt.Errorf("field `SubMchid` is required and must be specified in CreateTokenRequest")
}
toSerialize["sub_mchid"] = o.SubMchid
if o.SubAppid != nil {
toSerialize["sub_appid"] = o.SubAppid
}
if o.UserName == nil {
return nil, fmt.Errorf("field `UserName` is required and must be specified in CreateTokenRequest")
}
toSerialize["user_name"] = o.UserName
if o.IdCardNumber == nil {
return nil, fmt.Errorf("field `IdCardNumber` is required and must be specified in CreateTokenRequest")
}
toSerialize["id_card_number"] = o.IdCardNumber
if o.EmploymentType != nil {
toSerialize["employment_type"] = o.EmploymentType
}
return json.Marshal(toSerialize)
}
func (o CreateTokenRequest) String() string {
var ret string
if o.Openid == nil {
ret += "Openid:<nil>, "
} else {
ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
}
if o.Appid == nil {
ret += "Appid:<nil>, "
} else {
ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
}
if o.SubMchid == nil {
ret += "SubMchid:<nil>, "
} else {
ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
}
if o.SubAppid == nil {
ret += "SubAppid:<nil>, "
} else {
ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid)
}
if o.UserName == nil {
ret += "UserName:<nil>, "
} else {
ret += fmt.Sprintf("UserName:%v, ", *o.UserName)
}
if o.IdCardNumber == nil {
ret += "IdCardNumber:<nil>, "
} else {
ret += fmt.Sprintf("IdCardNumber:%v, ", *o.IdCardNumber)
}
if o.EmploymentType == nil {
ret += "EmploymentType:<nil>"
} else {
ret += fmt.Sprintf("EmploymentType:%v", *o.EmploymentType)
}
return fmt.Sprintf("CreateTokenRequest{%s}", ret)
}
func (o CreateTokenRequest) Clone() *CreateTokenRequest {
ret := CreateTokenRequest{}
if o.Openid != nil {
ret.Openid = new(string)
*ret.Openid = *o.Openid
}
if o.Appid != nil {
ret.Appid = new(string)
*ret.Appid = *o.Appid
}
if o.SubMchid != nil {
ret.SubMchid = new(string)
*ret.SubMchid = *o.SubMchid
}
if o.SubAppid != nil {
ret.SubAppid = new(string)
*ret.SubAppid = *o.SubAppid
}
if o.UserName != nil {
ret.UserName = new(string)
*ret.UserName = *o.UserName
}
if o.IdCardNumber != nil {
ret.IdCardNumber = new(string)
*ret.IdCardNumber = *o.IdCardNumber
}
if o.EmploymentType != nil {
ret.EmploymentType = new(EmploymentType)
*ret.EmploymentType = *o.EmploymentType
}
return &ret
}
// CreateTransferBatchRequest
type CreateTransferBatchRequest struct {
// 特约商户号
SubMchid *string `json:"sub_mchid"`
// 微信分配的特约商户公众账号ID,特约商户授权类型为INFORMATION_AUTHORIZATION_TYPE和INFORMATION_AND_FUND_AUTHORIZATION_TYPE时 需要填写
SubAppid *string `json:"sub_appid,omitempty"`
// 特约商户授权类型
AuthorizationType *AuthType `json:"authorization_type"`
// 商户系统内部的商家批次单号,在商户系统内部唯一
OutBatchNo *string `json:"out_batch_no"`
// 该笔批量转账的名称
BatchName *string `json:"batch_name"`
// 转账说明,UTF8编码,最多允许32个字符
BatchRemark *string `json:"batch_remark"`
// 转账金额单位为“分”。转账总金额必须与批次内所有明细转账金额之和保持一致,否则无法发起转账操作
TotalAmount *int64 `json:"total_amount"`
// 一个转账批次单最多发起三千笔转账。转账总笔数必须与批次内所有明细之和保持一致,否则无法发起转账操作
TotalNum *int64 `json:"total_num"`
// 发起批量转账的明细列表,最多三千笔
TransferDetailList []TransferDetailInput `json:"transfer_detail_list"`
// 微信分配的服务商商户公众账号ID,特约商户授权类型为FUND_AUTHORIZATION_TYPE时 需要填写
SpAppid *string `json:"sp_appid,omitempty"`
// 微工卡服务仅支持用于与商户有用工关系的用户,需明确用工类型;参考值:长期用工:LONG_TERM_EMPLOYMENT,短期用工:SHORT_TERM_EMPLOYMENT,合作关系:COOPERATION_EMPLOYMENT
EmploymentType *EmploymentType `json:"employment_type,omitempty"`
// 用工场景;参考值:LOGISTICS:物流;MANUFACTURING:制造业;HOTEL:酒店;CATERING:餐饮业;EVENT:活动促销;RETAIL:零售;OTHERS:其他
EmploymentScene *EmploymentScene `json:"employment_scene,omitempty"`
// 传入业务ID后必填,区分不同任务来源于哪个业务系统
BusinessType *BusinessType `json:"business_type,omitempty"`
}
func (o CreateTransferBatchRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.SubMchid == nil {
return nil, fmt.Errorf("field `SubMchid` is required and must be specified in CreateTransferBatchRequest")
}
toSerialize["sub_mchid"] = o.SubMchid
if o.SubAppid != nil {
toSerialize["sub_appid"] = o.SubAppid
}
if o.AuthorizationType == nil {
return nil, fmt.Errorf("field `AuthorizationType` is required and must be specified in CreateTransferBatchRequest")
}
toSerialize["authorization_type"] = o.AuthorizationType
if o.OutBatchNo == nil {
return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in CreateTransferBatchRequest")
}
toSerialize["out_batch_no"] = o.OutBatchNo
if o.BatchName == nil {
return nil, fmt.Errorf("field `BatchName` is required and must be specified in CreateTransferBatchRequest")
}
toSerialize["batch_name"] = o.BatchName
if o.BatchRemark == nil {
return nil, fmt.Errorf("field `BatchRemark` is required and must be specified in CreateTransferBatchRequest")
}
toSerialize["batch_remark"] = o.BatchRemark
if o.TotalAmount == nil {
return nil, fmt.Errorf("field `TotalAmount` is required and must be specified in CreateTransferBatchRequest")
}
toSerialize["total_amount"] = o.TotalAmount
if o.TotalNum == nil {
return nil, fmt.Errorf("field `TotalNum` is required and must be specified in CreateTransferBatchRequest")
}
toSerialize["total_num"] = o.TotalNum
if o.TransferDetailList == nil {
return nil, fmt.Errorf("field `TransferDetailList` is required and must be specified in CreateTransferBatchRequest")
}
toSerialize["transfer_detail_list"] = o.TransferDetailList
if o.SpAppid != nil {
toSerialize["sp_appid"] = o.SpAppid
}
if o.EmploymentType != nil {
toSerialize["employment_type"] = o.EmploymentType
}
if o.EmploymentScene != nil {
toSerialize["employment_scene"] = o.EmploymentScene
}
if o.BusinessType != nil {
toSerialize["business_type"] = o.BusinessType
}
return json.Marshal(toSerialize)
}
func (o CreateTransferBatchRequest) String() string {
var ret string
if o.SubMchid == nil {
ret += "SubMchid:<nil>, "
} else {
ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
}
if o.SubAppid == nil {
ret += "SubAppid:<nil>, "
} else {
ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid)
}
if o.AuthorizationType == nil {
ret += "AuthorizationType:<nil>, "
} else {
ret += fmt.Sprintf("AuthorizationType:%v, ", *o.AuthorizationType)
}
if o.OutBatchNo == nil {
ret += "OutBatchNo:<nil>, "
} else {
ret += fmt.Sprintf("OutBatchNo:%v, ", *o.OutBatchNo)
}
if o.BatchName == nil {
ret += "BatchName:<nil>, "
} else {
ret += fmt.Sprintf("BatchName:%v, ", *o.BatchName)
}
if o.BatchRemark == nil {
ret += "BatchRemark:<nil>, "
} else {
ret += fmt.Sprintf("BatchRemark:%v, ", *o.BatchRemark)
}
if o.TotalAmount == nil {
ret += "TotalAmount:<nil>, "
} else {
ret += fmt.Sprintf("TotalAmount:%v, ", *o.TotalAmount)
}
if o.TotalNum == nil {
ret += "TotalNum:<nil>, "
} else {
ret += fmt.Sprintf("TotalNum:%v, ", *o.TotalNum)
}
ret += fmt.Sprintf("TransferDetailList:%v, ", o.TransferDetailList)
if o.SpAppid == nil {
ret += "SpAppid:<nil>, "
} else {
ret += fmt.Sprintf("SpAppid:%v, ", *o.SpAppid)
}
if o.EmploymentType == nil {
ret += "EmploymentType:<nil>, "
} else {
ret += fmt.Sprintf("EmploymentType:%v, ", *o.EmploymentType)
}
if o.EmploymentScene == nil {
ret += "EmploymentScene:<nil>, "
} else {
ret += fmt.Sprintf("EmploymentScene:%v, ", *o.EmploymentScene)
}
if o.BusinessType == nil {
ret += "BusinessType:<nil>"
} else {
ret += fmt.Sprintf("BusinessType:%v", *o.BusinessType)
}
return fmt.Sprintf("CreateTransferBatchRequest{%s}", ret)
}
func (o CreateTransferBatchRequest) Clone() *CreateTransferBatchRequest {
ret := CreateTransferBatchRequest{}
if o.SubMchid != nil {
ret.SubMchid = new(string)
*ret.SubMchid = *o.SubMchid
}
if o.SubAppid != nil {
ret.SubAppid = new(string)
*ret.SubAppid = *o.SubAppid
}
if o.AuthorizationType != nil {
ret.AuthorizationType = new(AuthType)
*ret.AuthorizationType = *o.AuthorizationType
}
if o.OutBatchNo != nil {
ret.OutBatchNo = new(string)
*ret.OutBatchNo = *o.OutBatchNo
}
if o.BatchName != nil {
ret.BatchName = new(string)
*ret.BatchName = *o.BatchName
}
if o.BatchRemark != nil {
ret.BatchRemark = new(string)
*ret.BatchRemark = *o.BatchRemark
}
if o.TotalAmount != nil {
ret.TotalAmount = new(int64)
*ret.TotalAmount = *o.TotalAmount
}
if o.TotalNum != nil {
ret.TotalNum = new(int64)
*ret.TotalNum = *o.TotalNum
}
if o.TransferDetailList != nil {
ret.TransferDetailList = make([]TransferDetailInput, len(o.TransferDetailList))
for i, item := range o.TransferDetailList {
ret.TransferDetailList[i] = *item.Clone()
}
}
if o.SpAppid != nil {
ret.SpAppid = new(string)
*ret.SpAppid = *o.SpAppid
}
if o.EmploymentType != nil {
ret.EmploymentType = new(EmploymentType)
*ret.EmploymentType = *o.EmploymentType
}
if o.EmploymentScene != nil {
ret.EmploymentScene = new(EmploymentScene)
*ret.EmploymentScene = *o.EmploymentScene
}
if o.BusinessType != nil {
ret.BusinessType = new(BusinessType)
*ret.BusinessType = *o.BusinessType
}
return &ret
}
// EmploymentScene
type EmploymentScene string
func (e EmploymentScene) Ptr() *EmploymentScene {
return &e
}
// Enums of EmploymentScene
const (
EMPLOYMENTSCENE_LOGISTICS EmploymentScene = "LOGISTICS"
EMPLOYMENTSCENE_MANUFACTURING EmploymentScene = "MANUFACTURING"
EMPLOYMENTSCENE_HOTEL EmploymentScene = "HOTEL"
EMPLOYMENTSCENE_CATERING EmploymentScene = "CATERING"
EMPLOYMENTSCENE_EVENT EmploymentScene = "EVENT"
EMPLOYMENTSCENE_RETAIL EmploymentScene = "RETAIL"
EMPLOYMENTSCENE_OTHERS EmploymentScene = "OTHERS"
)
// EmploymentType
type EmploymentType string
func (e EmploymentType) Ptr() *EmploymentType {
return &e
}
// Enums of EmploymentType
const (
EMPLOYMENTTYPE_LONG_TERM_EMPLOYMENT EmploymentType = "LONG_TERM_EMPLOYMENT"
EMPLOYMENTTYPE_SHORT_TERM_EMPLOYMENT EmploymentType = "SHORT_TERM_EMPLOYMENT"
EMPLOYMENTTYPE_COOPERATION_EMPLOYMENT EmploymentType = "COOPERATION_EMPLOYMENT"
)
// GetAuthenticationRequest
type GetAuthenticationRequest struct {
// 特约商户号
SubMchid *string `json:"sub_mchid"`
// 商户系统内部的商家核身单号,要求此参数只能由数字、大小写字母组成,在服务商内部唯一
AuthenticateNumber *string `json:"authenticate_number"`
}
func (o GetAuthenticationRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.SubMchid == nil {
return nil, fmt.Errorf("field `SubMchid` is required and must be specified in GetAuthenticationRequest")
}
toSerialize["sub_mchid"] = o.SubMchid
if o.AuthenticateNumber == nil {
return nil, fmt.Errorf("field `AuthenticateNumber` is required and must be specified in GetAuthenticationRequest")
}
toSerialize["authenticate_number"] = o.AuthenticateNumber
return json.Marshal(toSerialize)
}
func (o GetAuthenticationRequest) String() string {
var ret string
if o.SubMchid == nil {
ret += "SubMchid:<nil>, "
} else {
ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
}
if o.AuthenticateNumber == nil {
ret += "AuthenticateNumber:<nil>"
} else {
ret += fmt.Sprintf("AuthenticateNumber:%v", *o.AuthenticateNumber)
}
return fmt.Sprintf("GetAuthenticationRequest{%s}", ret)
}
func (o GetAuthenticationRequest) Clone() *GetAuthenticationRequest {
ret := GetAuthenticationRequest{}
if o.SubMchid != nil {
ret.SubMchid = new(string)
*ret.SubMchid = *o.SubMchid
}
if o.AuthenticateNumber != nil {
ret.AuthenticateNumber = new(string)
*ret.AuthenticateNumber = *o.AuthenticateNumber
}
return &ret
}
// GetRelationRequest
type GetRelationRequest struct {
// 微信用户OpenID
Openid *string `json:"openid"`
// 特约商户号
SubMchid *string `json:"sub_mchid"`
// 当输入服务商AppID时会校验其与服务商商户号绑定关系。 服务商AppID和特约商户AppID至少输入一个。
Appid *string `json:"appid,omitempty"`
// 当输入特约商户AppID时会校验其与特约商户号关系。 特约商户AppID和服务商AppID至少输入一个。
SubAppid *string `json:"sub_appid,omitempty"`
}
func (o GetRelationRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Openid == nil {
return nil, fmt.Errorf("field `Openid` is required and must be specified in GetRelationRequest")
}
toSerialize["openid"] = o.Openid
if o.SubMchid == nil {
return nil, fmt.Errorf("field `SubMchid` is required and must be specified in GetRelationRequest")
}
toSerialize["sub_mchid"] = o.SubMchid
if o.Appid != nil {
toSerialize["appid"] = o.Appid
}
if o.SubAppid != nil {
toSerialize["sub_appid"] = o.SubAppid
}
return json.Marshal(toSerialize)
}
func (o GetRelationRequest) String() string {
var ret string
if o.Openid == nil {
ret += "Openid:<nil>, "
} else {
ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
}
if o.SubMchid == nil {
ret += "SubMchid:<nil>, "
} else {
ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
}
if o.Appid == nil {
ret += "Appid:<nil>, "
} else {
ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
}
if o.SubAppid == nil {
ret += "SubAppid:<nil>"
} else {
ret += fmt.Sprintf("SubAppid:%v", *o.SubAppid)
}
return fmt.Sprintf("GetRelationRequest{%s}", ret)
}
func (o GetRelationRequest) Clone() *GetRelationRequest {
ret := GetRelationRequest{}
if o.Openid != nil {
ret.Openid = new(string)
*ret.Openid = *o.Openid
}
if o.SubMchid != nil {
ret.SubMchid = new(string)
*ret.SubMchid = *o.SubMchid
}
if o.Appid != nil {
ret.Appid = new(string)
*ret.Appid = *o.Appid
}
if o.SubAppid != nil {
ret.SubAppid = new(string)
*ret.SubAppid = *o.SubAppid
}
return &ret
}
// ListAuthenticationsRequest
type ListAuthenticationsRequest struct {
// 微信用户OpenID
Openid *string `json:"openid"`
// 当输入服务商AppID时会校验其与服务商商户号绑定关系。 服务商AppID和特约商户AppID至少输入一个。
Appid *string `json:"appid,omitempty"`
// 当输入特约商户AppID时会校验其与特约商户号关系。 特约商户AppID和服务商AppID至少输入一个。
SubAppid *string `json:"sub_appid,omitempty"`
// 特约商户号
SubMchid *string `json:"sub_mchid"`
// 核身日期,一次只能查询一天,最久可查询90天内的记录,格式为“yyyy-MM-DD”
AuthenticateDate *string `json:"authenticate_date"`
// 核身状态,列表查询仅提供成功状态的核身记录查询,故此字段固定默认值即可
AuthenticateState *string `json:"authenticate_state,omitempty"`
// 非负整数,表示该次请求资源的起始位置,从0开始计数。调用方选填,默认为0。offset为10,limit为10时,查询第10-19条数据
Offset *int64 `json:"offset,omitempty"`
// 非0非负的整数,该次请求可返回的最大资源条数,默认值为10,最大支持10条。
Limit *int64 `json:"limit,omitempty"`
}
func (o ListAuthenticationsRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Openid == nil {
return nil, fmt.Errorf("field `Openid` is required and must be specified in ListAuthenticationsRequest")
}
toSerialize["openid"] = o.Openid
if o.Appid != nil {
toSerialize["appid"] = o.Appid
}
if o.SubAppid != nil {
toSerialize["sub_appid"] = o.SubAppid
}
if o.SubMchid == nil {
return nil, fmt.Errorf("field `SubMchid` is required and must be specified in ListAuthenticationsRequest")
}
toSerialize["sub_mchid"] = o.SubMchid
if o.AuthenticateDate == nil {
return nil, fmt.Errorf("field `AuthenticateDate` is required and must be specified in ListAuthenticationsRequest")
}
toSerialize["authenticate_date"] = o.AuthenticateDate
if o.AuthenticateState != nil {
toSerialize["authenticate_state"] = o.AuthenticateState
}
if o.Offset != nil {
toSerialize["offset"] = o.Offset
}
if o.Limit != nil {
toSerialize["limit"] = o.Limit
}
return json.Marshal(toSerialize)
}
func (o ListAuthenticationsRequest) String() string {
var ret string
if o.Openid == nil {
ret += "Openid:<nil>, "
} else {
ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
}
if o.Appid == nil {
ret += "Appid:<nil>, "
} else {
ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
}
if o.SubAppid == nil {
ret += "SubAppid:<nil>, "
} else {
ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid)
}
if o.SubMchid == nil {
ret += "SubMchid:<nil>, "
} else {
ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
}
if o.AuthenticateDate == nil {
ret += "AuthenticateDate:<nil>, "
} else {
ret += fmt.Sprintf("AuthenticateDate:%v, ", *o.AuthenticateDate)
}
if o.AuthenticateState == nil {
ret += "AuthenticateState:<nil>, "
} else {
ret += fmt.Sprintf("AuthenticateState:%v, ", *o.AuthenticateState)
}
if o.Offset == nil {
ret += "Offset:<nil>, "
} else {
ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
}
if o.Limit == nil {
ret += "Limit:<nil>"
} else {
ret += fmt.Sprintf("Limit:%v", *o.Limit)
}
return fmt.Sprintf("ListAuthenticationsRequest{%s}", ret)
}