1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254 |
- // 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)
- }
- func (o ListAuthenticationsRequest) Clone() *ListAuthenticationsRequest {
- ret := ListAuthenticationsRequest{}
- 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.SubAppid != nil {
- ret.SubAppid = new(string)
- *ret.SubAppid = *o.SubAppid
- }
- if o.SubMchid != nil {
- ret.SubMchid = new(string)
- *ret.SubMchid = *o.SubMchid
- }
- if o.AuthenticateDate != nil {
- ret.AuthenticateDate = new(string)
- *ret.AuthenticateDate = *o.AuthenticateDate
- }
- if o.AuthenticateState != nil {
- ret.AuthenticateState = new(string)
- *ret.AuthenticateState = *o.AuthenticateState
- }
- if o.Offset != nil {
- ret.Offset = new(int64)
- *ret.Offset = *o.Offset
- }
- if o.Limit != nil {
- ret.Limit = new(int64)
- *ret.Limit = *o.Limit
- }
- return &ret
- }
- // ListAuthenticationsResponse
- type ListAuthenticationsResponse struct {
- // 查询结果记录列表
- Data []AuthenticationEntity `json:"data,omitempty"`
- // 经过条件筛选,查询到的记录总数
- TotalCount *int64 `json:"total_count"`
- // 该次请求资源的起始位置,请求中包含偏移量时应答消息返回相同偏移量,否则返回默认值0
- Offset *int64 `json:"offset"`
- // 经过条件筛选,本次查询到的记录条数
- Limit *int64 `json:"limit"`
- }
- func (o ListAuthenticationsResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.Data != nil {
- toSerialize["data"] = o.Data
- }
- if o.TotalCount == nil {
- return nil, fmt.Errorf("field `TotalCount` is required and must be specified in ListAuthenticationsResponse")
- }
- toSerialize["total_count"] = o.TotalCount
- if o.Offset == nil {
- return nil, fmt.Errorf("field `Offset` is required and must be specified in ListAuthenticationsResponse")
- }
- toSerialize["offset"] = o.Offset
- if o.Limit == nil {
- return nil, fmt.Errorf("field `Limit` is required and must be specified in ListAuthenticationsResponse")
- }
- toSerialize["limit"] = o.Limit
- return json.Marshal(toSerialize)
- }
- func (o ListAuthenticationsResponse) String() string {
- var ret string
- ret += fmt.Sprintf("Data:%v, ", o.Data)
- if o.TotalCount == nil {
- ret += "TotalCount:<nil>, "
- } else {
- ret += fmt.Sprintf("TotalCount:%v, ", *o.TotalCount)
- }
- 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("ListAuthenticationsResponse{%s}", ret)
- }
- func (o ListAuthenticationsResponse) Clone() *ListAuthenticationsResponse {
- ret := ListAuthenticationsResponse{}
- if o.Data != nil {
- ret.Data = make([]AuthenticationEntity, len(o.Data))
- for i, item := range o.Data {
- ret.Data[i] = *item.Clone()
- }
- }
- if o.TotalCount != nil {
- ret.TotalCount = new(int64)
- *ret.TotalCount = *o.TotalCount
- }
- if o.Offset != nil {
- ret.Offset = new(int64)
- *ret.Offset = *o.Offset
- }
- if o.Limit != nil {
- ret.Limit = new(int64)
- *ret.Limit = *o.Limit
- }
- return &ret
- }
- // PayrollCardRegisterState
- type PayrollCardRegisterState string
- func (e PayrollCardRegisterState) Ptr() *PayrollCardRegisterState {
- return &e
- }
- // Enums of PayrollCardRegisterState
- const (
- PAYROLLCARDREGISTERSTATE_UNDEFINED PayrollCardRegisterState = "UNDEFINED"
- PAYROLLCARDREGISTERSTATE_UNREGISTERED PayrollCardRegisterState = "UNREGISTERED"
- PAYROLLCARDREGISTERSTATE_REGISTERED PayrollCardRegisterState = "REGISTERED"
- PAYROLLCARDREGISTERSTATE_CLOSED PayrollCardRegisterState = "CLOSED"
- )
- // PreOrderAuthenticationRequest
- type PreOrderAuthenticationRequest 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"`
- // 商户系统内部的商家核身单号,要求此参数只能由数字、大小写字母组成,在服务商内部唯一
- AuthenticateNumber *string `json:"authenticate_number"`
- // 该劳务活动的项目名称
- ProjectName *string `json:"project_name"`
- // 该工人所属的用工企业
- EmployerName *string `json:"employer_name"`
- // 核身类型
- AuthenticateType *AuthenticationType `json:"authenticate_type,omitempty"`
- }
- func (o PreOrderAuthenticationRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.Openid == nil {
- return nil, fmt.Errorf("field `Openid` is required and must be specified in PreOrderAuthenticationRequest")
- }
- 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 PreOrderAuthenticationRequest")
- }
- toSerialize["sub_mchid"] = o.SubMchid
- if o.SubAppid != nil {
- toSerialize["sub_appid"] = o.SubAppid
- }
- if o.AuthenticateNumber == nil {
- return nil, fmt.Errorf("field `AuthenticateNumber` is required and must be specified in PreOrderAuthenticationRequest")
- }
- toSerialize["authenticate_number"] = o.AuthenticateNumber
- if o.ProjectName == nil {
- return nil, fmt.Errorf("field `ProjectName` is required and must be specified in PreOrderAuthenticationRequest")
- }
- toSerialize["project_name"] = o.ProjectName
- if o.EmployerName == nil {
- return nil, fmt.Errorf("field `EmployerName` is required and must be specified in PreOrderAuthenticationRequest")
- }
- toSerialize["employer_name"] = o.EmployerName
- if o.AuthenticateType != nil {
- toSerialize["authenticate_type"] = o.AuthenticateType
- }
- return json.Marshal(toSerialize)
- }
- func (o PreOrderAuthenticationRequest) 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.AuthenticateNumber == nil {
- ret += "AuthenticateNumber:<nil>, "
- } else {
- ret += fmt.Sprintf("AuthenticateNumber:%v, ", *o.AuthenticateNumber)
- }
- 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.AuthenticateType == nil {
- ret += "AuthenticateType:<nil>"
- } else {
- ret += fmt.Sprintf("AuthenticateType:%v", *o.AuthenticateType)
- }
- return fmt.Sprintf("PreOrderAuthenticationRequest{%s}", ret)
- }
- func (o PreOrderAuthenticationRequest) Clone() *PreOrderAuthenticationRequest {
- ret := PreOrderAuthenticationRequest{}
- 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.AuthenticateNumber != nil {
- ret.AuthenticateNumber = new(string)
- *ret.AuthenticateNumber = *o.AuthenticateNumber
- }
- 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.AuthenticateType != nil {
- ret.AuthenticateType = new(AuthenticationType)
- *ret.AuthenticateType = *o.AuthenticateType
- }
- return &ret
- }
- // PreOrderAuthenticationResponse
- type PreOrderAuthenticationResponse struct {
- // 商户系统内部的商家核身单号,要求此参数只能由数字、大小写字母组成,在服务商内部唯一
- AuthenticateNumber *string `json:"authenticate_number"`
- // 微信用户OpenID
- Openid *string `json:"openid"`
- // 商户号
- Mchid *string `json:"mchid"`
- // 特约商户号
- SubMchid *string `json:"sub_mchid"`
- // token值
- Token *string `json:"token"`
- // token有效时间,单位秒
- ExpiresIn *int64 `json:"expires_in"`
- }
- func (o PreOrderAuthenticationResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.AuthenticateNumber == nil {
- return nil, fmt.Errorf("field `AuthenticateNumber` is required and must be specified in PreOrderAuthenticationResponse")
- }
- toSerialize["authenticate_number"] = o.AuthenticateNumber
- if o.Openid == nil {
- return nil, fmt.Errorf("field `Openid` is required and must be specified in PreOrderAuthenticationResponse")
- }
- toSerialize["openid"] = o.Openid
- if o.Mchid == nil {
- return nil, fmt.Errorf("field `Mchid` is required and must be specified in PreOrderAuthenticationResponse")
- }
- toSerialize["mchid"] = o.Mchid
- if o.SubMchid == nil {
- return nil, fmt.Errorf("field `SubMchid` is required and must be specified in PreOrderAuthenticationResponse")
- }
- toSerialize["sub_mchid"] = o.SubMchid
- if o.Token == nil {
- return nil, fmt.Errorf("field `Token` is required and must be specified in PreOrderAuthenticationResponse")
- }
- toSerialize["token"] = o.Token
- if o.ExpiresIn == nil {
- return nil, fmt.Errorf("field `ExpiresIn` is required and must be specified in PreOrderAuthenticationResponse")
- }
- toSerialize["expires_in"] = o.ExpiresIn
- return json.Marshal(toSerialize)
- }
- func (o PreOrderAuthenticationResponse) String() string {
- var ret string
- if o.AuthenticateNumber == nil {
- ret += "AuthenticateNumber:<nil>, "
- } else {
- ret += fmt.Sprintf("AuthenticateNumber:%v, ", *o.AuthenticateNumber)
- }
- if o.Openid == nil {
- ret += "Openid:<nil>, "
- } else {
- ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
- }
- 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.Token == nil {
- ret += "Token:<nil>, "
- } else {
- ret += fmt.Sprintf("Token:%v, ", *o.Token)
- }
- if o.ExpiresIn == nil {
- ret += "ExpiresIn:<nil>"
- } else {
- ret += fmt.Sprintf("ExpiresIn:%v", *o.ExpiresIn)
- }
- return fmt.Sprintf("PreOrderAuthenticationResponse{%s}", ret)
- }
- func (o PreOrderAuthenticationResponse) Clone() *PreOrderAuthenticationResponse {
- ret := PreOrderAuthenticationResponse{}
- if o.AuthenticateNumber != nil {
- ret.AuthenticateNumber = new(string)
- *ret.AuthenticateNumber = *o.AuthenticateNumber
- }
- if o.Openid != nil {
- ret.Openid = new(string)
- *ret.Openid = *o.Openid
- }
- 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.Token != nil {
- ret.Token = new(string)
- *ret.Token = *o.Token
- }
- if o.ExpiresIn != nil {
- ret.ExpiresIn = new(int64)
- *ret.ExpiresIn = *o.ExpiresIn
- }
- return &ret
- }
- // PreOrderAuthenticationWithAuthRequest
- type PreOrderAuthenticationWithAuthRequest 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"`
- // 商户系统内部的商家核身单号,要求此参数只能由数字、大小写字母组成,在服务商内部唯一
- AuthenticateNumber *string `json:"authenticate_number"`
- // 该劳务活动的项目名称
- ProjectName *string `json:"project_name"`
- // 该工人所属的用工企业
- EmployerName *string `json:"employer_name"`
- // 用户实名信息,按照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"`
- // 核身类型
- AuthenticateType *AuthenticationType `json:"authenticate_type,omitempty"`
- }
- func (o PreOrderAuthenticationWithAuthRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.Openid == nil {
- return nil, fmt.Errorf("field `Openid` is required and must be specified in PreOrderAuthenticationWithAuthRequest")
- }
- 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 PreOrderAuthenticationWithAuthRequest")
- }
- toSerialize["sub_mchid"] = o.SubMchid
- if o.SubAppid != nil {
- toSerialize["sub_appid"] = o.SubAppid
- }
- if o.AuthenticateNumber == nil {
- return nil, fmt.Errorf("field `AuthenticateNumber` is required and must be specified in PreOrderAuthenticationWithAuthRequest")
- }
- toSerialize["authenticate_number"] = o.AuthenticateNumber
- if o.ProjectName == nil {
- return nil, fmt.Errorf("field `ProjectName` is required and must be specified in PreOrderAuthenticationWithAuthRequest")
- }
- toSerialize["project_name"] = o.ProjectName
- if o.EmployerName == nil {
- return nil, fmt.Errorf("field `EmployerName` is required and must be specified in PreOrderAuthenticationWithAuthRequest")
- }
- toSerialize["employer_name"] = o.EmployerName
- if o.UserName == nil {
- return nil, fmt.Errorf("field `UserName` is required and must be specified in PreOrderAuthenticationWithAuthRequest")
- }
- toSerialize["user_name"] = o.UserName
- if o.IdCardNumber == nil {
- return nil, fmt.Errorf("field `IdCardNumber` is required and must be specified in PreOrderAuthenticationWithAuthRequest")
- }
- toSerialize["id_card_number"] = o.IdCardNumber
- if o.EmploymentType == nil {
- return nil, fmt.Errorf("field `EmploymentType` is required and must be specified in PreOrderAuthenticationWithAuthRequest")
- }
- toSerialize["employment_type"] = o.EmploymentType
- if o.AuthenticateType != nil {
- toSerialize["authenticate_type"] = o.AuthenticateType
- }
- return json.Marshal(toSerialize)
- }
- func (o PreOrderAuthenticationWithAuthRequest) 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.AuthenticateNumber == nil {
- ret += "AuthenticateNumber:<nil>, "
- } else {
- ret += fmt.Sprintf("AuthenticateNumber:%v, ", *o.AuthenticateNumber)
- }
- 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.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)
- }
- if o.AuthenticateType == nil {
- ret += "AuthenticateType:<nil>"
- } else {
- ret += fmt.Sprintf("AuthenticateType:%v", *o.AuthenticateType)
- }
- return fmt.Sprintf("PreOrderAuthenticationWithAuthRequest{%s}", ret)
- }
- func (o PreOrderAuthenticationWithAuthRequest) Clone() *PreOrderAuthenticationWithAuthRequest {
- ret := PreOrderAuthenticationWithAuthRequest{}
- 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.AuthenticateNumber != nil {
- ret.AuthenticateNumber = new(string)
- *ret.AuthenticateNumber = *o.AuthenticateNumber
- }
- 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.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
- }
- if o.AuthenticateType != nil {
- ret.AuthenticateType = new(AuthenticationType)
- *ret.AuthenticateType = *o.AuthenticateType
- }
- return &ret
- }
- // PreOrderAuthenticationWithAuthResponse
- type PreOrderAuthenticationWithAuthResponse struct {
- // 商户系统内部的商家核身单号,要求此参数只能由数字、大小写字母组成,在服务商内部唯一
- AuthenticateNumber *string `json:"authenticate_number"`
- // 微信用户OpenID
- Openid *string `json:"openid"`
- // 商户号
- Mchid *string `json:"mchid"`
- // 特约商户号
- SubMchid *string `json:"sub_mchid"`
- // token值
- Token *string `json:"token"`
- // token有效时间,单位秒
- ExpiresIn *int64 `json:"expires_in"`
- }
- func (o PreOrderAuthenticationWithAuthResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.AuthenticateNumber == nil {
- return nil, fmt.Errorf("field `AuthenticateNumber` is required and must be specified in PreOrderAuthenticationWithAuthResponse")
- }
- toSerialize["authenticate_number"] = o.AuthenticateNumber
- if o.Openid == nil {
- return nil, fmt.Errorf("field `Openid` is required and must be specified in PreOrderAuthenticationWithAuthResponse")
- }
- toSerialize["openid"] = o.Openid
- if o.Mchid == nil {
- return nil, fmt.Errorf("field `Mchid` is required and must be specified in PreOrderAuthenticationWithAuthResponse")
- }
- toSerialize["mchid"] = o.Mchid
- if o.SubMchid == nil {
- return nil, fmt.Errorf("field `SubMchid` is required and must be specified in PreOrderAuthenticationWithAuthResponse")
- }
- toSerialize["sub_mchid"] = o.SubMchid
- if o.Token == nil {
- return nil, fmt.Errorf("field `Token` is required and must be specified in PreOrderAuthenticationWithAuthResponse")
- }
- toSerialize["token"] = o.Token
- if o.ExpiresIn == nil {
- return nil, fmt.Errorf("field `ExpiresIn` is required and must be specified in PreOrderAuthenticationWithAuthResponse")
- }
- toSerialize["expires_in"] = o.ExpiresIn
- return json.Marshal(toSerialize)
- }
- func (o PreOrderAuthenticationWithAuthResponse) String() string {
- var ret string
- if o.AuthenticateNumber == nil {
- ret += "AuthenticateNumber:<nil>, "
- } else {
- ret += fmt.Sprintf("AuthenticateNumber:%v, ", *o.AuthenticateNumber)
- }
- if o.Openid == nil {
- ret += "Openid:<nil>, "
- } else {
- ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
- }
- 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.Token == nil {
- ret += "Token:<nil>, "
- } else {
- ret += fmt.Sprintf("Token:%v, ", *o.Token)
- }
- if o.ExpiresIn == nil {
- ret += "ExpiresIn:<nil>"
- } else {
- ret += fmt.Sprintf("ExpiresIn:%v", *o.ExpiresIn)
- }
- return fmt.Sprintf("PreOrderAuthenticationWithAuthResponse{%s}", ret)
- }
- func (o PreOrderAuthenticationWithAuthResponse) Clone() *PreOrderAuthenticationWithAuthResponse {
- ret := PreOrderAuthenticationWithAuthResponse{}
- if o.AuthenticateNumber != nil {
- ret.AuthenticateNumber = new(string)
- *ret.AuthenticateNumber = *o.AuthenticateNumber
- }
- if o.Openid != nil {
- ret.Openid = new(string)
- *ret.Openid = *o.Openid
- }
- 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.Token != nil {
- ret.Token = new(string)
- *ret.Token = *o.Token
- }
- if o.ExpiresIn != nil {
- ret.ExpiresIn = new(int64)
- *ret.ExpiresIn = *o.ExpiresIn
- }
- return &ret
- }
- // RelationEntity
- type RelationEntity struct {
- // 用户OpenID
- Openid *string `json:"openid"`
- // 商户号
- Mchid *string `json:"mchid"`
- // 特约商户号
- SubMchid *string `json:"sub_mchid"`
- // 授权状态:UNAUTHORIZED:未授权 AUTHORIZED:已授权 DEAUTHORIZED:已取消授权
- AuthorizeState *string `json:"authorize_state"`
- // 授权时间
- AuthorizeTime *string `json:"authorize_time,omitempty"`
- // 取消授权时间,遵循RFC3339标准格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。
- DeauthorizeTime *string `json:"deauthorize_time,omitempty"`
- // 微工卡的开通状态:UNREGISTERED:未开通;REGISTERED:已开通;CLOSED:已关闭
- RegisterState *PayrollCardRegisterState `json:"register_state"`
- // 开通时间,未开通时不返回。遵循RFC3339标准格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。
- RegisterTime *string `json:"register_time,omitempty"`
- // 关闭时间,仅当开通状态是已关闭时返回。遵循RFC3339标准格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。
- CloseTime *string `json:"close_time,omitempty"`
- }
- func (o RelationEntity) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.Openid == nil {
- return nil, fmt.Errorf("field `Openid` is required and must be specified in RelationEntity")
- }
- toSerialize["openid"] = o.Openid
- if o.Mchid == nil {
- return nil, fmt.Errorf("field `Mchid` is required and must be specified in RelationEntity")
- }
- toSerialize["mchid"] = o.Mchid
- if o.SubMchid == nil {
- return nil, fmt.Errorf("field `SubMchid` is required and must be specified in RelationEntity")
- }
- toSerialize["sub_mchid"] = o.SubMchid
- if o.AuthorizeState == nil {
- return nil, fmt.Errorf("field `AuthorizeState` is required and must be specified in RelationEntity")
- }
- toSerialize["authorize_state"] = o.AuthorizeState
- if o.AuthorizeTime != nil {
- toSerialize["authorize_time"] = o.AuthorizeTime
- }
- if o.DeauthorizeTime != nil {
- toSerialize["deauthorize_time"] = o.DeauthorizeTime
- }
- if o.RegisterState == nil {
- return nil, fmt.Errorf("field `RegisterState` is required and must be specified in RelationEntity")
- }
- toSerialize["register_state"] = o.RegisterState
- if o.RegisterTime != nil {
- toSerialize["register_time"] = o.RegisterTime
- }
- if o.CloseTime != nil {
- toSerialize["close_time"] = o.CloseTime
- }
- return json.Marshal(toSerialize)
- }
- func (o RelationEntity) String() string {
- var ret string
- if o.Openid == nil {
- ret += "Openid:<nil>, "
- } else {
- ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
- }
- 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.AuthorizeState == nil {
- ret += "AuthorizeState:<nil>, "
- } else {
- ret += fmt.Sprintf("AuthorizeState:%v, ", *o.AuthorizeState)
- }
- if o.AuthorizeTime == nil {
- ret += "AuthorizeTime:<nil>, "
- } else {
- ret += fmt.Sprintf("AuthorizeTime:%v, ", *o.AuthorizeTime)
- }
- if o.DeauthorizeTime == nil {
- ret += "DeauthorizeTime:<nil>, "
- } else {
- ret += fmt.Sprintf("DeauthorizeTime:%v, ", *o.DeauthorizeTime)
- }
- if o.RegisterState == nil {
- ret += "RegisterState:<nil>, "
- } else {
- ret += fmt.Sprintf("RegisterState:%v, ", *o.RegisterState)
- }
- if o.RegisterTime == nil {
- ret += "RegisterTime:<nil>, "
- } else {
- ret += fmt.Sprintf("RegisterTime:%v, ", *o.RegisterTime)
- }
- if o.CloseTime == nil {
- ret += "CloseTime:<nil>"
- } else {
- ret += fmt.Sprintf("CloseTime:%v", *o.CloseTime)
- }
- return fmt.Sprintf("RelationEntity{%s}", ret)
- }
- func (o RelationEntity) Clone() *RelationEntity {
- ret := RelationEntity{}
- if o.Openid != nil {
- ret.Openid = new(string)
- *ret.Openid = *o.Openid
- }
- 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.AuthorizeState != nil {
- ret.AuthorizeState = new(string)
- *ret.AuthorizeState = *o.AuthorizeState
- }
- if o.AuthorizeTime != nil {
- ret.AuthorizeTime = new(string)
- *ret.AuthorizeTime = *o.AuthorizeTime
- }
- if o.DeauthorizeTime != nil {
- ret.DeauthorizeTime = new(string)
- *ret.DeauthorizeTime = *o.DeauthorizeTime
- }
- if o.RegisterState != nil {
- ret.RegisterState = new(PayrollCardRegisterState)
- *ret.RegisterState = *o.RegisterState
- }
- if o.RegisterTime != nil {
- ret.RegisterTime = new(string)
- *ret.RegisterTime = *o.RegisterTime
- }
- if o.CloseTime != nil {
- ret.CloseTime = new(string)
- *ret.CloseTime = *o.CloseTime
- }
- return &ret
- }
- // TokenEntity
- type TokenEntity struct {
- // 微信用户OpenID
- Openid *string `json:"openid"`
- // 商户号
- Mchid *string `json:"mchid"`
- // 特约商户号
- SubMchid *string `json:"sub_mchid"`
- // token值
- Token *string `json:"token"`
- // token有效时间,单位秒
- ExpiresIn *int64 `json:"expires_in"`
- }
- func (o TokenEntity) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.Openid == nil {
- return nil, fmt.Errorf("field `Openid` is required and must be specified in TokenEntity")
- }
- toSerialize["openid"] = o.Openid
- if o.Mchid == nil {
- return nil, fmt.Errorf("field `Mchid` is required and must be specified in TokenEntity")
- }
- toSerialize["mchid"] = o.Mchid
- if o.SubMchid == nil {
- return nil, fmt.Errorf("field `SubMchid` is required and must be specified in TokenEntity")
- }
- toSerialize["sub_mchid"] = o.SubMchid
- if o.Token == nil {
- return nil, fmt.Errorf("field `Token` is required and must be specified in TokenEntity")
- }
- toSerialize["token"] = o.Token
- if o.ExpiresIn == nil {
- return nil, fmt.Errorf("field `ExpiresIn` is required and must be specified in TokenEntity")
- }
- toSerialize["expires_in"] = o.ExpiresIn
- return json.Marshal(toSerialize)
- }
- func (o TokenEntity) String() string {
- var ret string
- if o.Openid == nil {
- ret += "Openid:<nil>, "
- } else {
- ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
- }
- 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.Token == nil {
- ret += "Token:<nil>, "
- } else {
- ret += fmt.Sprintf("Token:%v, ", *o.Token)
- }
- if o.ExpiresIn == nil {
- ret += "ExpiresIn:<nil>"
- } else {
- ret += fmt.Sprintf("ExpiresIn:%v", *o.ExpiresIn)
- }
- return fmt.Sprintf("TokenEntity{%s}", ret)
- }
- func (o TokenEntity) Clone() *TokenEntity {
- ret := TokenEntity{}
- if o.Openid != nil {
- ret.Openid = new(string)
- *ret.Openid = *o.Openid
- }
- 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.Token != nil {
- ret.Token = new(string)
- *ret.Token = *o.Token
- }
- if o.ExpiresIn != nil {
- ret.ExpiresIn = new(int64)
- *ret.ExpiresIn = *o.ExpiresIn
- }
- return &ret
- }
- // TransferBatchEntity
- type TransferBatchEntity struct {
- // 商户系统内部的商家批次单号,在商户系统内部唯一
- OutBatchNo *string `json:"out_batch_no"`
- // 微信支付批次单号,微信商家转账系统返回的唯一标识
- BatchId *string `json:"batch_id"`
- // 批次受理成功时返回,按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE
- CreateTime *time.Time `json:"create_time"`
- }
- func (o TransferBatchEntity) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.OutBatchNo == nil {
- return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in TransferBatchEntity")
- }
- toSerialize["out_batch_no"] = o.OutBatchNo
- if o.BatchId == nil {
- return nil, fmt.Errorf("field `BatchId` is required and must be specified in TransferBatchEntity")
- }
- toSerialize["batch_id"] = o.BatchId
- if o.CreateTime == nil {
- return nil, fmt.Errorf("field `CreateTime` is required and must be specified in TransferBatchEntity")
- }
- toSerialize["create_time"] = o.CreateTime.Format(time.RFC3339)
- return json.Marshal(toSerialize)
- }
- func (o TransferBatchEntity) String() string {
- var ret string
- if o.OutBatchNo == nil {
- ret += "OutBatchNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutBatchNo:%v, ", *o.OutBatchNo)
- }
- if o.BatchId == nil {
- ret += "BatchId:<nil>, "
- } else {
- ret += fmt.Sprintf("BatchId:%v, ", *o.BatchId)
- }
- if o.CreateTime == nil {
- ret += "CreateTime:<nil>"
- } else {
- ret += fmt.Sprintf("CreateTime:%v", *o.CreateTime)
- }
- return fmt.Sprintf("TransferBatchEntity{%s}", ret)
- }
- func (o TransferBatchEntity) Clone() *TransferBatchEntity {
- ret := TransferBatchEntity{}
- if o.OutBatchNo != nil {
- ret.OutBatchNo = new(string)
- *ret.OutBatchNo = *o.OutBatchNo
- }
- if o.BatchId != nil {
- ret.BatchId = new(string)
- *ret.BatchId = *o.BatchId
- }
- if o.CreateTime != nil {
- ret.CreateTime = new(time.Time)
- *ret.CreateTime = *o.CreateTime
- }
- return &ret
- }
- // TransferDetailInput
- type TransferDetailInput struct {
- // 商户系统内部区分转账批次单下不同转账明细单的唯一标识
- OutDetailNo *string `json:"out_detail_no"`
- // 转账金额单位为“分”
- TransferAmount *int64 `json:"transfer_amount"`
- // 单条转账备注(微信用户会收到该备注),UTF8编码,最多允许32个字符
- TransferRemark *string `json:"transfer_remark"`
- // 收款用户OpenID。如果转账特约商户授权类型是INFORMATION_AUTHORIZATION_TYPE,对应的是特约商户公众号下的OpenID。
- Openid *string `json:"openid"`
- // 收款用户姓名。采用标准RSA算法,公钥由微信侧提供 明细转账金额 >= 2,000时,该笔明细必须填写收款用户姓名 同一批次转账明细中的姓名字段传入规则需保持一致,也即全部填写、或全部不填写 若商户传入收款用户姓名,微信支付会校验用户OpenID与姓名是否一致,并提供电子回单
- UserName *string `json:"user_name" encryption:"EM_APIV3"`
- }
- func (o TransferDetailInput) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.OutDetailNo == nil {
- return nil, fmt.Errorf("field `OutDetailNo` is required and must be specified in TransferDetailInput")
- }
- toSerialize["out_detail_no"] = o.OutDetailNo
- if o.TransferAmount == nil {
- return nil, fmt.Errorf("field `TransferAmount` is required and must be specified in TransferDetailInput")
- }
- toSerialize["transfer_amount"] = o.TransferAmount
- if o.TransferRemark == nil {
- return nil, fmt.Errorf("field `TransferRemark` is required and must be specified in TransferDetailInput")
- }
- toSerialize["transfer_remark"] = o.TransferRemark
- if o.Openid == nil {
- return nil, fmt.Errorf("field `Openid` is required and must be specified in TransferDetailInput")
- }
- toSerialize["openid"] = o.Openid
- if o.UserName == nil {
- return nil, fmt.Errorf("field `UserName` is required and must be specified in TransferDetailInput")
- }
- toSerialize["user_name"] = o.UserName
- return json.Marshal(toSerialize)
- }
- func (o TransferDetailInput) String() string {
- var ret string
- if o.OutDetailNo == nil {
- ret += "OutDetailNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutDetailNo:%v, ", *o.OutDetailNo)
- }
- if o.TransferAmount == nil {
- ret += "TransferAmount:<nil>, "
- } else {
- ret += fmt.Sprintf("TransferAmount:%v, ", *o.TransferAmount)
- }
- if o.TransferRemark == nil {
- ret += "TransferRemark:<nil>, "
- } else {
- ret += fmt.Sprintf("TransferRemark:%v, ", *o.TransferRemark)
- }
- if o.Openid == nil {
- ret += "Openid:<nil>, "
- } else {
- ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
- }
- if o.UserName == nil {
- ret += "UserName:<nil>"
- } else {
- ret += fmt.Sprintf("UserName:%v", *o.UserName)
- }
- return fmt.Sprintf("TransferDetailInput{%s}", ret)
- }
- func (o TransferDetailInput) Clone() *TransferDetailInput {
- ret := TransferDetailInput{}
- if o.OutDetailNo != nil {
- ret.OutDetailNo = new(string)
- *ret.OutDetailNo = *o.OutDetailNo
- }
- if o.TransferAmount != nil {
- ret.TransferAmount = new(int64)
- *ret.TransferAmount = *o.TransferAmount
- }
- if o.TransferRemark != nil {
- ret.TransferRemark = new(string)
- *ret.TransferRemark = *o.TransferRemark
- }
- if o.Openid != nil {
- ret.Openid = new(string)
- *ret.Openid = *o.Openid
- }
- if o.UserName != nil {
- ret.UserName = new(string)
- *ret.UserName = *o.UserName
- }
- return &ret
- }
|