models.go 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254
  1. // Copyright 2021 Tencent Inc. All rights reserved.
  2. //
  3. // 微工卡接口文档
  4. //
  5. // 服务商通过本API文档提供的接口,查询商户和微工卡的授权关系、生成预授权的token口令、核身预下单、核身结果的查询等。
  6. //
  7. // API version: 1.5.2
  8. // Code generated by WechatPay APIv3 Generator based on [OpenAPI Generator](https://openapi-generator.tech); DO NOT EDIT.
  9. package payrollcard
  10. import (
  11. "encoding/json"
  12. "fmt"
  13. "time"
  14. )
  15. // AuthType
  16. type AuthType string
  17. func (e AuthType) Ptr() *AuthType {
  18. return &e
  19. }
  20. // Enums of AuthType
  21. const (
  22. AUTHTYPE_INFORMATION_AUTHORIZATION_TYPE AuthType = "INFORMATION_AUTHORIZATION_TYPE"
  23. AUTHTYPE_FUND_AUTHORIZATION_TYPE AuthType = "FUND_AUTHORIZATION_TYPE"
  24. AUTHTYPE_INFORMATION_AND_FUND_AUTHORIZATION_TYPE AuthType = "INFORMATION_AND_FUND_AUTHORIZATION_TYPE"
  25. )
  26. // AuthenticationEntity
  27. type AuthenticationEntity struct {
  28. // 服务商商户号
  29. Mchid *string `json:"mchid"`
  30. // 特约商户商户号
  31. SubMchid *string `json:"sub_mchid"`
  32. // 用户OpenID
  33. Openid *string `json:"openid"`
  34. // 核身渠道,发起核身时的来源渠道,如通过小程序,硬件设备等
  35. AuthenticateScene *AuthenticationScene `json:"authenticate_scene"`
  36. // 核身渠道标识,用于定位渠道具体来源,如果是扫码打卡渠道标识就是具体的小程序AppID,若是硬件设备,则是设备的序列号等
  37. AuthenticateSource *string `json:"authenticate_source"`
  38. // 项目名称
  39. ProjectName *string `json:"project_name"`
  40. // 该工人所属的用工企业,由商户核身下单时传入
  41. EmployerName *string `json:"employer_name"`
  42. // 核身状态
  43. AuthenticateState *AuthenticationState `json:"authenticate_state"`
  44. // 核身时间,遵循RFC3339标准格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。
  45. AuthenticateTime *string `json:"authenticate_time,omitempty"`
  46. // 商户系统内部的商家核身单号,要求此参数只能由数字、大小写字母组成,在服务商内部唯一
  47. AuthenticateNumber *string `json:"authenticate_number"`
  48. // 结果为核身失败时的原因描述,仅在失败记录返回
  49. AuthenticateFailedReason *string `json:"authenticate_failed_reason,omitempty"`
  50. // 核身类型
  51. AuthenticateType *AuthenticationType `json:"authenticate_type,omitempty"`
  52. }
  53. func (o AuthenticationEntity) MarshalJSON() ([]byte, error) {
  54. toSerialize := map[string]interface{}{}
  55. if o.Mchid == nil {
  56. return nil, fmt.Errorf("field `Mchid` is required and must be specified in AuthenticationEntity")
  57. }
  58. toSerialize["mchid"] = o.Mchid
  59. if o.SubMchid == nil {
  60. return nil, fmt.Errorf("field `SubMchid` is required and must be specified in AuthenticationEntity")
  61. }
  62. toSerialize["sub_mchid"] = o.SubMchid
  63. if o.Openid == nil {
  64. return nil, fmt.Errorf("field `Openid` is required and must be specified in AuthenticationEntity")
  65. }
  66. toSerialize["openid"] = o.Openid
  67. if o.AuthenticateScene == nil {
  68. return nil, fmt.Errorf("field `AuthenticateScene` is required and must be specified in AuthenticationEntity")
  69. }
  70. toSerialize["authenticate_scene"] = o.AuthenticateScene
  71. if o.AuthenticateSource == nil {
  72. return nil, fmt.Errorf("field `AuthenticateSource` is required and must be specified in AuthenticationEntity")
  73. }
  74. toSerialize["authenticate_source"] = o.AuthenticateSource
  75. if o.ProjectName == nil {
  76. return nil, fmt.Errorf("field `ProjectName` is required and must be specified in AuthenticationEntity")
  77. }
  78. toSerialize["project_name"] = o.ProjectName
  79. if o.EmployerName == nil {
  80. return nil, fmt.Errorf("field `EmployerName` is required and must be specified in AuthenticationEntity")
  81. }
  82. toSerialize["employer_name"] = o.EmployerName
  83. if o.AuthenticateState == nil {
  84. return nil, fmt.Errorf("field `AuthenticateState` is required and must be specified in AuthenticationEntity")
  85. }
  86. toSerialize["authenticate_state"] = o.AuthenticateState
  87. if o.AuthenticateTime != nil {
  88. toSerialize["authenticate_time"] = o.AuthenticateTime
  89. }
  90. if o.AuthenticateNumber == nil {
  91. return nil, fmt.Errorf("field `AuthenticateNumber` is required and must be specified in AuthenticationEntity")
  92. }
  93. toSerialize["authenticate_number"] = o.AuthenticateNumber
  94. if o.AuthenticateFailedReason != nil {
  95. toSerialize["authenticate_failed_reason"] = o.AuthenticateFailedReason
  96. }
  97. if o.AuthenticateType != nil {
  98. toSerialize["authenticate_type"] = o.AuthenticateType
  99. }
  100. return json.Marshal(toSerialize)
  101. }
  102. func (o AuthenticationEntity) String() string {
  103. var ret string
  104. if o.Mchid == nil {
  105. ret += "Mchid:<nil>, "
  106. } else {
  107. ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid)
  108. }
  109. if o.SubMchid == nil {
  110. ret += "SubMchid:<nil>, "
  111. } else {
  112. ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
  113. }
  114. if o.Openid == nil {
  115. ret += "Openid:<nil>, "
  116. } else {
  117. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  118. }
  119. if o.AuthenticateScene == nil {
  120. ret += "AuthenticateScene:<nil>, "
  121. } else {
  122. ret += fmt.Sprintf("AuthenticateScene:%v, ", *o.AuthenticateScene)
  123. }
  124. if o.AuthenticateSource == nil {
  125. ret += "AuthenticateSource:<nil>, "
  126. } else {
  127. ret += fmt.Sprintf("AuthenticateSource:%v, ", *o.AuthenticateSource)
  128. }
  129. if o.ProjectName == nil {
  130. ret += "ProjectName:<nil>, "
  131. } else {
  132. ret += fmt.Sprintf("ProjectName:%v, ", *o.ProjectName)
  133. }
  134. if o.EmployerName == nil {
  135. ret += "EmployerName:<nil>, "
  136. } else {
  137. ret += fmt.Sprintf("EmployerName:%v, ", *o.EmployerName)
  138. }
  139. if o.AuthenticateState == nil {
  140. ret += "AuthenticateState:<nil>, "
  141. } else {
  142. ret += fmt.Sprintf("AuthenticateState:%v, ", *o.AuthenticateState)
  143. }
  144. if o.AuthenticateTime == nil {
  145. ret += "AuthenticateTime:<nil>, "
  146. } else {
  147. ret += fmt.Sprintf("AuthenticateTime:%v, ", *o.AuthenticateTime)
  148. }
  149. if o.AuthenticateNumber == nil {
  150. ret += "AuthenticateNumber:<nil>, "
  151. } else {
  152. ret += fmt.Sprintf("AuthenticateNumber:%v, ", *o.AuthenticateNumber)
  153. }
  154. if o.AuthenticateFailedReason == nil {
  155. ret += "AuthenticateFailedReason:<nil>, "
  156. } else {
  157. ret += fmt.Sprintf("AuthenticateFailedReason:%v, ", *o.AuthenticateFailedReason)
  158. }
  159. if o.AuthenticateType == nil {
  160. ret += "AuthenticateType:<nil>"
  161. } else {
  162. ret += fmt.Sprintf("AuthenticateType:%v", *o.AuthenticateType)
  163. }
  164. return fmt.Sprintf("AuthenticationEntity{%s}", ret)
  165. }
  166. func (o AuthenticationEntity) Clone() *AuthenticationEntity {
  167. ret := AuthenticationEntity{}
  168. if o.Mchid != nil {
  169. ret.Mchid = new(string)
  170. *ret.Mchid = *o.Mchid
  171. }
  172. if o.SubMchid != nil {
  173. ret.SubMchid = new(string)
  174. *ret.SubMchid = *o.SubMchid
  175. }
  176. if o.Openid != nil {
  177. ret.Openid = new(string)
  178. *ret.Openid = *o.Openid
  179. }
  180. if o.AuthenticateScene != nil {
  181. ret.AuthenticateScene = new(AuthenticationScene)
  182. *ret.AuthenticateScene = *o.AuthenticateScene
  183. }
  184. if o.AuthenticateSource != nil {
  185. ret.AuthenticateSource = new(string)
  186. *ret.AuthenticateSource = *o.AuthenticateSource
  187. }
  188. if o.ProjectName != nil {
  189. ret.ProjectName = new(string)
  190. *ret.ProjectName = *o.ProjectName
  191. }
  192. if o.EmployerName != nil {
  193. ret.EmployerName = new(string)
  194. *ret.EmployerName = *o.EmployerName
  195. }
  196. if o.AuthenticateState != nil {
  197. ret.AuthenticateState = new(AuthenticationState)
  198. *ret.AuthenticateState = *o.AuthenticateState
  199. }
  200. if o.AuthenticateTime != nil {
  201. ret.AuthenticateTime = new(string)
  202. *ret.AuthenticateTime = *o.AuthenticateTime
  203. }
  204. if o.AuthenticateNumber != nil {
  205. ret.AuthenticateNumber = new(string)
  206. *ret.AuthenticateNumber = *o.AuthenticateNumber
  207. }
  208. if o.AuthenticateFailedReason != nil {
  209. ret.AuthenticateFailedReason = new(string)
  210. *ret.AuthenticateFailedReason = *o.AuthenticateFailedReason
  211. }
  212. if o.AuthenticateType != nil {
  213. ret.AuthenticateType = new(AuthenticationType)
  214. *ret.AuthenticateType = *o.AuthenticateType
  215. }
  216. return &ret
  217. }
  218. // AuthenticationScene
  219. type AuthenticationScene string
  220. func (e AuthenticationScene) Ptr() *AuthenticationScene {
  221. return &e
  222. }
  223. // Enums of AuthenticationScene
  224. const (
  225. AUTHENTICATIONSCENE_MINI_APP AuthenticationScene = "FROM_MINI_APP"
  226. AUTHENTICATIONSCENE_HARDWARE AuthenticationScene = "FROM_HARDWARE"
  227. )
  228. // AuthenticationState
  229. type AuthenticationState string
  230. func (e AuthenticationState) Ptr() *AuthenticationState {
  231. return &e
  232. }
  233. // Enums of AuthenticationState
  234. const (
  235. AUTHENTICATIONSTATE_PROCESSING AuthenticationState = "AUTHENTICATE_PROCESSING"
  236. AUTHENTICATIONSTATE_SUCCESS AuthenticationState = "AUTHENTICATE_SUCCESS"
  237. AUTHENTICATIONSTATE_FAILED AuthenticationState = "AUTHENTICATE_FAILED"
  238. )
  239. // AuthenticationType
  240. type AuthenticationType string
  241. func (e AuthenticationType) Ptr() *AuthenticationType {
  242. return &e
  243. }
  244. // Enums of AuthenticationType
  245. const (
  246. AUTHENTICATIONTYPE_NORMAL AuthenticationType = "NORMAL"
  247. AUTHENTICATIONTYPE_SIGN_IN AuthenticationType = "SIGN_IN"
  248. AUTHENTICATIONTYPE_INSURANCE AuthenticationType = "INSURANCE"
  249. AUTHENTICATIONTYPE_CONTRACT AuthenticationType = "CONTRACT"
  250. )
  251. // BusinessType
  252. type BusinessType string
  253. func (e BusinessType) Ptr() *BusinessType {
  254. return &e
  255. }
  256. // Enums of BusinessType
  257. const (
  258. BUSINESSTYPE_UNDEFINE BusinessType = "UNDEFINE"
  259. BUSINESSTYPE_PROMOTION BusinessType = "PROMOTION"
  260. )
  261. // CreateTokenRequest
  262. type CreateTokenRequest struct {
  263. // 用户OpenID
  264. Openid *string `json:"openid"`
  265. // 当输入服务商AppID时,会校验其与服务商商户号的绑定关系。 服务商AppID和与特约商户AppID至少输入一个,且必须要有拉起微工卡小程序时使用的AppID。
  266. Appid *string `json:"appid,omitempty"`
  267. // 特约商户号
  268. SubMchid *string `json:"sub_mchid"`
  269. // 当输入特约商户AppID时,会校验其与特约商户号的绑定关系。 服务商AppID和与特约商户AppID至少输入一个,且必须要有拉起微工卡小程序时使用的AppID。
  270. SubAppid *string `json:"sub_appid,omitempty"`
  271. // 用户实名信息,按照APIV3标准加密该字段
  272. UserName *string `json:"user_name" encryption:"EM_APIV3"`
  273. // 用户证件号,按照APIV3标准加密该字段
  274. IdCardNumber *string `json:"id_card_number" encryption:"EM_APIV3"`
  275. // 微工卡服务仅支持用于与商户有用工关系的用户,需明确用工类型;参考值:长期用工:LONG_TERM_EMPLOYMENT,短期用工:SHORT_TERM_EMPLOYMENT,合作关系:COOPERATION_EMPLOYMENT
  276. EmploymentType *EmploymentType `json:"employment_type,omitempty"`
  277. }
  278. func (o CreateTokenRequest) MarshalJSON() ([]byte, error) {
  279. toSerialize := map[string]interface{}{}
  280. if o.Openid == nil {
  281. return nil, fmt.Errorf("field `Openid` is required and must be specified in CreateTokenRequest")
  282. }
  283. toSerialize["openid"] = o.Openid
  284. if o.Appid != nil {
  285. toSerialize["appid"] = o.Appid
  286. }
  287. if o.SubMchid == nil {
  288. return nil, fmt.Errorf("field `SubMchid` is required and must be specified in CreateTokenRequest")
  289. }
  290. toSerialize["sub_mchid"] = o.SubMchid
  291. if o.SubAppid != nil {
  292. toSerialize["sub_appid"] = o.SubAppid
  293. }
  294. if o.UserName == nil {
  295. return nil, fmt.Errorf("field `UserName` is required and must be specified in CreateTokenRequest")
  296. }
  297. toSerialize["user_name"] = o.UserName
  298. if o.IdCardNumber == nil {
  299. return nil, fmt.Errorf("field `IdCardNumber` is required and must be specified in CreateTokenRequest")
  300. }
  301. toSerialize["id_card_number"] = o.IdCardNumber
  302. if o.EmploymentType != nil {
  303. toSerialize["employment_type"] = o.EmploymentType
  304. }
  305. return json.Marshal(toSerialize)
  306. }
  307. func (o CreateTokenRequest) String() string {
  308. var ret string
  309. if o.Openid == nil {
  310. ret += "Openid:<nil>, "
  311. } else {
  312. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  313. }
  314. if o.Appid == nil {
  315. ret += "Appid:<nil>, "
  316. } else {
  317. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  318. }
  319. if o.SubMchid == nil {
  320. ret += "SubMchid:<nil>, "
  321. } else {
  322. ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
  323. }
  324. if o.SubAppid == nil {
  325. ret += "SubAppid:<nil>, "
  326. } else {
  327. ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid)
  328. }
  329. if o.UserName == nil {
  330. ret += "UserName:<nil>, "
  331. } else {
  332. ret += fmt.Sprintf("UserName:%v, ", *o.UserName)
  333. }
  334. if o.IdCardNumber == nil {
  335. ret += "IdCardNumber:<nil>, "
  336. } else {
  337. ret += fmt.Sprintf("IdCardNumber:%v, ", *o.IdCardNumber)
  338. }
  339. if o.EmploymentType == nil {
  340. ret += "EmploymentType:<nil>"
  341. } else {
  342. ret += fmt.Sprintf("EmploymentType:%v", *o.EmploymentType)
  343. }
  344. return fmt.Sprintf("CreateTokenRequest{%s}", ret)
  345. }
  346. func (o CreateTokenRequest) Clone() *CreateTokenRequest {
  347. ret := CreateTokenRequest{}
  348. if o.Openid != nil {
  349. ret.Openid = new(string)
  350. *ret.Openid = *o.Openid
  351. }
  352. if o.Appid != nil {
  353. ret.Appid = new(string)
  354. *ret.Appid = *o.Appid
  355. }
  356. if o.SubMchid != nil {
  357. ret.SubMchid = new(string)
  358. *ret.SubMchid = *o.SubMchid
  359. }
  360. if o.SubAppid != nil {
  361. ret.SubAppid = new(string)
  362. *ret.SubAppid = *o.SubAppid
  363. }
  364. if o.UserName != nil {
  365. ret.UserName = new(string)
  366. *ret.UserName = *o.UserName
  367. }
  368. if o.IdCardNumber != nil {
  369. ret.IdCardNumber = new(string)
  370. *ret.IdCardNumber = *o.IdCardNumber
  371. }
  372. if o.EmploymentType != nil {
  373. ret.EmploymentType = new(EmploymentType)
  374. *ret.EmploymentType = *o.EmploymentType
  375. }
  376. return &ret
  377. }
  378. // CreateTransferBatchRequest
  379. type CreateTransferBatchRequest struct {
  380. // 特约商户号
  381. SubMchid *string `json:"sub_mchid"`
  382. // 微信分配的特约商户公众账号ID,特约商户授权类型为INFORMATION_AUTHORIZATION_TYPE和INFORMATION_AND_FUND_AUTHORIZATION_TYPE时 需要填写
  383. SubAppid *string `json:"sub_appid,omitempty"`
  384. // 特约商户授权类型
  385. AuthorizationType *AuthType `json:"authorization_type"`
  386. // 商户系统内部的商家批次单号,在商户系统内部唯一
  387. OutBatchNo *string `json:"out_batch_no"`
  388. // 该笔批量转账的名称
  389. BatchName *string `json:"batch_name"`
  390. // 转账说明,UTF8编码,最多允许32个字符
  391. BatchRemark *string `json:"batch_remark"`
  392. // 转账金额单位为“分”。转账总金额必须与批次内所有明细转账金额之和保持一致,否则无法发起转账操作
  393. TotalAmount *int64 `json:"total_amount"`
  394. // 一个转账批次单最多发起三千笔转账。转账总笔数必须与批次内所有明细之和保持一致,否则无法发起转账操作
  395. TotalNum *int64 `json:"total_num"`
  396. // 发起批量转账的明细列表,最多三千笔
  397. TransferDetailList []TransferDetailInput `json:"transfer_detail_list"`
  398. // 微信分配的服务商商户公众账号ID,特约商户授权类型为FUND_AUTHORIZATION_TYPE时 需要填写
  399. SpAppid *string `json:"sp_appid,omitempty"`
  400. // 微工卡服务仅支持用于与商户有用工关系的用户,需明确用工类型;参考值:长期用工:LONG_TERM_EMPLOYMENT,短期用工:SHORT_TERM_EMPLOYMENT,合作关系:COOPERATION_EMPLOYMENT
  401. EmploymentType *EmploymentType `json:"employment_type,omitempty"`
  402. // 用工场景;参考值:LOGISTICS:物流;MANUFACTURING:制造业;HOTEL:酒店;CATERING:餐饮业;EVENT:活动促销;RETAIL:零售;OTHERS:其他
  403. EmploymentScene *EmploymentScene `json:"employment_scene,omitempty"`
  404. // 传入业务ID后必填,区分不同任务来源于哪个业务系统
  405. BusinessType *BusinessType `json:"business_type,omitempty"`
  406. }
  407. func (o CreateTransferBatchRequest) MarshalJSON() ([]byte, error) {
  408. toSerialize := map[string]interface{}{}
  409. if o.SubMchid == nil {
  410. return nil, fmt.Errorf("field `SubMchid` is required and must be specified in CreateTransferBatchRequest")
  411. }
  412. toSerialize["sub_mchid"] = o.SubMchid
  413. if o.SubAppid != nil {
  414. toSerialize["sub_appid"] = o.SubAppid
  415. }
  416. if o.AuthorizationType == nil {
  417. return nil, fmt.Errorf("field `AuthorizationType` is required and must be specified in CreateTransferBatchRequest")
  418. }
  419. toSerialize["authorization_type"] = o.AuthorizationType
  420. if o.OutBatchNo == nil {
  421. return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in CreateTransferBatchRequest")
  422. }
  423. toSerialize["out_batch_no"] = o.OutBatchNo
  424. if o.BatchName == nil {
  425. return nil, fmt.Errorf("field `BatchName` is required and must be specified in CreateTransferBatchRequest")
  426. }
  427. toSerialize["batch_name"] = o.BatchName
  428. if o.BatchRemark == nil {
  429. return nil, fmt.Errorf("field `BatchRemark` is required and must be specified in CreateTransferBatchRequest")
  430. }
  431. toSerialize["batch_remark"] = o.BatchRemark
  432. if o.TotalAmount == nil {
  433. return nil, fmt.Errorf("field `TotalAmount` is required and must be specified in CreateTransferBatchRequest")
  434. }
  435. toSerialize["total_amount"] = o.TotalAmount
  436. if o.TotalNum == nil {
  437. return nil, fmt.Errorf("field `TotalNum` is required and must be specified in CreateTransferBatchRequest")
  438. }
  439. toSerialize["total_num"] = o.TotalNum
  440. if o.TransferDetailList == nil {
  441. return nil, fmt.Errorf("field `TransferDetailList` is required and must be specified in CreateTransferBatchRequest")
  442. }
  443. toSerialize["transfer_detail_list"] = o.TransferDetailList
  444. if o.SpAppid != nil {
  445. toSerialize["sp_appid"] = o.SpAppid
  446. }
  447. if o.EmploymentType != nil {
  448. toSerialize["employment_type"] = o.EmploymentType
  449. }
  450. if o.EmploymentScene != nil {
  451. toSerialize["employment_scene"] = o.EmploymentScene
  452. }
  453. if o.BusinessType != nil {
  454. toSerialize["business_type"] = o.BusinessType
  455. }
  456. return json.Marshal(toSerialize)
  457. }
  458. func (o CreateTransferBatchRequest) String() string {
  459. var ret string
  460. if o.SubMchid == nil {
  461. ret += "SubMchid:<nil>, "
  462. } else {
  463. ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
  464. }
  465. if o.SubAppid == nil {
  466. ret += "SubAppid:<nil>, "
  467. } else {
  468. ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid)
  469. }
  470. if o.AuthorizationType == nil {
  471. ret += "AuthorizationType:<nil>, "
  472. } else {
  473. ret += fmt.Sprintf("AuthorizationType:%v, ", *o.AuthorizationType)
  474. }
  475. if o.OutBatchNo == nil {
  476. ret += "OutBatchNo:<nil>, "
  477. } else {
  478. ret += fmt.Sprintf("OutBatchNo:%v, ", *o.OutBatchNo)
  479. }
  480. if o.BatchName == nil {
  481. ret += "BatchName:<nil>, "
  482. } else {
  483. ret += fmt.Sprintf("BatchName:%v, ", *o.BatchName)
  484. }
  485. if o.BatchRemark == nil {
  486. ret += "BatchRemark:<nil>, "
  487. } else {
  488. ret += fmt.Sprintf("BatchRemark:%v, ", *o.BatchRemark)
  489. }
  490. if o.TotalAmount == nil {
  491. ret += "TotalAmount:<nil>, "
  492. } else {
  493. ret += fmt.Sprintf("TotalAmount:%v, ", *o.TotalAmount)
  494. }
  495. if o.TotalNum == nil {
  496. ret += "TotalNum:<nil>, "
  497. } else {
  498. ret += fmt.Sprintf("TotalNum:%v, ", *o.TotalNum)
  499. }
  500. ret += fmt.Sprintf("TransferDetailList:%v, ", o.TransferDetailList)
  501. if o.SpAppid == nil {
  502. ret += "SpAppid:<nil>, "
  503. } else {
  504. ret += fmt.Sprintf("SpAppid:%v, ", *o.SpAppid)
  505. }
  506. if o.EmploymentType == nil {
  507. ret += "EmploymentType:<nil>, "
  508. } else {
  509. ret += fmt.Sprintf("EmploymentType:%v, ", *o.EmploymentType)
  510. }
  511. if o.EmploymentScene == nil {
  512. ret += "EmploymentScene:<nil>, "
  513. } else {
  514. ret += fmt.Sprintf("EmploymentScene:%v, ", *o.EmploymentScene)
  515. }
  516. if o.BusinessType == nil {
  517. ret += "BusinessType:<nil>"
  518. } else {
  519. ret += fmt.Sprintf("BusinessType:%v", *o.BusinessType)
  520. }
  521. return fmt.Sprintf("CreateTransferBatchRequest{%s}", ret)
  522. }
  523. func (o CreateTransferBatchRequest) Clone() *CreateTransferBatchRequest {
  524. ret := CreateTransferBatchRequest{}
  525. if o.SubMchid != nil {
  526. ret.SubMchid = new(string)
  527. *ret.SubMchid = *o.SubMchid
  528. }
  529. if o.SubAppid != nil {
  530. ret.SubAppid = new(string)
  531. *ret.SubAppid = *o.SubAppid
  532. }
  533. if o.AuthorizationType != nil {
  534. ret.AuthorizationType = new(AuthType)
  535. *ret.AuthorizationType = *o.AuthorizationType
  536. }
  537. if o.OutBatchNo != nil {
  538. ret.OutBatchNo = new(string)
  539. *ret.OutBatchNo = *o.OutBatchNo
  540. }
  541. if o.BatchName != nil {
  542. ret.BatchName = new(string)
  543. *ret.BatchName = *o.BatchName
  544. }
  545. if o.BatchRemark != nil {
  546. ret.BatchRemark = new(string)
  547. *ret.BatchRemark = *o.BatchRemark
  548. }
  549. if o.TotalAmount != nil {
  550. ret.TotalAmount = new(int64)
  551. *ret.TotalAmount = *o.TotalAmount
  552. }
  553. if o.TotalNum != nil {
  554. ret.TotalNum = new(int64)
  555. *ret.TotalNum = *o.TotalNum
  556. }
  557. if o.TransferDetailList != nil {
  558. ret.TransferDetailList = make([]TransferDetailInput, len(o.TransferDetailList))
  559. for i, item := range o.TransferDetailList {
  560. ret.TransferDetailList[i] = *item.Clone()
  561. }
  562. }
  563. if o.SpAppid != nil {
  564. ret.SpAppid = new(string)
  565. *ret.SpAppid = *o.SpAppid
  566. }
  567. if o.EmploymentType != nil {
  568. ret.EmploymentType = new(EmploymentType)
  569. *ret.EmploymentType = *o.EmploymentType
  570. }
  571. if o.EmploymentScene != nil {
  572. ret.EmploymentScene = new(EmploymentScene)
  573. *ret.EmploymentScene = *o.EmploymentScene
  574. }
  575. if o.BusinessType != nil {
  576. ret.BusinessType = new(BusinessType)
  577. *ret.BusinessType = *o.BusinessType
  578. }
  579. return &ret
  580. }
  581. // EmploymentScene
  582. type EmploymentScene string
  583. func (e EmploymentScene) Ptr() *EmploymentScene {
  584. return &e
  585. }
  586. // Enums of EmploymentScene
  587. const (
  588. EMPLOYMENTSCENE_LOGISTICS EmploymentScene = "LOGISTICS"
  589. EMPLOYMENTSCENE_MANUFACTURING EmploymentScene = "MANUFACTURING"
  590. EMPLOYMENTSCENE_HOTEL EmploymentScene = "HOTEL"
  591. EMPLOYMENTSCENE_CATERING EmploymentScene = "CATERING"
  592. EMPLOYMENTSCENE_EVENT EmploymentScene = "EVENT"
  593. EMPLOYMENTSCENE_RETAIL EmploymentScene = "RETAIL"
  594. EMPLOYMENTSCENE_OTHERS EmploymentScene = "OTHERS"
  595. )
  596. // EmploymentType
  597. type EmploymentType string
  598. func (e EmploymentType) Ptr() *EmploymentType {
  599. return &e
  600. }
  601. // Enums of EmploymentType
  602. const (
  603. EMPLOYMENTTYPE_LONG_TERM_EMPLOYMENT EmploymentType = "LONG_TERM_EMPLOYMENT"
  604. EMPLOYMENTTYPE_SHORT_TERM_EMPLOYMENT EmploymentType = "SHORT_TERM_EMPLOYMENT"
  605. EMPLOYMENTTYPE_COOPERATION_EMPLOYMENT EmploymentType = "COOPERATION_EMPLOYMENT"
  606. )
  607. // GetAuthenticationRequest
  608. type GetAuthenticationRequest struct {
  609. // 特约商户号
  610. SubMchid *string `json:"sub_mchid"`
  611. // 商户系统内部的商家核身单号,要求此参数只能由数字、大小写字母组成,在服务商内部唯一
  612. AuthenticateNumber *string `json:"authenticate_number"`
  613. }
  614. func (o GetAuthenticationRequest) MarshalJSON() ([]byte, error) {
  615. toSerialize := map[string]interface{}{}
  616. if o.SubMchid == nil {
  617. return nil, fmt.Errorf("field `SubMchid` is required and must be specified in GetAuthenticationRequest")
  618. }
  619. toSerialize["sub_mchid"] = o.SubMchid
  620. if o.AuthenticateNumber == nil {
  621. return nil, fmt.Errorf("field `AuthenticateNumber` is required and must be specified in GetAuthenticationRequest")
  622. }
  623. toSerialize["authenticate_number"] = o.AuthenticateNumber
  624. return json.Marshal(toSerialize)
  625. }
  626. func (o GetAuthenticationRequest) String() string {
  627. var ret string
  628. if o.SubMchid == nil {
  629. ret += "SubMchid:<nil>, "
  630. } else {
  631. ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
  632. }
  633. if o.AuthenticateNumber == nil {
  634. ret += "AuthenticateNumber:<nil>"
  635. } else {
  636. ret += fmt.Sprintf("AuthenticateNumber:%v", *o.AuthenticateNumber)
  637. }
  638. return fmt.Sprintf("GetAuthenticationRequest{%s}", ret)
  639. }
  640. func (o GetAuthenticationRequest) Clone() *GetAuthenticationRequest {
  641. ret := GetAuthenticationRequest{}
  642. if o.SubMchid != nil {
  643. ret.SubMchid = new(string)
  644. *ret.SubMchid = *o.SubMchid
  645. }
  646. if o.AuthenticateNumber != nil {
  647. ret.AuthenticateNumber = new(string)
  648. *ret.AuthenticateNumber = *o.AuthenticateNumber
  649. }
  650. return &ret
  651. }
  652. // GetRelationRequest
  653. type GetRelationRequest struct {
  654. // 微信用户OpenID
  655. Openid *string `json:"openid"`
  656. // 特约商户号
  657. SubMchid *string `json:"sub_mchid"`
  658. // 当输入服务商AppID时会校验其与服务商商户号绑定关系。 服务商AppID和特约商户AppID至少输入一个。
  659. Appid *string `json:"appid,omitempty"`
  660. // 当输入特约商户AppID时会校验其与特约商户号关系。 特约商户AppID和服务商AppID至少输入一个。
  661. SubAppid *string `json:"sub_appid,omitempty"`
  662. }
  663. func (o GetRelationRequest) MarshalJSON() ([]byte, error) {
  664. toSerialize := map[string]interface{}{}
  665. if o.Openid == nil {
  666. return nil, fmt.Errorf("field `Openid` is required and must be specified in GetRelationRequest")
  667. }
  668. toSerialize["openid"] = o.Openid
  669. if o.SubMchid == nil {
  670. return nil, fmt.Errorf("field `SubMchid` is required and must be specified in GetRelationRequest")
  671. }
  672. toSerialize["sub_mchid"] = o.SubMchid
  673. if o.Appid != nil {
  674. toSerialize["appid"] = o.Appid
  675. }
  676. if o.SubAppid != nil {
  677. toSerialize["sub_appid"] = o.SubAppid
  678. }
  679. return json.Marshal(toSerialize)
  680. }
  681. func (o GetRelationRequest) String() string {
  682. var ret string
  683. if o.Openid == nil {
  684. ret += "Openid:<nil>, "
  685. } else {
  686. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  687. }
  688. if o.SubMchid == nil {
  689. ret += "SubMchid:<nil>, "
  690. } else {
  691. ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
  692. }
  693. if o.Appid == nil {
  694. ret += "Appid:<nil>, "
  695. } else {
  696. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  697. }
  698. if o.SubAppid == nil {
  699. ret += "SubAppid:<nil>"
  700. } else {
  701. ret += fmt.Sprintf("SubAppid:%v", *o.SubAppid)
  702. }
  703. return fmt.Sprintf("GetRelationRequest{%s}", ret)
  704. }
  705. func (o GetRelationRequest) Clone() *GetRelationRequest {
  706. ret := GetRelationRequest{}
  707. if o.Openid != nil {
  708. ret.Openid = new(string)
  709. *ret.Openid = *o.Openid
  710. }
  711. if o.SubMchid != nil {
  712. ret.SubMchid = new(string)
  713. *ret.SubMchid = *o.SubMchid
  714. }
  715. if o.Appid != nil {
  716. ret.Appid = new(string)
  717. *ret.Appid = *o.Appid
  718. }
  719. if o.SubAppid != nil {
  720. ret.SubAppid = new(string)
  721. *ret.SubAppid = *o.SubAppid
  722. }
  723. return &ret
  724. }
  725. // ListAuthenticationsRequest
  726. type ListAuthenticationsRequest struct {
  727. // 微信用户OpenID
  728. Openid *string `json:"openid"`
  729. // 当输入服务商AppID时会校验其与服务商商户号绑定关系。 服务商AppID和特约商户AppID至少输入一个。
  730. Appid *string `json:"appid,omitempty"`
  731. // 当输入特约商户AppID时会校验其与特约商户号关系。 特约商户AppID和服务商AppID至少输入一个。
  732. SubAppid *string `json:"sub_appid,omitempty"`
  733. // 特约商户号
  734. SubMchid *string `json:"sub_mchid"`
  735. // 核身日期,一次只能查询一天,最久可查询90天内的记录,格式为“yyyy-MM-DD”
  736. AuthenticateDate *string `json:"authenticate_date"`
  737. // 核身状态,列表查询仅提供成功状态的核身记录查询,故此字段固定默认值即可
  738. AuthenticateState *string `json:"authenticate_state,omitempty"`
  739. // 非负整数,表示该次请求资源的起始位置,从0开始计数。调用方选填,默认为0。offset为10,limit为10时,查询第10-19条数据
  740. Offset *int64 `json:"offset,omitempty"`
  741. // 非0非负的整数,该次请求可返回的最大资源条数,默认值为10,最大支持10条。
  742. Limit *int64 `json:"limit,omitempty"`
  743. }
  744. func (o ListAuthenticationsRequest) MarshalJSON() ([]byte, error) {
  745. toSerialize := map[string]interface{}{}
  746. if o.Openid == nil {
  747. return nil, fmt.Errorf("field `Openid` is required and must be specified in ListAuthenticationsRequest")
  748. }
  749. toSerialize["openid"] = o.Openid
  750. if o.Appid != nil {
  751. toSerialize["appid"] = o.Appid
  752. }
  753. if o.SubAppid != nil {
  754. toSerialize["sub_appid"] = o.SubAppid
  755. }
  756. if o.SubMchid == nil {
  757. return nil, fmt.Errorf("field `SubMchid` is required and must be specified in ListAuthenticationsRequest")
  758. }
  759. toSerialize["sub_mchid"] = o.SubMchid
  760. if o.AuthenticateDate == nil {
  761. return nil, fmt.Errorf("field `AuthenticateDate` is required and must be specified in ListAuthenticationsRequest")
  762. }
  763. toSerialize["authenticate_date"] = o.AuthenticateDate
  764. if o.AuthenticateState != nil {
  765. toSerialize["authenticate_state"] = o.AuthenticateState
  766. }
  767. if o.Offset != nil {
  768. toSerialize["offset"] = o.Offset
  769. }
  770. if o.Limit != nil {
  771. toSerialize["limit"] = o.Limit
  772. }
  773. return json.Marshal(toSerialize)
  774. }
  775. func (o ListAuthenticationsRequest) String() string {
  776. var ret string
  777. if o.Openid == nil {
  778. ret += "Openid:<nil>, "
  779. } else {
  780. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  781. }
  782. if o.Appid == nil {
  783. ret += "Appid:<nil>, "
  784. } else {
  785. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  786. }
  787. if o.SubAppid == nil {
  788. ret += "SubAppid:<nil>, "
  789. } else {
  790. ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid)
  791. }
  792. if o.SubMchid == nil {
  793. ret += "SubMchid:<nil>, "
  794. } else {
  795. ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
  796. }
  797. if o.AuthenticateDate == nil {
  798. ret += "AuthenticateDate:<nil>, "
  799. } else {
  800. ret += fmt.Sprintf("AuthenticateDate:%v, ", *o.AuthenticateDate)
  801. }
  802. if o.AuthenticateState == nil {
  803. ret += "AuthenticateState:<nil>, "
  804. } else {
  805. ret += fmt.Sprintf("AuthenticateState:%v, ", *o.AuthenticateState)
  806. }
  807. if o.Offset == nil {
  808. ret += "Offset:<nil>, "
  809. } else {
  810. ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
  811. }
  812. if o.Limit == nil {
  813. ret += "Limit:<nil>"
  814. } else {
  815. ret += fmt.Sprintf("Limit:%v", *o.Limit)
  816. }
  817. return fmt.Sprintf("ListAuthenticationsRequest{%s}", ret)
  818. }
  819. func (o ListAuthenticationsRequest) Clone() *ListAuthenticationsRequest {
  820. ret := ListAuthenticationsRequest{}
  821. if o.Openid != nil {
  822. ret.Openid = new(string)
  823. *ret.Openid = *o.Openid
  824. }
  825. if o.Appid != nil {
  826. ret.Appid = new(string)
  827. *ret.Appid = *o.Appid
  828. }
  829. if o.SubAppid != nil {
  830. ret.SubAppid = new(string)
  831. *ret.SubAppid = *o.SubAppid
  832. }
  833. if o.SubMchid != nil {
  834. ret.SubMchid = new(string)
  835. *ret.SubMchid = *o.SubMchid
  836. }
  837. if o.AuthenticateDate != nil {
  838. ret.AuthenticateDate = new(string)
  839. *ret.AuthenticateDate = *o.AuthenticateDate
  840. }
  841. if o.AuthenticateState != nil {
  842. ret.AuthenticateState = new(string)
  843. *ret.AuthenticateState = *o.AuthenticateState
  844. }
  845. if o.Offset != nil {
  846. ret.Offset = new(int64)
  847. *ret.Offset = *o.Offset
  848. }
  849. if o.Limit != nil {
  850. ret.Limit = new(int64)
  851. *ret.Limit = *o.Limit
  852. }
  853. return &ret
  854. }
  855. // ListAuthenticationsResponse
  856. type ListAuthenticationsResponse struct {
  857. // 查询结果记录列表
  858. Data []AuthenticationEntity `json:"data,omitempty"`
  859. // 经过条件筛选,查询到的记录总数
  860. TotalCount *int64 `json:"total_count"`
  861. // 该次请求资源的起始位置,请求中包含偏移量时应答消息返回相同偏移量,否则返回默认值0
  862. Offset *int64 `json:"offset"`
  863. // 经过条件筛选,本次查询到的记录条数
  864. Limit *int64 `json:"limit"`
  865. }
  866. func (o ListAuthenticationsResponse) MarshalJSON() ([]byte, error) {
  867. toSerialize := map[string]interface{}{}
  868. if o.Data != nil {
  869. toSerialize["data"] = o.Data
  870. }
  871. if o.TotalCount == nil {
  872. return nil, fmt.Errorf("field `TotalCount` is required and must be specified in ListAuthenticationsResponse")
  873. }
  874. toSerialize["total_count"] = o.TotalCount
  875. if o.Offset == nil {
  876. return nil, fmt.Errorf("field `Offset` is required and must be specified in ListAuthenticationsResponse")
  877. }
  878. toSerialize["offset"] = o.Offset
  879. if o.Limit == nil {
  880. return nil, fmt.Errorf("field `Limit` is required and must be specified in ListAuthenticationsResponse")
  881. }
  882. toSerialize["limit"] = o.Limit
  883. return json.Marshal(toSerialize)
  884. }
  885. func (o ListAuthenticationsResponse) String() string {
  886. var ret string
  887. ret += fmt.Sprintf("Data:%v, ", o.Data)
  888. if o.TotalCount == nil {
  889. ret += "TotalCount:<nil>, "
  890. } else {
  891. ret += fmt.Sprintf("TotalCount:%v, ", *o.TotalCount)
  892. }
  893. if o.Offset == nil {
  894. ret += "Offset:<nil>, "
  895. } else {
  896. ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
  897. }
  898. if o.Limit == nil {
  899. ret += "Limit:<nil>"
  900. } else {
  901. ret += fmt.Sprintf("Limit:%v", *o.Limit)
  902. }
  903. return fmt.Sprintf("ListAuthenticationsResponse{%s}", ret)
  904. }
  905. func (o ListAuthenticationsResponse) Clone() *ListAuthenticationsResponse {
  906. ret := ListAuthenticationsResponse{}
  907. if o.Data != nil {
  908. ret.Data = make([]AuthenticationEntity, len(o.Data))
  909. for i, item := range o.Data {
  910. ret.Data[i] = *item.Clone()
  911. }
  912. }
  913. if o.TotalCount != nil {
  914. ret.TotalCount = new(int64)
  915. *ret.TotalCount = *o.TotalCount
  916. }
  917. if o.Offset != nil {
  918. ret.Offset = new(int64)
  919. *ret.Offset = *o.Offset
  920. }
  921. if o.Limit != nil {
  922. ret.Limit = new(int64)
  923. *ret.Limit = *o.Limit
  924. }
  925. return &ret
  926. }
  927. // PayrollCardRegisterState
  928. type PayrollCardRegisterState string
  929. func (e PayrollCardRegisterState) Ptr() *PayrollCardRegisterState {
  930. return &e
  931. }
  932. // Enums of PayrollCardRegisterState
  933. const (
  934. PAYROLLCARDREGISTERSTATE_UNDEFINED PayrollCardRegisterState = "UNDEFINED"
  935. PAYROLLCARDREGISTERSTATE_UNREGISTERED PayrollCardRegisterState = "UNREGISTERED"
  936. PAYROLLCARDREGISTERSTATE_REGISTERED PayrollCardRegisterState = "REGISTERED"
  937. PAYROLLCARDREGISTERSTATE_CLOSED PayrollCardRegisterState = "CLOSED"
  938. )
  939. // PreOrderAuthenticationRequest
  940. type PreOrderAuthenticationRequest struct {
  941. // 用户OpenID
  942. Openid *string `json:"openid"`
  943. // 当输入服务商AppID时,会校验其与服务商商户号的绑定关系。服务商AppID和与特约商户AppID至少输入一个,且必须要有拉起微工卡小程序时使用的AppID。
  944. Appid *string `json:"appid,omitempty"`
  945. // 特约商户号
  946. SubMchid *string `json:"sub_mchid"`
  947. // 当输入特约商户AppID时,会校验其与特约商户号的绑定关系。服务商AppID和与特约商户AppID至少输入一个,且必须要有拉起微工卡小程序时使用的AppID。
  948. SubAppid *string `json:"sub_appid,omitempty"`
  949. // 商户系统内部的商家核身单号,要求此参数只能由数字、大小写字母组成,在服务商内部唯一
  950. AuthenticateNumber *string `json:"authenticate_number"`
  951. // 该劳务活动的项目名称
  952. ProjectName *string `json:"project_name"`
  953. // 该工人所属的用工企业
  954. EmployerName *string `json:"employer_name"`
  955. // 核身类型
  956. AuthenticateType *AuthenticationType `json:"authenticate_type,omitempty"`
  957. }
  958. func (o PreOrderAuthenticationRequest) MarshalJSON() ([]byte, error) {
  959. toSerialize := map[string]interface{}{}
  960. if o.Openid == nil {
  961. return nil, fmt.Errorf("field `Openid` is required and must be specified in PreOrderAuthenticationRequest")
  962. }
  963. toSerialize["openid"] = o.Openid
  964. if o.Appid != nil {
  965. toSerialize["appid"] = o.Appid
  966. }
  967. if o.SubMchid == nil {
  968. return nil, fmt.Errorf("field `SubMchid` is required and must be specified in PreOrderAuthenticationRequest")
  969. }
  970. toSerialize["sub_mchid"] = o.SubMchid
  971. if o.SubAppid != nil {
  972. toSerialize["sub_appid"] = o.SubAppid
  973. }
  974. if o.AuthenticateNumber == nil {
  975. return nil, fmt.Errorf("field `AuthenticateNumber` is required and must be specified in PreOrderAuthenticationRequest")
  976. }
  977. toSerialize["authenticate_number"] = o.AuthenticateNumber
  978. if o.ProjectName == nil {
  979. return nil, fmt.Errorf("field `ProjectName` is required and must be specified in PreOrderAuthenticationRequest")
  980. }
  981. toSerialize["project_name"] = o.ProjectName
  982. if o.EmployerName == nil {
  983. return nil, fmt.Errorf("field `EmployerName` is required and must be specified in PreOrderAuthenticationRequest")
  984. }
  985. toSerialize["employer_name"] = o.EmployerName
  986. if o.AuthenticateType != nil {
  987. toSerialize["authenticate_type"] = o.AuthenticateType
  988. }
  989. return json.Marshal(toSerialize)
  990. }
  991. func (o PreOrderAuthenticationRequest) String() string {
  992. var ret string
  993. if o.Openid == nil {
  994. ret += "Openid:<nil>, "
  995. } else {
  996. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  997. }
  998. if o.Appid == nil {
  999. ret += "Appid:<nil>, "
  1000. } else {
  1001. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  1002. }
  1003. if o.SubMchid == nil {
  1004. ret += "SubMchid:<nil>, "
  1005. } else {
  1006. ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
  1007. }
  1008. if o.SubAppid == nil {
  1009. ret += "SubAppid:<nil>, "
  1010. } else {
  1011. ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid)
  1012. }
  1013. if o.AuthenticateNumber == nil {
  1014. ret += "AuthenticateNumber:<nil>, "
  1015. } else {
  1016. ret += fmt.Sprintf("AuthenticateNumber:%v, ", *o.AuthenticateNumber)
  1017. }
  1018. if o.ProjectName == nil {
  1019. ret += "ProjectName:<nil>, "
  1020. } else {
  1021. ret += fmt.Sprintf("ProjectName:%v, ", *o.ProjectName)
  1022. }
  1023. if o.EmployerName == nil {
  1024. ret += "EmployerName:<nil>, "
  1025. } else {
  1026. ret += fmt.Sprintf("EmployerName:%v, ", *o.EmployerName)
  1027. }
  1028. if o.AuthenticateType == nil {
  1029. ret += "AuthenticateType:<nil>"
  1030. } else {
  1031. ret += fmt.Sprintf("AuthenticateType:%v", *o.AuthenticateType)
  1032. }
  1033. return fmt.Sprintf("PreOrderAuthenticationRequest{%s}", ret)
  1034. }
  1035. func (o PreOrderAuthenticationRequest) Clone() *PreOrderAuthenticationRequest {
  1036. ret := PreOrderAuthenticationRequest{}
  1037. if o.Openid != nil {
  1038. ret.Openid = new(string)
  1039. *ret.Openid = *o.Openid
  1040. }
  1041. if o.Appid != nil {
  1042. ret.Appid = new(string)
  1043. *ret.Appid = *o.Appid
  1044. }
  1045. if o.SubMchid != nil {
  1046. ret.SubMchid = new(string)
  1047. *ret.SubMchid = *o.SubMchid
  1048. }
  1049. if o.SubAppid != nil {
  1050. ret.SubAppid = new(string)
  1051. *ret.SubAppid = *o.SubAppid
  1052. }
  1053. if o.AuthenticateNumber != nil {
  1054. ret.AuthenticateNumber = new(string)
  1055. *ret.AuthenticateNumber = *o.AuthenticateNumber
  1056. }
  1057. if o.ProjectName != nil {
  1058. ret.ProjectName = new(string)
  1059. *ret.ProjectName = *o.ProjectName
  1060. }
  1061. if o.EmployerName != nil {
  1062. ret.EmployerName = new(string)
  1063. *ret.EmployerName = *o.EmployerName
  1064. }
  1065. if o.AuthenticateType != nil {
  1066. ret.AuthenticateType = new(AuthenticationType)
  1067. *ret.AuthenticateType = *o.AuthenticateType
  1068. }
  1069. return &ret
  1070. }
  1071. // PreOrderAuthenticationResponse
  1072. type PreOrderAuthenticationResponse struct {
  1073. // 商户系统内部的商家核身单号,要求此参数只能由数字、大小写字母组成,在服务商内部唯一
  1074. AuthenticateNumber *string `json:"authenticate_number"`
  1075. // 微信用户OpenID
  1076. Openid *string `json:"openid"`
  1077. // 商户号
  1078. Mchid *string `json:"mchid"`
  1079. // 特约商户号
  1080. SubMchid *string `json:"sub_mchid"`
  1081. // token值
  1082. Token *string `json:"token"`
  1083. // token有效时间,单位秒
  1084. ExpiresIn *int64 `json:"expires_in"`
  1085. }
  1086. func (o PreOrderAuthenticationResponse) MarshalJSON() ([]byte, error) {
  1087. toSerialize := map[string]interface{}{}
  1088. if o.AuthenticateNumber == nil {
  1089. return nil, fmt.Errorf("field `AuthenticateNumber` is required and must be specified in PreOrderAuthenticationResponse")
  1090. }
  1091. toSerialize["authenticate_number"] = o.AuthenticateNumber
  1092. if o.Openid == nil {
  1093. return nil, fmt.Errorf("field `Openid` is required and must be specified in PreOrderAuthenticationResponse")
  1094. }
  1095. toSerialize["openid"] = o.Openid
  1096. if o.Mchid == nil {
  1097. return nil, fmt.Errorf("field `Mchid` is required and must be specified in PreOrderAuthenticationResponse")
  1098. }
  1099. toSerialize["mchid"] = o.Mchid
  1100. if o.SubMchid == nil {
  1101. return nil, fmt.Errorf("field `SubMchid` is required and must be specified in PreOrderAuthenticationResponse")
  1102. }
  1103. toSerialize["sub_mchid"] = o.SubMchid
  1104. if o.Token == nil {
  1105. return nil, fmt.Errorf("field `Token` is required and must be specified in PreOrderAuthenticationResponse")
  1106. }
  1107. toSerialize["token"] = o.Token
  1108. if o.ExpiresIn == nil {
  1109. return nil, fmt.Errorf("field `ExpiresIn` is required and must be specified in PreOrderAuthenticationResponse")
  1110. }
  1111. toSerialize["expires_in"] = o.ExpiresIn
  1112. return json.Marshal(toSerialize)
  1113. }
  1114. func (o PreOrderAuthenticationResponse) String() string {
  1115. var ret string
  1116. if o.AuthenticateNumber == nil {
  1117. ret += "AuthenticateNumber:<nil>, "
  1118. } else {
  1119. ret += fmt.Sprintf("AuthenticateNumber:%v, ", *o.AuthenticateNumber)
  1120. }
  1121. if o.Openid == nil {
  1122. ret += "Openid:<nil>, "
  1123. } else {
  1124. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  1125. }
  1126. if o.Mchid == nil {
  1127. ret += "Mchid:<nil>, "
  1128. } else {
  1129. ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid)
  1130. }
  1131. if o.SubMchid == nil {
  1132. ret += "SubMchid:<nil>, "
  1133. } else {
  1134. ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
  1135. }
  1136. if o.Token == nil {
  1137. ret += "Token:<nil>, "
  1138. } else {
  1139. ret += fmt.Sprintf("Token:%v, ", *o.Token)
  1140. }
  1141. if o.ExpiresIn == nil {
  1142. ret += "ExpiresIn:<nil>"
  1143. } else {
  1144. ret += fmt.Sprintf("ExpiresIn:%v", *o.ExpiresIn)
  1145. }
  1146. return fmt.Sprintf("PreOrderAuthenticationResponse{%s}", ret)
  1147. }
  1148. func (o PreOrderAuthenticationResponse) Clone() *PreOrderAuthenticationResponse {
  1149. ret := PreOrderAuthenticationResponse{}
  1150. if o.AuthenticateNumber != nil {
  1151. ret.AuthenticateNumber = new(string)
  1152. *ret.AuthenticateNumber = *o.AuthenticateNumber
  1153. }
  1154. if o.Openid != nil {
  1155. ret.Openid = new(string)
  1156. *ret.Openid = *o.Openid
  1157. }
  1158. if o.Mchid != nil {
  1159. ret.Mchid = new(string)
  1160. *ret.Mchid = *o.Mchid
  1161. }
  1162. if o.SubMchid != nil {
  1163. ret.SubMchid = new(string)
  1164. *ret.SubMchid = *o.SubMchid
  1165. }
  1166. if o.Token != nil {
  1167. ret.Token = new(string)
  1168. *ret.Token = *o.Token
  1169. }
  1170. if o.ExpiresIn != nil {
  1171. ret.ExpiresIn = new(int64)
  1172. *ret.ExpiresIn = *o.ExpiresIn
  1173. }
  1174. return &ret
  1175. }
  1176. // PreOrderAuthenticationWithAuthRequest
  1177. type PreOrderAuthenticationWithAuthRequest struct {
  1178. // 用户OpenID
  1179. Openid *string `json:"openid"`
  1180. // 当输入服务商AppID时,会校验其与服务商商户号的绑定关系。服务商AppID和与特约商户AppID至少输入一个,且必须要有拉起微工卡小程序时使用的AppID。
  1181. Appid *string `json:"appid,omitempty"`
  1182. // 特约商户号
  1183. SubMchid *string `json:"sub_mchid"`
  1184. // 当输入特约商户AppID时,会校验其与特约商户号的绑定关系。服务商AppID和与特约商户AppID至少输入一个,且必须要有拉起微工卡小程序时使用的AppID。
  1185. SubAppid *string `json:"sub_appid,omitempty"`
  1186. // 商户系统内部的商家核身单号,要求此参数只能由数字、大小写字母组成,在服务商内部唯一
  1187. AuthenticateNumber *string `json:"authenticate_number"`
  1188. // 该劳务活动的项目名称
  1189. ProjectName *string `json:"project_name"`
  1190. // 该工人所属的用工企业
  1191. EmployerName *string `json:"employer_name"`
  1192. // 用户实名信息,按照APIV3标准加密该字段
  1193. UserName *string `json:"user_name" encryption:"EM_APIV3"`
  1194. // 用户证件号,按照APIV3标准加密该字段
  1195. IdCardNumber *string `json:"id_card_number" encryption:"EM_APIV3"`
  1196. // 微工卡服务仅支持用于与商户有用工关系的用户,需明确用工类型;非必填;未授权必填,授权过,非必填,如填写,需要校验和初次填写的一致性;参考值:长期用工:LONG_TERM_EMPLOYMENT,短期用工:SHORT_TERM_EMPLOYMENT,合作关系:COOPERATION_EMPLOYMENT
  1197. EmploymentType *EmploymentType `json:"employment_type"`
  1198. // 核身类型
  1199. AuthenticateType *AuthenticationType `json:"authenticate_type,omitempty"`
  1200. }
  1201. func (o PreOrderAuthenticationWithAuthRequest) MarshalJSON() ([]byte, error) {
  1202. toSerialize := map[string]interface{}{}
  1203. if o.Openid == nil {
  1204. return nil, fmt.Errorf("field `Openid` is required and must be specified in PreOrderAuthenticationWithAuthRequest")
  1205. }
  1206. toSerialize["openid"] = o.Openid
  1207. if o.Appid != nil {
  1208. toSerialize["appid"] = o.Appid
  1209. }
  1210. if o.SubMchid == nil {
  1211. return nil, fmt.Errorf("field `SubMchid` is required and must be specified in PreOrderAuthenticationWithAuthRequest")
  1212. }
  1213. toSerialize["sub_mchid"] = o.SubMchid
  1214. if o.SubAppid != nil {
  1215. toSerialize["sub_appid"] = o.SubAppid
  1216. }
  1217. if o.AuthenticateNumber == nil {
  1218. return nil, fmt.Errorf("field `AuthenticateNumber` is required and must be specified in PreOrderAuthenticationWithAuthRequest")
  1219. }
  1220. toSerialize["authenticate_number"] = o.AuthenticateNumber
  1221. if o.ProjectName == nil {
  1222. return nil, fmt.Errorf("field `ProjectName` is required and must be specified in PreOrderAuthenticationWithAuthRequest")
  1223. }
  1224. toSerialize["project_name"] = o.ProjectName
  1225. if o.EmployerName == nil {
  1226. return nil, fmt.Errorf("field `EmployerName` is required and must be specified in PreOrderAuthenticationWithAuthRequest")
  1227. }
  1228. toSerialize["employer_name"] = o.EmployerName
  1229. if o.UserName == nil {
  1230. return nil, fmt.Errorf("field `UserName` is required and must be specified in PreOrderAuthenticationWithAuthRequest")
  1231. }
  1232. toSerialize["user_name"] = o.UserName
  1233. if o.IdCardNumber == nil {
  1234. return nil, fmt.Errorf("field `IdCardNumber` is required and must be specified in PreOrderAuthenticationWithAuthRequest")
  1235. }
  1236. toSerialize["id_card_number"] = o.IdCardNumber
  1237. if o.EmploymentType == nil {
  1238. return nil, fmt.Errorf("field `EmploymentType` is required and must be specified in PreOrderAuthenticationWithAuthRequest")
  1239. }
  1240. toSerialize["employment_type"] = o.EmploymentType
  1241. if o.AuthenticateType != nil {
  1242. toSerialize["authenticate_type"] = o.AuthenticateType
  1243. }
  1244. return json.Marshal(toSerialize)
  1245. }
  1246. func (o PreOrderAuthenticationWithAuthRequest) String() string {
  1247. var ret string
  1248. if o.Openid == nil {
  1249. ret += "Openid:<nil>, "
  1250. } else {
  1251. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  1252. }
  1253. if o.Appid == nil {
  1254. ret += "Appid:<nil>, "
  1255. } else {
  1256. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  1257. }
  1258. if o.SubMchid == nil {
  1259. ret += "SubMchid:<nil>, "
  1260. } else {
  1261. ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
  1262. }
  1263. if o.SubAppid == nil {
  1264. ret += "SubAppid:<nil>, "
  1265. } else {
  1266. ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid)
  1267. }
  1268. if o.AuthenticateNumber == nil {
  1269. ret += "AuthenticateNumber:<nil>, "
  1270. } else {
  1271. ret += fmt.Sprintf("AuthenticateNumber:%v, ", *o.AuthenticateNumber)
  1272. }
  1273. if o.ProjectName == nil {
  1274. ret += "ProjectName:<nil>, "
  1275. } else {
  1276. ret += fmt.Sprintf("ProjectName:%v, ", *o.ProjectName)
  1277. }
  1278. if o.EmployerName == nil {
  1279. ret += "EmployerName:<nil>, "
  1280. } else {
  1281. ret += fmt.Sprintf("EmployerName:%v, ", *o.EmployerName)
  1282. }
  1283. if o.UserName == nil {
  1284. ret += "UserName:<nil>, "
  1285. } else {
  1286. ret += fmt.Sprintf("UserName:%v, ", *o.UserName)
  1287. }
  1288. if o.IdCardNumber == nil {
  1289. ret += "IdCardNumber:<nil>, "
  1290. } else {
  1291. ret += fmt.Sprintf("IdCardNumber:%v, ", *o.IdCardNumber)
  1292. }
  1293. if o.EmploymentType == nil {
  1294. ret += "EmploymentType:<nil>, "
  1295. } else {
  1296. ret += fmt.Sprintf("EmploymentType:%v, ", *o.EmploymentType)
  1297. }
  1298. if o.AuthenticateType == nil {
  1299. ret += "AuthenticateType:<nil>"
  1300. } else {
  1301. ret += fmt.Sprintf("AuthenticateType:%v", *o.AuthenticateType)
  1302. }
  1303. return fmt.Sprintf("PreOrderAuthenticationWithAuthRequest{%s}", ret)
  1304. }
  1305. func (o PreOrderAuthenticationWithAuthRequest) Clone() *PreOrderAuthenticationWithAuthRequest {
  1306. ret := PreOrderAuthenticationWithAuthRequest{}
  1307. if o.Openid != nil {
  1308. ret.Openid = new(string)
  1309. *ret.Openid = *o.Openid
  1310. }
  1311. if o.Appid != nil {
  1312. ret.Appid = new(string)
  1313. *ret.Appid = *o.Appid
  1314. }
  1315. if o.SubMchid != nil {
  1316. ret.SubMchid = new(string)
  1317. *ret.SubMchid = *o.SubMchid
  1318. }
  1319. if o.SubAppid != nil {
  1320. ret.SubAppid = new(string)
  1321. *ret.SubAppid = *o.SubAppid
  1322. }
  1323. if o.AuthenticateNumber != nil {
  1324. ret.AuthenticateNumber = new(string)
  1325. *ret.AuthenticateNumber = *o.AuthenticateNumber
  1326. }
  1327. if o.ProjectName != nil {
  1328. ret.ProjectName = new(string)
  1329. *ret.ProjectName = *o.ProjectName
  1330. }
  1331. if o.EmployerName != nil {
  1332. ret.EmployerName = new(string)
  1333. *ret.EmployerName = *o.EmployerName
  1334. }
  1335. if o.UserName != nil {
  1336. ret.UserName = new(string)
  1337. *ret.UserName = *o.UserName
  1338. }
  1339. if o.IdCardNumber != nil {
  1340. ret.IdCardNumber = new(string)
  1341. *ret.IdCardNumber = *o.IdCardNumber
  1342. }
  1343. if o.EmploymentType != nil {
  1344. ret.EmploymentType = new(EmploymentType)
  1345. *ret.EmploymentType = *o.EmploymentType
  1346. }
  1347. if o.AuthenticateType != nil {
  1348. ret.AuthenticateType = new(AuthenticationType)
  1349. *ret.AuthenticateType = *o.AuthenticateType
  1350. }
  1351. return &ret
  1352. }
  1353. // PreOrderAuthenticationWithAuthResponse
  1354. type PreOrderAuthenticationWithAuthResponse struct {
  1355. // 商户系统内部的商家核身单号,要求此参数只能由数字、大小写字母组成,在服务商内部唯一
  1356. AuthenticateNumber *string `json:"authenticate_number"`
  1357. // 微信用户OpenID
  1358. Openid *string `json:"openid"`
  1359. // 商户号
  1360. Mchid *string `json:"mchid"`
  1361. // 特约商户号
  1362. SubMchid *string `json:"sub_mchid"`
  1363. // token值
  1364. Token *string `json:"token"`
  1365. // token有效时间,单位秒
  1366. ExpiresIn *int64 `json:"expires_in"`
  1367. }
  1368. func (o PreOrderAuthenticationWithAuthResponse) MarshalJSON() ([]byte, error) {
  1369. toSerialize := map[string]interface{}{}
  1370. if o.AuthenticateNumber == nil {
  1371. return nil, fmt.Errorf("field `AuthenticateNumber` is required and must be specified in PreOrderAuthenticationWithAuthResponse")
  1372. }
  1373. toSerialize["authenticate_number"] = o.AuthenticateNumber
  1374. if o.Openid == nil {
  1375. return nil, fmt.Errorf("field `Openid` is required and must be specified in PreOrderAuthenticationWithAuthResponse")
  1376. }
  1377. toSerialize["openid"] = o.Openid
  1378. if o.Mchid == nil {
  1379. return nil, fmt.Errorf("field `Mchid` is required and must be specified in PreOrderAuthenticationWithAuthResponse")
  1380. }
  1381. toSerialize["mchid"] = o.Mchid
  1382. if o.SubMchid == nil {
  1383. return nil, fmt.Errorf("field `SubMchid` is required and must be specified in PreOrderAuthenticationWithAuthResponse")
  1384. }
  1385. toSerialize["sub_mchid"] = o.SubMchid
  1386. if o.Token == nil {
  1387. return nil, fmt.Errorf("field `Token` is required and must be specified in PreOrderAuthenticationWithAuthResponse")
  1388. }
  1389. toSerialize["token"] = o.Token
  1390. if o.ExpiresIn == nil {
  1391. return nil, fmt.Errorf("field `ExpiresIn` is required and must be specified in PreOrderAuthenticationWithAuthResponse")
  1392. }
  1393. toSerialize["expires_in"] = o.ExpiresIn
  1394. return json.Marshal(toSerialize)
  1395. }
  1396. func (o PreOrderAuthenticationWithAuthResponse) String() string {
  1397. var ret string
  1398. if o.AuthenticateNumber == nil {
  1399. ret += "AuthenticateNumber:<nil>, "
  1400. } else {
  1401. ret += fmt.Sprintf("AuthenticateNumber:%v, ", *o.AuthenticateNumber)
  1402. }
  1403. if o.Openid == nil {
  1404. ret += "Openid:<nil>, "
  1405. } else {
  1406. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  1407. }
  1408. if o.Mchid == nil {
  1409. ret += "Mchid:<nil>, "
  1410. } else {
  1411. ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid)
  1412. }
  1413. if o.SubMchid == nil {
  1414. ret += "SubMchid:<nil>, "
  1415. } else {
  1416. ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
  1417. }
  1418. if o.Token == nil {
  1419. ret += "Token:<nil>, "
  1420. } else {
  1421. ret += fmt.Sprintf("Token:%v, ", *o.Token)
  1422. }
  1423. if o.ExpiresIn == nil {
  1424. ret += "ExpiresIn:<nil>"
  1425. } else {
  1426. ret += fmt.Sprintf("ExpiresIn:%v", *o.ExpiresIn)
  1427. }
  1428. return fmt.Sprintf("PreOrderAuthenticationWithAuthResponse{%s}", ret)
  1429. }
  1430. func (o PreOrderAuthenticationWithAuthResponse) Clone() *PreOrderAuthenticationWithAuthResponse {
  1431. ret := PreOrderAuthenticationWithAuthResponse{}
  1432. if o.AuthenticateNumber != nil {
  1433. ret.AuthenticateNumber = new(string)
  1434. *ret.AuthenticateNumber = *o.AuthenticateNumber
  1435. }
  1436. if o.Openid != nil {
  1437. ret.Openid = new(string)
  1438. *ret.Openid = *o.Openid
  1439. }
  1440. if o.Mchid != nil {
  1441. ret.Mchid = new(string)
  1442. *ret.Mchid = *o.Mchid
  1443. }
  1444. if o.SubMchid != nil {
  1445. ret.SubMchid = new(string)
  1446. *ret.SubMchid = *o.SubMchid
  1447. }
  1448. if o.Token != nil {
  1449. ret.Token = new(string)
  1450. *ret.Token = *o.Token
  1451. }
  1452. if o.ExpiresIn != nil {
  1453. ret.ExpiresIn = new(int64)
  1454. *ret.ExpiresIn = *o.ExpiresIn
  1455. }
  1456. return &ret
  1457. }
  1458. // RelationEntity
  1459. type RelationEntity struct {
  1460. // 用户OpenID
  1461. Openid *string `json:"openid"`
  1462. // 商户号
  1463. Mchid *string `json:"mchid"`
  1464. // 特约商户号
  1465. SubMchid *string `json:"sub_mchid"`
  1466. // 授权状态:UNAUTHORIZED:未授权 AUTHORIZED:已授权 DEAUTHORIZED:已取消授权
  1467. AuthorizeState *string `json:"authorize_state"`
  1468. // 授权时间
  1469. AuthorizeTime *string `json:"authorize_time,omitempty"`
  1470. // 取消授权时间,遵循RFC3339标准格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。
  1471. DeauthorizeTime *string `json:"deauthorize_time,omitempty"`
  1472. // 微工卡的开通状态:UNREGISTERED:未开通;REGISTERED:已开通;CLOSED:已关闭
  1473. RegisterState *PayrollCardRegisterState `json:"register_state"`
  1474. // 开通时间,未开通时不返回。遵循RFC3339标准格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。
  1475. RegisterTime *string `json:"register_time,omitempty"`
  1476. // 关闭时间,仅当开通状态是已关闭时返回。遵循RFC3339标准格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。
  1477. CloseTime *string `json:"close_time,omitempty"`
  1478. }
  1479. func (o RelationEntity) MarshalJSON() ([]byte, error) {
  1480. toSerialize := map[string]interface{}{}
  1481. if o.Openid == nil {
  1482. return nil, fmt.Errorf("field `Openid` is required and must be specified in RelationEntity")
  1483. }
  1484. toSerialize["openid"] = o.Openid
  1485. if o.Mchid == nil {
  1486. return nil, fmt.Errorf("field `Mchid` is required and must be specified in RelationEntity")
  1487. }
  1488. toSerialize["mchid"] = o.Mchid
  1489. if o.SubMchid == nil {
  1490. return nil, fmt.Errorf("field `SubMchid` is required and must be specified in RelationEntity")
  1491. }
  1492. toSerialize["sub_mchid"] = o.SubMchid
  1493. if o.AuthorizeState == nil {
  1494. return nil, fmt.Errorf("field `AuthorizeState` is required and must be specified in RelationEntity")
  1495. }
  1496. toSerialize["authorize_state"] = o.AuthorizeState
  1497. if o.AuthorizeTime != nil {
  1498. toSerialize["authorize_time"] = o.AuthorizeTime
  1499. }
  1500. if o.DeauthorizeTime != nil {
  1501. toSerialize["deauthorize_time"] = o.DeauthorizeTime
  1502. }
  1503. if o.RegisterState == nil {
  1504. return nil, fmt.Errorf("field `RegisterState` is required and must be specified in RelationEntity")
  1505. }
  1506. toSerialize["register_state"] = o.RegisterState
  1507. if o.RegisterTime != nil {
  1508. toSerialize["register_time"] = o.RegisterTime
  1509. }
  1510. if o.CloseTime != nil {
  1511. toSerialize["close_time"] = o.CloseTime
  1512. }
  1513. return json.Marshal(toSerialize)
  1514. }
  1515. func (o RelationEntity) String() string {
  1516. var ret string
  1517. if o.Openid == nil {
  1518. ret += "Openid:<nil>, "
  1519. } else {
  1520. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  1521. }
  1522. if o.Mchid == nil {
  1523. ret += "Mchid:<nil>, "
  1524. } else {
  1525. ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid)
  1526. }
  1527. if o.SubMchid == nil {
  1528. ret += "SubMchid:<nil>, "
  1529. } else {
  1530. ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
  1531. }
  1532. if o.AuthorizeState == nil {
  1533. ret += "AuthorizeState:<nil>, "
  1534. } else {
  1535. ret += fmt.Sprintf("AuthorizeState:%v, ", *o.AuthorizeState)
  1536. }
  1537. if o.AuthorizeTime == nil {
  1538. ret += "AuthorizeTime:<nil>, "
  1539. } else {
  1540. ret += fmt.Sprintf("AuthorizeTime:%v, ", *o.AuthorizeTime)
  1541. }
  1542. if o.DeauthorizeTime == nil {
  1543. ret += "DeauthorizeTime:<nil>, "
  1544. } else {
  1545. ret += fmt.Sprintf("DeauthorizeTime:%v, ", *o.DeauthorizeTime)
  1546. }
  1547. if o.RegisterState == nil {
  1548. ret += "RegisterState:<nil>, "
  1549. } else {
  1550. ret += fmt.Sprintf("RegisterState:%v, ", *o.RegisterState)
  1551. }
  1552. if o.RegisterTime == nil {
  1553. ret += "RegisterTime:<nil>, "
  1554. } else {
  1555. ret += fmt.Sprintf("RegisterTime:%v, ", *o.RegisterTime)
  1556. }
  1557. if o.CloseTime == nil {
  1558. ret += "CloseTime:<nil>"
  1559. } else {
  1560. ret += fmt.Sprintf("CloseTime:%v", *o.CloseTime)
  1561. }
  1562. return fmt.Sprintf("RelationEntity{%s}", ret)
  1563. }
  1564. func (o RelationEntity) Clone() *RelationEntity {
  1565. ret := RelationEntity{}
  1566. if o.Openid != nil {
  1567. ret.Openid = new(string)
  1568. *ret.Openid = *o.Openid
  1569. }
  1570. if o.Mchid != nil {
  1571. ret.Mchid = new(string)
  1572. *ret.Mchid = *o.Mchid
  1573. }
  1574. if o.SubMchid != nil {
  1575. ret.SubMchid = new(string)
  1576. *ret.SubMchid = *o.SubMchid
  1577. }
  1578. if o.AuthorizeState != nil {
  1579. ret.AuthorizeState = new(string)
  1580. *ret.AuthorizeState = *o.AuthorizeState
  1581. }
  1582. if o.AuthorizeTime != nil {
  1583. ret.AuthorizeTime = new(string)
  1584. *ret.AuthorizeTime = *o.AuthorizeTime
  1585. }
  1586. if o.DeauthorizeTime != nil {
  1587. ret.DeauthorizeTime = new(string)
  1588. *ret.DeauthorizeTime = *o.DeauthorizeTime
  1589. }
  1590. if o.RegisterState != nil {
  1591. ret.RegisterState = new(PayrollCardRegisterState)
  1592. *ret.RegisterState = *o.RegisterState
  1593. }
  1594. if o.RegisterTime != nil {
  1595. ret.RegisterTime = new(string)
  1596. *ret.RegisterTime = *o.RegisterTime
  1597. }
  1598. if o.CloseTime != nil {
  1599. ret.CloseTime = new(string)
  1600. *ret.CloseTime = *o.CloseTime
  1601. }
  1602. return &ret
  1603. }
  1604. // TokenEntity
  1605. type TokenEntity struct {
  1606. // 微信用户OpenID
  1607. Openid *string `json:"openid"`
  1608. // 商户号
  1609. Mchid *string `json:"mchid"`
  1610. // 特约商户号
  1611. SubMchid *string `json:"sub_mchid"`
  1612. // token值
  1613. Token *string `json:"token"`
  1614. // token有效时间,单位秒
  1615. ExpiresIn *int64 `json:"expires_in"`
  1616. }
  1617. func (o TokenEntity) MarshalJSON() ([]byte, error) {
  1618. toSerialize := map[string]interface{}{}
  1619. if o.Openid == nil {
  1620. return nil, fmt.Errorf("field `Openid` is required and must be specified in TokenEntity")
  1621. }
  1622. toSerialize["openid"] = o.Openid
  1623. if o.Mchid == nil {
  1624. return nil, fmt.Errorf("field `Mchid` is required and must be specified in TokenEntity")
  1625. }
  1626. toSerialize["mchid"] = o.Mchid
  1627. if o.SubMchid == nil {
  1628. return nil, fmt.Errorf("field `SubMchid` is required and must be specified in TokenEntity")
  1629. }
  1630. toSerialize["sub_mchid"] = o.SubMchid
  1631. if o.Token == nil {
  1632. return nil, fmt.Errorf("field `Token` is required and must be specified in TokenEntity")
  1633. }
  1634. toSerialize["token"] = o.Token
  1635. if o.ExpiresIn == nil {
  1636. return nil, fmt.Errorf("field `ExpiresIn` is required and must be specified in TokenEntity")
  1637. }
  1638. toSerialize["expires_in"] = o.ExpiresIn
  1639. return json.Marshal(toSerialize)
  1640. }
  1641. func (o TokenEntity) String() string {
  1642. var ret string
  1643. if o.Openid == nil {
  1644. ret += "Openid:<nil>, "
  1645. } else {
  1646. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  1647. }
  1648. if o.Mchid == nil {
  1649. ret += "Mchid:<nil>, "
  1650. } else {
  1651. ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid)
  1652. }
  1653. if o.SubMchid == nil {
  1654. ret += "SubMchid:<nil>, "
  1655. } else {
  1656. ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
  1657. }
  1658. if o.Token == nil {
  1659. ret += "Token:<nil>, "
  1660. } else {
  1661. ret += fmt.Sprintf("Token:%v, ", *o.Token)
  1662. }
  1663. if o.ExpiresIn == nil {
  1664. ret += "ExpiresIn:<nil>"
  1665. } else {
  1666. ret += fmt.Sprintf("ExpiresIn:%v", *o.ExpiresIn)
  1667. }
  1668. return fmt.Sprintf("TokenEntity{%s}", ret)
  1669. }
  1670. func (o TokenEntity) Clone() *TokenEntity {
  1671. ret := TokenEntity{}
  1672. if o.Openid != nil {
  1673. ret.Openid = new(string)
  1674. *ret.Openid = *o.Openid
  1675. }
  1676. if o.Mchid != nil {
  1677. ret.Mchid = new(string)
  1678. *ret.Mchid = *o.Mchid
  1679. }
  1680. if o.SubMchid != nil {
  1681. ret.SubMchid = new(string)
  1682. *ret.SubMchid = *o.SubMchid
  1683. }
  1684. if o.Token != nil {
  1685. ret.Token = new(string)
  1686. *ret.Token = *o.Token
  1687. }
  1688. if o.ExpiresIn != nil {
  1689. ret.ExpiresIn = new(int64)
  1690. *ret.ExpiresIn = *o.ExpiresIn
  1691. }
  1692. return &ret
  1693. }
  1694. // TransferBatchEntity
  1695. type TransferBatchEntity struct {
  1696. // 商户系统内部的商家批次单号,在商户系统内部唯一
  1697. OutBatchNo *string `json:"out_batch_no"`
  1698. // 微信支付批次单号,微信商家转账系统返回的唯一标识
  1699. BatchId *string `json:"batch_id"`
  1700. // 批次受理成功时返回,按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE
  1701. CreateTime *time.Time `json:"create_time"`
  1702. }
  1703. func (o TransferBatchEntity) MarshalJSON() ([]byte, error) {
  1704. toSerialize := map[string]interface{}{}
  1705. if o.OutBatchNo == nil {
  1706. return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in TransferBatchEntity")
  1707. }
  1708. toSerialize["out_batch_no"] = o.OutBatchNo
  1709. if o.BatchId == nil {
  1710. return nil, fmt.Errorf("field `BatchId` is required and must be specified in TransferBatchEntity")
  1711. }
  1712. toSerialize["batch_id"] = o.BatchId
  1713. if o.CreateTime == nil {
  1714. return nil, fmt.Errorf("field `CreateTime` is required and must be specified in TransferBatchEntity")
  1715. }
  1716. toSerialize["create_time"] = o.CreateTime.Format(time.RFC3339)
  1717. return json.Marshal(toSerialize)
  1718. }
  1719. func (o TransferBatchEntity) String() string {
  1720. var ret string
  1721. if o.OutBatchNo == nil {
  1722. ret += "OutBatchNo:<nil>, "
  1723. } else {
  1724. ret += fmt.Sprintf("OutBatchNo:%v, ", *o.OutBatchNo)
  1725. }
  1726. if o.BatchId == nil {
  1727. ret += "BatchId:<nil>, "
  1728. } else {
  1729. ret += fmt.Sprintf("BatchId:%v, ", *o.BatchId)
  1730. }
  1731. if o.CreateTime == nil {
  1732. ret += "CreateTime:<nil>"
  1733. } else {
  1734. ret += fmt.Sprintf("CreateTime:%v", *o.CreateTime)
  1735. }
  1736. return fmt.Sprintf("TransferBatchEntity{%s}", ret)
  1737. }
  1738. func (o TransferBatchEntity) Clone() *TransferBatchEntity {
  1739. ret := TransferBatchEntity{}
  1740. if o.OutBatchNo != nil {
  1741. ret.OutBatchNo = new(string)
  1742. *ret.OutBatchNo = *o.OutBatchNo
  1743. }
  1744. if o.BatchId != nil {
  1745. ret.BatchId = new(string)
  1746. *ret.BatchId = *o.BatchId
  1747. }
  1748. if o.CreateTime != nil {
  1749. ret.CreateTime = new(time.Time)
  1750. *ret.CreateTime = *o.CreateTime
  1751. }
  1752. return &ret
  1753. }
  1754. // TransferDetailInput
  1755. type TransferDetailInput struct {
  1756. // 商户系统内部区分转账批次单下不同转账明细单的唯一标识
  1757. OutDetailNo *string `json:"out_detail_no"`
  1758. // 转账金额单位为“分”
  1759. TransferAmount *int64 `json:"transfer_amount"`
  1760. // 单条转账备注(微信用户会收到该备注),UTF8编码,最多允许32个字符
  1761. TransferRemark *string `json:"transfer_remark"`
  1762. // 收款用户OpenID。如果转账特约商户授权类型是INFORMATION_AUTHORIZATION_TYPE,对应的是特约商户公众号下的OpenID。
  1763. Openid *string `json:"openid"`
  1764. // 收款用户姓名。采用标准RSA算法,公钥由微信侧提供 明细转账金额 >= 2,000时,该笔明细必须填写收款用户姓名 同一批次转账明细中的姓名字段传入规则需保持一致,也即全部填写、或全部不填写 若商户传入收款用户姓名,微信支付会校验用户OpenID与姓名是否一致,并提供电子回单
  1765. UserName *string `json:"user_name" encryption:"EM_APIV3"`
  1766. }
  1767. func (o TransferDetailInput) MarshalJSON() ([]byte, error) {
  1768. toSerialize := map[string]interface{}{}
  1769. if o.OutDetailNo == nil {
  1770. return nil, fmt.Errorf("field `OutDetailNo` is required and must be specified in TransferDetailInput")
  1771. }
  1772. toSerialize["out_detail_no"] = o.OutDetailNo
  1773. if o.TransferAmount == nil {
  1774. return nil, fmt.Errorf("field `TransferAmount` is required and must be specified in TransferDetailInput")
  1775. }
  1776. toSerialize["transfer_amount"] = o.TransferAmount
  1777. if o.TransferRemark == nil {
  1778. return nil, fmt.Errorf("field `TransferRemark` is required and must be specified in TransferDetailInput")
  1779. }
  1780. toSerialize["transfer_remark"] = o.TransferRemark
  1781. if o.Openid == nil {
  1782. return nil, fmt.Errorf("field `Openid` is required and must be specified in TransferDetailInput")
  1783. }
  1784. toSerialize["openid"] = o.Openid
  1785. if o.UserName == nil {
  1786. return nil, fmt.Errorf("field `UserName` is required and must be specified in TransferDetailInput")
  1787. }
  1788. toSerialize["user_name"] = o.UserName
  1789. return json.Marshal(toSerialize)
  1790. }
  1791. func (o TransferDetailInput) String() string {
  1792. var ret string
  1793. if o.OutDetailNo == nil {
  1794. ret += "OutDetailNo:<nil>, "
  1795. } else {
  1796. ret += fmt.Sprintf("OutDetailNo:%v, ", *o.OutDetailNo)
  1797. }
  1798. if o.TransferAmount == nil {
  1799. ret += "TransferAmount:<nil>, "
  1800. } else {
  1801. ret += fmt.Sprintf("TransferAmount:%v, ", *o.TransferAmount)
  1802. }
  1803. if o.TransferRemark == nil {
  1804. ret += "TransferRemark:<nil>, "
  1805. } else {
  1806. ret += fmt.Sprintf("TransferRemark:%v, ", *o.TransferRemark)
  1807. }
  1808. if o.Openid == nil {
  1809. ret += "Openid:<nil>, "
  1810. } else {
  1811. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  1812. }
  1813. if o.UserName == nil {
  1814. ret += "UserName:<nil>"
  1815. } else {
  1816. ret += fmt.Sprintf("UserName:%v", *o.UserName)
  1817. }
  1818. return fmt.Sprintf("TransferDetailInput{%s}", ret)
  1819. }
  1820. func (o TransferDetailInput) Clone() *TransferDetailInput {
  1821. ret := TransferDetailInput{}
  1822. if o.OutDetailNo != nil {
  1823. ret.OutDetailNo = new(string)
  1824. *ret.OutDetailNo = *o.OutDetailNo
  1825. }
  1826. if o.TransferAmount != nil {
  1827. ret.TransferAmount = new(int64)
  1828. *ret.TransferAmount = *o.TransferAmount
  1829. }
  1830. if o.TransferRemark != nil {
  1831. ret.TransferRemark = new(string)
  1832. *ret.TransferRemark = *o.TransferRemark
  1833. }
  1834. if o.Openid != nil {
  1835. ret.Openid = new(string)
  1836. *ret.Openid = *o.Openid
  1837. }
  1838. if o.UserName != nil {
  1839. ret.UserName = new(string)
  1840. *ret.UserName = *o.UserName
  1841. }
  1842. return &ret
  1843. }