// 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:, " } else { ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid) } if o.SubMchid == nil { ret += "SubMchid:, " } else { ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid) } if o.Openid == nil { ret += "Openid:, " } else { ret += fmt.Sprintf("Openid:%v, ", *o.Openid) } if o.AuthenticateScene == nil { ret += "AuthenticateScene:, " } else { ret += fmt.Sprintf("AuthenticateScene:%v, ", *o.AuthenticateScene) } if o.AuthenticateSource == nil { ret += "AuthenticateSource:, " } else { ret += fmt.Sprintf("AuthenticateSource:%v, ", *o.AuthenticateSource) } if o.ProjectName == nil { ret += "ProjectName:, " } else { ret += fmt.Sprintf("ProjectName:%v, ", *o.ProjectName) } if o.EmployerName == nil { ret += "EmployerName:, " } else { ret += fmt.Sprintf("EmployerName:%v, ", *o.EmployerName) } if o.AuthenticateState == nil { ret += "AuthenticateState:, " } else { ret += fmt.Sprintf("AuthenticateState:%v, ", *o.AuthenticateState) } if o.AuthenticateTime == nil { ret += "AuthenticateTime:, " } else { ret += fmt.Sprintf("AuthenticateTime:%v, ", *o.AuthenticateTime) } if o.AuthenticateNumber == nil { ret += "AuthenticateNumber:, " } else { ret += fmt.Sprintf("AuthenticateNumber:%v, ", *o.AuthenticateNumber) } if o.AuthenticateFailedReason == nil { ret += "AuthenticateFailedReason:, " } else { ret += fmt.Sprintf("AuthenticateFailedReason:%v, ", *o.AuthenticateFailedReason) } if o.AuthenticateType == nil { ret += "AuthenticateType:" } 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:, " } else { ret += fmt.Sprintf("Openid:%v, ", *o.Openid) } if o.Appid == nil { ret += "Appid:, " } else { ret += fmt.Sprintf("Appid:%v, ", *o.Appid) } if o.SubMchid == nil { ret += "SubMchid:, " } else { ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid) } if o.SubAppid == nil { ret += "SubAppid:, " } else { ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid) } if o.UserName == nil { ret += "UserName:, " } else { ret += fmt.Sprintf("UserName:%v, ", *o.UserName) } if o.IdCardNumber == nil { ret += "IdCardNumber:, " } else { ret += fmt.Sprintf("IdCardNumber:%v, ", *o.IdCardNumber) } if o.EmploymentType == nil { ret += "EmploymentType:" } 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:, " } else { ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid) } if o.SubAppid == nil { ret += "SubAppid:, " } else { ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid) } if o.AuthorizationType == nil { ret += "AuthorizationType:, " } else { ret += fmt.Sprintf("AuthorizationType:%v, ", *o.AuthorizationType) } if o.OutBatchNo == nil { ret += "OutBatchNo:, " } else { ret += fmt.Sprintf("OutBatchNo:%v, ", *o.OutBatchNo) } if o.BatchName == nil { ret += "BatchName:, " } else { ret += fmt.Sprintf("BatchName:%v, ", *o.BatchName) } if o.BatchRemark == nil { ret += "BatchRemark:, " } else { ret += fmt.Sprintf("BatchRemark:%v, ", *o.BatchRemark) } if o.TotalAmount == nil { ret += "TotalAmount:, " } else { ret += fmt.Sprintf("TotalAmount:%v, ", *o.TotalAmount) } if o.TotalNum == nil { ret += "TotalNum:, " } else { ret += fmt.Sprintf("TotalNum:%v, ", *o.TotalNum) } ret += fmt.Sprintf("TransferDetailList:%v, ", o.TransferDetailList) if o.SpAppid == nil { ret += "SpAppid:, " } else { ret += fmt.Sprintf("SpAppid:%v, ", *o.SpAppid) } if o.EmploymentType == nil { ret += "EmploymentType:, " } else { ret += fmt.Sprintf("EmploymentType:%v, ", *o.EmploymentType) } if o.EmploymentScene == nil { ret += "EmploymentScene:, " } else { ret += fmt.Sprintf("EmploymentScene:%v, ", *o.EmploymentScene) } if o.BusinessType == nil { ret += "BusinessType:" } 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:, " } else { ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid) } if o.AuthenticateNumber == nil { ret += "AuthenticateNumber:" } 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:, " } else { ret += fmt.Sprintf("Openid:%v, ", *o.Openid) } if o.SubMchid == nil { ret += "SubMchid:, " } else { ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid) } if o.Appid == nil { ret += "Appid:, " } else { ret += fmt.Sprintf("Appid:%v, ", *o.Appid) } if o.SubAppid == nil { ret += "SubAppid:" } 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:, " } else { ret += fmt.Sprintf("Openid:%v, ", *o.Openid) } if o.Appid == nil { ret += "Appid:, " } else { ret += fmt.Sprintf("Appid:%v, ", *o.Appid) } if o.SubAppid == nil { ret += "SubAppid:, " } else { ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid) } if o.SubMchid == nil { ret += "SubMchid:, " } else { ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid) } if o.AuthenticateDate == nil { ret += "AuthenticateDate:, " } else { ret += fmt.Sprintf("AuthenticateDate:%v, ", *o.AuthenticateDate) } if o.AuthenticateState == nil { ret += "AuthenticateState:, " } else { ret += fmt.Sprintf("AuthenticateState:%v, ", *o.AuthenticateState) } if o.Offset == nil { ret += "Offset:, " } else { ret += fmt.Sprintf("Offset:%v, ", *o.Offset) } if o.Limit == nil { ret += "Limit:" } 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:, " } else { ret += fmt.Sprintf("TotalCount:%v, ", *o.TotalCount) } if o.Offset == nil { ret += "Offset:, " } else { ret += fmt.Sprintf("Offset:%v, ", *o.Offset) } if o.Limit == nil { ret += "Limit:" } 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:, " } else { ret += fmt.Sprintf("Openid:%v, ", *o.Openid) } if o.Appid == nil { ret += "Appid:, " } else { ret += fmt.Sprintf("Appid:%v, ", *o.Appid) } if o.SubMchid == nil { ret += "SubMchid:, " } else { ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid) } if o.SubAppid == nil { ret += "SubAppid:, " } else { ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid) } if o.AuthenticateNumber == nil { ret += "AuthenticateNumber:, " } else { ret += fmt.Sprintf("AuthenticateNumber:%v, ", *o.AuthenticateNumber) } if o.ProjectName == nil { ret += "ProjectName:, " } else { ret += fmt.Sprintf("ProjectName:%v, ", *o.ProjectName) } if o.EmployerName == nil { ret += "EmployerName:, " } else { ret += fmt.Sprintf("EmployerName:%v, ", *o.EmployerName) } if o.AuthenticateType == nil { ret += "AuthenticateType:" } 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:, " } else { ret += fmt.Sprintf("AuthenticateNumber:%v, ", *o.AuthenticateNumber) } if o.Openid == nil { ret += "Openid:, " } else { ret += fmt.Sprintf("Openid:%v, ", *o.Openid) } if o.Mchid == nil { ret += "Mchid:, " } else { ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid) } if o.SubMchid == nil { ret += "SubMchid:, " } else { ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid) } if o.Token == nil { ret += "Token:, " } else { ret += fmt.Sprintf("Token:%v, ", *o.Token) } if o.ExpiresIn == nil { ret += "ExpiresIn:" } 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:, " } else { ret += fmt.Sprintf("Openid:%v, ", *o.Openid) } if o.Appid == nil { ret += "Appid:, " } else { ret += fmt.Sprintf("Appid:%v, ", *o.Appid) } if o.SubMchid == nil { ret += "SubMchid:, " } else { ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid) } if o.SubAppid == nil { ret += "SubAppid:, " } else { ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid) } if o.AuthenticateNumber == nil { ret += "AuthenticateNumber:, " } else { ret += fmt.Sprintf("AuthenticateNumber:%v, ", *o.AuthenticateNumber) } if o.ProjectName == nil { ret += "ProjectName:, " } else { ret += fmt.Sprintf("ProjectName:%v, ", *o.ProjectName) } if o.EmployerName == nil { ret += "EmployerName:, " } else { ret += fmt.Sprintf("EmployerName:%v, ", *o.EmployerName) } if o.UserName == nil { ret += "UserName:, " } else { ret += fmt.Sprintf("UserName:%v, ", *o.UserName) } if o.IdCardNumber == nil { ret += "IdCardNumber:, " } else { ret += fmt.Sprintf("IdCardNumber:%v, ", *o.IdCardNumber) } if o.EmploymentType == nil { ret += "EmploymentType:, " } else { ret += fmt.Sprintf("EmploymentType:%v, ", *o.EmploymentType) } if o.AuthenticateType == nil { ret += "AuthenticateType:" } 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:, " } else { ret += fmt.Sprintf("AuthenticateNumber:%v, ", *o.AuthenticateNumber) } if o.Openid == nil { ret += "Openid:, " } else { ret += fmt.Sprintf("Openid:%v, ", *o.Openid) } if o.Mchid == nil { ret += "Mchid:, " } else { ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid) } if o.SubMchid == nil { ret += "SubMchid:, " } else { ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid) } if o.Token == nil { ret += "Token:, " } else { ret += fmt.Sprintf("Token:%v, ", *o.Token) } if o.ExpiresIn == nil { ret += "ExpiresIn:" } 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:, " } else { ret += fmt.Sprintf("Openid:%v, ", *o.Openid) } if o.Mchid == nil { ret += "Mchid:, " } else { ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid) } if o.SubMchid == nil { ret += "SubMchid:, " } else { ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid) } if o.AuthorizeState == nil { ret += "AuthorizeState:, " } else { ret += fmt.Sprintf("AuthorizeState:%v, ", *o.AuthorizeState) } if o.AuthorizeTime == nil { ret += "AuthorizeTime:, " } else { ret += fmt.Sprintf("AuthorizeTime:%v, ", *o.AuthorizeTime) } if o.DeauthorizeTime == nil { ret += "DeauthorizeTime:, " } else { ret += fmt.Sprintf("DeauthorizeTime:%v, ", *o.DeauthorizeTime) } if o.RegisterState == nil { ret += "RegisterState:, " } else { ret += fmt.Sprintf("RegisterState:%v, ", *o.RegisterState) } if o.RegisterTime == nil { ret += "RegisterTime:, " } else { ret += fmt.Sprintf("RegisterTime:%v, ", *o.RegisterTime) } if o.CloseTime == nil { ret += "CloseTime:" } 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:, " } else { ret += fmt.Sprintf("Openid:%v, ", *o.Openid) } if o.Mchid == nil { ret += "Mchid:, " } else { ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid) } if o.SubMchid == nil { ret += "SubMchid:, " } else { ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid) } if o.Token == nil { ret += "Token:, " } else { ret += fmt.Sprintf("Token:%v, ", *o.Token) } if o.ExpiresIn == nil { ret += "ExpiresIn:" } 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:, " } else { ret += fmt.Sprintf("OutBatchNo:%v, ", *o.OutBatchNo) } if o.BatchId == nil { ret += "BatchId:, " } else { ret += fmt.Sprintf("BatchId:%v, ", *o.BatchId) } if o.CreateTime == nil { ret += "CreateTime:" } 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:, " } else { ret += fmt.Sprintf("OutDetailNo:%v, ", *o.OutDetailNo) } if o.TransferAmount == nil { ret += "TransferAmount:, " } else { ret += fmt.Sprintf("TransferAmount:%v, ", *o.TransferAmount) } if o.TransferRemark == nil { ret += "TransferRemark:, " } else { ret += fmt.Sprintf("TransferRemark:%v, ", *o.TransferRemark) } if o.Openid == nil { ret += "Openid:, " } else { ret += fmt.Sprintf("Openid:%v, ", *o.Openid) } if o.UserName == nil { ret += "UserName:" } 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 }