├── .gitignore ├── README.md ├── example └── fetcher.go ├── go.mod ├── go.sum ├── lineapigo ├── auth.go ├── config.go ├── login.go ├── poll.go ├── talk.go └── util.go ├── secondaryqrcodeloginservice ├── GoUnusedProtection__.go ├── SecondaryQrCodeLoginService-consts.go └── SecondaryQrCodeLoginService.go └── talkservice ├── GoUnusedProtection__.go ├── TalkService-consts.go └── TalkService.go /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | # vendor/ 16 | 17 | .idea/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LineApiGo 2 | Copyright (c) 2020 @sakura-rip\ 3 | Version 1.1 bata\ 4 | LastUpdate 2020/08/28 5 | 6 | 7 | 8 | Unofficial line api 9 | 10 | 11 | 12 | ## Usage: 13 | ```Go 14 | package main 15 | 16 | import "github.com/sakura-rip/lineapigo" 17 | 18 | func main() { 19 | // Create Instance 20 | bot := lineapigo.NewLineClient("LITE") 21 | // Login with Qr Code 22 | bot.LoginWithQrCode() 23 | 24 | 25 | // Create Instance 26 | bot1 := lineapigo.NewLineClient("IOS") 27 | // Login with AuthToken 28 | bot1.LoginWithAuthToken("token here") 29 | } 30 | ``` 31 | see example to get more information 32 | 33 | 34 | have fun :) 35 | 36 | Studying golang... 37 | 38 | GOたのちい 39 | -------------------------------------------------------------------------------- /example/fetcher.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 @sakura-rip 2 | // Version 1.1 beta 3 | // LastUpdate 2020/08/28 4 | 5 | package main 6 | 7 | import ( 8 | "fmt" 9 | 10 | "github.com/sakura-rip/lineapigo/lineapigo" 11 | ) 12 | 13 | func main() { 14 | bot := lineapigo.NewLineClient("LITE") 15 | bot.LoginWithQrCode() 16 | for { 17 | ops, err := bot.FetchOperations() 18 | if err == nil { 19 | for _, op := range ops { 20 | // skip end of operation 21 | if op.Revision != -1 { 22 | fmt.Println(op) 23 | bot.SetRevision(op.Revision) 24 | } 25 | } 26 | } else { 27 | fmt.Println(err) 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/sakura-rip/lineapigo 2 | 3 | go 1.15 4 | 5 | require github.com/apache/thrift v0.13.0 // direct 6 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/apache/thrift v0.13.0 h1:5hryIiq9gtn+MiLVn0wP37kb/uTeRZgN08WoCsAhIhI= 2 | github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= 3 | -------------------------------------------------------------------------------- /lineapigo/auth.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 @sakura-rip 2 | // Version 1.1 beta 3 | // LastUpdate 2020/08/28 4 | 5 | package lineapigo 6 | 7 | import ( 8 | "log" 9 | 10 | sqlogin "github.com/sakura-rip/lineapigo/secondaryqrcodeloginservice" 11 | ) 12 | 13 | // CreateQrSession create qr session for SecondaryQRLogin 14 | func (cl *LineClient) CreateQrSession() (string, error) { 15 | req := sqlogin.NewCreateQrSessionRequest() 16 | res, err := cl.qrLogin.login1.CreateSession(cl.ctx, req) 17 | if err != nil { 18 | log.Printf("%+v\n", err) 19 | } 20 | cl.qrLogin.sessionID = res.AuthSessionId 21 | return res.AuthSessionId, err 22 | } 23 | 24 | // CreateQrCode create qr code for SecondaryQRLogin 25 | func (cl *LineClient) CreateQrCode() (string, error) { 26 | req := sqlogin.NewCreateQrCodeRequest() 27 | req.AuthSessionId = cl.qrLogin.sessionID 28 | res, err := cl.qrLogin.login1.CreateQrCode(cl.ctx, req) 29 | // FIXME return res.CallbackUrl + createSecret(), err 30 | return res.CallbackUrl, err 31 | } 32 | 33 | // WaitForQrCodeVerified wait for qr code verified 34 | func (cl *LineClient) WaitForQrCodeVerified() { 35 | req := sqlogin.NewCheckQrCodeVerifiedRequest() 36 | req.AuthSessionId = cl.qrLogin.sessionID 37 | _, err := cl.qrLogin.loginCheck.CheckQrCodeVerified(cl.ctx, req) 38 | if err != nil { 39 | log.Printf("%+v\n", err) 40 | } 41 | } 42 | 43 | // CertificateLogin try login with certificate 44 | func (cl *LineClient) CertificateLogin(certificate string) (*sqlogin.VerifyCertificateResponse, error) { 45 | req := sqlogin.NewVerifyCertificateRequest() 46 | req.AuthSessionId = cl.qrLogin.sessionID 47 | res, err := cl.qrLogin.login1.VerifyCertificate(cl.ctx, req) 48 | return res, err 49 | } 50 | 51 | // CreatePinCode create pin code 52 | func (cl *LineClient) CreatePinCode() (string, error) { 53 | req := sqlogin.NewCreatePinCodeRequest() 54 | req.AuthSessionId = cl.qrLogin.sessionID 55 | res, err := cl.qrLogin.login1.CreatePinCode(cl.ctx, req) 56 | if err != nil { 57 | log.Printf("%+v\n", err) 58 | } 59 | return res.PinCode, err 60 | } 61 | 62 | // WaitForInputPinCode wait for input pin 63 | func (cl *LineClient) WaitForInputPinCode() { 64 | req := sqlogin.NewCheckPinCodeVerifiedRequest() 65 | req.AuthSessionId = cl.qrLogin.sessionID 66 | cl.qrLogin.loginCheck.CheckPinCodeVerified(cl.ctx, req) 67 | } 68 | 69 | // QrLogin qr login 70 | func (cl *LineClient) QrLogin() (string, string, error) { 71 | req := sqlogin.NewQrCodeLoginRequest() 72 | req.AuthSessionId = cl.qrLogin.sessionID 73 | req.SystemName = systemName 74 | req.AutoLoginIsRequired = true 75 | callback, err := cl.qrLogin.login1.QrCodeLogin(cl.ctx, req) 76 | return callback.AccessToken, callback.Certificate, err 77 | } 78 | 79 | // FIXME 80 | // func createSecret() string { 81 | // privateKey := curve25519.GeneratePrivateKey() 82 | // curve25519.PublicKey(privateKey) 83 | // } 84 | -------------------------------------------------------------------------------- /lineapigo/config.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 @sakura-rip 2 | // Version 1.1 beta 3 | // LastUpdate 2020/08/28 4 | 5 | package lineapigo 6 | 7 | // HOST URL 8 | var lineHostURL string = "https://ga2.line.naver.jp" 9 | 10 | // TALK PATH 11 | var normal string = "/S4" 12 | 13 | //POLLING PATH 14 | var longPolling string = "/P4" 15 | 16 | var authRegistration string = "/api/v4p/rs" 17 | var newRegistration string = "/acct/lp/lgn/sq/v1" 18 | var secondaryQrLogin string = "/acct/lgn/sq/v1" 19 | 20 | var systemName string = "lineapigo" 21 | 22 | var systemVersion map[string]string = map[string]string{ 23 | "LITE": "10.0", 24 | "MAC": "10.15.1", 25 | "CHROME": "1", 26 | "IOS": "13.4.1", 27 | // "CHROME": "81.0", 28 | } 29 | 30 | var appVersion map[string]string = map[string]string{ 31 | "LITE": "2.16.0", 32 | "MAC": "6.6.0", 33 | "CHROME": "2.4.3", 34 | "IOS": "11.4.1", 35 | } 36 | 37 | // GetUserAgent This func will return UserAgent for line 38 | // @param appType(string) string of your choiced line application 39 | // @return string of User-Agent 40 | func GetUserAgent(appType string) string { 41 | switch appType { 42 | case "LITE": 43 | return "LLA/" + systemVersion["LITE"] + " Galaxy Note 10+ " + systemVersion["LITE"] 44 | case "MAC": 45 | return "Line/" + systemVersion["MAC"] 46 | case "IOS": 47 | return "Line/" + appVersion["IOS"] + " iPhone8,1 " + systemVersion["IOS"] 48 | case "CHROME": 49 | return "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36" 50 | default: 51 | return GetUserAgent("LITE") 52 | } 53 | } 54 | 55 | // GetLineApplication This func will return string of X-Line-Application 56 | // @param appType(string) string of your choiced line application type 57 | // @return string of X-Line-Application 58 | func GetLineApplication(appType string) string { 59 | switch appType { 60 | case "LITE": 61 | return "ANDROIDLITE\t" + appVersion["LITE"] + "\tAndroid OS\t" + systemVersion["LITE"] 62 | case "MAC": 63 | return "DESKTOPMAC\t" + appVersion["MAC"] + "\tOS X\t" + systemVersion["MAC"] 64 | case "IOS": 65 | return "IOS\t" + appVersion["IOS"] + "\tiOS\t" + systemVersion["IOS"] 66 | case "CHROME": 67 | return "CHROMEOS\t" + appVersion["CHROME"] + "\tChrome_OS\t" + systemVersion["CHROME"] 68 | default: 69 | return GetLineApplication("LITE") 70 | } 71 | } 72 | 73 | // GetXLal This func will return string of x-lal 74 | func GetXLal(appType string) string { 75 | switch appType { 76 | case "CHROME": 77 | return "ja" 78 | default: 79 | return "jp_ja" 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /lineapigo/login.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 @sakura-rip 2 | // Version 1.1 beta 3 | // LastUpdate 2020/08/28 4 | 5 | package lineapigo 6 | 7 | import ( 8 | "context" 9 | "fmt" 10 | "log" 11 | "net/http" 12 | 13 | "github.com/apache/thrift/lib/go/thrift" 14 | sqlogin "github.com/sakura-rip/lineapigo/secondaryqrcodeloginservice" 15 | ser "github.com/sakura-rip/lineapigo/talkservice" 16 | talk "github.com/sakura-rip/lineapigo/talkservice" 17 | ) 18 | 19 | // LoginRequest struct of qrlogin 20 | type LoginRequest struct { 21 | login1 *sqlogin.SecondaryQRCodeLoginServiceClient 22 | loginCheck *sqlogin.SecondaryQRCodeLoginServiceClient 23 | sessionID string 24 | } 25 | 26 | // SavedInfo struct of saved 27 | type SavedInfo struct { 28 | AllChatMids []string 29 | AllChatInfo map[string]ser.Chat 30 | FriendMids []string 31 | Profile *talk.Profile 32 | } 33 | 34 | // LineClient struct of line 35 | type LineClient struct { 36 | talk *talk.TalkServiceClient 37 | poll *talk.TalkServiceClient 38 | qrLogin LoginRequest 39 | revision int64 40 | ctx context.Context 41 | appType string 42 | reqSeq int32 43 | reqSeqMessage map[string]int32 44 | globalRev int64 45 | individualRev int64 46 | Data SavedInfo 47 | } 48 | 49 | // NewLineClient return new LineClient 50 | func NewLineClient(appType string) *LineClient { 51 | return &LineClient{ 52 | ctx: context.Background(), 53 | revision: -1, 54 | reqSeq: 0, 55 | qrLogin: LoginRequest{}, 56 | reqSeqMessage: map[string]int32{}, 57 | appType: appType, 58 | } 59 | } 60 | 61 | // LoginWithAuthToken >_< 62 | func (cl *LineClient) LoginWithAuthToken(token string) { 63 | cl.talk = createTalkService(token, cl.appType, lineHostURL+normal) 64 | cl.poll = createTalkService(token, cl.appType, lineHostURL+longPolling) 65 | } 66 | 67 | // LoginWithQrCode >_< 68 | func (cl *LineClient) LoginWithQrCode() { 69 | cl.createLogionSession1() 70 | cl.CreateQrSession() 71 | cl.createLogionSession2() 72 | url, er := cl.CreateQrCode() 73 | if er != nil { 74 | log.Printf("%+v\n", er) 75 | } 76 | fmt.Println("login this url on your mobile : " + url) 77 | 78 | cl.WaitForQrCodeVerified() 79 | _, err := cl.CertificateLogin("") 80 | if err != nil { 81 | pin, _ := cl.CreatePinCode() 82 | fmt.Println("input this pin code on your mobile : " + pin) 83 | cl.WaitForInputPinCode() 84 | } 85 | token, _, _ := cl.QrLogin() 86 | fmt.Println(token) 87 | 88 | cl.talk = createTalkService(token, cl.appType, lineHostURL+normal) 89 | cl.poll = createTalkService(token, cl.appType, lineHostURL+longPolling) 90 | } 91 | 92 | // createTalkService create thrift session using autoToken 93 | func createTalkService(authToken, appType, targetURL string) *talk.TalkServiceClient { 94 | var transport thrift.TTransport 95 | 96 | option := thrift.THttpClientOptions{ 97 | Client: &http.Client{ 98 | Transport: &http.Transport{}, 99 | }, 100 | } 101 | transport, _ = thrift.NewTHttpClientWithOptions(targetURL, option) 102 | connect := transport.(*thrift.THttpClient) 103 | connect.SetHeader("X-Line-Access", authToken) 104 | connect.SetHeader("X-Line-Application", GetLineApplication(appType)) 105 | connect.SetHeader("User-Agent", GetUserAgent(appType)) 106 | connect.SetHeader("x-lal", GetXLal(appType)) 107 | pcol := thrift.NewTCompactProtocol(transport) 108 | tstc := thrift.NewTStandardClient(pcol, pcol) 109 | return talk.NewTalkServiceClient(tstc) 110 | } 111 | 112 | func createLoginService(targetURL string, headers map[string]string) *sqlogin.SecondaryQRCodeLoginServiceClient { 113 | var transport thrift.TTransport 114 | option := thrift.THttpClientOptions{ 115 | Client: &http.Client{ 116 | Transport: &http.Transport{}, 117 | }, 118 | } 119 | transport, _ = thrift.NewTHttpClientWithOptions(targetURL, option) 120 | connect := transport.(*thrift.THttpClient) 121 | //set header 122 | for key, val := range headers { 123 | connect.SetHeader(key, val) 124 | } 125 | pcol := thrift.NewTCompactProtocol(transport) 126 | tstc := thrift.NewTStandardClient(pcol, pcol) 127 | return sqlogin.NewSecondaryQRCodeLoginServiceClient(tstc) 128 | } 129 | 130 | func (cl *LineClient) createLogionSession2() { 131 | cl.qrLogin.loginCheck = createLoginService(lineHostURL+newRegistration, map[string]string{ 132 | "X-Line-Application": GetLineApplication(cl.appType) + ";SECONDARY", 133 | "User-Agent": GetUserAgent(cl.appType), 134 | "x-lal": GetXLal(cl.appType), 135 | "X-Line-Access": cl.qrLogin.sessionID, 136 | }) 137 | } 138 | 139 | func (cl *LineClient) createLogionSession1() { 140 | cl.qrLogin.login1 = createLoginService(lineHostURL+secondaryQrLogin, map[string]string{ 141 | "X-Line-Application": GetLineApplication(cl.appType) + ";SECONDARY", 142 | "User-Agent": GetUserAgent(cl.appType), 143 | "x-lal": GetXLal(cl.appType), 144 | }) 145 | } 146 | -------------------------------------------------------------------------------- /lineapigo/poll.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 @sakura-rip 2 | // Version 1.1 beta 3 | // LastUpdate 2020/08/28 4 | 5 | package lineapigo 6 | 7 | import ser "github.com/sakura-rip/lineapigo/talkservice" 8 | 9 | // FetchOps fetch operations 10 | func (cl *LineClient) FetchOps() ([]*ser.Operation, error) { 11 | return cl.poll.FetchOps(cl.ctx, cl.revision, 100, cl.globalRev, cl.individualRev) 12 | } 13 | 14 | // FetchOperations fetch operations 15 | func (cl *LineClient) FetchOperations() ([]*ser.Operation, error) { 16 | return cl.poll.FetchOperations(cl.ctx, cl.revision, 100) 17 | } 18 | 19 | // SetRevision set revision 20 | func (cl *LineClient) SetRevision(rev int64) { 21 | if rev > cl.revision { 22 | cl.revision = rev 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lineapigo/talk.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 @sakura-rip 2 | // Version 1.1 beta 3 | // LastUpdate 2020/08/28 4 | 5 | package lineapigo 6 | 7 | import ( 8 | ser "github.com/sakura-rip/lineapigo/talkservice" 9 | ) 10 | 11 | /* 12 | PROFILE FUNCTION 13 | */ 14 | 15 | // GetProfile return the object of Profile 16 | func (cl *LineClient) GetProfile() (*ser.Profile, error) { 17 | prof, err := cl.talk.GetProfile(cl.ctx, ser.SyncReason_UNKNOWN) 18 | cl.Data.Profile = prof 19 | return cl.Data.Profile, err 20 | } 21 | 22 | // GenerateUserTicket generate user ticket 23 | func (cl *LineClient) GenerateUserTicket() (string, error) { 24 | res, err := cl.talk.GenerateUserTicket(cl.ctx, 9223372036854775807, 2147483647) 25 | return res.ID, err 26 | } 27 | 28 | // UpdateProfileName change Profile name 29 | func (cl *LineClient) UpdateProfileName(name string) error { 30 | req := ser.NewUpdateProfileAttributesRequest() 31 | content := ser.NewProfileContent() 32 | content.Value = name 33 | content.Meta = nil 34 | req.ProfileAttributes = map[ser.Attr]*ser.ProfileContent{ser.Attr_DISPLAY_NAME: content} 35 | cl.reqSeq++ 36 | err := cl.talk.UpdateProfileAttributes(cl.ctx, cl.reqSeq, req) 37 | return err 38 | } 39 | 40 | // UpdateProfileBio change status message 41 | func (cl *LineClient) UpdateProfileBio(bio string) error { 42 | req := ser.NewUpdateProfileAttributesRequest() 43 | content := ser.NewProfileContent() 44 | content.Value = bio 45 | content.Meta = nil 46 | req.ProfileAttributes = map[ser.Attr]*ser.ProfileContent{ser.Attr_STATUS_MESSAGE: content} 47 | cl.reqSeq++ 48 | err := cl.talk.UpdateProfileAttributes(cl.ctx, cl.reqSeq, req) 49 | return err 50 | } 51 | 52 | /* 53 | Message FUNCTION 54 | */ 55 | 56 | // SendMessage send text message 57 | func (cl *LineClient) SendMessage(toMid, text string) (*ser.Message, error) { 58 | msg := ser.NewMessage() 59 | msg.Text = text 60 | msg.To = toMid 61 | msg.ContentType = ser.ContentType_NONE 62 | if IsStrInMap(toMid, cl.reqSeqMessage) { 63 | cl.reqSeqMessage[toMid]++ 64 | } else { 65 | cl.reqSeqMessage[toMid] = -1 66 | } 67 | return cl.talk.SendMessage(cl.ctx, cl.reqSeqMessage[toMid], msg) 68 | } 69 | 70 | // SendContact send contact to toMid 71 | func (cl *LineClient) SendContact(toMid, contactMid string) (*ser.Message, error) { 72 | msg := ser.NewMessage() 73 | msg.To = toMid 74 | msg.ContentType = ser.ContentType_CONTACT 75 | msg.ContentMetadata = map[string]string{"mid": contactMid} 76 | if IsStrInMap(toMid, cl.reqSeqMessage) { 77 | cl.reqSeqMessage[toMid]++ 78 | } else { 79 | cl.reqSeqMessage[toMid] = 1 80 | } 81 | return cl.talk.SendMessage(cl.ctx, cl.reqSeqMessage[toMid], msg) 82 | } 83 | 84 | // UnsendMessage unsend message 85 | func (cl *LineClient) UnsendMessage(messageID string) error { 86 | cl.reqSeq++ 87 | err := cl.talk.UnsendMessage(cl.ctx, cl.reqSeq, messageID) 88 | return err 89 | } 90 | 91 | // SendChatChecked read message 92 | func (cl *LineClient) SendChatChecked(groupID, messageID string) error { 93 | cl.reqSeq++ 94 | err := cl.talk.SendChatChecked(cl.ctx, cl.reqSeq, groupID, messageID, 0) 95 | return err 96 | } 97 | 98 | /* 99 | CHAT FUNCTION 100 | */ 101 | 102 | // GetChats get chats 103 | func (cl *LineClient) GetChats(chatsMids []string) ([]*ser.Chat, error) { 104 | req := ser.NewGetChatsRequest() 105 | req.ChatMid = chatsMids 106 | req.WithInvitees = true 107 | req.WithMembers = true 108 | res, err := cl.talk.GetChats(cl.ctx, req) 109 | return res.Chats, err 110 | } 111 | 112 | // AcceptChatInvitation join chat 113 | func (cl *LineClient) AcceptChatInvitation(groupMid string) error { 114 | req := ser.NewAcceptChatInvitationRequest() 115 | req.ChatMid = groupMid 116 | req.ReqSeq = cl.reqSeq 117 | cl.reqSeq++ 118 | _, err := cl.talk.AcceptChatInvitation(cl.ctx, req) 119 | return err 120 | } 121 | 122 | // AcceptChatInvitationByTicket join chat by ticket 123 | func (cl *LineClient) AcceptChatInvitationByTicket(groupMid, ticketID string) error { 124 | req := ser.NewAcceptChatInvitationByTicketRequest() 125 | req.ChatMid = groupMid 126 | req.ReqSeq = cl.reqSeq 127 | req.TicketId = ticketID 128 | cl.reqSeq++ 129 | _, err := cl.talk.AcceptChatInvitationByTicket(cl.ctx, req) 130 | return err 131 | } 132 | 133 | // InviteIntoChat invite friend to chat 134 | func (cl *LineClient) InviteIntoChat(chatMid string, targetMids []string) error { 135 | req := ser.NewInviteIntoChatRequest() 136 | req.ReqSeq = cl.reqSeq 137 | cl.reqSeq++ 138 | req.ChatMid = chatMid 139 | req.TargetUserMids = targetMids 140 | _, err := cl.talk.InviteIntoChat(cl.ctx, req) 141 | return err 142 | } 143 | 144 | // ReissueChatTicket get chat invitation ticket 145 | func (cl *LineClient) ReissueChatTicket(chatMid string) (string, error) { 146 | req := ser.NewReissueChatTicketRequest() 147 | req.GroupMid = chatMid 148 | req.ReqSeq = cl.reqSeq 149 | cl.reqSeq++ 150 | res, err := cl.talk.ReissueChatTicket(cl.ctx, req) 151 | return res.TicketId, err 152 | } 153 | 154 | // RejectChatInvitation reject chat 155 | func (cl *LineClient) RejectChatInvitation(chatMid string) error { 156 | req := ser.NewRejectChatInvitationRequest() 157 | req.ReqSeq = cl.reqSeq 158 | cl.reqSeq++ 159 | req.ChatMid = chatMid 160 | _, err := cl.talk.RejectChatInvitation(cl.ctx, req) 161 | return err 162 | } 163 | 164 | // GetChat return one chatmid 165 | func (cl *LineClient) GetChat(chatID string) (*ser.Chat, error) { 166 | req := ser.NewGetChatsRequest() 167 | req.ChatMid = []string{chatID} 168 | req.WithInvitees = true 169 | req.WithMembers = true 170 | res, err := cl.talk.GetChats(cl.ctx, req) 171 | if len(res.Chats) > 0 { 172 | return res.Chats[0], err 173 | } 174 | return nil, err 175 | } 176 | 177 | // UpdateChatName change chat name 178 | func (cl *LineClient) UpdateChatName(chatID, name string) error { 179 | chat := &ser.Chat{} 180 | chat.ChatName = name 181 | req := ser.NewUpdateChatRequest() 182 | req.Chat = chat 183 | req.UpdatedAttribute = ser.ChatAttribute_NAME 184 | _, err := cl.talk.UpdateChat(cl.ctx, req) 185 | return err 186 | 187 | } 188 | 189 | // UpdateChatURL change chat url 190 | func (cl *LineClient) UpdateChatURL(chatID string, typeVar bool) error { 191 | chat := &ser.Chat{} 192 | chat.Extra.GroupExtra.PreventedJoinByTicket = typeVar 193 | req := ser.NewUpdateChatRequest() 194 | req.Chat = chat 195 | req.UpdatedAttribute = ser.ChatAttribute_PREVENTED_JOIN_BY_TICKET 196 | _, err := cl.talk.UpdateChat(cl.ctx, req) 197 | return err 198 | } 199 | 200 | // DeleteOtherFromChat kickout some one from chat 201 | func (cl *LineClient) DeleteOtherFromChat(toMid, targetMid string) error { 202 | req := ser.NewDeleteOtherFromChatRequest() 203 | req.ChatMid = toMid 204 | req.ReqSeq = cl.reqSeq 205 | req.TargetUserMids = []string{targetMid} 206 | cl.reqSeq++ 207 | _, err := cl.talk.DeleteOtherFromChat(cl.ctx, req) 208 | return err 209 | } 210 | 211 | // DeleteSelfFromChat leave from chat 212 | func (cl *LineClient) DeleteSelfFromChat(toMid string) error { 213 | req := ser.NewDeleteSelfFromChatRequest() 214 | req.ChatMid = toMid 215 | req.ReqSeq = cl.reqSeq 216 | cl.reqSeq++ 217 | req.LastSeenMessageDeliveredTime = 0 218 | req.LastSeenMessageId = "" 219 | req.LastMessageDeliveredTime = 0 220 | req.LastMessageId = "" 221 | _, err := cl.talk.DeleteSelfFromChat(cl.ctx, req) 222 | return err 223 | } 224 | 225 | // GetAllChatMids get all chat mids 226 | func (cl *LineClient) GetAllChatMids() (*ser.GetAllChatMidsResponse, error) { 227 | req := ser.NewGetAllChatMidsRequest() 228 | req.WithInvitedChats = true 229 | req.WithMemberChats = true 230 | return cl.talk.GetAllChatMids(cl.ctx, req, ser.SyncReason_UNKNOWN) 231 | } 232 | 233 | // CancelChatInvitation cancel user 234 | func (cl *LineClient) CancelChatInvitation(groupID, targetMid string) error { 235 | req := ser.NewCancelChatInvitationRequest() 236 | req.ChatMid = groupID 237 | req.ReqSeq = cl.reqSeq 238 | cl.reqSeq++ 239 | req.TargetUserMids = []string{targetMid} 240 | _, err := cl.talk.CancelChatInvitation(cl.ctx, req) 241 | return err 242 | } 243 | 244 | // FindChatByTicket find chat by ticket 245 | func (cl *LineClient) FindChatByTicket(ticketID string) (*ser.Chat, error) { 246 | req := ser.NewFindChatByTicketRequest() 247 | req.TicketId = ticketID 248 | res, err := cl.talk.FindChatByTicket(cl.ctx, req) 249 | return res.Chat, err 250 | } 251 | 252 | /* 253 | Settings 254 | */ 255 | 256 | // GetSettings get settings 257 | func (cl *LineClient) GetSettings() (*ser.Settings, error) { 258 | return cl.talk.GetSettings(cl.ctx, ser.SyncReason_UNKNOWN) 259 | } 260 | 261 | // UpdateSettings update settings 262 | func (cl *LineClient) UpdateSettings(attr []ser.SettingsAttributes, settings *ser.Settings) error { 263 | _, err := cl.talk.UpdateSettingsAttributes2(cl.ctx, cl.reqSeq, attr, settings) 264 | return err 265 | } 266 | 267 | // DisableE2ee disable e2ee 268 | func (cl *LineClient) DisableE2ee() error { 269 | set := ser.NewSettings() 270 | set.E2eeEnable = false 271 | err := cl.UpdateSettings([]ser.SettingsAttributes{ser.SettingsAttributes_E2EE_ENABLE}, set) 272 | return err 273 | } 274 | 275 | /* 276 | Contact 277 | */ 278 | 279 | // FindAndAddContactsByMid add friend 280 | func (cl *LineClient) FindAndAddContactsByMid(targetMid string) (map[string]*ser.Contact, error) { 281 | return cl.talk.FindAndAddContactsByMid(cl.ctx, cl.reqSeq, targetMid, ser.MIDType_MID, `{"screen":"homeTab","spec":"native"}`) 282 | } 283 | 284 | // GetContacts get contact with list 285 | func (cl *LineClient) GetContacts(targetMid []string) ([]*ser.Contact, error) { 286 | return cl.talk.GetContacts(cl.ctx, targetMid) 287 | } 288 | 289 | // GetContact get contact with list 290 | func (cl *LineClient) GetContact(targetMid string) (*ser.Contact, error) { 291 | return cl.talk.GetContact(cl.ctx, targetMid) 292 | } 293 | 294 | // CoteHan update display name over ridden 295 | func (cl *LineClient) CoteHan(mid, cote string) error { 296 | return cl.talk.UpdateContactSetting(cl.ctx, cl.reqSeq, mid, ser.ContactFlag_CONTACT_SETTING_DISPLAY_NAME_OVERRIDE, cote) 297 | } 298 | 299 | // GetAllContactIds get all list of mid 300 | func (cl *LineClient) GetAllContactIds() ([]string, error) { 301 | return cl.talk.GetAllContactIds(cl.ctx, ser.SyncReason_UNKNOWN) 302 | } 303 | 304 | /* 305 | OTHER 306 | */ 307 | 308 | // Noop nothing to do 309 | func (cl *LineClient) Noop() { 310 | cl.talk.Noop(cl.ctx) 311 | } 312 | -------------------------------------------------------------------------------- /lineapigo/util.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 @sakura-rip 2 | // Version 1.1 beta 3 | // LastUpdate 2020/08/28 4 | 5 | package lineapigo 6 | 7 | import ( 8 | "encoding/json" 9 | 10 | ser "github.com/sakura-rip/lineapigo/talkservice" 11 | ) 12 | 13 | // IsStrInMap check string in map 14 | func IsStrInMap(str string, dic map[string]int32) bool { 15 | _, isIn := dic[str] 16 | return isIn 17 | } 18 | 19 | // JSONMention struct of json for parse Mention 20 | type JSONMention struct { 21 | MENTION struct { 22 | MENTIONEES []struct { 23 | S string `json:"S"` 24 | E string `json:"E"` 25 | M string `json:"M"` 26 | } `json:"MENTIONEES"` 27 | } `json:"MENTION"` 28 | } 29 | 30 | // ParseMention get list of mid 31 | func ParseMention(msg ser.Message) []string { 32 | var mentions []string 33 | var strut JSONMention 34 | // change map to byte 35 | bytes, _ := json.Marshal(msg.ContentMetadata) 36 | // Parse byte(map) to json struct 37 | err := json.Unmarshal(bytes, &strut) 38 | // if parse failed, return No element list 39 | if err != nil { 40 | return mentions 41 | } 42 | for _, mid := range strut.MENTION.MENTIONEES { 43 | mentions = append(mentions, mid.M) 44 | } 45 | return mentions 46 | } 47 | 48 | // MyChat self made struct 49 | type MyChat struct { 50 | chatName string 51 | chatMid string 52 | createdTime int64 53 | preventedJoinByTicket bool 54 | invitationTicket string 55 | memberMids []string 56 | inviteeMids []string 57 | creatorMid string 58 | } 59 | 60 | // GetChatUtil get chat util from chat return MyChat 61 | func (cl *LineClient) GetChatUtil(chat *ser.Chat) *MyChat { 62 | struc := &MyChat{} 63 | struc.chatMid = chat.ChatMid 64 | struc.chatName = chat.ChatName 65 | struc.preventedJoinByTicket = chat.Extra.GroupExtra.PreventedJoinByTicket 66 | struc.invitationTicket = chat.Extra.GroupExtra.InvitationTicket 67 | var memberMids []string 68 | for mid := range chat.Extra.GroupExtra.MemberMids { 69 | memberMids = append(memberMids, mid) 70 | } 71 | struc.memberMids = memberMids 72 | var inviteeMids []string 73 | for mid := range chat.Extra.GroupExtra.InviteeMids { 74 | inviteeMids = append(inviteeMids, mid) 75 | } 76 | struc.inviteeMids = inviteeMids 77 | struc.creatorMid = chat.Extra.GroupExtra.Creator 78 | return struc 79 | } 80 | -------------------------------------------------------------------------------- /secondaryqrcodeloginservice/GoUnusedProtection__.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package secondaryqrcodeloginservice 5 | 6 | var GoUnusedProtection__ int 7 | -------------------------------------------------------------------------------- /secondaryqrcodeloginservice/SecondaryQrCodeLoginService-consts.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package secondaryqrcodeloginservice 5 | 6 | import ( 7 | "bytes" 8 | "context" 9 | "fmt" 10 | "github.com/apache/thrift/lib/go/thrift" 11 | "reflect" 12 | ) 13 | 14 | // (needed to ensure safety because of naive import list construction.) 15 | var _ = thrift.ZERO 16 | var _ = fmt.Printf 17 | var _ = context.Background 18 | var _ = reflect.DeepEqual 19 | var _ = bytes.Equal 20 | 21 | func init() { 22 | } 23 | -------------------------------------------------------------------------------- /secondaryqrcodeloginservice/SecondaryQrCodeLoginService.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package secondaryqrcodeloginservice 5 | 6 | import ( 7 | "bytes" 8 | "context" 9 | "database/sql/driver" 10 | "errors" 11 | "fmt" 12 | "github.com/apache/thrift/lib/go/thrift" 13 | "reflect" 14 | ) 15 | 16 | // (needed to ensure safety because of naive import list construction.) 17 | var _ = thrift.ZERO 18 | var _ = fmt.Printf 19 | var _ = context.Background 20 | var _ = reflect.DeepEqual 21 | var _ = bytes.Equal 22 | 23 | type ErrorCode int64 24 | 25 | const ( 26 | ErrorCode_INTERNAL_ERROR ErrorCode = 0 27 | ErrorCode_ILLEGAL_ARGUMENT ErrorCode = 1 28 | ErrorCode_VERIFICATION_FAILED ErrorCode = 2 29 | ErrorCode_NOT_ALLOWED_QR_CODE_LOGIN ErrorCode = 3 30 | ErrorCode_VERIFICATION_NOTICE_FAILED ErrorCode = 4 31 | ErrorCode_RETRY_LATER ErrorCode = 5 32 | ErrorCode_INVALID_CONTEXT ErrorCode = 100 33 | ErrorCode_APP_UPGRADE_REQUIRED ErrorCode = 101 34 | ) 35 | 36 | func (p ErrorCode) String() string { 37 | switch p { 38 | case ErrorCode_INTERNAL_ERROR: 39 | return "INTERNAL_ERROR" 40 | case ErrorCode_ILLEGAL_ARGUMENT: 41 | return "ILLEGAL_ARGUMENT" 42 | case ErrorCode_VERIFICATION_FAILED: 43 | return "VERIFICATION_FAILED" 44 | case ErrorCode_NOT_ALLOWED_QR_CODE_LOGIN: 45 | return "NOT_ALLOWED_QR_CODE_LOGIN" 46 | case ErrorCode_VERIFICATION_NOTICE_FAILED: 47 | return "VERIFICATION_NOTICE_FAILED" 48 | case ErrorCode_RETRY_LATER: 49 | return "RETRY_LATER" 50 | case ErrorCode_INVALID_CONTEXT: 51 | return "INVALID_CONTEXT" 52 | case ErrorCode_APP_UPGRADE_REQUIRED: 53 | return "APP_UPGRADE_REQUIRED" 54 | } 55 | return "" 56 | } 57 | 58 | func ErrorCodeFromString(s string) (ErrorCode, error) { 59 | switch s { 60 | case "INTERNAL_ERROR": 61 | return ErrorCode_INTERNAL_ERROR, nil 62 | case "ILLEGAL_ARGUMENT": 63 | return ErrorCode_ILLEGAL_ARGUMENT, nil 64 | case "VERIFICATION_FAILED": 65 | return ErrorCode_VERIFICATION_FAILED, nil 66 | case "NOT_ALLOWED_QR_CODE_LOGIN": 67 | return ErrorCode_NOT_ALLOWED_QR_CODE_LOGIN, nil 68 | case "VERIFICATION_NOTICE_FAILED": 69 | return ErrorCode_VERIFICATION_NOTICE_FAILED, nil 70 | case "RETRY_LATER": 71 | return ErrorCode_RETRY_LATER, nil 72 | case "INVALID_CONTEXT": 73 | return ErrorCode_INVALID_CONTEXT, nil 74 | case "APP_UPGRADE_REQUIRED": 75 | return ErrorCode_APP_UPGRADE_REQUIRED, nil 76 | } 77 | return ErrorCode(0), fmt.Errorf("not a valid ErrorCode string") 78 | } 79 | 80 | func ErrorCodePtr(v ErrorCode) *ErrorCode { return &v } 81 | 82 | func (p ErrorCode) MarshalText() ([]byte, error) { 83 | return []byte(p.String()), nil 84 | } 85 | 86 | func (p *ErrorCode) UnmarshalText(text []byte) error { 87 | q, err := ErrorCodeFromString(string(text)) 88 | if err != nil { 89 | return err 90 | } 91 | *p = q 92 | return nil 93 | } 94 | 95 | func (p *ErrorCode) Scan(value interface{}) error { 96 | v, ok := value.(int64) 97 | if !ok { 98 | return errors.New("Scan value is not int64") 99 | } 100 | *p = ErrorCode(v) 101 | return nil 102 | } 103 | 104 | func (p *ErrorCode) Value() (driver.Value, error) { 105 | if p == nil { 106 | return nil, nil 107 | } 108 | return int64(*p), nil 109 | } 110 | 111 | // Attributes: 112 | // - AuthSessionId 113 | type CancelPinCodeRequest struct { 114 | AuthSessionId string `thrift:"authSessionId,1" db:"authSessionId" json:"authSessionId"` 115 | } 116 | 117 | func NewCancelPinCodeRequest() *CancelPinCodeRequest { 118 | return &CancelPinCodeRequest{} 119 | } 120 | 121 | func (p *CancelPinCodeRequest) GetAuthSessionId() string { 122 | return p.AuthSessionId 123 | } 124 | func (p *CancelPinCodeRequest) Read(iprot thrift.TProtocol) error { 125 | if _, err := iprot.ReadStructBegin(); err != nil { 126 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 127 | } 128 | 129 | for { 130 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 131 | if err != nil { 132 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 133 | } 134 | if fieldTypeId == thrift.STOP { 135 | break 136 | } 137 | switch fieldId { 138 | case 1: 139 | if fieldTypeId == thrift.STRING { 140 | if err := p.ReadField1(iprot); err != nil { 141 | return err 142 | } 143 | } else { 144 | if err := iprot.Skip(fieldTypeId); err != nil { 145 | return err 146 | } 147 | } 148 | default: 149 | if err := iprot.Skip(fieldTypeId); err != nil { 150 | return err 151 | } 152 | } 153 | if err := iprot.ReadFieldEnd(); err != nil { 154 | return err 155 | } 156 | } 157 | if err := iprot.ReadStructEnd(); err != nil { 158 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 159 | } 160 | return nil 161 | } 162 | 163 | func (p *CancelPinCodeRequest) ReadField1(iprot thrift.TProtocol) error { 164 | if v, err := iprot.ReadString(); err != nil { 165 | return thrift.PrependError("error reading field 1: ", err) 166 | } else { 167 | p.AuthSessionId = v 168 | } 169 | return nil 170 | } 171 | 172 | func (p *CancelPinCodeRequest) Write(oprot thrift.TProtocol) error { 173 | if err := oprot.WriteStructBegin("CancelPinCodeRequest"); err != nil { 174 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 175 | } 176 | if p != nil { 177 | if err := p.writeField1(oprot); err != nil { 178 | return err 179 | } 180 | } 181 | if err := oprot.WriteFieldStop(); err != nil { 182 | return thrift.PrependError("write field stop error: ", err) 183 | } 184 | if err := oprot.WriteStructEnd(); err != nil { 185 | return thrift.PrependError("write struct stop error: ", err) 186 | } 187 | return nil 188 | } 189 | 190 | func (p *CancelPinCodeRequest) writeField1(oprot thrift.TProtocol) (err error) { 191 | if err := oprot.WriteFieldBegin("authSessionId", thrift.STRING, 1); err != nil { 192 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:authSessionId: ", p), err) 193 | } 194 | if err := oprot.WriteString(string(p.AuthSessionId)); err != nil { 195 | return thrift.PrependError(fmt.Sprintf("%T.authSessionId (1) field write error: ", p), err) 196 | } 197 | if err := oprot.WriteFieldEnd(); err != nil { 198 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:authSessionId: ", p), err) 199 | } 200 | return err 201 | } 202 | 203 | func (p *CancelPinCodeRequest) String() string { 204 | if p == nil { 205 | return "" 206 | } 207 | return fmt.Sprintf("CancelPinCodeRequest(%+v)", *p) 208 | } 209 | 210 | type CancelPinCodeResponse struct { 211 | } 212 | 213 | func NewCancelPinCodeResponse() *CancelPinCodeResponse { 214 | return &CancelPinCodeResponse{} 215 | } 216 | 217 | func (p *CancelPinCodeResponse) Read(iprot thrift.TProtocol) error { 218 | if _, err := iprot.ReadStructBegin(); err != nil { 219 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 220 | } 221 | 222 | for { 223 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 224 | if err != nil { 225 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 226 | } 227 | if fieldTypeId == thrift.STOP { 228 | break 229 | } 230 | if err := iprot.Skip(fieldTypeId); err != nil { 231 | return err 232 | } 233 | if err := iprot.ReadFieldEnd(); err != nil { 234 | return err 235 | } 236 | } 237 | if err := iprot.ReadStructEnd(); err != nil { 238 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 239 | } 240 | return nil 241 | } 242 | 243 | func (p *CancelPinCodeResponse) Write(oprot thrift.TProtocol) error { 244 | if err := oprot.WriteStructBegin("CancelPinCodeResponse"); err != nil { 245 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 246 | } 247 | if p != nil { 248 | } 249 | if err := oprot.WriteFieldStop(); err != nil { 250 | return thrift.PrependError("write field stop error: ", err) 251 | } 252 | if err := oprot.WriteStructEnd(); err != nil { 253 | return thrift.PrependError("write struct stop error: ", err) 254 | } 255 | return nil 256 | } 257 | 258 | func (p *CancelPinCodeResponse) String() string { 259 | if p == nil { 260 | return "" 261 | } 262 | return fmt.Sprintf("CancelPinCodeResponse(%+v)", *p) 263 | } 264 | 265 | // Attributes: 266 | // - Code 267 | // - AlertMessage 268 | type SecondaryQrCodeException struct { 269 | Code ErrorCode `thrift:"code,1" db:"code" json:"code"` 270 | AlertMessage string `thrift:"alertMessage,2" db:"alertMessage" json:"alertMessage"` 271 | } 272 | 273 | func NewSecondaryQrCodeException() *SecondaryQrCodeException { 274 | return &SecondaryQrCodeException{} 275 | } 276 | 277 | func (p *SecondaryQrCodeException) GetCode() ErrorCode { 278 | return p.Code 279 | } 280 | 281 | func (p *SecondaryQrCodeException) GetAlertMessage() string { 282 | return p.AlertMessage 283 | } 284 | func (p *SecondaryQrCodeException) Read(iprot thrift.TProtocol) error { 285 | if _, err := iprot.ReadStructBegin(); err != nil { 286 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 287 | } 288 | 289 | for { 290 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 291 | if err != nil { 292 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 293 | } 294 | if fieldTypeId == thrift.STOP { 295 | break 296 | } 297 | switch fieldId { 298 | case 1: 299 | if fieldTypeId == thrift.I32 { 300 | if err := p.ReadField1(iprot); err != nil { 301 | return err 302 | } 303 | } else { 304 | if err := iprot.Skip(fieldTypeId); err != nil { 305 | return err 306 | } 307 | } 308 | case 2: 309 | if fieldTypeId == thrift.STRING { 310 | if err := p.ReadField2(iprot); err != nil { 311 | return err 312 | } 313 | } else { 314 | if err := iprot.Skip(fieldTypeId); err != nil { 315 | return err 316 | } 317 | } 318 | default: 319 | if err := iprot.Skip(fieldTypeId); err != nil { 320 | return err 321 | } 322 | } 323 | if err := iprot.ReadFieldEnd(); err != nil { 324 | return err 325 | } 326 | } 327 | if err := iprot.ReadStructEnd(); err != nil { 328 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 329 | } 330 | return nil 331 | } 332 | 333 | func (p *SecondaryQrCodeException) ReadField1(iprot thrift.TProtocol) error { 334 | if v, err := iprot.ReadI32(); err != nil { 335 | return thrift.PrependError("error reading field 1: ", err) 336 | } else { 337 | temp := ErrorCode(v) 338 | p.Code = temp 339 | } 340 | return nil 341 | } 342 | 343 | func (p *SecondaryQrCodeException) ReadField2(iprot thrift.TProtocol) error { 344 | if v, err := iprot.ReadString(); err != nil { 345 | return thrift.PrependError("error reading field 2: ", err) 346 | } else { 347 | p.AlertMessage = v 348 | } 349 | return nil 350 | } 351 | 352 | func (p *SecondaryQrCodeException) Write(oprot thrift.TProtocol) error { 353 | if err := oprot.WriteStructBegin("SecondaryQrCodeException"); err != nil { 354 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 355 | } 356 | if p != nil { 357 | if err := p.writeField1(oprot); err != nil { 358 | return err 359 | } 360 | if err := p.writeField2(oprot); err != nil { 361 | return err 362 | } 363 | } 364 | if err := oprot.WriteFieldStop(); err != nil { 365 | return thrift.PrependError("write field stop error: ", err) 366 | } 367 | if err := oprot.WriteStructEnd(); err != nil { 368 | return thrift.PrependError("write struct stop error: ", err) 369 | } 370 | return nil 371 | } 372 | 373 | func (p *SecondaryQrCodeException) writeField1(oprot thrift.TProtocol) (err error) { 374 | if err := oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { 375 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) 376 | } 377 | if err := oprot.WriteI32(int32(p.Code)); err != nil { 378 | return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) 379 | } 380 | if err := oprot.WriteFieldEnd(); err != nil { 381 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) 382 | } 383 | return err 384 | } 385 | 386 | func (p *SecondaryQrCodeException) writeField2(oprot thrift.TProtocol) (err error) { 387 | if err := oprot.WriteFieldBegin("alertMessage", thrift.STRING, 2); err != nil { 388 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:alertMessage: ", p), err) 389 | } 390 | if err := oprot.WriteString(string(p.AlertMessage)); err != nil { 391 | return thrift.PrependError(fmt.Sprintf("%T.alertMessage (2) field write error: ", p), err) 392 | } 393 | if err := oprot.WriteFieldEnd(); err != nil { 394 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:alertMessage: ", p), err) 395 | } 396 | return err 397 | } 398 | 399 | func (p *SecondaryQrCodeException) String() string { 400 | if p == nil { 401 | return "" 402 | } 403 | return fmt.Sprintf("SecondaryQrCodeException(%+v)", *p) 404 | } 405 | 406 | func (p *SecondaryQrCodeException) Error() string { 407 | return p.String() 408 | } 409 | 410 | type VerifyQrCodeResponse struct { 411 | } 412 | 413 | func NewVerifyQrCodeResponse() *VerifyQrCodeResponse { 414 | return &VerifyQrCodeResponse{} 415 | } 416 | 417 | func (p *VerifyQrCodeResponse) Read(iprot thrift.TProtocol) error { 418 | if _, err := iprot.ReadStructBegin(); err != nil { 419 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 420 | } 421 | 422 | for { 423 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 424 | if err != nil { 425 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 426 | } 427 | if fieldTypeId == thrift.STOP { 428 | break 429 | } 430 | if err := iprot.Skip(fieldTypeId); err != nil { 431 | return err 432 | } 433 | if err := iprot.ReadFieldEnd(); err != nil { 434 | return err 435 | } 436 | } 437 | if err := iprot.ReadStructEnd(); err != nil { 438 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 439 | } 440 | return nil 441 | } 442 | 443 | func (p *VerifyQrCodeResponse) Write(oprot thrift.TProtocol) error { 444 | if err := oprot.WriteStructBegin("VerifyQrCodeResponse"); err != nil { 445 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 446 | } 447 | if p != nil { 448 | } 449 | if err := oprot.WriteFieldStop(); err != nil { 450 | return thrift.PrependError("write field stop error: ", err) 451 | } 452 | if err := oprot.WriteStructEnd(); err != nil { 453 | return thrift.PrependError("write struct stop error: ", err) 454 | } 455 | return nil 456 | } 457 | 458 | func (p *VerifyQrCodeResponse) String() string { 459 | if p == nil { 460 | return "" 461 | } 462 | return fmt.Sprintf("VerifyQrCodeResponse(%+v)", *p) 463 | } 464 | 465 | // Attributes: 466 | // - AuthSessionId 467 | // - PinCode 468 | type VerifyPinCodeRequest struct { 469 | AuthSessionId string `thrift:"authSessionId,1" db:"authSessionId" json:"authSessionId"` 470 | PinCode string `thrift:"pinCode,2" db:"pinCode" json:"pinCode"` 471 | } 472 | 473 | func NewVerifyPinCodeRequest() *VerifyPinCodeRequest { 474 | return &VerifyPinCodeRequest{} 475 | } 476 | 477 | func (p *VerifyPinCodeRequest) GetAuthSessionId() string { 478 | return p.AuthSessionId 479 | } 480 | 481 | func (p *VerifyPinCodeRequest) GetPinCode() string { 482 | return p.PinCode 483 | } 484 | func (p *VerifyPinCodeRequest) Read(iprot thrift.TProtocol) error { 485 | if _, err := iprot.ReadStructBegin(); err != nil { 486 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 487 | } 488 | 489 | for { 490 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 491 | if err != nil { 492 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 493 | } 494 | if fieldTypeId == thrift.STOP { 495 | break 496 | } 497 | switch fieldId { 498 | case 1: 499 | if fieldTypeId == thrift.STRING { 500 | if err := p.ReadField1(iprot); err != nil { 501 | return err 502 | } 503 | } else { 504 | if err := iprot.Skip(fieldTypeId); err != nil { 505 | return err 506 | } 507 | } 508 | case 2: 509 | if fieldTypeId == thrift.STRING { 510 | if err := p.ReadField2(iprot); err != nil { 511 | return err 512 | } 513 | } else { 514 | if err := iprot.Skip(fieldTypeId); err != nil { 515 | return err 516 | } 517 | } 518 | default: 519 | if err := iprot.Skip(fieldTypeId); err != nil { 520 | return err 521 | } 522 | } 523 | if err := iprot.ReadFieldEnd(); err != nil { 524 | return err 525 | } 526 | } 527 | if err := iprot.ReadStructEnd(); err != nil { 528 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 529 | } 530 | return nil 531 | } 532 | 533 | func (p *VerifyPinCodeRequest) ReadField1(iprot thrift.TProtocol) error { 534 | if v, err := iprot.ReadString(); err != nil { 535 | return thrift.PrependError("error reading field 1: ", err) 536 | } else { 537 | p.AuthSessionId = v 538 | } 539 | return nil 540 | } 541 | 542 | func (p *VerifyPinCodeRequest) ReadField2(iprot thrift.TProtocol) error { 543 | if v, err := iprot.ReadString(); err != nil { 544 | return thrift.PrependError("error reading field 2: ", err) 545 | } else { 546 | p.PinCode = v 547 | } 548 | return nil 549 | } 550 | 551 | func (p *VerifyPinCodeRequest) Write(oprot thrift.TProtocol) error { 552 | if err := oprot.WriteStructBegin("VerifyPinCodeRequest"); err != nil { 553 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 554 | } 555 | if p != nil { 556 | if err := p.writeField1(oprot); err != nil { 557 | return err 558 | } 559 | if err := p.writeField2(oprot); err != nil { 560 | return err 561 | } 562 | } 563 | if err := oprot.WriteFieldStop(); err != nil { 564 | return thrift.PrependError("write field stop error: ", err) 565 | } 566 | if err := oprot.WriteStructEnd(); err != nil { 567 | return thrift.PrependError("write struct stop error: ", err) 568 | } 569 | return nil 570 | } 571 | 572 | func (p *VerifyPinCodeRequest) writeField1(oprot thrift.TProtocol) (err error) { 573 | if err := oprot.WriteFieldBegin("authSessionId", thrift.STRING, 1); err != nil { 574 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:authSessionId: ", p), err) 575 | } 576 | if err := oprot.WriteString(string(p.AuthSessionId)); err != nil { 577 | return thrift.PrependError(fmt.Sprintf("%T.authSessionId (1) field write error: ", p), err) 578 | } 579 | if err := oprot.WriteFieldEnd(); err != nil { 580 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:authSessionId: ", p), err) 581 | } 582 | return err 583 | } 584 | 585 | func (p *VerifyPinCodeRequest) writeField2(oprot thrift.TProtocol) (err error) { 586 | if err := oprot.WriteFieldBegin("pinCode", thrift.STRING, 2); err != nil { 587 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:pinCode: ", p), err) 588 | } 589 | if err := oprot.WriteString(string(p.PinCode)); err != nil { 590 | return thrift.PrependError(fmt.Sprintf("%T.pinCode (2) field write error: ", p), err) 591 | } 592 | if err := oprot.WriteFieldEnd(); err != nil { 593 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:pinCode: ", p), err) 594 | } 595 | return err 596 | } 597 | 598 | func (p *VerifyPinCodeRequest) String() string { 599 | if p == nil { 600 | return "" 601 | } 602 | return fmt.Sprintf("VerifyPinCodeRequest(%+v)", *p) 603 | } 604 | 605 | type VerifyPinCodeResponse struct { 606 | } 607 | 608 | func NewVerifyPinCodeResponse() *VerifyPinCodeResponse { 609 | return &VerifyPinCodeResponse{} 610 | } 611 | 612 | func (p *VerifyPinCodeResponse) Read(iprot thrift.TProtocol) error { 613 | if _, err := iprot.ReadStructBegin(); err != nil { 614 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 615 | } 616 | 617 | for { 618 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 619 | if err != nil { 620 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 621 | } 622 | if fieldTypeId == thrift.STOP { 623 | break 624 | } 625 | if err := iprot.Skip(fieldTypeId); err != nil { 626 | return err 627 | } 628 | if err := iprot.ReadFieldEnd(); err != nil { 629 | return err 630 | } 631 | } 632 | if err := iprot.ReadStructEnd(); err != nil { 633 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 634 | } 635 | return nil 636 | } 637 | 638 | func (p *VerifyPinCodeResponse) Write(oprot thrift.TProtocol) error { 639 | if err := oprot.WriteStructBegin("VerifyPinCodeResponse"); err != nil { 640 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 641 | } 642 | if p != nil { 643 | } 644 | if err := oprot.WriteFieldStop(); err != nil { 645 | return thrift.PrependError("write field stop error: ", err) 646 | } 647 | if err := oprot.WriteStructEnd(); err != nil { 648 | return thrift.PrependError("write struct stop error: ", err) 649 | } 650 | return nil 651 | } 652 | 653 | func (p *VerifyPinCodeResponse) String() string { 654 | if p == nil { 655 | return "" 656 | } 657 | return fmt.Sprintf("VerifyPinCodeResponse(%+v)", *p) 658 | } 659 | 660 | // Attributes: 661 | // - AuthSessionId 662 | // - Certificate 663 | type VerifyCertificateRequest struct { 664 | AuthSessionId string `thrift:"authSessionId,1" db:"authSessionId" json:"authSessionId"` 665 | Certificate string `thrift:"certificate,2" db:"certificate" json:"certificate"` 666 | } 667 | 668 | func NewVerifyCertificateRequest() *VerifyCertificateRequest { 669 | return &VerifyCertificateRequest{} 670 | } 671 | 672 | func (p *VerifyCertificateRequest) GetAuthSessionId() string { 673 | return p.AuthSessionId 674 | } 675 | 676 | func (p *VerifyCertificateRequest) GetCertificate() string { 677 | return p.Certificate 678 | } 679 | func (p *VerifyCertificateRequest) Read(iprot thrift.TProtocol) error { 680 | if _, err := iprot.ReadStructBegin(); err != nil { 681 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 682 | } 683 | 684 | for { 685 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 686 | if err != nil { 687 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 688 | } 689 | if fieldTypeId == thrift.STOP { 690 | break 691 | } 692 | switch fieldId { 693 | case 1: 694 | if fieldTypeId == thrift.STRING { 695 | if err := p.ReadField1(iprot); err != nil { 696 | return err 697 | } 698 | } else { 699 | if err := iprot.Skip(fieldTypeId); err != nil { 700 | return err 701 | } 702 | } 703 | case 2: 704 | if fieldTypeId == thrift.STRING { 705 | if err := p.ReadField2(iprot); err != nil { 706 | return err 707 | } 708 | } else { 709 | if err := iprot.Skip(fieldTypeId); err != nil { 710 | return err 711 | } 712 | } 713 | default: 714 | if err := iprot.Skip(fieldTypeId); err != nil { 715 | return err 716 | } 717 | } 718 | if err := iprot.ReadFieldEnd(); err != nil { 719 | return err 720 | } 721 | } 722 | if err := iprot.ReadStructEnd(); err != nil { 723 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 724 | } 725 | return nil 726 | } 727 | 728 | func (p *VerifyCertificateRequest) ReadField1(iprot thrift.TProtocol) error { 729 | if v, err := iprot.ReadString(); err != nil { 730 | return thrift.PrependError("error reading field 1: ", err) 731 | } else { 732 | p.AuthSessionId = v 733 | } 734 | return nil 735 | } 736 | 737 | func (p *VerifyCertificateRequest) ReadField2(iprot thrift.TProtocol) error { 738 | if v, err := iprot.ReadString(); err != nil { 739 | return thrift.PrependError("error reading field 2: ", err) 740 | } else { 741 | p.Certificate = v 742 | } 743 | return nil 744 | } 745 | 746 | func (p *VerifyCertificateRequest) Write(oprot thrift.TProtocol) error { 747 | if err := oprot.WriteStructBegin("VerifyCertificateRequest"); err != nil { 748 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 749 | } 750 | if p != nil { 751 | if err := p.writeField1(oprot); err != nil { 752 | return err 753 | } 754 | if err := p.writeField2(oprot); err != nil { 755 | return err 756 | } 757 | } 758 | if err := oprot.WriteFieldStop(); err != nil { 759 | return thrift.PrependError("write field stop error: ", err) 760 | } 761 | if err := oprot.WriteStructEnd(); err != nil { 762 | return thrift.PrependError("write struct stop error: ", err) 763 | } 764 | return nil 765 | } 766 | 767 | func (p *VerifyCertificateRequest) writeField1(oprot thrift.TProtocol) (err error) { 768 | if err := oprot.WriteFieldBegin("authSessionId", thrift.STRING, 1); err != nil { 769 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:authSessionId: ", p), err) 770 | } 771 | if err := oprot.WriteString(string(p.AuthSessionId)); err != nil { 772 | return thrift.PrependError(fmt.Sprintf("%T.authSessionId (1) field write error: ", p), err) 773 | } 774 | if err := oprot.WriteFieldEnd(); err != nil { 775 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:authSessionId: ", p), err) 776 | } 777 | return err 778 | } 779 | 780 | func (p *VerifyCertificateRequest) writeField2(oprot thrift.TProtocol) (err error) { 781 | if err := oprot.WriteFieldBegin("certificate", thrift.STRING, 2); err != nil { 782 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:certificate: ", p), err) 783 | } 784 | if err := oprot.WriteString(string(p.Certificate)); err != nil { 785 | return thrift.PrependError(fmt.Sprintf("%T.certificate (2) field write error: ", p), err) 786 | } 787 | if err := oprot.WriteFieldEnd(); err != nil { 788 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:certificate: ", p), err) 789 | } 790 | return err 791 | } 792 | 793 | func (p *VerifyCertificateRequest) String() string { 794 | if p == nil { 795 | return "" 796 | } 797 | return fmt.Sprintf("VerifyCertificateRequest(%+v)", *p) 798 | } 799 | 800 | // Attributes: 801 | // - PinCode 802 | type CreatePinCodeResponse struct { 803 | PinCode string `thrift:"pinCode,1" db:"pinCode" json:"pinCode"` 804 | } 805 | 806 | func NewCreatePinCodeResponse() *CreatePinCodeResponse { 807 | return &CreatePinCodeResponse{} 808 | } 809 | 810 | func (p *CreatePinCodeResponse) GetPinCode() string { 811 | return p.PinCode 812 | } 813 | func (p *CreatePinCodeResponse) Read(iprot thrift.TProtocol) error { 814 | if _, err := iprot.ReadStructBegin(); err != nil { 815 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 816 | } 817 | 818 | for { 819 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 820 | if err != nil { 821 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 822 | } 823 | if fieldTypeId == thrift.STOP { 824 | break 825 | } 826 | switch fieldId { 827 | case 1: 828 | if fieldTypeId == thrift.STRING { 829 | if err := p.ReadField1(iprot); err != nil { 830 | return err 831 | } 832 | } else { 833 | if err := iprot.Skip(fieldTypeId); err != nil { 834 | return err 835 | } 836 | } 837 | default: 838 | if err := iprot.Skip(fieldTypeId); err != nil { 839 | return err 840 | } 841 | } 842 | if err := iprot.ReadFieldEnd(); err != nil { 843 | return err 844 | } 845 | } 846 | if err := iprot.ReadStructEnd(); err != nil { 847 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 848 | } 849 | return nil 850 | } 851 | 852 | func (p *CreatePinCodeResponse) ReadField1(iprot thrift.TProtocol) error { 853 | if v, err := iprot.ReadString(); err != nil { 854 | return thrift.PrependError("error reading field 1: ", err) 855 | } else { 856 | p.PinCode = v 857 | } 858 | return nil 859 | } 860 | 861 | func (p *CreatePinCodeResponse) Write(oprot thrift.TProtocol) error { 862 | if err := oprot.WriteStructBegin("CreatePinCodeResponse"); err != nil { 863 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 864 | } 865 | if p != nil { 866 | if err := p.writeField1(oprot); err != nil { 867 | return err 868 | } 869 | } 870 | if err := oprot.WriteFieldStop(); err != nil { 871 | return thrift.PrependError("write field stop error: ", err) 872 | } 873 | if err := oprot.WriteStructEnd(); err != nil { 874 | return thrift.PrependError("write struct stop error: ", err) 875 | } 876 | return nil 877 | } 878 | 879 | func (p *CreatePinCodeResponse) writeField1(oprot thrift.TProtocol) (err error) { 880 | if err := oprot.WriteFieldBegin("pinCode", thrift.STRING, 1); err != nil { 881 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:pinCode: ", p), err) 882 | } 883 | if err := oprot.WriteString(string(p.PinCode)); err != nil { 884 | return thrift.PrependError(fmt.Sprintf("%T.pinCode (1) field write error: ", p), err) 885 | } 886 | if err := oprot.WriteFieldEnd(); err != nil { 887 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:pinCode: ", p), err) 888 | } 889 | return err 890 | } 891 | 892 | func (p *CreatePinCodeResponse) String() string { 893 | if p == nil { 894 | return "" 895 | } 896 | return fmt.Sprintf("CreatePinCodeResponse(%+v)", *p) 897 | } 898 | 899 | // Attributes: 900 | // - AuthSessionId 901 | type CreatePinCodeRequest struct { 902 | AuthSessionId string `thrift:"authSessionId,1" db:"authSessionId" json:"authSessionId"` 903 | } 904 | 905 | func NewCreatePinCodeRequest() *CreatePinCodeRequest { 906 | return &CreatePinCodeRequest{} 907 | } 908 | 909 | func (p *CreatePinCodeRequest) GetAuthSessionId() string { 910 | return p.AuthSessionId 911 | } 912 | func (p *CreatePinCodeRequest) Read(iprot thrift.TProtocol) error { 913 | if _, err := iprot.ReadStructBegin(); err != nil { 914 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 915 | } 916 | 917 | for { 918 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 919 | if err != nil { 920 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 921 | } 922 | if fieldTypeId == thrift.STOP { 923 | break 924 | } 925 | switch fieldId { 926 | case 1: 927 | if fieldTypeId == thrift.STRING { 928 | if err := p.ReadField1(iprot); err != nil { 929 | return err 930 | } 931 | } else { 932 | if err := iprot.Skip(fieldTypeId); err != nil { 933 | return err 934 | } 935 | } 936 | default: 937 | if err := iprot.Skip(fieldTypeId); err != nil { 938 | return err 939 | } 940 | } 941 | if err := iprot.ReadFieldEnd(); err != nil { 942 | return err 943 | } 944 | } 945 | if err := iprot.ReadStructEnd(); err != nil { 946 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 947 | } 948 | return nil 949 | } 950 | 951 | func (p *CreatePinCodeRequest) ReadField1(iprot thrift.TProtocol) error { 952 | if v, err := iprot.ReadString(); err != nil { 953 | return thrift.PrependError("error reading field 1: ", err) 954 | } else { 955 | p.AuthSessionId = v 956 | } 957 | return nil 958 | } 959 | 960 | func (p *CreatePinCodeRequest) Write(oprot thrift.TProtocol) error { 961 | if err := oprot.WriteStructBegin("CreatePinCodeRequest"); err != nil { 962 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 963 | } 964 | if p != nil { 965 | if err := p.writeField1(oprot); err != nil { 966 | return err 967 | } 968 | } 969 | if err := oprot.WriteFieldStop(); err != nil { 970 | return thrift.PrependError("write field stop error: ", err) 971 | } 972 | if err := oprot.WriteStructEnd(); err != nil { 973 | return thrift.PrependError("write struct stop error: ", err) 974 | } 975 | return nil 976 | } 977 | 978 | func (p *CreatePinCodeRequest) writeField1(oprot thrift.TProtocol) (err error) { 979 | if err := oprot.WriteFieldBegin("authSessionId", thrift.STRING, 1); err != nil { 980 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:authSessionId: ", p), err) 981 | } 982 | if err := oprot.WriteString(string(p.AuthSessionId)); err != nil { 983 | return thrift.PrependError(fmt.Sprintf("%T.authSessionId (1) field write error: ", p), err) 984 | } 985 | if err := oprot.WriteFieldEnd(); err != nil { 986 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:authSessionId: ", p), err) 987 | } 988 | return err 989 | } 990 | 991 | func (p *CreatePinCodeRequest) String() string { 992 | if p == nil { 993 | return "" 994 | } 995 | return fmt.Sprintf("CreatePinCodeRequest(%+v)", *p) 996 | } 997 | 998 | // Attributes: 999 | // - AuthSessionId 1000 | type CreateQrCodeRequest struct { 1001 | AuthSessionId string `thrift:"authSessionId,1" db:"authSessionId" json:"authSessionId"` 1002 | } 1003 | 1004 | func NewCreateQrCodeRequest() *CreateQrCodeRequest { 1005 | return &CreateQrCodeRequest{} 1006 | } 1007 | 1008 | func (p *CreateQrCodeRequest) GetAuthSessionId() string { 1009 | return p.AuthSessionId 1010 | } 1011 | func (p *CreateQrCodeRequest) Read(iprot thrift.TProtocol) error { 1012 | if _, err := iprot.ReadStructBegin(); err != nil { 1013 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 1014 | } 1015 | 1016 | for { 1017 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 1018 | if err != nil { 1019 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 1020 | } 1021 | if fieldTypeId == thrift.STOP { 1022 | break 1023 | } 1024 | switch fieldId { 1025 | case 1: 1026 | if fieldTypeId == thrift.STRING { 1027 | if err := p.ReadField1(iprot); err != nil { 1028 | return err 1029 | } 1030 | } else { 1031 | if err := iprot.Skip(fieldTypeId); err != nil { 1032 | return err 1033 | } 1034 | } 1035 | default: 1036 | if err := iprot.Skip(fieldTypeId); err != nil { 1037 | return err 1038 | } 1039 | } 1040 | if err := iprot.ReadFieldEnd(); err != nil { 1041 | return err 1042 | } 1043 | } 1044 | if err := iprot.ReadStructEnd(); err != nil { 1045 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 1046 | } 1047 | return nil 1048 | } 1049 | 1050 | func (p *CreateQrCodeRequest) ReadField1(iprot thrift.TProtocol) error { 1051 | if v, err := iprot.ReadString(); err != nil { 1052 | return thrift.PrependError("error reading field 1: ", err) 1053 | } else { 1054 | p.AuthSessionId = v 1055 | } 1056 | return nil 1057 | } 1058 | 1059 | func (p *CreateQrCodeRequest) Write(oprot thrift.TProtocol) error { 1060 | if err := oprot.WriteStructBegin("CreateQrCodeRequest"); err != nil { 1061 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 1062 | } 1063 | if p != nil { 1064 | if err := p.writeField1(oprot); err != nil { 1065 | return err 1066 | } 1067 | } 1068 | if err := oprot.WriteFieldStop(); err != nil { 1069 | return thrift.PrependError("write field stop error: ", err) 1070 | } 1071 | if err := oprot.WriteStructEnd(); err != nil { 1072 | return thrift.PrependError("write struct stop error: ", err) 1073 | } 1074 | return nil 1075 | } 1076 | 1077 | func (p *CreateQrCodeRequest) writeField1(oprot thrift.TProtocol) (err error) { 1078 | if err := oprot.WriteFieldBegin("authSessionId", thrift.STRING, 1); err != nil { 1079 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:authSessionId: ", p), err) 1080 | } 1081 | if err := oprot.WriteString(string(p.AuthSessionId)); err != nil { 1082 | return thrift.PrependError(fmt.Sprintf("%T.authSessionId (1) field write error: ", p), err) 1083 | } 1084 | if err := oprot.WriteFieldEnd(); err != nil { 1085 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:authSessionId: ", p), err) 1086 | } 1087 | return err 1088 | } 1089 | 1090 | func (p *CreateQrCodeRequest) String() string { 1091 | if p == nil { 1092 | return "" 1093 | } 1094 | return fmt.Sprintf("CreateQrCodeRequest(%+v)", *p) 1095 | } 1096 | 1097 | // Attributes: 1098 | // - CallbackUrl 1099 | type CreateQrCodeResponse struct { 1100 | CallbackUrl string `thrift:"callbackUrl,1" db:"callbackUrl" json:"callbackUrl"` 1101 | } 1102 | 1103 | func NewCreateQrCodeResponse() *CreateQrCodeResponse { 1104 | return &CreateQrCodeResponse{} 1105 | } 1106 | 1107 | func (p *CreateQrCodeResponse) GetCallbackUrl() string { 1108 | return p.CallbackUrl 1109 | } 1110 | func (p *CreateQrCodeResponse) Read(iprot thrift.TProtocol) error { 1111 | if _, err := iprot.ReadStructBegin(); err != nil { 1112 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 1113 | } 1114 | 1115 | for { 1116 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 1117 | if err != nil { 1118 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 1119 | } 1120 | if fieldTypeId == thrift.STOP { 1121 | break 1122 | } 1123 | switch fieldId { 1124 | case 1: 1125 | if fieldTypeId == thrift.STRING { 1126 | if err := p.ReadField1(iprot); err != nil { 1127 | return err 1128 | } 1129 | } else { 1130 | if err := iprot.Skip(fieldTypeId); err != nil { 1131 | return err 1132 | } 1133 | } 1134 | default: 1135 | if err := iprot.Skip(fieldTypeId); err != nil { 1136 | return err 1137 | } 1138 | } 1139 | if err := iprot.ReadFieldEnd(); err != nil { 1140 | return err 1141 | } 1142 | } 1143 | if err := iprot.ReadStructEnd(); err != nil { 1144 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 1145 | } 1146 | return nil 1147 | } 1148 | 1149 | func (p *CreateQrCodeResponse) ReadField1(iprot thrift.TProtocol) error { 1150 | if v, err := iprot.ReadString(); err != nil { 1151 | return thrift.PrependError("error reading field 1: ", err) 1152 | } else { 1153 | p.CallbackUrl = v 1154 | } 1155 | return nil 1156 | } 1157 | 1158 | func (p *CreateQrCodeResponse) Write(oprot thrift.TProtocol) error { 1159 | if err := oprot.WriteStructBegin("CreateQrCodeResponse"); err != nil { 1160 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 1161 | } 1162 | if p != nil { 1163 | if err := p.writeField1(oprot); err != nil { 1164 | return err 1165 | } 1166 | } 1167 | if err := oprot.WriteFieldStop(); err != nil { 1168 | return thrift.PrependError("write field stop error: ", err) 1169 | } 1170 | if err := oprot.WriteStructEnd(); err != nil { 1171 | return thrift.PrependError("write struct stop error: ", err) 1172 | } 1173 | return nil 1174 | } 1175 | 1176 | func (p *CreateQrCodeResponse) writeField1(oprot thrift.TProtocol) (err error) { 1177 | if err := oprot.WriteFieldBegin("callbackUrl", thrift.STRING, 1); err != nil { 1178 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:callbackUrl: ", p), err) 1179 | } 1180 | if err := oprot.WriteString(string(p.CallbackUrl)); err != nil { 1181 | return thrift.PrependError(fmt.Sprintf("%T.callbackUrl (1) field write error: ", p), err) 1182 | } 1183 | if err := oprot.WriteFieldEnd(); err != nil { 1184 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:callbackUrl: ", p), err) 1185 | } 1186 | return err 1187 | } 1188 | 1189 | func (p *CreateQrCodeResponse) String() string { 1190 | if p == nil { 1191 | return "" 1192 | } 1193 | return fmt.Sprintf("CreateQrCodeResponse(%+v)", *p) 1194 | } 1195 | 1196 | type CreateQrSessionRequest struct { 1197 | } 1198 | 1199 | func NewCreateQrSessionRequest() *CreateQrSessionRequest { 1200 | return &CreateQrSessionRequest{} 1201 | } 1202 | 1203 | func (p *CreateQrSessionRequest) Read(iprot thrift.TProtocol) error { 1204 | if _, err := iprot.ReadStructBegin(); err != nil { 1205 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 1206 | } 1207 | 1208 | for { 1209 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 1210 | if err != nil { 1211 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 1212 | } 1213 | if fieldTypeId == thrift.STOP { 1214 | break 1215 | } 1216 | if err := iprot.Skip(fieldTypeId); err != nil { 1217 | return err 1218 | } 1219 | if err := iprot.ReadFieldEnd(); err != nil { 1220 | return err 1221 | } 1222 | } 1223 | if err := iprot.ReadStructEnd(); err != nil { 1224 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 1225 | } 1226 | return nil 1227 | } 1228 | 1229 | func (p *CreateQrSessionRequest) Write(oprot thrift.TProtocol) error { 1230 | if err := oprot.WriteStructBegin("CreateQrSessionRequest"); err != nil { 1231 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 1232 | } 1233 | if p != nil { 1234 | } 1235 | if err := oprot.WriteFieldStop(); err != nil { 1236 | return thrift.PrependError("write field stop error: ", err) 1237 | } 1238 | if err := oprot.WriteStructEnd(); err != nil { 1239 | return thrift.PrependError("write struct stop error: ", err) 1240 | } 1241 | return nil 1242 | } 1243 | 1244 | func (p *CreateQrSessionRequest) String() string { 1245 | if p == nil { 1246 | return "" 1247 | } 1248 | return fmt.Sprintf("CreateQrSessionRequest(%+v)", *p) 1249 | } 1250 | 1251 | // Attributes: 1252 | // - AuthSessionId 1253 | type CreateQrSessionResponse struct { 1254 | AuthSessionId string `thrift:"authSessionId,1" db:"authSessionId" json:"authSessionId"` 1255 | } 1256 | 1257 | func NewCreateQrSessionResponse() *CreateQrSessionResponse { 1258 | return &CreateQrSessionResponse{} 1259 | } 1260 | 1261 | func (p *CreateQrSessionResponse) GetAuthSessionId() string { 1262 | return p.AuthSessionId 1263 | } 1264 | func (p *CreateQrSessionResponse) Read(iprot thrift.TProtocol) error { 1265 | if _, err := iprot.ReadStructBegin(); err != nil { 1266 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 1267 | } 1268 | 1269 | for { 1270 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 1271 | if err != nil { 1272 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 1273 | } 1274 | if fieldTypeId == thrift.STOP { 1275 | break 1276 | } 1277 | switch fieldId { 1278 | case 1: 1279 | if fieldTypeId == thrift.STRING { 1280 | if err := p.ReadField1(iprot); err != nil { 1281 | return err 1282 | } 1283 | } else { 1284 | if err := iprot.Skip(fieldTypeId); err != nil { 1285 | return err 1286 | } 1287 | } 1288 | default: 1289 | if err := iprot.Skip(fieldTypeId); err != nil { 1290 | return err 1291 | } 1292 | } 1293 | if err := iprot.ReadFieldEnd(); err != nil { 1294 | return err 1295 | } 1296 | } 1297 | if err := iprot.ReadStructEnd(); err != nil { 1298 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 1299 | } 1300 | return nil 1301 | } 1302 | 1303 | func (p *CreateQrSessionResponse) ReadField1(iprot thrift.TProtocol) error { 1304 | if v, err := iprot.ReadString(); err != nil { 1305 | return thrift.PrependError("error reading field 1: ", err) 1306 | } else { 1307 | p.AuthSessionId = v 1308 | } 1309 | return nil 1310 | } 1311 | 1312 | func (p *CreateQrSessionResponse) Write(oprot thrift.TProtocol) error { 1313 | if err := oprot.WriteStructBegin("CreateQrSessionResponse"); err != nil { 1314 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 1315 | } 1316 | if p != nil { 1317 | if err := p.writeField1(oprot); err != nil { 1318 | return err 1319 | } 1320 | } 1321 | if err := oprot.WriteFieldStop(); err != nil { 1322 | return thrift.PrependError("write field stop error: ", err) 1323 | } 1324 | if err := oprot.WriteStructEnd(); err != nil { 1325 | return thrift.PrependError("write struct stop error: ", err) 1326 | } 1327 | return nil 1328 | } 1329 | 1330 | func (p *CreateQrSessionResponse) writeField1(oprot thrift.TProtocol) (err error) { 1331 | if err := oprot.WriteFieldBegin("authSessionId", thrift.STRING, 1); err != nil { 1332 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:authSessionId: ", p), err) 1333 | } 1334 | if err := oprot.WriteString(string(p.AuthSessionId)); err != nil { 1335 | return thrift.PrependError(fmt.Sprintf("%T.authSessionId (1) field write error: ", p), err) 1336 | } 1337 | if err := oprot.WriteFieldEnd(); err != nil { 1338 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:authSessionId: ", p), err) 1339 | } 1340 | return err 1341 | } 1342 | 1343 | func (p *CreateQrSessionResponse) String() string { 1344 | if p == nil { 1345 | return "" 1346 | } 1347 | return fmt.Sprintf("CreateQrSessionResponse(%+v)", *p) 1348 | } 1349 | 1350 | // Attributes: 1351 | // - AuthSessionId 1352 | // - SystemName 1353 | // - AutoLoginIsRequired 1354 | type QrCodeLoginRequest struct { 1355 | AuthSessionId string `thrift:"authSessionId,1" db:"authSessionId" json:"authSessionId"` 1356 | SystemName string `thrift:"systemName,2" db:"systemName" json:"systemName"` 1357 | AutoLoginIsRequired bool `thrift:"autoLoginIsRequired,3" db:"autoLoginIsRequired" json:"autoLoginIsRequired"` 1358 | } 1359 | 1360 | func NewQrCodeLoginRequest() *QrCodeLoginRequest { 1361 | return &QrCodeLoginRequest{} 1362 | } 1363 | 1364 | func (p *QrCodeLoginRequest) GetAuthSessionId() string { 1365 | return p.AuthSessionId 1366 | } 1367 | 1368 | func (p *QrCodeLoginRequest) GetSystemName() string { 1369 | return p.SystemName 1370 | } 1371 | 1372 | func (p *QrCodeLoginRequest) GetAutoLoginIsRequired() bool { 1373 | return p.AutoLoginIsRequired 1374 | } 1375 | func (p *QrCodeLoginRequest) Read(iprot thrift.TProtocol) error { 1376 | if _, err := iprot.ReadStructBegin(); err != nil { 1377 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 1378 | } 1379 | 1380 | for { 1381 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 1382 | if err != nil { 1383 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 1384 | } 1385 | if fieldTypeId == thrift.STOP { 1386 | break 1387 | } 1388 | switch fieldId { 1389 | case 1: 1390 | if fieldTypeId == thrift.STRING { 1391 | if err := p.ReadField1(iprot); err != nil { 1392 | return err 1393 | } 1394 | } else { 1395 | if err := iprot.Skip(fieldTypeId); err != nil { 1396 | return err 1397 | } 1398 | } 1399 | case 2: 1400 | if fieldTypeId == thrift.STRING { 1401 | if err := p.ReadField2(iprot); err != nil { 1402 | return err 1403 | } 1404 | } else { 1405 | if err := iprot.Skip(fieldTypeId); err != nil { 1406 | return err 1407 | } 1408 | } 1409 | case 3: 1410 | if fieldTypeId == thrift.BOOL { 1411 | if err := p.ReadField3(iprot); err != nil { 1412 | return err 1413 | } 1414 | } else { 1415 | if err := iprot.Skip(fieldTypeId); err != nil { 1416 | return err 1417 | } 1418 | } 1419 | default: 1420 | if err := iprot.Skip(fieldTypeId); err != nil { 1421 | return err 1422 | } 1423 | } 1424 | if err := iprot.ReadFieldEnd(); err != nil { 1425 | return err 1426 | } 1427 | } 1428 | if err := iprot.ReadStructEnd(); err != nil { 1429 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 1430 | } 1431 | return nil 1432 | } 1433 | 1434 | func (p *QrCodeLoginRequest) ReadField1(iprot thrift.TProtocol) error { 1435 | if v, err := iprot.ReadString(); err != nil { 1436 | return thrift.PrependError("error reading field 1: ", err) 1437 | } else { 1438 | p.AuthSessionId = v 1439 | } 1440 | return nil 1441 | } 1442 | 1443 | func (p *QrCodeLoginRequest) ReadField2(iprot thrift.TProtocol) error { 1444 | if v, err := iprot.ReadString(); err != nil { 1445 | return thrift.PrependError("error reading field 2: ", err) 1446 | } else { 1447 | p.SystemName = v 1448 | } 1449 | return nil 1450 | } 1451 | 1452 | func (p *QrCodeLoginRequest) ReadField3(iprot thrift.TProtocol) error { 1453 | if v, err := iprot.ReadBool(); err != nil { 1454 | return thrift.PrependError("error reading field 3: ", err) 1455 | } else { 1456 | p.AutoLoginIsRequired = v 1457 | } 1458 | return nil 1459 | } 1460 | 1461 | func (p *QrCodeLoginRequest) Write(oprot thrift.TProtocol) error { 1462 | if err := oprot.WriteStructBegin("QrCodeLoginRequest"); err != nil { 1463 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 1464 | } 1465 | if p != nil { 1466 | if err := p.writeField1(oprot); err != nil { 1467 | return err 1468 | } 1469 | if err := p.writeField2(oprot); err != nil { 1470 | return err 1471 | } 1472 | if err := p.writeField3(oprot); err != nil { 1473 | return err 1474 | } 1475 | } 1476 | if err := oprot.WriteFieldStop(); err != nil { 1477 | return thrift.PrependError("write field stop error: ", err) 1478 | } 1479 | if err := oprot.WriteStructEnd(); err != nil { 1480 | return thrift.PrependError("write struct stop error: ", err) 1481 | } 1482 | return nil 1483 | } 1484 | 1485 | func (p *QrCodeLoginRequest) writeField1(oprot thrift.TProtocol) (err error) { 1486 | if err := oprot.WriteFieldBegin("authSessionId", thrift.STRING, 1); err != nil { 1487 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:authSessionId: ", p), err) 1488 | } 1489 | if err := oprot.WriteString(string(p.AuthSessionId)); err != nil { 1490 | return thrift.PrependError(fmt.Sprintf("%T.authSessionId (1) field write error: ", p), err) 1491 | } 1492 | if err := oprot.WriteFieldEnd(); err != nil { 1493 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:authSessionId: ", p), err) 1494 | } 1495 | return err 1496 | } 1497 | 1498 | func (p *QrCodeLoginRequest) writeField2(oprot thrift.TProtocol) (err error) { 1499 | if err := oprot.WriteFieldBegin("systemName", thrift.STRING, 2); err != nil { 1500 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:systemName: ", p), err) 1501 | } 1502 | if err := oprot.WriteString(string(p.SystemName)); err != nil { 1503 | return thrift.PrependError(fmt.Sprintf("%T.systemName (2) field write error: ", p), err) 1504 | } 1505 | if err := oprot.WriteFieldEnd(); err != nil { 1506 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:systemName: ", p), err) 1507 | } 1508 | return err 1509 | } 1510 | 1511 | func (p *QrCodeLoginRequest) writeField3(oprot thrift.TProtocol) (err error) { 1512 | if err := oprot.WriteFieldBegin("autoLoginIsRequired", thrift.BOOL, 3); err != nil { 1513 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:autoLoginIsRequired: ", p), err) 1514 | } 1515 | if err := oprot.WriteBool(bool(p.AutoLoginIsRequired)); err != nil { 1516 | return thrift.PrependError(fmt.Sprintf("%T.autoLoginIsRequired (3) field write error: ", p), err) 1517 | } 1518 | if err := oprot.WriteFieldEnd(); err != nil { 1519 | return thrift.PrependError(fmt.Sprintf("%T write field end error 3:autoLoginIsRequired: ", p), err) 1520 | } 1521 | return err 1522 | } 1523 | 1524 | func (p *QrCodeLoginRequest) String() string { 1525 | if p == nil { 1526 | return "" 1527 | } 1528 | return fmt.Sprintf("QrCodeLoginRequest(%+v)", *p) 1529 | } 1530 | 1531 | // Attributes: 1532 | // - Certificate 1533 | // - AccessToken 1534 | // - LastBindTimestamp 1535 | // - MetaData 1536 | type QrCodeLoginResponse struct { 1537 | Certificate string `thrift:"certificate,1" db:"certificate" json:"certificate"` 1538 | AccessToken string `thrift:"accessToken,2" db:"accessToken" json:"accessToken"` 1539 | LastBindTimestamp int64 `thrift:"lastBindTimestamp,3" db:"lastBindTimestamp" json:"lastBindTimestamp"` 1540 | MetaData map[string]string `thrift:"metaData,4" db:"metaData" json:"metaData"` 1541 | } 1542 | 1543 | func NewQrCodeLoginResponse() *QrCodeLoginResponse { 1544 | return &QrCodeLoginResponse{} 1545 | } 1546 | 1547 | func (p *QrCodeLoginResponse) GetCertificate() string { 1548 | return p.Certificate 1549 | } 1550 | 1551 | func (p *QrCodeLoginResponse) GetAccessToken() string { 1552 | return p.AccessToken 1553 | } 1554 | 1555 | func (p *QrCodeLoginResponse) GetLastBindTimestamp() int64 { 1556 | return p.LastBindTimestamp 1557 | } 1558 | 1559 | func (p *QrCodeLoginResponse) GetMetaData() map[string]string { 1560 | return p.MetaData 1561 | } 1562 | func (p *QrCodeLoginResponse) Read(iprot thrift.TProtocol) error { 1563 | if _, err := iprot.ReadStructBegin(); err != nil { 1564 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 1565 | } 1566 | 1567 | for { 1568 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 1569 | if err != nil { 1570 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 1571 | } 1572 | if fieldTypeId == thrift.STOP { 1573 | break 1574 | } 1575 | switch fieldId { 1576 | case 1: 1577 | if fieldTypeId == thrift.STRING { 1578 | if err := p.ReadField1(iprot); err != nil { 1579 | return err 1580 | } 1581 | } else { 1582 | if err := iprot.Skip(fieldTypeId); err != nil { 1583 | return err 1584 | } 1585 | } 1586 | case 2: 1587 | if fieldTypeId == thrift.STRING { 1588 | if err := p.ReadField2(iprot); err != nil { 1589 | return err 1590 | } 1591 | } else { 1592 | if err := iprot.Skip(fieldTypeId); err != nil { 1593 | return err 1594 | } 1595 | } 1596 | case 3: 1597 | if fieldTypeId == thrift.I64 { 1598 | if err := p.ReadField3(iprot); err != nil { 1599 | return err 1600 | } 1601 | } else { 1602 | if err := iprot.Skip(fieldTypeId); err != nil { 1603 | return err 1604 | } 1605 | } 1606 | case 4: 1607 | if fieldTypeId == thrift.MAP { 1608 | if err := p.ReadField4(iprot); err != nil { 1609 | return err 1610 | } 1611 | } else { 1612 | if err := iprot.Skip(fieldTypeId); err != nil { 1613 | return err 1614 | } 1615 | } 1616 | default: 1617 | if err := iprot.Skip(fieldTypeId); err != nil { 1618 | return err 1619 | } 1620 | } 1621 | if err := iprot.ReadFieldEnd(); err != nil { 1622 | return err 1623 | } 1624 | } 1625 | if err := iprot.ReadStructEnd(); err != nil { 1626 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 1627 | } 1628 | return nil 1629 | } 1630 | 1631 | func (p *QrCodeLoginResponse) ReadField1(iprot thrift.TProtocol) error { 1632 | if v, err := iprot.ReadString(); err != nil { 1633 | return thrift.PrependError("error reading field 1: ", err) 1634 | } else { 1635 | p.Certificate = v 1636 | } 1637 | return nil 1638 | } 1639 | 1640 | func (p *QrCodeLoginResponse) ReadField2(iprot thrift.TProtocol) error { 1641 | if v, err := iprot.ReadString(); err != nil { 1642 | return thrift.PrependError("error reading field 2: ", err) 1643 | } else { 1644 | p.AccessToken = v 1645 | } 1646 | return nil 1647 | } 1648 | 1649 | func (p *QrCodeLoginResponse) ReadField3(iprot thrift.TProtocol) error { 1650 | if v, err := iprot.ReadI64(); err != nil { 1651 | return thrift.PrependError("error reading field 3: ", err) 1652 | } else { 1653 | p.LastBindTimestamp = v 1654 | } 1655 | return nil 1656 | } 1657 | 1658 | func (p *QrCodeLoginResponse) ReadField4(iprot thrift.TProtocol) error { 1659 | _, _, size, err := iprot.ReadMapBegin() 1660 | if err != nil { 1661 | return thrift.PrependError("error reading map begin: ", err) 1662 | } 1663 | tMap := make(map[string]string, size) 1664 | p.MetaData = tMap 1665 | for i := 0; i < size; i++ { 1666 | var _key0 string 1667 | if v, err := iprot.ReadString(); err != nil { 1668 | return thrift.PrependError("error reading field 0: ", err) 1669 | } else { 1670 | _key0 = v 1671 | } 1672 | var _val1 string 1673 | if v, err := iprot.ReadString(); err != nil { 1674 | return thrift.PrependError("error reading field 0: ", err) 1675 | } else { 1676 | _val1 = v 1677 | } 1678 | p.MetaData[_key0] = _val1 1679 | } 1680 | if err := iprot.ReadMapEnd(); err != nil { 1681 | return thrift.PrependError("error reading map end: ", err) 1682 | } 1683 | return nil 1684 | } 1685 | 1686 | func (p *QrCodeLoginResponse) Write(oprot thrift.TProtocol) error { 1687 | if err := oprot.WriteStructBegin("QrCodeLoginResponse"); err != nil { 1688 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 1689 | } 1690 | if p != nil { 1691 | if err := p.writeField1(oprot); err != nil { 1692 | return err 1693 | } 1694 | if err := p.writeField2(oprot); err != nil { 1695 | return err 1696 | } 1697 | if err := p.writeField3(oprot); err != nil { 1698 | return err 1699 | } 1700 | if err := p.writeField4(oprot); err != nil { 1701 | return err 1702 | } 1703 | } 1704 | if err := oprot.WriteFieldStop(); err != nil { 1705 | return thrift.PrependError("write field stop error: ", err) 1706 | } 1707 | if err := oprot.WriteStructEnd(); err != nil { 1708 | return thrift.PrependError("write struct stop error: ", err) 1709 | } 1710 | return nil 1711 | } 1712 | 1713 | func (p *QrCodeLoginResponse) writeField1(oprot thrift.TProtocol) (err error) { 1714 | if err := oprot.WriteFieldBegin("certificate", thrift.STRING, 1); err != nil { 1715 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:certificate: ", p), err) 1716 | } 1717 | if err := oprot.WriteString(string(p.Certificate)); err != nil { 1718 | return thrift.PrependError(fmt.Sprintf("%T.certificate (1) field write error: ", p), err) 1719 | } 1720 | if err := oprot.WriteFieldEnd(); err != nil { 1721 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:certificate: ", p), err) 1722 | } 1723 | return err 1724 | } 1725 | 1726 | func (p *QrCodeLoginResponse) writeField2(oprot thrift.TProtocol) (err error) { 1727 | if err := oprot.WriteFieldBegin("accessToken", thrift.STRING, 2); err != nil { 1728 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:accessToken: ", p), err) 1729 | } 1730 | if err := oprot.WriteString(string(p.AccessToken)); err != nil { 1731 | return thrift.PrependError(fmt.Sprintf("%T.accessToken (2) field write error: ", p), err) 1732 | } 1733 | if err := oprot.WriteFieldEnd(); err != nil { 1734 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:accessToken: ", p), err) 1735 | } 1736 | return err 1737 | } 1738 | 1739 | func (p *QrCodeLoginResponse) writeField3(oprot thrift.TProtocol) (err error) { 1740 | if err := oprot.WriteFieldBegin("lastBindTimestamp", thrift.I64, 3); err != nil { 1741 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:lastBindTimestamp: ", p), err) 1742 | } 1743 | if err := oprot.WriteI64(int64(p.LastBindTimestamp)); err != nil { 1744 | return thrift.PrependError(fmt.Sprintf("%T.lastBindTimestamp (3) field write error: ", p), err) 1745 | } 1746 | if err := oprot.WriteFieldEnd(); err != nil { 1747 | return thrift.PrependError(fmt.Sprintf("%T write field end error 3:lastBindTimestamp: ", p), err) 1748 | } 1749 | return err 1750 | } 1751 | 1752 | func (p *QrCodeLoginResponse) writeField4(oprot thrift.TProtocol) (err error) { 1753 | if err := oprot.WriteFieldBegin("metaData", thrift.MAP, 4); err != nil { 1754 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:metaData: ", p), err) 1755 | } 1756 | if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.MetaData)); err != nil { 1757 | return thrift.PrependError("error writing map begin: ", err) 1758 | } 1759 | for k, v := range p.MetaData { 1760 | if err := oprot.WriteString(string(k)); err != nil { 1761 | return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) 1762 | } 1763 | if err := oprot.WriteString(string(v)); err != nil { 1764 | return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) 1765 | } 1766 | } 1767 | if err := oprot.WriteMapEnd(); err != nil { 1768 | return thrift.PrependError("error writing map end: ", err) 1769 | } 1770 | if err := oprot.WriteFieldEnd(); err != nil { 1771 | return thrift.PrependError(fmt.Sprintf("%T write field end error 4:metaData: ", p), err) 1772 | } 1773 | return err 1774 | } 1775 | 1776 | func (p *QrCodeLoginResponse) String() string { 1777 | if p == nil { 1778 | return "" 1779 | } 1780 | return fmt.Sprintf("QrCodeLoginResponse(%+v)", *p) 1781 | } 1782 | 1783 | type VerifyCertificateResponse struct { 1784 | } 1785 | 1786 | func NewVerifyCertificateResponse() *VerifyCertificateResponse { 1787 | return &VerifyCertificateResponse{} 1788 | } 1789 | 1790 | func (p *VerifyCertificateResponse) Read(iprot thrift.TProtocol) error { 1791 | if _, err := iprot.ReadStructBegin(); err != nil { 1792 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 1793 | } 1794 | 1795 | for { 1796 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 1797 | if err != nil { 1798 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 1799 | } 1800 | if fieldTypeId == thrift.STOP { 1801 | break 1802 | } 1803 | if err := iprot.Skip(fieldTypeId); err != nil { 1804 | return err 1805 | } 1806 | if err := iprot.ReadFieldEnd(); err != nil { 1807 | return err 1808 | } 1809 | } 1810 | if err := iprot.ReadStructEnd(); err != nil { 1811 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 1812 | } 1813 | return nil 1814 | } 1815 | 1816 | func (p *VerifyCertificateResponse) Write(oprot thrift.TProtocol) error { 1817 | if err := oprot.WriteStructBegin("VerifyCertificateResponse"); err != nil { 1818 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 1819 | } 1820 | if p != nil { 1821 | } 1822 | if err := oprot.WriteFieldStop(); err != nil { 1823 | return thrift.PrependError("write field stop error: ", err) 1824 | } 1825 | if err := oprot.WriteStructEnd(); err != nil { 1826 | return thrift.PrependError("write struct stop error: ", err) 1827 | } 1828 | return nil 1829 | } 1830 | 1831 | func (p *VerifyCertificateResponse) String() string { 1832 | if p == nil { 1833 | return "" 1834 | } 1835 | return fmt.Sprintf("VerifyCertificateResponse(%+v)", *p) 1836 | } 1837 | 1838 | // Attributes: 1839 | // - AuthSessionId 1840 | type CheckPinCodeVerifiedRequest struct { 1841 | AuthSessionId string `thrift:"authSessionId,1" db:"authSessionId" json:"authSessionId"` 1842 | } 1843 | 1844 | func NewCheckPinCodeVerifiedRequest() *CheckPinCodeVerifiedRequest { 1845 | return &CheckPinCodeVerifiedRequest{} 1846 | } 1847 | 1848 | func (p *CheckPinCodeVerifiedRequest) GetAuthSessionId() string { 1849 | return p.AuthSessionId 1850 | } 1851 | func (p *CheckPinCodeVerifiedRequest) Read(iprot thrift.TProtocol) error { 1852 | if _, err := iprot.ReadStructBegin(); err != nil { 1853 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 1854 | } 1855 | 1856 | for { 1857 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 1858 | if err != nil { 1859 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 1860 | } 1861 | if fieldTypeId == thrift.STOP { 1862 | break 1863 | } 1864 | switch fieldId { 1865 | case 1: 1866 | if fieldTypeId == thrift.STRING { 1867 | if err := p.ReadField1(iprot); err != nil { 1868 | return err 1869 | } 1870 | } else { 1871 | if err := iprot.Skip(fieldTypeId); err != nil { 1872 | return err 1873 | } 1874 | } 1875 | default: 1876 | if err := iprot.Skip(fieldTypeId); err != nil { 1877 | return err 1878 | } 1879 | } 1880 | if err := iprot.ReadFieldEnd(); err != nil { 1881 | return err 1882 | } 1883 | } 1884 | if err := iprot.ReadStructEnd(); err != nil { 1885 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 1886 | } 1887 | return nil 1888 | } 1889 | 1890 | func (p *CheckPinCodeVerifiedRequest) ReadField1(iprot thrift.TProtocol) error { 1891 | if v, err := iprot.ReadString(); err != nil { 1892 | return thrift.PrependError("error reading field 1: ", err) 1893 | } else { 1894 | p.AuthSessionId = v 1895 | } 1896 | return nil 1897 | } 1898 | 1899 | func (p *CheckPinCodeVerifiedRequest) Write(oprot thrift.TProtocol) error { 1900 | if err := oprot.WriteStructBegin("CheckPinCodeVerifiedRequest"); err != nil { 1901 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 1902 | } 1903 | if p != nil { 1904 | if err := p.writeField1(oprot); err != nil { 1905 | return err 1906 | } 1907 | } 1908 | if err := oprot.WriteFieldStop(); err != nil { 1909 | return thrift.PrependError("write field stop error: ", err) 1910 | } 1911 | if err := oprot.WriteStructEnd(); err != nil { 1912 | return thrift.PrependError("write struct stop error: ", err) 1913 | } 1914 | return nil 1915 | } 1916 | 1917 | func (p *CheckPinCodeVerifiedRequest) writeField1(oprot thrift.TProtocol) (err error) { 1918 | if err := oprot.WriteFieldBegin("authSessionId", thrift.STRING, 1); err != nil { 1919 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:authSessionId: ", p), err) 1920 | } 1921 | if err := oprot.WriteString(string(p.AuthSessionId)); err != nil { 1922 | return thrift.PrependError(fmt.Sprintf("%T.authSessionId (1) field write error: ", p), err) 1923 | } 1924 | if err := oprot.WriteFieldEnd(); err != nil { 1925 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:authSessionId: ", p), err) 1926 | } 1927 | return err 1928 | } 1929 | 1930 | func (p *CheckPinCodeVerifiedRequest) String() string { 1931 | if p == nil { 1932 | return "" 1933 | } 1934 | return fmt.Sprintf("CheckPinCodeVerifiedRequest(%+v)", *p) 1935 | } 1936 | 1937 | type CheckPinCodeVerifiedResponse struct { 1938 | } 1939 | 1940 | func NewCheckPinCodeVerifiedResponse() *CheckPinCodeVerifiedResponse { 1941 | return &CheckPinCodeVerifiedResponse{} 1942 | } 1943 | 1944 | func (p *CheckPinCodeVerifiedResponse) Read(iprot thrift.TProtocol) error { 1945 | if _, err := iprot.ReadStructBegin(); err != nil { 1946 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 1947 | } 1948 | 1949 | for { 1950 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 1951 | if err != nil { 1952 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 1953 | } 1954 | if fieldTypeId == thrift.STOP { 1955 | break 1956 | } 1957 | if err := iprot.Skip(fieldTypeId); err != nil { 1958 | return err 1959 | } 1960 | if err := iprot.ReadFieldEnd(); err != nil { 1961 | return err 1962 | } 1963 | } 1964 | if err := iprot.ReadStructEnd(); err != nil { 1965 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 1966 | } 1967 | return nil 1968 | } 1969 | 1970 | func (p *CheckPinCodeVerifiedResponse) Write(oprot thrift.TProtocol) error { 1971 | if err := oprot.WriteStructBegin("CheckPinCodeVerifiedResponse"); err != nil { 1972 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 1973 | } 1974 | if p != nil { 1975 | } 1976 | if err := oprot.WriteFieldStop(); err != nil { 1977 | return thrift.PrependError("write field stop error: ", err) 1978 | } 1979 | if err := oprot.WriteStructEnd(); err != nil { 1980 | return thrift.PrependError("write struct stop error: ", err) 1981 | } 1982 | return nil 1983 | } 1984 | 1985 | func (p *CheckPinCodeVerifiedResponse) String() string { 1986 | if p == nil { 1987 | return "" 1988 | } 1989 | return fmt.Sprintf("CheckPinCodeVerifiedResponse(%+v)", *p) 1990 | } 1991 | 1992 | // Attributes: 1993 | // - AuthSessionId 1994 | type CheckQrCodeVerifiedRequest struct { 1995 | AuthSessionId string `thrift:"authSessionId,1" db:"authSessionId" json:"authSessionId"` 1996 | } 1997 | 1998 | func NewCheckQrCodeVerifiedRequest() *CheckQrCodeVerifiedRequest { 1999 | return &CheckQrCodeVerifiedRequest{} 2000 | } 2001 | 2002 | func (p *CheckQrCodeVerifiedRequest) GetAuthSessionId() string { 2003 | return p.AuthSessionId 2004 | } 2005 | func (p *CheckQrCodeVerifiedRequest) Read(iprot thrift.TProtocol) error { 2006 | if _, err := iprot.ReadStructBegin(); err != nil { 2007 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 2008 | } 2009 | 2010 | for { 2011 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 2012 | if err != nil { 2013 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 2014 | } 2015 | if fieldTypeId == thrift.STOP { 2016 | break 2017 | } 2018 | switch fieldId { 2019 | case 1: 2020 | if fieldTypeId == thrift.STRING { 2021 | if err := p.ReadField1(iprot); err != nil { 2022 | return err 2023 | } 2024 | } else { 2025 | if err := iprot.Skip(fieldTypeId); err != nil { 2026 | return err 2027 | } 2028 | } 2029 | default: 2030 | if err := iprot.Skip(fieldTypeId); err != nil { 2031 | return err 2032 | } 2033 | } 2034 | if err := iprot.ReadFieldEnd(); err != nil { 2035 | return err 2036 | } 2037 | } 2038 | if err := iprot.ReadStructEnd(); err != nil { 2039 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 2040 | } 2041 | return nil 2042 | } 2043 | 2044 | func (p *CheckQrCodeVerifiedRequest) ReadField1(iprot thrift.TProtocol) error { 2045 | if v, err := iprot.ReadString(); err != nil { 2046 | return thrift.PrependError("error reading field 1: ", err) 2047 | } else { 2048 | p.AuthSessionId = v 2049 | } 2050 | return nil 2051 | } 2052 | 2053 | func (p *CheckQrCodeVerifiedRequest) Write(oprot thrift.TProtocol) error { 2054 | if err := oprot.WriteStructBegin("CheckQrCodeVerifiedRequest"); err != nil { 2055 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 2056 | } 2057 | if p != nil { 2058 | if err := p.writeField1(oprot); err != nil { 2059 | return err 2060 | } 2061 | } 2062 | if err := oprot.WriteFieldStop(); err != nil { 2063 | return thrift.PrependError("write field stop error: ", err) 2064 | } 2065 | if err := oprot.WriteStructEnd(); err != nil { 2066 | return thrift.PrependError("write struct stop error: ", err) 2067 | } 2068 | return nil 2069 | } 2070 | 2071 | func (p *CheckQrCodeVerifiedRequest) writeField1(oprot thrift.TProtocol) (err error) { 2072 | if err := oprot.WriteFieldBegin("authSessionId", thrift.STRING, 1); err != nil { 2073 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:authSessionId: ", p), err) 2074 | } 2075 | if err := oprot.WriteString(string(p.AuthSessionId)); err != nil { 2076 | return thrift.PrependError(fmt.Sprintf("%T.authSessionId (1) field write error: ", p), err) 2077 | } 2078 | if err := oprot.WriteFieldEnd(); err != nil { 2079 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:authSessionId: ", p), err) 2080 | } 2081 | return err 2082 | } 2083 | 2084 | func (p *CheckQrCodeVerifiedRequest) String() string { 2085 | if p == nil { 2086 | return "" 2087 | } 2088 | return fmt.Sprintf("CheckQrCodeVerifiedRequest(%+v)", *p) 2089 | } 2090 | 2091 | type CheckQrCodeVerifiedResponse struct { 2092 | } 2093 | 2094 | func NewCheckQrCodeVerifiedResponse() *CheckQrCodeVerifiedResponse { 2095 | return &CheckQrCodeVerifiedResponse{} 2096 | } 2097 | 2098 | func (p *CheckQrCodeVerifiedResponse) Read(iprot thrift.TProtocol) error { 2099 | if _, err := iprot.ReadStructBegin(); err != nil { 2100 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 2101 | } 2102 | 2103 | for { 2104 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 2105 | if err != nil { 2106 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 2107 | } 2108 | if fieldTypeId == thrift.STOP { 2109 | break 2110 | } 2111 | if err := iprot.Skip(fieldTypeId); err != nil { 2112 | return err 2113 | } 2114 | if err := iprot.ReadFieldEnd(); err != nil { 2115 | return err 2116 | } 2117 | } 2118 | if err := iprot.ReadStructEnd(); err != nil { 2119 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 2120 | } 2121 | return nil 2122 | } 2123 | 2124 | func (p *CheckQrCodeVerifiedResponse) Write(oprot thrift.TProtocol) error { 2125 | if err := oprot.WriteStructBegin("CheckQrCodeVerifiedResponse"); err != nil { 2126 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 2127 | } 2128 | if p != nil { 2129 | } 2130 | if err := oprot.WriteFieldStop(); err != nil { 2131 | return thrift.PrependError("write field stop error: ", err) 2132 | } 2133 | if err := oprot.WriteStructEnd(); err != nil { 2134 | return thrift.PrependError("write struct stop error: ", err) 2135 | } 2136 | return nil 2137 | } 2138 | 2139 | func (p *CheckQrCodeVerifiedResponse) String() string { 2140 | if p == nil { 2141 | return "" 2142 | } 2143 | return fmt.Sprintf("CheckQrCodeVerifiedResponse(%+v)", *p) 2144 | } 2145 | 2146 | type SecondaryQRCodeLoginService interface { 2147 | // Parameters: 2148 | // - Request 2149 | CancelPinCode(ctx context.Context, request *CancelPinCodeRequest) (r *CancelPinCodeResponse, err error) 2150 | // Parameters: 2151 | // - Request 2152 | VerifyPinCode(ctx context.Context, request *VerifyPinCodeRequest) (r *VerifyPinCodeResponse, err error) 2153 | // Parameters: 2154 | // - Request 2155 | VerifyQrCode(ctx context.Context, request *VerifyCertificateRequest) (r *VerifyQrCodeResponse, err error) 2156 | // Parameters: 2157 | // - Request 2158 | CreatePinCode(ctx context.Context, request *CreatePinCodeRequest) (r *CreatePinCodeResponse, err error) 2159 | // Parameters: 2160 | // - Request 2161 | CreateQrCode(ctx context.Context, request *CreateQrCodeRequest) (r *CreateQrCodeResponse, err error) 2162 | // Parameters: 2163 | // - Request 2164 | CreateSession(ctx context.Context, request *CreateQrSessionRequest) (r *CreateQrSessionResponse, err error) 2165 | // Parameters: 2166 | // - Request 2167 | QrCodeLogin(ctx context.Context, request *QrCodeLoginRequest) (r *QrCodeLoginResponse, err error) 2168 | // Parameters: 2169 | // - Request 2170 | VerifyCertificate(ctx context.Context, request *VerifyCertificateRequest) (r *VerifyCertificateResponse, err error) 2171 | // Parameters: 2172 | // - Request 2173 | CheckPinCodeVerified(ctx context.Context, request *CheckPinCodeVerifiedRequest) (r *CheckPinCodeVerifiedResponse, err error) 2174 | // Parameters: 2175 | // - Request 2176 | CheckQrCodeVerified(ctx context.Context, request *CheckQrCodeVerifiedRequest) (r *CheckQrCodeVerifiedResponse, err error) 2177 | } 2178 | 2179 | type SecondaryQRCodeLoginServiceClient struct { 2180 | c thrift.TClient 2181 | } 2182 | 2183 | func NewSecondaryQRCodeLoginServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *SecondaryQRCodeLoginServiceClient { 2184 | return &SecondaryQRCodeLoginServiceClient{ 2185 | c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), 2186 | } 2187 | } 2188 | 2189 | func NewSecondaryQRCodeLoginServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *SecondaryQRCodeLoginServiceClient { 2190 | return &SecondaryQRCodeLoginServiceClient{ 2191 | c: thrift.NewTStandardClient(iprot, oprot), 2192 | } 2193 | } 2194 | 2195 | func NewSecondaryQRCodeLoginServiceClient(c thrift.TClient) *SecondaryQRCodeLoginServiceClient { 2196 | return &SecondaryQRCodeLoginServiceClient{ 2197 | c: c, 2198 | } 2199 | } 2200 | 2201 | func (p *SecondaryQRCodeLoginServiceClient) Client_() thrift.TClient { 2202 | return p.c 2203 | } 2204 | 2205 | // Parameters: 2206 | // - Request 2207 | func (p *SecondaryQRCodeLoginServiceClient) CancelPinCode(ctx context.Context, request *CancelPinCodeRequest) (r *CancelPinCodeResponse, err error) { 2208 | var _args2 SecondaryQRCodeLoginServiceCancelPinCodeArgs 2209 | _args2.Request = request 2210 | var _result3 SecondaryQRCodeLoginServiceCancelPinCodeResult 2211 | if err = p.Client_().Call(ctx, "cancelPinCode", &_args2, &_result3); err != nil { 2212 | return 2213 | } 2214 | switch { 2215 | case _result3.E != nil: 2216 | return r, _result3.E 2217 | } 2218 | 2219 | return _result3.GetSuccess(), nil 2220 | } 2221 | 2222 | // Parameters: 2223 | // - Request 2224 | func (p *SecondaryQRCodeLoginServiceClient) VerifyPinCode(ctx context.Context, request *VerifyPinCodeRequest) (r *VerifyPinCodeResponse, err error) { 2225 | var _args4 SecondaryQRCodeLoginServiceVerifyPinCodeArgs 2226 | _args4.Request = request 2227 | var _result5 SecondaryQRCodeLoginServiceVerifyPinCodeResult 2228 | if err = p.Client_().Call(ctx, "verifyPinCode", &_args4, &_result5); err != nil { 2229 | return 2230 | } 2231 | switch { 2232 | case _result5.E != nil: 2233 | return r, _result5.E 2234 | } 2235 | 2236 | return _result5.GetSuccess(), nil 2237 | } 2238 | 2239 | // Parameters: 2240 | // - Request 2241 | func (p *SecondaryQRCodeLoginServiceClient) VerifyQrCode(ctx context.Context, request *VerifyCertificateRequest) (r *VerifyQrCodeResponse, err error) { 2242 | var _args6 SecondaryQRCodeLoginServiceVerifyQrCodeArgs 2243 | _args6.Request = request 2244 | var _result7 SecondaryQRCodeLoginServiceVerifyQrCodeResult 2245 | if err = p.Client_().Call(ctx, "verifyQrCode", &_args6, &_result7); err != nil { 2246 | return 2247 | } 2248 | switch { 2249 | case _result7.E != nil: 2250 | return r, _result7.E 2251 | } 2252 | 2253 | return _result7.GetSuccess(), nil 2254 | } 2255 | 2256 | // Parameters: 2257 | // - Request 2258 | func (p *SecondaryQRCodeLoginServiceClient) CreatePinCode(ctx context.Context, request *CreatePinCodeRequest) (r *CreatePinCodeResponse, err error) { 2259 | var _args8 SecondaryQRCodeLoginServiceCreatePinCodeArgs 2260 | _args8.Request = request 2261 | var _result9 SecondaryQRCodeLoginServiceCreatePinCodeResult 2262 | if err = p.Client_().Call(ctx, "createPinCode", &_args8, &_result9); err != nil { 2263 | return 2264 | } 2265 | switch { 2266 | case _result9.E != nil: 2267 | return r, _result9.E 2268 | } 2269 | 2270 | return _result9.GetSuccess(), nil 2271 | } 2272 | 2273 | // Parameters: 2274 | // - Request 2275 | func (p *SecondaryQRCodeLoginServiceClient) CreateQrCode(ctx context.Context, request *CreateQrCodeRequest) (r *CreateQrCodeResponse, err error) { 2276 | var _args10 SecondaryQRCodeLoginServiceCreateQrCodeArgs 2277 | _args10.Request = request 2278 | var _result11 SecondaryQRCodeLoginServiceCreateQrCodeResult 2279 | if err = p.Client_().Call(ctx, "createQrCode", &_args10, &_result11); err != nil { 2280 | return 2281 | } 2282 | switch { 2283 | case _result11.E != nil: 2284 | return r, _result11.E 2285 | } 2286 | 2287 | return _result11.GetSuccess(), nil 2288 | } 2289 | 2290 | // Parameters: 2291 | // - Request 2292 | func (p *SecondaryQRCodeLoginServiceClient) CreateSession(ctx context.Context, request *CreateQrSessionRequest) (r *CreateQrSessionResponse, err error) { 2293 | var _args12 SecondaryQRCodeLoginServiceCreateSessionArgs 2294 | _args12.Request = request 2295 | var _result13 SecondaryQRCodeLoginServiceCreateSessionResult 2296 | if err = p.Client_().Call(ctx, "createSession", &_args12, &_result13); err != nil { 2297 | return 2298 | } 2299 | switch { 2300 | case _result13.E != nil: 2301 | return r, _result13.E 2302 | } 2303 | 2304 | return _result13.GetSuccess(), nil 2305 | } 2306 | 2307 | // Parameters: 2308 | // - Request 2309 | func (p *SecondaryQRCodeLoginServiceClient) QrCodeLogin(ctx context.Context, request *QrCodeLoginRequest) (r *QrCodeLoginResponse, err error) { 2310 | var _args14 SecondaryQRCodeLoginServiceQrCodeLoginArgs 2311 | _args14.Request = request 2312 | var _result15 SecondaryQRCodeLoginServiceQrCodeLoginResult 2313 | if err = p.Client_().Call(ctx, "qrCodeLogin", &_args14, &_result15); err != nil { 2314 | return 2315 | } 2316 | switch { 2317 | case _result15.E != nil: 2318 | return r, _result15.E 2319 | } 2320 | 2321 | return _result15.GetSuccess(), nil 2322 | } 2323 | 2324 | // Parameters: 2325 | // - Request 2326 | func (p *SecondaryQRCodeLoginServiceClient) VerifyCertificate(ctx context.Context, request *VerifyCertificateRequest) (r *VerifyCertificateResponse, err error) { 2327 | var _args16 SecondaryQRCodeLoginServiceVerifyCertificateArgs 2328 | _args16.Request = request 2329 | var _result17 SecondaryQRCodeLoginServiceVerifyCertificateResult 2330 | if err = p.Client_().Call(ctx, "verifyCertificate", &_args16, &_result17); err != nil { 2331 | return 2332 | } 2333 | switch { 2334 | case _result17.E != nil: 2335 | return r, _result17.E 2336 | } 2337 | 2338 | return _result17.GetSuccess(), nil 2339 | } 2340 | 2341 | // Parameters: 2342 | // - Request 2343 | func (p *SecondaryQRCodeLoginServiceClient) CheckPinCodeVerified(ctx context.Context, request *CheckPinCodeVerifiedRequest) (r *CheckPinCodeVerifiedResponse, err error) { 2344 | var _args18 SecondaryQRCodeLoginServiceCheckPinCodeVerifiedArgs 2345 | _args18.Request = request 2346 | var _result19 SecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult 2347 | if err = p.Client_().Call(ctx, "checkPinCodeVerified", &_args18, &_result19); err != nil { 2348 | return 2349 | } 2350 | switch { 2351 | case _result19.E != nil: 2352 | return r, _result19.E 2353 | } 2354 | 2355 | return _result19.GetSuccess(), nil 2356 | } 2357 | 2358 | // Parameters: 2359 | // - Request 2360 | func (p *SecondaryQRCodeLoginServiceClient) CheckQrCodeVerified(ctx context.Context, request *CheckQrCodeVerifiedRequest) (r *CheckQrCodeVerifiedResponse, err error) { 2361 | var _args20 SecondaryQRCodeLoginServiceCheckQrCodeVerifiedArgs 2362 | _args20.Request = request 2363 | var _result21 SecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult 2364 | if err = p.Client_().Call(ctx, "checkQrCodeVerified", &_args20, &_result21); err != nil { 2365 | return 2366 | } 2367 | switch { 2368 | case _result21.E != nil: 2369 | return r, _result21.E 2370 | } 2371 | 2372 | return _result21.GetSuccess(), nil 2373 | } 2374 | 2375 | type SecondaryQRCodeLoginServiceProcessor struct { 2376 | processorMap map[string]thrift.TProcessorFunction 2377 | handler SecondaryQRCodeLoginService 2378 | } 2379 | 2380 | func (p *SecondaryQRCodeLoginServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { 2381 | p.processorMap[key] = processor 2382 | } 2383 | 2384 | func (p *SecondaryQRCodeLoginServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { 2385 | processor, ok = p.processorMap[key] 2386 | return processor, ok 2387 | } 2388 | 2389 | func (p *SecondaryQRCodeLoginServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { 2390 | return p.processorMap 2391 | } 2392 | 2393 | func NewSecondaryQRCodeLoginServiceProcessor(handler SecondaryQRCodeLoginService) *SecondaryQRCodeLoginServiceProcessor { 2394 | 2395 | self22 := &SecondaryQRCodeLoginServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} 2396 | self22.processorMap["cancelPinCode"] = &secondaryQRCodeLoginServiceProcessorCancelPinCode{handler: handler} 2397 | self22.processorMap["verifyPinCode"] = &secondaryQRCodeLoginServiceProcessorVerifyPinCode{handler: handler} 2398 | self22.processorMap["verifyQrCode"] = &secondaryQRCodeLoginServiceProcessorVerifyQrCode{handler: handler} 2399 | self22.processorMap["createPinCode"] = &secondaryQRCodeLoginServiceProcessorCreatePinCode{handler: handler} 2400 | self22.processorMap["createQrCode"] = &secondaryQRCodeLoginServiceProcessorCreateQrCode{handler: handler} 2401 | self22.processorMap["createSession"] = &secondaryQRCodeLoginServiceProcessorCreateSession{handler: handler} 2402 | self22.processorMap["qrCodeLogin"] = &secondaryQRCodeLoginServiceProcessorQrCodeLogin{handler: handler} 2403 | self22.processorMap["verifyCertificate"] = &secondaryQRCodeLoginServiceProcessorVerifyCertificate{handler: handler} 2404 | self22.processorMap["checkPinCodeVerified"] = &secondaryQRCodeLoginServiceProcessorCheckPinCodeVerified{handler: handler} 2405 | self22.processorMap["checkQrCodeVerified"] = &secondaryQRCodeLoginServiceProcessorCheckQrCodeVerified{handler: handler} 2406 | return self22 2407 | } 2408 | 2409 | func (p *SecondaryQRCodeLoginServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 2410 | name, _, seqId, err := iprot.ReadMessageBegin() 2411 | if err != nil { 2412 | return false, err 2413 | } 2414 | if processor, ok := p.GetProcessorFunction(name); ok { 2415 | return processor.Process(ctx, seqId, iprot, oprot) 2416 | } 2417 | iprot.Skip(thrift.STRUCT) 2418 | iprot.ReadMessageEnd() 2419 | x23 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) 2420 | oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) 2421 | x23.Write(oprot) 2422 | oprot.WriteMessageEnd() 2423 | oprot.Flush(ctx) 2424 | return false, x23 2425 | 2426 | } 2427 | 2428 | type secondaryQRCodeLoginServiceProcessorCancelPinCode struct { 2429 | handler SecondaryQRCodeLoginService 2430 | } 2431 | 2432 | func (p *secondaryQRCodeLoginServiceProcessorCancelPinCode) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 2433 | args := SecondaryQRCodeLoginServiceCancelPinCodeArgs{} 2434 | if err = args.Read(iprot); err != nil { 2435 | iprot.ReadMessageEnd() 2436 | x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) 2437 | oprot.WriteMessageBegin("cancelPinCode", thrift.EXCEPTION, seqId) 2438 | x.Write(oprot) 2439 | oprot.WriteMessageEnd() 2440 | oprot.Flush(ctx) 2441 | return false, err 2442 | } 2443 | 2444 | iprot.ReadMessageEnd() 2445 | result := SecondaryQRCodeLoginServiceCancelPinCodeResult{} 2446 | var retval *CancelPinCodeResponse 2447 | var err2 error 2448 | if retval, err2 = p.handler.CancelPinCode(ctx, args.Request); err2 != nil { 2449 | switch v := err2.(type) { 2450 | case *SecondaryQrCodeException: 2451 | result.E = v 2452 | default: 2453 | x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing cancelPinCode: "+err2.Error()) 2454 | oprot.WriteMessageBegin("cancelPinCode", thrift.EXCEPTION, seqId) 2455 | x.Write(oprot) 2456 | oprot.WriteMessageEnd() 2457 | oprot.Flush(ctx) 2458 | return true, err2 2459 | } 2460 | } else { 2461 | result.Success = retval 2462 | } 2463 | if err2 = oprot.WriteMessageBegin("cancelPinCode", thrift.REPLY, seqId); err2 != nil { 2464 | err = err2 2465 | } 2466 | if err2 = result.Write(oprot); err == nil && err2 != nil { 2467 | err = err2 2468 | } 2469 | if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { 2470 | err = err2 2471 | } 2472 | if err2 = oprot.Flush(ctx); err == nil && err2 != nil { 2473 | err = err2 2474 | } 2475 | if err != nil { 2476 | return 2477 | } 2478 | return true, err 2479 | } 2480 | 2481 | type secondaryQRCodeLoginServiceProcessorVerifyPinCode struct { 2482 | handler SecondaryQRCodeLoginService 2483 | } 2484 | 2485 | func (p *secondaryQRCodeLoginServiceProcessorVerifyPinCode) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 2486 | args := SecondaryQRCodeLoginServiceVerifyPinCodeArgs{} 2487 | if err = args.Read(iprot); err != nil { 2488 | iprot.ReadMessageEnd() 2489 | x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) 2490 | oprot.WriteMessageBegin("verifyPinCode", thrift.EXCEPTION, seqId) 2491 | x.Write(oprot) 2492 | oprot.WriteMessageEnd() 2493 | oprot.Flush(ctx) 2494 | return false, err 2495 | } 2496 | 2497 | iprot.ReadMessageEnd() 2498 | result := SecondaryQRCodeLoginServiceVerifyPinCodeResult{} 2499 | var retval *VerifyPinCodeResponse 2500 | var err2 error 2501 | if retval, err2 = p.handler.VerifyPinCode(ctx, args.Request); err2 != nil { 2502 | switch v := err2.(type) { 2503 | case *SecondaryQrCodeException: 2504 | result.E = v 2505 | default: 2506 | x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing verifyPinCode: "+err2.Error()) 2507 | oprot.WriteMessageBegin("verifyPinCode", thrift.EXCEPTION, seqId) 2508 | x.Write(oprot) 2509 | oprot.WriteMessageEnd() 2510 | oprot.Flush(ctx) 2511 | return true, err2 2512 | } 2513 | } else { 2514 | result.Success = retval 2515 | } 2516 | if err2 = oprot.WriteMessageBegin("verifyPinCode", thrift.REPLY, seqId); err2 != nil { 2517 | err = err2 2518 | } 2519 | if err2 = result.Write(oprot); err == nil && err2 != nil { 2520 | err = err2 2521 | } 2522 | if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { 2523 | err = err2 2524 | } 2525 | if err2 = oprot.Flush(ctx); err == nil && err2 != nil { 2526 | err = err2 2527 | } 2528 | if err != nil { 2529 | return 2530 | } 2531 | return true, err 2532 | } 2533 | 2534 | type secondaryQRCodeLoginServiceProcessorVerifyQrCode struct { 2535 | handler SecondaryQRCodeLoginService 2536 | } 2537 | 2538 | func (p *secondaryQRCodeLoginServiceProcessorVerifyQrCode) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 2539 | args := SecondaryQRCodeLoginServiceVerifyQrCodeArgs{} 2540 | if err = args.Read(iprot); err != nil { 2541 | iprot.ReadMessageEnd() 2542 | x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) 2543 | oprot.WriteMessageBegin("verifyQrCode", thrift.EXCEPTION, seqId) 2544 | x.Write(oprot) 2545 | oprot.WriteMessageEnd() 2546 | oprot.Flush(ctx) 2547 | return false, err 2548 | } 2549 | 2550 | iprot.ReadMessageEnd() 2551 | result := SecondaryQRCodeLoginServiceVerifyQrCodeResult{} 2552 | var retval *VerifyQrCodeResponse 2553 | var err2 error 2554 | if retval, err2 = p.handler.VerifyQrCode(ctx, args.Request); err2 != nil { 2555 | switch v := err2.(type) { 2556 | case *SecondaryQrCodeException: 2557 | result.E = v 2558 | default: 2559 | x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing verifyQrCode: "+err2.Error()) 2560 | oprot.WriteMessageBegin("verifyQrCode", thrift.EXCEPTION, seqId) 2561 | x.Write(oprot) 2562 | oprot.WriteMessageEnd() 2563 | oprot.Flush(ctx) 2564 | return true, err2 2565 | } 2566 | } else { 2567 | result.Success = retval 2568 | } 2569 | if err2 = oprot.WriteMessageBegin("verifyQrCode", thrift.REPLY, seqId); err2 != nil { 2570 | err = err2 2571 | } 2572 | if err2 = result.Write(oprot); err == nil && err2 != nil { 2573 | err = err2 2574 | } 2575 | if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { 2576 | err = err2 2577 | } 2578 | if err2 = oprot.Flush(ctx); err == nil && err2 != nil { 2579 | err = err2 2580 | } 2581 | if err != nil { 2582 | return 2583 | } 2584 | return true, err 2585 | } 2586 | 2587 | type secondaryQRCodeLoginServiceProcessorCreatePinCode struct { 2588 | handler SecondaryQRCodeLoginService 2589 | } 2590 | 2591 | func (p *secondaryQRCodeLoginServiceProcessorCreatePinCode) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 2592 | args := SecondaryQRCodeLoginServiceCreatePinCodeArgs{} 2593 | if err = args.Read(iprot); err != nil { 2594 | iprot.ReadMessageEnd() 2595 | x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) 2596 | oprot.WriteMessageBegin("createPinCode", thrift.EXCEPTION, seqId) 2597 | x.Write(oprot) 2598 | oprot.WriteMessageEnd() 2599 | oprot.Flush(ctx) 2600 | return false, err 2601 | } 2602 | 2603 | iprot.ReadMessageEnd() 2604 | result := SecondaryQRCodeLoginServiceCreatePinCodeResult{} 2605 | var retval *CreatePinCodeResponse 2606 | var err2 error 2607 | if retval, err2 = p.handler.CreatePinCode(ctx, args.Request); err2 != nil { 2608 | switch v := err2.(type) { 2609 | case *SecondaryQrCodeException: 2610 | result.E = v 2611 | default: 2612 | x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createPinCode: "+err2.Error()) 2613 | oprot.WriteMessageBegin("createPinCode", thrift.EXCEPTION, seqId) 2614 | x.Write(oprot) 2615 | oprot.WriteMessageEnd() 2616 | oprot.Flush(ctx) 2617 | return true, err2 2618 | } 2619 | } else { 2620 | result.Success = retval 2621 | } 2622 | if err2 = oprot.WriteMessageBegin("createPinCode", thrift.REPLY, seqId); err2 != nil { 2623 | err = err2 2624 | } 2625 | if err2 = result.Write(oprot); err == nil && err2 != nil { 2626 | err = err2 2627 | } 2628 | if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { 2629 | err = err2 2630 | } 2631 | if err2 = oprot.Flush(ctx); err == nil && err2 != nil { 2632 | err = err2 2633 | } 2634 | if err != nil { 2635 | return 2636 | } 2637 | return true, err 2638 | } 2639 | 2640 | type secondaryQRCodeLoginServiceProcessorCreateQrCode struct { 2641 | handler SecondaryQRCodeLoginService 2642 | } 2643 | 2644 | func (p *secondaryQRCodeLoginServiceProcessorCreateQrCode) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 2645 | args := SecondaryQRCodeLoginServiceCreateQrCodeArgs{} 2646 | if err = args.Read(iprot); err != nil { 2647 | iprot.ReadMessageEnd() 2648 | x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) 2649 | oprot.WriteMessageBegin("createQrCode", thrift.EXCEPTION, seqId) 2650 | x.Write(oprot) 2651 | oprot.WriteMessageEnd() 2652 | oprot.Flush(ctx) 2653 | return false, err 2654 | } 2655 | 2656 | iprot.ReadMessageEnd() 2657 | result := SecondaryQRCodeLoginServiceCreateQrCodeResult{} 2658 | var retval *CreateQrCodeResponse 2659 | var err2 error 2660 | if retval, err2 = p.handler.CreateQrCode(ctx, args.Request); err2 != nil { 2661 | switch v := err2.(type) { 2662 | case *SecondaryQrCodeException: 2663 | result.E = v 2664 | default: 2665 | x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createQrCode: "+err2.Error()) 2666 | oprot.WriteMessageBegin("createQrCode", thrift.EXCEPTION, seqId) 2667 | x.Write(oprot) 2668 | oprot.WriteMessageEnd() 2669 | oprot.Flush(ctx) 2670 | return true, err2 2671 | } 2672 | } else { 2673 | result.Success = retval 2674 | } 2675 | if err2 = oprot.WriteMessageBegin("createQrCode", thrift.REPLY, seqId); err2 != nil { 2676 | err = err2 2677 | } 2678 | if err2 = result.Write(oprot); err == nil && err2 != nil { 2679 | err = err2 2680 | } 2681 | if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { 2682 | err = err2 2683 | } 2684 | if err2 = oprot.Flush(ctx); err == nil && err2 != nil { 2685 | err = err2 2686 | } 2687 | if err != nil { 2688 | return 2689 | } 2690 | return true, err 2691 | } 2692 | 2693 | type secondaryQRCodeLoginServiceProcessorCreateSession struct { 2694 | handler SecondaryQRCodeLoginService 2695 | } 2696 | 2697 | func (p *secondaryQRCodeLoginServiceProcessorCreateSession) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 2698 | args := SecondaryQRCodeLoginServiceCreateSessionArgs{} 2699 | if err = args.Read(iprot); err != nil { 2700 | iprot.ReadMessageEnd() 2701 | x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) 2702 | oprot.WriteMessageBegin("createSession", thrift.EXCEPTION, seqId) 2703 | x.Write(oprot) 2704 | oprot.WriteMessageEnd() 2705 | oprot.Flush(ctx) 2706 | return false, err 2707 | } 2708 | 2709 | iprot.ReadMessageEnd() 2710 | result := SecondaryQRCodeLoginServiceCreateSessionResult{} 2711 | var retval *CreateQrSessionResponse 2712 | var err2 error 2713 | if retval, err2 = p.handler.CreateSession(ctx, args.Request); err2 != nil { 2714 | switch v := err2.(type) { 2715 | case *SecondaryQrCodeException: 2716 | result.E = v 2717 | default: 2718 | x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createSession: "+err2.Error()) 2719 | oprot.WriteMessageBegin("createSession", thrift.EXCEPTION, seqId) 2720 | x.Write(oprot) 2721 | oprot.WriteMessageEnd() 2722 | oprot.Flush(ctx) 2723 | return true, err2 2724 | } 2725 | } else { 2726 | result.Success = retval 2727 | } 2728 | if err2 = oprot.WriteMessageBegin("createSession", thrift.REPLY, seqId); err2 != nil { 2729 | err = err2 2730 | } 2731 | if err2 = result.Write(oprot); err == nil && err2 != nil { 2732 | err = err2 2733 | } 2734 | if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { 2735 | err = err2 2736 | } 2737 | if err2 = oprot.Flush(ctx); err == nil && err2 != nil { 2738 | err = err2 2739 | } 2740 | if err != nil { 2741 | return 2742 | } 2743 | return true, err 2744 | } 2745 | 2746 | type secondaryQRCodeLoginServiceProcessorQrCodeLogin struct { 2747 | handler SecondaryQRCodeLoginService 2748 | } 2749 | 2750 | func (p *secondaryQRCodeLoginServiceProcessorQrCodeLogin) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 2751 | args := SecondaryQRCodeLoginServiceQrCodeLoginArgs{} 2752 | if err = args.Read(iprot); err != nil { 2753 | iprot.ReadMessageEnd() 2754 | x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) 2755 | oprot.WriteMessageBegin("qrCodeLogin", thrift.EXCEPTION, seqId) 2756 | x.Write(oprot) 2757 | oprot.WriteMessageEnd() 2758 | oprot.Flush(ctx) 2759 | return false, err 2760 | } 2761 | 2762 | iprot.ReadMessageEnd() 2763 | result := SecondaryQRCodeLoginServiceQrCodeLoginResult{} 2764 | var retval *QrCodeLoginResponse 2765 | var err2 error 2766 | if retval, err2 = p.handler.QrCodeLogin(ctx, args.Request); err2 != nil { 2767 | switch v := err2.(type) { 2768 | case *SecondaryQrCodeException: 2769 | result.E = v 2770 | default: 2771 | x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing qrCodeLogin: "+err2.Error()) 2772 | oprot.WriteMessageBegin("qrCodeLogin", thrift.EXCEPTION, seqId) 2773 | x.Write(oprot) 2774 | oprot.WriteMessageEnd() 2775 | oprot.Flush(ctx) 2776 | return true, err2 2777 | } 2778 | } else { 2779 | result.Success = retval 2780 | } 2781 | if err2 = oprot.WriteMessageBegin("qrCodeLogin", thrift.REPLY, seqId); err2 != nil { 2782 | err = err2 2783 | } 2784 | if err2 = result.Write(oprot); err == nil && err2 != nil { 2785 | err = err2 2786 | } 2787 | if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { 2788 | err = err2 2789 | } 2790 | if err2 = oprot.Flush(ctx); err == nil && err2 != nil { 2791 | err = err2 2792 | } 2793 | if err != nil { 2794 | return 2795 | } 2796 | return true, err 2797 | } 2798 | 2799 | type secondaryQRCodeLoginServiceProcessorVerifyCertificate struct { 2800 | handler SecondaryQRCodeLoginService 2801 | } 2802 | 2803 | func (p *secondaryQRCodeLoginServiceProcessorVerifyCertificate) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 2804 | args := SecondaryQRCodeLoginServiceVerifyCertificateArgs{} 2805 | if err = args.Read(iprot); err != nil { 2806 | iprot.ReadMessageEnd() 2807 | x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) 2808 | oprot.WriteMessageBegin("verifyCertificate", thrift.EXCEPTION, seqId) 2809 | x.Write(oprot) 2810 | oprot.WriteMessageEnd() 2811 | oprot.Flush(ctx) 2812 | return false, err 2813 | } 2814 | 2815 | iprot.ReadMessageEnd() 2816 | result := SecondaryQRCodeLoginServiceVerifyCertificateResult{} 2817 | var retval *VerifyCertificateResponse 2818 | var err2 error 2819 | if retval, err2 = p.handler.VerifyCertificate(ctx, args.Request); err2 != nil { 2820 | switch v := err2.(type) { 2821 | case *SecondaryQrCodeException: 2822 | result.E = v 2823 | default: 2824 | x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing verifyCertificate: "+err2.Error()) 2825 | oprot.WriteMessageBegin("verifyCertificate", thrift.EXCEPTION, seqId) 2826 | x.Write(oprot) 2827 | oprot.WriteMessageEnd() 2828 | oprot.Flush(ctx) 2829 | return true, err2 2830 | } 2831 | } else { 2832 | result.Success = retval 2833 | } 2834 | if err2 = oprot.WriteMessageBegin("verifyCertificate", thrift.REPLY, seqId); err2 != nil { 2835 | err = err2 2836 | } 2837 | if err2 = result.Write(oprot); err == nil && err2 != nil { 2838 | err = err2 2839 | } 2840 | if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { 2841 | err = err2 2842 | } 2843 | if err2 = oprot.Flush(ctx); err == nil && err2 != nil { 2844 | err = err2 2845 | } 2846 | if err != nil { 2847 | return 2848 | } 2849 | return true, err 2850 | } 2851 | 2852 | type secondaryQRCodeLoginServiceProcessorCheckPinCodeVerified struct { 2853 | handler SecondaryQRCodeLoginService 2854 | } 2855 | 2856 | func (p *secondaryQRCodeLoginServiceProcessorCheckPinCodeVerified) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 2857 | args := SecondaryQRCodeLoginServiceCheckPinCodeVerifiedArgs{} 2858 | if err = args.Read(iprot); err != nil { 2859 | iprot.ReadMessageEnd() 2860 | x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) 2861 | oprot.WriteMessageBegin("checkPinCodeVerified", thrift.EXCEPTION, seqId) 2862 | x.Write(oprot) 2863 | oprot.WriteMessageEnd() 2864 | oprot.Flush(ctx) 2865 | return false, err 2866 | } 2867 | 2868 | iprot.ReadMessageEnd() 2869 | result := SecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult{} 2870 | var retval *CheckPinCodeVerifiedResponse 2871 | var err2 error 2872 | if retval, err2 = p.handler.CheckPinCodeVerified(ctx, args.Request); err2 != nil { 2873 | switch v := err2.(type) { 2874 | case *SecondaryQrCodeException: 2875 | result.E = v 2876 | default: 2877 | x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing checkPinCodeVerified: "+err2.Error()) 2878 | oprot.WriteMessageBegin("checkPinCodeVerified", thrift.EXCEPTION, seqId) 2879 | x.Write(oprot) 2880 | oprot.WriteMessageEnd() 2881 | oprot.Flush(ctx) 2882 | return true, err2 2883 | } 2884 | } else { 2885 | result.Success = retval 2886 | } 2887 | if err2 = oprot.WriteMessageBegin("checkPinCodeVerified", thrift.REPLY, seqId); err2 != nil { 2888 | err = err2 2889 | } 2890 | if err2 = result.Write(oprot); err == nil && err2 != nil { 2891 | err = err2 2892 | } 2893 | if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { 2894 | err = err2 2895 | } 2896 | if err2 = oprot.Flush(ctx); err == nil && err2 != nil { 2897 | err = err2 2898 | } 2899 | if err != nil { 2900 | return 2901 | } 2902 | return true, err 2903 | } 2904 | 2905 | type secondaryQRCodeLoginServiceProcessorCheckQrCodeVerified struct { 2906 | handler SecondaryQRCodeLoginService 2907 | } 2908 | 2909 | func (p *secondaryQRCodeLoginServiceProcessorCheckQrCodeVerified) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 2910 | args := SecondaryQRCodeLoginServiceCheckQrCodeVerifiedArgs{} 2911 | if err = args.Read(iprot); err != nil { 2912 | iprot.ReadMessageEnd() 2913 | x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) 2914 | oprot.WriteMessageBegin("checkQrCodeVerified", thrift.EXCEPTION, seqId) 2915 | x.Write(oprot) 2916 | oprot.WriteMessageEnd() 2917 | oprot.Flush(ctx) 2918 | return false, err 2919 | } 2920 | 2921 | iprot.ReadMessageEnd() 2922 | result := SecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult{} 2923 | var retval *CheckQrCodeVerifiedResponse 2924 | var err2 error 2925 | if retval, err2 = p.handler.CheckQrCodeVerified(ctx, args.Request); err2 != nil { 2926 | switch v := err2.(type) { 2927 | case *SecondaryQrCodeException: 2928 | result.E = v 2929 | default: 2930 | x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing checkQrCodeVerified: "+err2.Error()) 2931 | oprot.WriteMessageBegin("checkQrCodeVerified", thrift.EXCEPTION, seqId) 2932 | x.Write(oprot) 2933 | oprot.WriteMessageEnd() 2934 | oprot.Flush(ctx) 2935 | return true, err2 2936 | } 2937 | } else { 2938 | result.Success = retval 2939 | } 2940 | if err2 = oprot.WriteMessageBegin("checkQrCodeVerified", thrift.REPLY, seqId); err2 != nil { 2941 | err = err2 2942 | } 2943 | if err2 = result.Write(oprot); err == nil && err2 != nil { 2944 | err = err2 2945 | } 2946 | if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { 2947 | err = err2 2948 | } 2949 | if err2 = oprot.Flush(ctx); err == nil && err2 != nil { 2950 | err = err2 2951 | } 2952 | if err != nil { 2953 | return 2954 | } 2955 | return true, err 2956 | } 2957 | 2958 | // HELPER FUNCTIONS AND STRUCTURES 2959 | 2960 | // Attributes: 2961 | // - Request 2962 | type SecondaryQRCodeLoginServiceCancelPinCodeArgs struct { 2963 | Request *CancelPinCodeRequest `thrift:"request,1" db:"request" json:"request"` 2964 | } 2965 | 2966 | func NewSecondaryQRCodeLoginServiceCancelPinCodeArgs() *SecondaryQRCodeLoginServiceCancelPinCodeArgs { 2967 | return &SecondaryQRCodeLoginServiceCancelPinCodeArgs{} 2968 | } 2969 | 2970 | var SecondaryQRCodeLoginServiceCancelPinCodeArgs_Request_DEFAULT *CancelPinCodeRequest 2971 | 2972 | func (p *SecondaryQRCodeLoginServiceCancelPinCodeArgs) GetRequest() *CancelPinCodeRequest { 2973 | if !p.IsSetRequest() { 2974 | return SecondaryQRCodeLoginServiceCancelPinCodeArgs_Request_DEFAULT 2975 | } 2976 | return p.Request 2977 | } 2978 | func (p *SecondaryQRCodeLoginServiceCancelPinCodeArgs) IsSetRequest() bool { 2979 | return p.Request != nil 2980 | } 2981 | 2982 | func (p *SecondaryQRCodeLoginServiceCancelPinCodeArgs) Read(iprot thrift.TProtocol) error { 2983 | if _, err := iprot.ReadStructBegin(); err != nil { 2984 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 2985 | } 2986 | 2987 | for { 2988 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 2989 | if err != nil { 2990 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 2991 | } 2992 | if fieldTypeId == thrift.STOP { 2993 | break 2994 | } 2995 | switch fieldId { 2996 | case 1: 2997 | if fieldTypeId == thrift.STRUCT { 2998 | if err := p.ReadField1(iprot); err != nil { 2999 | return err 3000 | } 3001 | } else { 3002 | if err := iprot.Skip(fieldTypeId); err != nil { 3003 | return err 3004 | } 3005 | } 3006 | default: 3007 | if err := iprot.Skip(fieldTypeId); err != nil { 3008 | return err 3009 | } 3010 | } 3011 | if err := iprot.ReadFieldEnd(); err != nil { 3012 | return err 3013 | } 3014 | } 3015 | if err := iprot.ReadStructEnd(); err != nil { 3016 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 3017 | } 3018 | return nil 3019 | } 3020 | 3021 | func (p *SecondaryQRCodeLoginServiceCancelPinCodeArgs) ReadField1(iprot thrift.TProtocol) error { 3022 | p.Request = &CancelPinCodeRequest{} 3023 | if err := p.Request.Read(iprot); err != nil { 3024 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) 3025 | } 3026 | return nil 3027 | } 3028 | 3029 | func (p *SecondaryQRCodeLoginServiceCancelPinCodeArgs) Write(oprot thrift.TProtocol) error { 3030 | if err := oprot.WriteStructBegin("cancelPinCode_args"); err != nil { 3031 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 3032 | } 3033 | if p != nil { 3034 | if err := p.writeField1(oprot); err != nil { 3035 | return err 3036 | } 3037 | } 3038 | if err := oprot.WriteFieldStop(); err != nil { 3039 | return thrift.PrependError("write field stop error: ", err) 3040 | } 3041 | if err := oprot.WriteStructEnd(); err != nil { 3042 | return thrift.PrependError("write struct stop error: ", err) 3043 | } 3044 | return nil 3045 | } 3046 | 3047 | func (p *SecondaryQRCodeLoginServiceCancelPinCodeArgs) writeField1(oprot thrift.TProtocol) (err error) { 3048 | if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { 3049 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err) 3050 | } 3051 | if err := p.Request.Write(oprot); err != nil { 3052 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err) 3053 | } 3054 | if err := oprot.WriteFieldEnd(); err != nil { 3055 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err) 3056 | } 3057 | return err 3058 | } 3059 | 3060 | func (p *SecondaryQRCodeLoginServiceCancelPinCodeArgs) String() string { 3061 | if p == nil { 3062 | return "" 3063 | } 3064 | return fmt.Sprintf("SecondaryQRCodeLoginServiceCancelPinCodeArgs(%+v)", *p) 3065 | } 3066 | 3067 | // Attributes: 3068 | // - Success 3069 | // - E 3070 | type SecondaryQRCodeLoginServiceCancelPinCodeResult struct { 3071 | Success *CancelPinCodeResponse `thrift:"success,0" db:"success" json:"success,omitempty"` 3072 | E *SecondaryQrCodeException `thrift:"e,1" db:"e" json:"e,omitempty"` 3073 | } 3074 | 3075 | func NewSecondaryQRCodeLoginServiceCancelPinCodeResult() *SecondaryQRCodeLoginServiceCancelPinCodeResult { 3076 | return &SecondaryQRCodeLoginServiceCancelPinCodeResult{} 3077 | } 3078 | 3079 | var SecondaryQRCodeLoginServiceCancelPinCodeResult_Success_DEFAULT *CancelPinCodeResponse 3080 | 3081 | func (p *SecondaryQRCodeLoginServiceCancelPinCodeResult) GetSuccess() *CancelPinCodeResponse { 3082 | if !p.IsSetSuccess() { 3083 | return SecondaryQRCodeLoginServiceCancelPinCodeResult_Success_DEFAULT 3084 | } 3085 | return p.Success 3086 | } 3087 | 3088 | var SecondaryQRCodeLoginServiceCancelPinCodeResult_E_DEFAULT *SecondaryQrCodeException 3089 | 3090 | func (p *SecondaryQRCodeLoginServiceCancelPinCodeResult) GetE() *SecondaryQrCodeException { 3091 | if !p.IsSetE() { 3092 | return SecondaryQRCodeLoginServiceCancelPinCodeResult_E_DEFAULT 3093 | } 3094 | return p.E 3095 | } 3096 | func (p *SecondaryQRCodeLoginServiceCancelPinCodeResult) IsSetSuccess() bool { 3097 | return p.Success != nil 3098 | } 3099 | 3100 | func (p *SecondaryQRCodeLoginServiceCancelPinCodeResult) IsSetE() bool { 3101 | return p.E != nil 3102 | } 3103 | 3104 | func (p *SecondaryQRCodeLoginServiceCancelPinCodeResult) Read(iprot thrift.TProtocol) error { 3105 | if _, err := iprot.ReadStructBegin(); err != nil { 3106 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 3107 | } 3108 | 3109 | for { 3110 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 3111 | if err != nil { 3112 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 3113 | } 3114 | if fieldTypeId == thrift.STOP { 3115 | break 3116 | } 3117 | switch fieldId { 3118 | case 0: 3119 | if fieldTypeId == thrift.STRUCT { 3120 | if err := p.ReadField0(iprot); err != nil { 3121 | return err 3122 | } 3123 | } else { 3124 | if err := iprot.Skip(fieldTypeId); err != nil { 3125 | return err 3126 | } 3127 | } 3128 | case 1: 3129 | if fieldTypeId == thrift.STRUCT { 3130 | if err := p.ReadField1(iprot); err != nil { 3131 | return err 3132 | } 3133 | } else { 3134 | if err := iprot.Skip(fieldTypeId); err != nil { 3135 | return err 3136 | } 3137 | } 3138 | default: 3139 | if err := iprot.Skip(fieldTypeId); err != nil { 3140 | return err 3141 | } 3142 | } 3143 | if err := iprot.ReadFieldEnd(); err != nil { 3144 | return err 3145 | } 3146 | } 3147 | if err := iprot.ReadStructEnd(); err != nil { 3148 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 3149 | } 3150 | return nil 3151 | } 3152 | 3153 | func (p *SecondaryQRCodeLoginServiceCancelPinCodeResult) ReadField0(iprot thrift.TProtocol) error { 3154 | p.Success = &CancelPinCodeResponse{} 3155 | if err := p.Success.Read(iprot); err != nil { 3156 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) 3157 | } 3158 | return nil 3159 | } 3160 | 3161 | func (p *SecondaryQRCodeLoginServiceCancelPinCodeResult) ReadField1(iprot thrift.TProtocol) error { 3162 | p.E = &SecondaryQrCodeException{} 3163 | if err := p.E.Read(iprot); err != nil { 3164 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err) 3165 | } 3166 | return nil 3167 | } 3168 | 3169 | func (p *SecondaryQRCodeLoginServiceCancelPinCodeResult) Write(oprot thrift.TProtocol) error { 3170 | if err := oprot.WriteStructBegin("cancelPinCode_result"); err != nil { 3171 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 3172 | } 3173 | if p != nil { 3174 | if err := p.writeField0(oprot); err != nil { 3175 | return err 3176 | } 3177 | if err := p.writeField1(oprot); err != nil { 3178 | return err 3179 | } 3180 | } 3181 | if err := oprot.WriteFieldStop(); err != nil { 3182 | return thrift.PrependError("write field stop error: ", err) 3183 | } 3184 | if err := oprot.WriteStructEnd(); err != nil { 3185 | return thrift.PrependError("write struct stop error: ", err) 3186 | } 3187 | return nil 3188 | } 3189 | 3190 | func (p *SecondaryQRCodeLoginServiceCancelPinCodeResult) writeField0(oprot thrift.TProtocol) (err error) { 3191 | if p.IsSetSuccess() { 3192 | if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { 3193 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) 3194 | } 3195 | if err := p.Success.Write(oprot); err != nil { 3196 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) 3197 | } 3198 | if err := oprot.WriteFieldEnd(); err != nil { 3199 | return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) 3200 | } 3201 | } 3202 | return err 3203 | } 3204 | 3205 | func (p *SecondaryQRCodeLoginServiceCancelPinCodeResult) writeField1(oprot thrift.TProtocol) (err error) { 3206 | if p.IsSetE() { 3207 | if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { 3208 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) 3209 | } 3210 | if err := p.E.Write(oprot); err != nil { 3211 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err) 3212 | } 3213 | if err := oprot.WriteFieldEnd(); err != nil { 3214 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) 3215 | } 3216 | } 3217 | return err 3218 | } 3219 | 3220 | func (p *SecondaryQRCodeLoginServiceCancelPinCodeResult) String() string { 3221 | if p == nil { 3222 | return "" 3223 | } 3224 | return fmt.Sprintf("SecondaryQRCodeLoginServiceCancelPinCodeResult(%+v)", *p) 3225 | } 3226 | 3227 | // Attributes: 3228 | // - Request 3229 | type SecondaryQRCodeLoginServiceVerifyPinCodeArgs struct { 3230 | Request *VerifyPinCodeRequest `thrift:"request,1" db:"request" json:"request"` 3231 | } 3232 | 3233 | func NewSecondaryQRCodeLoginServiceVerifyPinCodeArgs() *SecondaryQRCodeLoginServiceVerifyPinCodeArgs { 3234 | return &SecondaryQRCodeLoginServiceVerifyPinCodeArgs{} 3235 | } 3236 | 3237 | var SecondaryQRCodeLoginServiceVerifyPinCodeArgs_Request_DEFAULT *VerifyPinCodeRequest 3238 | 3239 | func (p *SecondaryQRCodeLoginServiceVerifyPinCodeArgs) GetRequest() *VerifyPinCodeRequest { 3240 | if !p.IsSetRequest() { 3241 | return SecondaryQRCodeLoginServiceVerifyPinCodeArgs_Request_DEFAULT 3242 | } 3243 | return p.Request 3244 | } 3245 | func (p *SecondaryQRCodeLoginServiceVerifyPinCodeArgs) IsSetRequest() bool { 3246 | return p.Request != nil 3247 | } 3248 | 3249 | func (p *SecondaryQRCodeLoginServiceVerifyPinCodeArgs) Read(iprot thrift.TProtocol) error { 3250 | if _, err := iprot.ReadStructBegin(); err != nil { 3251 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 3252 | } 3253 | 3254 | for { 3255 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 3256 | if err != nil { 3257 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 3258 | } 3259 | if fieldTypeId == thrift.STOP { 3260 | break 3261 | } 3262 | switch fieldId { 3263 | case 1: 3264 | if fieldTypeId == thrift.STRUCT { 3265 | if err := p.ReadField1(iprot); err != nil { 3266 | return err 3267 | } 3268 | } else { 3269 | if err := iprot.Skip(fieldTypeId); err != nil { 3270 | return err 3271 | } 3272 | } 3273 | default: 3274 | if err := iprot.Skip(fieldTypeId); err != nil { 3275 | return err 3276 | } 3277 | } 3278 | if err := iprot.ReadFieldEnd(); err != nil { 3279 | return err 3280 | } 3281 | } 3282 | if err := iprot.ReadStructEnd(); err != nil { 3283 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 3284 | } 3285 | return nil 3286 | } 3287 | 3288 | func (p *SecondaryQRCodeLoginServiceVerifyPinCodeArgs) ReadField1(iprot thrift.TProtocol) error { 3289 | p.Request = &VerifyPinCodeRequest{} 3290 | if err := p.Request.Read(iprot); err != nil { 3291 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) 3292 | } 3293 | return nil 3294 | } 3295 | 3296 | func (p *SecondaryQRCodeLoginServiceVerifyPinCodeArgs) Write(oprot thrift.TProtocol) error { 3297 | if err := oprot.WriteStructBegin("verifyPinCode_args"); err != nil { 3298 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 3299 | } 3300 | if p != nil { 3301 | if err := p.writeField1(oprot); err != nil { 3302 | return err 3303 | } 3304 | } 3305 | if err := oprot.WriteFieldStop(); err != nil { 3306 | return thrift.PrependError("write field stop error: ", err) 3307 | } 3308 | if err := oprot.WriteStructEnd(); err != nil { 3309 | return thrift.PrependError("write struct stop error: ", err) 3310 | } 3311 | return nil 3312 | } 3313 | 3314 | func (p *SecondaryQRCodeLoginServiceVerifyPinCodeArgs) writeField1(oprot thrift.TProtocol) (err error) { 3315 | if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { 3316 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err) 3317 | } 3318 | if err := p.Request.Write(oprot); err != nil { 3319 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err) 3320 | } 3321 | if err := oprot.WriteFieldEnd(); err != nil { 3322 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err) 3323 | } 3324 | return err 3325 | } 3326 | 3327 | func (p *SecondaryQRCodeLoginServiceVerifyPinCodeArgs) String() string { 3328 | if p == nil { 3329 | return "" 3330 | } 3331 | return fmt.Sprintf("SecondaryQRCodeLoginServiceVerifyPinCodeArgs(%+v)", *p) 3332 | } 3333 | 3334 | // Attributes: 3335 | // - Success 3336 | // - E 3337 | type SecondaryQRCodeLoginServiceVerifyPinCodeResult struct { 3338 | Success *VerifyPinCodeResponse `thrift:"success,0" db:"success" json:"success,omitempty"` 3339 | E *SecondaryQrCodeException `thrift:"e,1" db:"e" json:"e,omitempty"` 3340 | } 3341 | 3342 | func NewSecondaryQRCodeLoginServiceVerifyPinCodeResult() *SecondaryQRCodeLoginServiceVerifyPinCodeResult { 3343 | return &SecondaryQRCodeLoginServiceVerifyPinCodeResult{} 3344 | } 3345 | 3346 | var SecondaryQRCodeLoginServiceVerifyPinCodeResult_Success_DEFAULT *VerifyPinCodeResponse 3347 | 3348 | func (p *SecondaryQRCodeLoginServiceVerifyPinCodeResult) GetSuccess() *VerifyPinCodeResponse { 3349 | if !p.IsSetSuccess() { 3350 | return SecondaryQRCodeLoginServiceVerifyPinCodeResult_Success_DEFAULT 3351 | } 3352 | return p.Success 3353 | } 3354 | 3355 | var SecondaryQRCodeLoginServiceVerifyPinCodeResult_E_DEFAULT *SecondaryQrCodeException 3356 | 3357 | func (p *SecondaryQRCodeLoginServiceVerifyPinCodeResult) GetE() *SecondaryQrCodeException { 3358 | if !p.IsSetE() { 3359 | return SecondaryQRCodeLoginServiceVerifyPinCodeResult_E_DEFAULT 3360 | } 3361 | return p.E 3362 | } 3363 | func (p *SecondaryQRCodeLoginServiceVerifyPinCodeResult) IsSetSuccess() bool { 3364 | return p.Success != nil 3365 | } 3366 | 3367 | func (p *SecondaryQRCodeLoginServiceVerifyPinCodeResult) IsSetE() bool { 3368 | return p.E != nil 3369 | } 3370 | 3371 | func (p *SecondaryQRCodeLoginServiceVerifyPinCodeResult) Read(iprot thrift.TProtocol) error { 3372 | if _, err := iprot.ReadStructBegin(); err != nil { 3373 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 3374 | } 3375 | 3376 | for { 3377 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 3378 | if err != nil { 3379 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 3380 | } 3381 | if fieldTypeId == thrift.STOP { 3382 | break 3383 | } 3384 | switch fieldId { 3385 | case 0: 3386 | if fieldTypeId == thrift.STRUCT { 3387 | if err := p.ReadField0(iprot); err != nil { 3388 | return err 3389 | } 3390 | } else { 3391 | if err := iprot.Skip(fieldTypeId); err != nil { 3392 | return err 3393 | } 3394 | } 3395 | case 1: 3396 | if fieldTypeId == thrift.STRUCT { 3397 | if err := p.ReadField1(iprot); err != nil { 3398 | return err 3399 | } 3400 | } else { 3401 | if err := iprot.Skip(fieldTypeId); err != nil { 3402 | return err 3403 | } 3404 | } 3405 | default: 3406 | if err := iprot.Skip(fieldTypeId); err != nil { 3407 | return err 3408 | } 3409 | } 3410 | if err := iprot.ReadFieldEnd(); err != nil { 3411 | return err 3412 | } 3413 | } 3414 | if err := iprot.ReadStructEnd(); err != nil { 3415 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 3416 | } 3417 | return nil 3418 | } 3419 | 3420 | func (p *SecondaryQRCodeLoginServiceVerifyPinCodeResult) ReadField0(iprot thrift.TProtocol) error { 3421 | p.Success = &VerifyPinCodeResponse{} 3422 | if err := p.Success.Read(iprot); err != nil { 3423 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) 3424 | } 3425 | return nil 3426 | } 3427 | 3428 | func (p *SecondaryQRCodeLoginServiceVerifyPinCodeResult) ReadField1(iprot thrift.TProtocol) error { 3429 | p.E = &SecondaryQrCodeException{} 3430 | if err := p.E.Read(iprot); err != nil { 3431 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err) 3432 | } 3433 | return nil 3434 | } 3435 | 3436 | func (p *SecondaryQRCodeLoginServiceVerifyPinCodeResult) Write(oprot thrift.TProtocol) error { 3437 | if err := oprot.WriteStructBegin("verifyPinCode_result"); err != nil { 3438 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 3439 | } 3440 | if p != nil { 3441 | if err := p.writeField0(oprot); err != nil { 3442 | return err 3443 | } 3444 | if err := p.writeField1(oprot); err != nil { 3445 | return err 3446 | } 3447 | } 3448 | if err := oprot.WriteFieldStop(); err != nil { 3449 | return thrift.PrependError("write field stop error: ", err) 3450 | } 3451 | if err := oprot.WriteStructEnd(); err != nil { 3452 | return thrift.PrependError("write struct stop error: ", err) 3453 | } 3454 | return nil 3455 | } 3456 | 3457 | func (p *SecondaryQRCodeLoginServiceVerifyPinCodeResult) writeField0(oprot thrift.TProtocol) (err error) { 3458 | if p.IsSetSuccess() { 3459 | if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { 3460 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) 3461 | } 3462 | if err := p.Success.Write(oprot); err != nil { 3463 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) 3464 | } 3465 | if err := oprot.WriteFieldEnd(); err != nil { 3466 | return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) 3467 | } 3468 | } 3469 | return err 3470 | } 3471 | 3472 | func (p *SecondaryQRCodeLoginServiceVerifyPinCodeResult) writeField1(oprot thrift.TProtocol) (err error) { 3473 | if p.IsSetE() { 3474 | if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { 3475 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) 3476 | } 3477 | if err := p.E.Write(oprot); err != nil { 3478 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err) 3479 | } 3480 | if err := oprot.WriteFieldEnd(); err != nil { 3481 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) 3482 | } 3483 | } 3484 | return err 3485 | } 3486 | 3487 | func (p *SecondaryQRCodeLoginServiceVerifyPinCodeResult) String() string { 3488 | if p == nil { 3489 | return "" 3490 | } 3491 | return fmt.Sprintf("SecondaryQRCodeLoginServiceVerifyPinCodeResult(%+v)", *p) 3492 | } 3493 | 3494 | // Attributes: 3495 | // - Request 3496 | type SecondaryQRCodeLoginServiceVerifyQrCodeArgs struct { 3497 | Request *VerifyCertificateRequest `thrift:"request,1" db:"request" json:"request"` 3498 | } 3499 | 3500 | func NewSecondaryQRCodeLoginServiceVerifyQrCodeArgs() *SecondaryQRCodeLoginServiceVerifyQrCodeArgs { 3501 | return &SecondaryQRCodeLoginServiceVerifyQrCodeArgs{} 3502 | } 3503 | 3504 | var SecondaryQRCodeLoginServiceVerifyQrCodeArgs_Request_DEFAULT *VerifyCertificateRequest 3505 | 3506 | func (p *SecondaryQRCodeLoginServiceVerifyQrCodeArgs) GetRequest() *VerifyCertificateRequest { 3507 | if !p.IsSetRequest() { 3508 | return SecondaryQRCodeLoginServiceVerifyQrCodeArgs_Request_DEFAULT 3509 | } 3510 | return p.Request 3511 | } 3512 | func (p *SecondaryQRCodeLoginServiceVerifyQrCodeArgs) IsSetRequest() bool { 3513 | return p.Request != nil 3514 | } 3515 | 3516 | func (p *SecondaryQRCodeLoginServiceVerifyQrCodeArgs) Read(iprot thrift.TProtocol) error { 3517 | if _, err := iprot.ReadStructBegin(); err != nil { 3518 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 3519 | } 3520 | 3521 | for { 3522 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 3523 | if err != nil { 3524 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 3525 | } 3526 | if fieldTypeId == thrift.STOP { 3527 | break 3528 | } 3529 | switch fieldId { 3530 | case 1: 3531 | if fieldTypeId == thrift.STRUCT { 3532 | if err := p.ReadField1(iprot); err != nil { 3533 | return err 3534 | } 3535 | } else { 3536 | if err := iprot.Skip(fieldTypeId); err != nil { 3537 | return err 3538 | } 3539 | } 3540 | default: 3541 | if err := iprot.Skip(fieldTypeId); err != nil { 3542 | return err 3543 | } 3544 | } 3545 | if err := iprot.ReadFieldEnd(); err != nil { 3546 | return err 3547 | } 3548 | } 3549 | if err := iprot.ReadStructEnd(); err != nil { 3550 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 3551 | } 3552 | return nil 3553 | } 3554 | 3555 | func (p *SecondaryQRCodeLoginServiceVerifyQrCodeArgs) ReadField1(iprot thrift.TProtocol) error { 3556 | p.Request = &VerifyCertificateRequest{} 3557 | if err := p.Request.Read(iprot); err != nil { 3558 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) 3559 | } 3560 | return nil 3561 | } 3562 | 3563 | func (p *SecondaryQRCodeLoginServiceVerifyQrCodeArgs) Write(oprot thrift.TProtocol) error { 3564 | if err := oprot.WriteStructBegin("verifyQrCode_args"); err != nil { 3565 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 3566 | } 3567 | if p != nil { 3568 | if err := p.writeField1(oprot); err != nil { 3569 | return err 3570 | } 3571 | } 3572 | if err := oprot.WriteFieldStop(); err != nil { 3573 | return thrift.PrependError("write field stop error: ", err) 3574 | } 3575 | if err := oprot.WriteStructEnd(); err != nil { 3576 | return thrift.PrependError("write struct stop error: ", err) 3577 | } 3578 | return nil 3579 | } 3580 | 3581 | func (p *SecondaryQRCodeLoginServiceVerifyQrCodeArgs) writeField1(oprot thrift.TProtocol) (err error) { 3582 | if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { 3583 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err) 3584 | } 3585 | if err := p.Request.Write(oprot); err != nil { 3586 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err) 3587 | } 3588 | if err := oprot.WriteFieldEnd(); err != nil { 3589 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err) 3590 | } 3591 | return err 3592 | } 3593 | 3594 | func (p *SecondaryQRCodeLoginServiceVerifyQrCodeArgs) String() string { 3595 | if p == nil { 3596 | return "" 3597 | } 3598 | return fmt.Sprintf("SecondaryQRCodeLoginServiceVerifyQrCodeArgs(%+v)", *p) 3599 | } 3600 | 3601 | // Attributes: 3602 | // - Success 3603 | // - E 3604 | type SecondaryQRCodeLoginServiceVerifyQrCodeResult struct { 3605 | Success *VerifyQrCodeResponse `thrift:"success,0" db:"success" json:"success,omitempty"` 3606 | E *SecondaryQrCodeException `thrift:"e,1" db:"e" json:"e,omitempty"` 3607 | } 3608 | 3609 | func NewSecondaryQRCodeLoginServiceVerifyQrCodeResult() *SecondaryQRCodeLoginServiceVerifyQrCodeResult { 3610 | return &SecondaryQRCodeLoginServiceVerifyQrCodeResult{} 3611 | } 3612 | 3613 | var SecondaryQRCodeLoginServiceVerifyQrCodeResult_Success_DEFAULT *VerifyQrCodeResponse 3614 | 3615 | func (p *SecondaryQRCodeLoginServiceVerifyQrCodeResult) GetSuccess() *VerifyQrCodeResponse { 3616 | if !p.IsSetSuccess() { 3617 | return SecondaryQRCodeLoginServiceVerifyQrCodeResult_Success_DEFAULT 3618 | } 3619 | return p.Success 3620 | } 3621 | 3622 | var SecondaryQRCodeLoginServiceVerifyQrCodeResult_E_DEFAULT *SecondaryQrCodeException 3623 | 3624 | func (p *SecondaryQRCodeLoginServiceVerifyQrCodeResult) GetE() *SecondaryQrCodeException { 3625 | if !p.IsSetE() { 3626 | return SecondaryQRCodeLoginServiceVerifyQrCodeResult_E_DEFAULT 3627 | } 3628 | return p.E 3629 | } 3630 | func (p *SecondaryQRCodeLoginServiceVerifyQrCodeResult) IsSetSuccess() bool { 3631 | return p.Success != nil 3632 | } 3633 | 3634 | func (p *SecondaryQRCodeLoginServiceVerifyQrCodeResult) IsSetE() bool { 3635 | return p.E != nil 3636 | } 3637 | 3638 | func (p *SecondaryQRCodeLoginServiceVerifyQrCodeResult) Read(iprot thrift.TProtocol) error { 3639 | if _, err := iprot.ReadStructBegin(); err != nil { 3640 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 3641 | } 3642 | 3643 | for { 3644 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 3645 | if err != nil { 3646 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 3647 | } 3648 | if fieldTypeId == thrift.STOP { 3649 | break 3650 | } 3651 | switch fieldId { 3652 | case 0: 3653 | if fieldTypeId == thrift.STRUCT { 3654 | if err := p.ReadField0(iprot); err != nil { 3655 | return err 3656 | } 3657 | } else { 3658 | if err := iprot.Skip(fieldTypeId); err != nil { 3659 | return err 3660 | } 3661 | } 3662 | case 1: 3663 | if fieldTypeId == thrift.STRUCT { 3664 | if err := p.ReadField1(iprot); err != nil { 3665 | return err 3666 | } 3667 | } else { 3668 | if err := iprot.Skip(fieldTypeId); err != nil { 3669 | return err 3670 | } 3671 | } 3672 | default: 3673 | if err := iprot.Skip(fieldTypeId); err != nil { 3674 | return err 3675 | } 3676 | } 3677 | if err := iprot.ReadFieldEnd(); err != nil { 3678 | return err 3679 | } 3680 | } 3681 | if err := iprot.ReadStructEnd(); err != nil { 3682 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 3683 | } 3684 | return nil 3685 | } 3686 | 3687 | func (p *SecondaryQRCodeLoginServiceVerifyQrCodeResult) ReadField0(iprot thrift.TProtocol) error { 3688 | p.Success = &VerifyQrCodeResponse{} 3689 | if err := p.Success.Read(iprot); err != nil { 3690 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) 3691 | } 3692 | return nil 3693 | } 3694 | 3695 | func (p *SecondaryQRCodeLoginServiceVerifyQrCodeResult) ReadField1(iprot thrift.TProtocol) error { 3696 | p.E = &SecondaryQrCodeException{} 3697 | if err := p.E.Read(iprot); err != nil { 3698 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err) 3699 | } 3700 | return nil 3701 | } 3702 | 3703 | func (p *SecondaryQRCodeLoginServiceVerifyQrCodeResult) Write(oprot thrift.TProtocol) error { 3704 | if err := oprot.WriteStructBegin("verifyQrCode_result"); err != nil { 3705 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 3706 | } 3707 | if p != nil { 3708 | if err := p.writeField0(oprot); err != nil { 3709 | return err 3710 | } 3711 | if err := p.writeField1(oprot); err != nil { 3712 | return err 3713 | } 3714 | } 3715 | if err := oprot.WriteFieldStop(); err != nil { 3716 | return thrift.PrependError("write field stop error: ", err) 3717 | } 3718 | if err := oprot.WriteStructEnd(); err != nil { 3719 | return thrift.PrependError("write struct stop error: ", err) 3720 | } 3721 | return nil 3722 | } 3723 | 3724 | func (p *SecondaryQRCodeLoginServiceVerifyQrCodeResult) writeField0(oprot thrift.TProtocol) (err error) { 3725 | if p.IsSetSuccess() { 3726 | if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { 3727 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) 3728 | } 3729 | if err := p.Success.Write(oprot); err != nil { 3730 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) 3731 | } 3732 | if err := oprot.WriteFieldEnd(); err != nil { 3733 | return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) 3734 | } 3735 | } 3736 | return err 3737 | } 3738 | 3739 | func (p *SecondaryQRCodeLoginServiceVerifyQrCodeResult) writeField1(oprot thrift.TProtocol) (err error) { 3740 | if p.IsSetE() { 3741 | if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { 3742 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) 3743 | } 3744 | if err := p.E.Write(oprot); err != nil { 3745 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err) 3746 | } 3747 | if err := oprot.WriteFieldEnd(); err != nil { 3748 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) 3749 | } 3750 | } 3751 | return err 3752 | } 3753 | 3754 | func (p *SecondaryQRCodeLoginServiceVerifyQrCodeResult) String() string { 3755 | if p == nil { 3756 | return "" 3757 | } 3758 | return fmt.Sprintf("SecondaryQRCodeLoginServiceVerifyQrCodeResult(%+v)", *p) 3759 | } 3760 | 3761 | // Attributes: 3762 | // - Request 3763 | type SecondaryQRCodeLoginServiceCreatePinCodeArgs struct { 3764 | Request *CreatePinCodeRequest `thrift:"request,1" db:"request" json:"request"` 3765 | } 3766 | 3767 | func NewSecondaryQRCodeLoginServiceCreatePinCodeArgs() *SecondaryQRCodeLoginServiceCreatePinCodeArgs { 3768 | return &SecondaryQRCodeLoginServiceCreatePinCodeArgs{} 3769 | } 3770 | 3771 | var SecondaryQRCodeLoginServiceCreatePinCodeArgs_Request_DEFAULT *CreatePinCodeRequest 3772 | 3773 | func (p *SecondaryQRCodeLoginServiceCreatePinCodeArgs) GetRequest() *CreatePinCodeRequest { 3774 | if !p.IsSetRequest() { 3775 | return SecondaryQRCodeLoginServiceCreatePinCodeArgs_Request_DEFAULT 3776 | } 3777 | return p.Request 3778 | } 3779 | func (p *SecondaryQRCodeLoginServiceCreatePinCodeArgs) IsSetRequest() bool { 3780 | return p.Request != nil 3781 | } 3782 | 3783 | func (p *SecondaryQRCodeLoginServiceCreatePinCodeArgs) Read(iprot thrift.TProtocol) error { 3784 | if _, err := iprot.ReadStructBegin(); err != nil { 3785 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 3786 | } 3787 | 3788 | for { 3789 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 3790 | if err != nil { 3791 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 3792 | } 3793 | if fieldTypeId == thrift.STOP { 3794 | break 3795 | } 3796 | switch fieldId { 3797 | case 1: 3798 | if fieldTypeId == thrift.STRUCT { 3799 | if err := p.ReadField1(iprot); err != nil { 3800 | return err 3801 | } 3802 | } else { 3803 | if err := iprot.Skip(fieldTypeId); err != nil { 3804 | return err 3805 | } 3806 | } 3807 | default: 3808 | if err := iprot.Skip(fieldTypeId); err != nil { 3809 | return err 3810 | } 3811 | } 3812 | if err := iprot.ReadFieldEnd(); err != nil { 3813 | return err 3814 | } 3815 | } 3816 | if err := iprot.ReadStructEnd(); err != nil { 3817 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 3818 | } 3819 | return nil 3820 | } 3821 | 3822 | func (p *SecondaryQRCodeLoginServiceCreatePinCodeArgs) ReadField1(iprot thrift.TProtocol) error { 3823 | p.Request = &CreatePinCodeRequest{} 3824 | if err := p.Request.Read(iprot); err != nil { 3825 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) 3826 | } 3827 | return nil 3828 | } 3829 | 3830 | func (p *SecondaryQRCodeLoginServiceCreatePinCodeArgs) Write(oprot thrift.TProtocol) error { 3831 | if err := oprot.WriteStructBegin("createPinCode_args"); err != nil { 3832 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 3833 | } 3834 | if p != nil { 3835 | if err := p.writeField1(oprot); err != nil { 3836 | return err 3837 | } 3838 | } 3839 | if err := oprot.WriteFieldStop(); err != nil { 3840 | return thrift.PrependError("write field stop error: ", err) 3841 | } 3842 | if err := oprot.WriteStructEnd(); err != nil { 3843 | return thrift.PrependError("write struct stop error: ", err) 3844 | } 3845 | return nil 3846 | } 3847 | 3848 | func (p *SecondaryQRCodeLoginServiceCreatePinCodeArgs) writeField1(oprot thrift.TProtocol) (err error) { 3849 | if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { 3850 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err) 3851 | } 3852 | if err := p.Request.Write(oprot); err != nil { 3853 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err) 3854 | } 3855 | if err := oprot.WriteFieldEnd(); err != nil { 3856 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err) 3857 | } 3858 | return err 3859 | } 3860 | 3861 | func (p *SecondaryQRCodeLoginServiceCreatePinCodeArgs) String() string { 3862 | if p == nil { 3863 | return "" 3864 | } 3865 | return fmt.Sprintf("SecondaryQRCodeLoginServiceCreatePinCodeArgs(%+v)", *p) 3866 | } 3867 | 3868 | // Attributes: 3869 | // - Success 3870 | // - E 3871 | type SecondaryQRCodeLoginServiceCreatePinCodeResult struct { 3872 | Success *CreatePinCodeResponse `thrift:"success,0" db:"success" json:"success,omitempty"` 3873 | E *SecondaryQrCodeException `thrift:"e,1" db:"e" json:"e,omitempty"` 3874 | } 3875 | 3876 | func NewSecondaryQRCodeLoginServiceCreatePinCodeResult() *SecondaryQRCodeLoginServiceCreatePinCodeResult { 3877 | return &SecondaryQRCodeLoginServiceCreatePinCodeResult{} 3878 | } 3879 | 3880 | var SecondaryQRCodeLoginServiceCreatePinCodeResult_Success_DEFAULT *CreatePinCodeResponse 3881 | 3882 | func (p *SecondaryQRCodeLoginServiceCreatePinCodeResult) GetSuccess() *CreatePinCodeResponse { 3883 | if !p.IsSetSuccess() { 3884 | return SecondaryQRCodeLoginServiceCreatePinCodeResult_Success_DEFAULT 3885 | } 3886 | return p.Success 3887 | } 3888 | 3889 | var SecondaryQRCodeLoginServiceCreatePinCodeResult_E_DEFAULT *SecondaryQrCodeException 3890 | 3891 | func (p *SecondaryQRCodeLoginServiceCreatePinCodeResult) GetE() *SecondaryQrCodeException { 3892 | if !p.IsSetE() { 3893 | return SecondaryQRCodeLoginServiceCreatePinCodeResult_E_DEFAULT 3894 | } 3895 | return p.E 3896 | } 3897 | func (p *SecondaryQRCodeLoginServiceCreatePinCodeResult) IsSetSuccess() bool { 3898 | return p.Success != nil 3899 | } 3900 | 3901 | func (p *SecondaryQRCodeLoginServiceCreatePinCodeResult) IsSetE() bool { 3902 | return p.E != nil 3903 | } 3904 | 3905 | func (p *SecondaryQRCodeLoginServiceCreatePinCodeResult) Read(iprot thrift.TProtocol) error { 3906 | if _, err := iprot.ReadStructBegin(); err != nil { 3907 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 3908 | } 3909 | 3910 | for { 3911 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 3912 | if err != nil { 3913 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 3914 | } 3915 | if fieldTypeId == thrift.STOP { 3916 | break 3917 | } 3918 | switch fieldId { 3919 | case 0: 3920 | if fieldTypeId == thrift.STRUCT { 3921 | if err := p.ReadField0(iprot); err != nil { 3922 | return err 3923 | } 3924 | } else { 3925 | if err := iprot.Skip(fieldTypeId); err != nil { 3926 | return err 3927 | } 3928 | } 3929 | case 1: 3930 | if fieldTypeId == thrift.STRUCT { 3931 | if err := p.ReadField1(iprot); err != nil { 3932 | return err 3933 | } 3934 | } else { 3935 | if err := iprot.Skip(fieldTypeId); err != nil { 3936 | return err 3937 | } 3938 | } 3939 | default: 3940 | if err := iprot.Skip(fieldTypeId); err != nil { 3941 | return err 3942 | } 3943 | } 3944 | if err := iprot.ReadFieldEnd(); err != nil { 3945 | return err 3946 | } 3947 | } 3948 | if err := iprot.ReadStructEnd(); err != nil { 3949 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 3950 | } 3951 | return nil 3952 | } 3953 | 3954 | func (p *SecondaryQRCodeLoginServiceCreatePinCodeResult) ReadField0(iprot thrift.TProtocol) error { 3955 | p.Success = &CreatePinCodeResponse{} 3956 | if err := p.Success.Read(iprot); err != nil { 3957 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) 3958 | } 3959 | return nil 3960 | } 3961 | 3962 | func (p *SecondaryQRCodeLoginServiceCreatePinCodeResult) ReadField1(iprot thrift.TProtocol) error { 3963 | p.E = &SecondaryQrCodeException{} 3964 | if err := p.E.Read(iprot); err != nil { 3965 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err) 3966 | } 3967 | return nil 3968 | } 3969 | 3970 | func (p *SecondaryQRCodeLoginServiceCreatePinCodeResult) Write(oprot thrift.TProtocol) error { 3971 | if err := oprot.WriteStructBegin("createPinCode_result"); err != nil { 3972 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 3973 | } 3974 | if p != nil { 3975 | if err := p.writeField0(oprot); err != nil { 3976 | return err 3977 | } 3978 | if err := p.writeField1(oprot); err != nil { 3979 | return err 3980 | } 3981 | } 3982 | if err := oprot.WriteFieldStop(); err != nil { 3983 | return thrift.PrependError("write field stop error: ", err) 3984 | } 3985 | if err := oprot.WriteStructEnd(); err != nil { 3986 | return thrift.PrependError("write struct stop error: ", err) 3987 | } 3988 | return nil 3989 | } 3990 | 3991 | func (p *SecondaryQRCodeLoginServiceCreatePinCodeResult) writeField0(oprot thrift.TProtocol) (err error) { 3992 | if p.IsSetSuccess() { 3993 | if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { 3994 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) 3995 | } 3996 | if err := p.Success.Write(oprot); err != nil { 3997 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) 3998 | } 3999 | if err := oprot.WriteFieldEnd(); err != nil { 4000 | return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) 4001 | } 4002 | } 4003 | return err 4004 | } 4005 | 4006 | func (p *SecondaryQRCodeLoginServiceCreatePinCodeResult) writeField1(oprot thrift.TProtocol) (err error) { 4007 | if p.IsSetE() { 4008 | if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { 4009 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) 4010 | } 4011 | if err := p.E.Write(oprot); err != nil { 4012 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err) 4013 | } 4014 | if err := oprot.WriteFieldEnd(); err != nil { 4015 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) 4016 | } 4017 | } 4018 | return err 4019 | } 4020 | 4021 | func (p *SecondaryQRCodeLoginServiceCreatePinCodeResult) String() string { 4022 | if p == nil { 4023 | return "" 4024 | } 4025 | return fmt.Sprintf("SecondaryQRCodeLoginServiceCreatePinCodeResult(%+v)", *p) 4026 | } 4027 | 4028 | // Attributes: 4029 | // - Request 4030 | type SecondaryQRCodeLoginServiceCreateQrCodeArgs struct { 4031 | Request *CreateQrCodeRequest `thrift:"request,1" db:"request" json:"request"` 4032 | } 4033 | 4034 | func NewSecondaryQRCodeLoginServiceCreateQrCodeArgs() *SecondaryQRCodeLoginServiceCreateQrCodeArgs { 4035 | return &SecondaryQRCodeLoginServiceCreateQrCodeArgs{} 4036 | } 4037 | 4038 | var SecondaryQRCodeLoginServiceCreateQrCodeArgs_Request_DEFAULT *CreateQrCodeRequest 4039 | 4040 | func (p *SecondaryQRCodeLoginServiceCreateQrCodeArgs) GetRequest() *CreateQrCodeRequest { 4041 | if !p.IsSetRequest() { 4042 | return SecondaryQRCodeLoginServiceCreateQrCodeArgs_Request_DEFAULT 4043 | } 4044 | return p.Request 4045 | } 4046 | func (p *SecondaryQRCodeLoginServiceCreateQrCodeArgs) IsSetRequest() bool { 4047 | return p.Request != nil 4048 | } 4049 | 4050 | func (p *SecondaryQRCodeLoginServiceCreateQrCodeArgs) Read(iprot thrift.TProtocol) error { 4051 | if _, err := iprot.ReadStructBegin(); err != nil { 4052 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 4053 | } 4054 | 4055 | for { 4056 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 4057 | if err != nil { 4058 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 4059 | } 4060 | if fieldTypeId == thrift.STOP { 4061 | break 4062 | } 4063 | switch fieldId { 4064 | case 1: 4065 | if fieldTypeId == thrift.STRUCT { 4066 | if err := p.ReadField1(iprot); err != nil { 4067 | return err 4068 | } 4069 | } else { 4070 | if err := iprot.Skip(fieldTypeId); err != nil { 4071 | return err 4072 | } 4073 | } 4074 | default: 4075 | if err := iprot.Skip(fieldTypeId); err != nil { 4076 | return err 4077 | } 4078 | } 4079 | if err := iprot.ReadFieldEnd(); err != nil { 4080 | return err 4081 | } 4082 | } 4083 | if err := iprot.ReadStructEnd(); err != nil { 4084 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 4085 | } 4086 | return nil 4087 | } 4088 | 4089 | func (p *SecondaryQRCodeLoginServiceCreateQrCodeArgs) ReadField1(iprot thrift.TProtocol) error { 4090 | p.Request = &CreateQrCodeRequest{} 4091 | if err := p.Request.Read(iprot); err != nil { 4092 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) 4093 | } 4094 | return nil 4095 | } 4096 | 4097 | func (p *SecondaryQRCodeLoginServiceCreateQrCodeArgs) Write(oprot thrift.TProtocol) error { 4098 | if err := oprot.WriteStructBegin("createQrCode_args"); err != nil { 4099 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 4100 | } 4101 | if p != nil { 4102 | if err := p.writeField1(oprot); err != nil { 4103 | return err 4104 | } 4105 | } 4106 | if err := oprot.WriteFieldStop(); err != nil { 4107 | return thrift.PrependError("write field stop error: ", err) 4108 | } 4109 | if err := oprot.WriteStructEnd(); err != nil { 4110 | return thrift.PrependError("write struct stop error: ", err) 4111 | } 4112 | return nil 4113 | } 4114 | 4115 | func (p *SecondaryQRCodeLoginServiceCreateQrCodeArgs) writeField1(oprot thrift.TProtocol) (err error) { 4116 | if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { 4117 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err) 4118 | } 4119 | if err := p.Request.Write(oprot); err != nil { 4120 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err) 4121 | } 4122 | if err := oprot.WriteFieldEnd(); err != nil { 4123 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err) 4124 | } 4125 | return err 4126 | } 4127 | 4128 | func (p *SecondaryQRCodeLoginServiceCreateQrCodeArgs) String() string { 4129 | if p == nil { 4130 | return "" 4131 | } 4132 | return fmt.Sprintf("SecondaryQRCodeLoginServiceCreateQrCodeArgs(%+v)", *p) 4133 | } 4134 | 4135 | // Attributes: 4136 | // - Success 4137 | // - E 4138 | type SecondaryQRCodeLoginServiceCreateQrCodeResult struct { 4139 | Success *CreateQrCodeResponse `thrift:"success,0" db:"success" json:"success,omitempty"` 4140 | E *SecondaryQrCodeException `thrift:"e,1" db:"e" json:"e,omitempty"` 4141 | } 4142 | 4143 | func NewSecondaryQRCodeLoginServiceCreateQrCodeResult() *SecondaryQRCodeLoginServiceCreateQrCodeResult { 4144 | return &SecondaryQRCodeLoginServiceCreateQrCodeResult{} 4145 | } 4146 | 4147 | var SecondaryQRCodeLoginServiceCreateQrCodeResult_Success_DEFAULT *CreateQrCodeResponse 4148 | 4149 | func (p *SecondaryQRCodeLoginServiceCreateQrCodeResult) GetSuccess() *CreateQrCodeResponse { 4150 | if !p.IsSetSuccess() { 4151 | return SecondaryQRCodeLoginServiceCreateQrCodeResult_Success_DEFAULT 4152 | } 4153 | return p.Success 4154 | } 4155 | 4156 | var SecondaryQRCodeLoginServiceCreateQrCodeResult_E_DEFAULT *SecondaryQrCodeException 4157 | 4158 | func (p *SecondaryQRCodeLoginServiceCreateQrCodeResult) GetE() *SecondaryQrCodeException { 4159 | if !p.IsSetE() { 4160 | return SecondaryQRCodeLoginServiceCreateQrCodeResult_E_DEFAULT 4161 | } 4162 | return p.E 4163 | } 4164 | func (p *SecondaryQRCodeLoginServiceCreateQrCodeResult) IsSetSuccess() bool { 4165 | return p.Success != nil 4166 | } 4167 | 4168 | func (p *SecondaryQRCodeLoginServiceCreateQrCodeResult) IsSetE() bool { 4169 | return p.E != nil 4170 | } 4171 | 4172 | func (p *SecondaryQRCodeLoginServiceCreateQrCodeResult) Read(iprot thrift.TProtocol) error { 4173 | if _, err := iprot.ReadStructBegin(); err != nil { 4174 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 4175 | } 4176 | 4177 | for { 4178 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 4179 | if err != nil { 4180 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 4181 | } 4182 | if fieldTypeId == thrift.STOP { 4183 | break 4184 | } 4185 | switch fieldId { 4186 | case 0: 4187 | if fieldTypeId == thrift.STRUCT { 4188 | if err := p.ReadField0(iprot); err != nil { 4189 | return err 4190 | } 4191 | } else { 4192 | if err := iprot.Skip(fieldTypeId); err != nil { 4193 | return err 4194 | } 4195 | } 4196 | case 1: 4197 | if fieldTypeId == thrift.STRUCT { 4198 | if err := p.ReadField1(iprot); err != nil { 4199 | return err 4200 | } 4201 | } else { 4202 | if err := iprot.Skip(fieldTypeId); err != nil { 4203 | return err 4204 | } 4205 | } 4206 | default: 4207 | if err := iprot.Skip(fieldTypeId); err != nil { 4208 | return err 4209 | } 4210 | } 4211 | if err := iprot.ReadFieldEnd(); err != nil { 4212 | return err 4213 | } 4214 | } 4215 | if err := iprot.ReadStructEnd(); err != nil { 4216 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 4217 | } 4218 | return nil 4219 | } 4220 | 4221 | func (p *SecondaryQRCodeLoginServiceCreateQrCodeResult) ReadField0(iprot thrift.TProtocol) error { 4222 | p.Success = &CreateQrCodeResponse{} 4223 | if err := p.Success.Read(iprot); err != nil { 4224 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) 4225 | } 4226 | return nil 4227 | } 4228 | 4229 | func (p *SecondaryQRCodeLoginServiceCreateQrCodeResult) ReadField1(iprot thrift.TProtocol) error { 4230 | p.E = &SecondaryQrCodeException{} 4231 | if err := p.E.Read(iprot); err != nil { 4232 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err) 4233 | } 4234 | return nil 4235 | } 4236 | 4237 | func (p *SecondaryQRCodeLoginServiceCreateQrCodeResult) Write(oprot thrift.TProtocol) error { 4238 | if err := oprot.WriteStructBegin("createQrCode_result"); err != nil { 4239 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 4240 | } 4241 | if p != nil { 4242 | if err := p.writeField0(oprot); err != nil { 4243 | return err 4244 | } 4245 | if err := p.writeField1(oprot); err != nil { 4246 | return err 4247 | } 4248 | } 4249 | if err := oprot.WriteFieldStop(); err != nil { 4250 | return thrift.PrependError("write field stop error: ", err) 4251 | } 4252 | if err := oprot.WriteStructEnd(); err != nil { 4253 | return thrift.PrependError("write struct stop error: ", err) 4254 | } 4255 | return nil 4256 | } 4257 | 4258 | func (p *SecondaryQRCodeLoginServiceCreateQrCodeResult) writeField0(oprot thrift.TProtocol) (err error) { 4259 | if p.IsSetSuccess() { 4260 | if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { 4261 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) 4262 | } 4263 | if err := p.Success.Write(oprot); err != nil { 4264 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) 4265 | } 4266 | if err := oprot.WriteFieldEnd(); err != nil { 4267 | return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) 4268 | } 4269 | } 4270 | return err 4271 | } 4272 | 4273 | func (p *SecondaryQRCodeLoginServiceCreateQrCodeResult) writeField1(oprot thrift.TProtocol) (err error) { 4274 | if p.IsSetE() { 4275 | if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { 4276 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) 4277 | } 4278 | if err := p.E.Write(oprot); err != nil { 4279 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err) 4280 | } 4281 | if err := oprot.WriteFieldEnd(); err != nil { 4282 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) 4283 | } 4284 | } 4285 | return err 4286 | } 4287 | 4288 | func (p *SecondaryQRCodeLoginServiceCreateQrCodeResult) String() string { 4289 | if p == nil { 4290 | return "" 4291 | } 4292 | return fmt.Sprintf("SecondaryQRCodeLoginServiceCreateQrCodeResult(%+v)", *p) 4293 | } 4294 | 4295 | // Attributes: 4296 | // - Request 4297 | type SecondaryQRCodeLoginServiceCreateSessionArgs struct { 4298 | Request *CreateQrSessionRequest `thrift:"request,1" db:"request" json:"request"` 4299 | } 4300 | 4301 | func NewSecondaryQRCodeLoginServiceCreateSessionArgs() *SecondaryQRCodeLoginServiceCreateSessionArgs { 4302 | return &SecondaryQRCodeLoginServiceCreateSessionArgs{} 4303 | } 4304 | 4305 | var SecondaryQRCodeLoginServiceCreateSessionArgs_Request_DEFAULT *CreateQrSessionRequest 4306 | 4307 | func (p *SecondaryQRCodeLoginServiceCreateSessionArgs) GetRequest() *CreateQrSessionRequest { 4308 | if !p.IsSetRequest() { 4309 | return SecondaryQRCodeLoginServiceCreateSessionArgs_Request_DEFAULT 4310 | } 4311 | return p.Request 4312 | } 4313 | func (p *SecondaryQRCodeLoginServiceCreateSessionArgs) IsSetRequest() bool { 4314 | return p.Request != nil 4315 | } 4316 | 4317 | func (p *SecondaryQRCodeLoginServiceCreateSessionArgs) Read(iprot thrift.TProtocol) error { 4318 | if _, err := iprot.ReadStructBegin(); err != nil { 4319 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 4320 | } 4321 | 4322 | for { 4323 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 4324 | if err != nil { 4325 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 4326 | } 4327 | if fieldTypeId == thrift.STOP { 4328 | break 4329 | } 4330 | switch fieldId { 4331 | case 1: 4332 | if fieldTypeId == thrift.STRUCT { 4333 | if err := p.ReadField1(iprot); err != nil { 4334 | return err 4335 | } 4336 | } else { 4337 | if err := iprot.Skip(fieldTypeId); err != nil { 4338 | return err 4339 | } 4340 | } 4341 | default: 4342 | if err := iprot.Skip(fieldTypeId); err != nil { 4343 | return err 4344 | } 4345 | } 4346 | if err := iprot.ReadFieldEnd(); err != nil { 4347 | return err 4348 | } 4349 | } 4350 | if err := iprot.ReadStructEnd(); err != nil { 4351 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 4352 | } 4353 | return nil 4354 | } 4355 | 4356 | func (p *SecondaryQRCodeLoginServiceCreateSessionArgs) ReadField1(iprot thrift.TProtocol) error { 4357 | p.Request = &CreateQrSessionRequest{} 4358 | if err := p.Request.Read(iprot); err != nil { 4359 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) 4360 | } 4361 | return nil 4362 | } 4363 | 4364 | func (p *SecondaryQRCodeLoginServiceCreateSessionArgs) Write(oprot thrift.TProtocol) error { 4365 | if err := oprot.WriteStructBegin("createSession_args"); err != nil { 4366 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 4367 | } 4368 | if p != nil { 4369 | if err := p.writeField1(oprot); err != nil { 4370 | return err 4371 | } 4372 | } 4373 | if err := oprot.WriteFieldStop(); err != nil { 4374 | return thrift.PrependError("write field stop error: ", err) 4375 | } 4376 | if err := oprot.WriteStructEnd(); err != nil { 4377 | return thrift.PrependError("write struct stop error: ", err) 4378 | } 4379 | return nil 4380 | } 4381 | 4382 | func (p *SecondaryQRCodeLoginServiceCreateSessionArgs) writeField1(oprot thrift.TProtocol) (err error) { 4383 | if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { 4384 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err) 4385 | } 4386 | if err := p.Request.Write(oprot); err != nil { 4387 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err) 4388 | } 4389 | if err := oprot.WriteFieldEnd(); err != nil { 4390 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err) 4391 | } 4392 | return err 4393 | } 4394 | 4395 | func (p *SecondaryQRCodeLoginServiceCreateSessionArgs) String() string { 4396 | if p == nil { 4397 | return "" 4398 | } 4399 | return fmt.Sprintf("SecondaryQRCodeLoginServiceCreateSessionArgs(%+v)", *p) 4400 | } 4401 | 4402 | // Attributes: 4403 | // - Success 4404 | // - E 4405 | type SecondaryQRCodeLoginServiceCreateSessionResult struct { 4406 | Success *CreateQrSessionResponse `thrift:"success,0" db:"success" json:"success,omitempty"` 4407 | E *SecondaryQrCodeException `thrift:"e,1" db:"e" json:"e,omitempty"` 4408 | } 4409 | 4410 | func NewSecondaryQRCodeLoginServiceCreateSessionResult() *SecondaryQRCodeLoginServiceCreateSessionResult { 4411 | return &SecondaryQRCodeLoginServiceCreateSessionResult{} 4412 | } 4413 | 4414 | var SecondaryQRCodeLoginServiceCreateSessionResult_Success_DEFAULT *CreateQrSessionResponse 4415 | 4416 | func (p *SecondaryQRCodeLoginServiceCreateSessionResult) GetSuccess() *CreateQrSessionResponse { 4417 | if !p.IsSetSuccess() { 4418 | return SecondaryQRCodeLoginServiceCreateSessionResult_Success_DEFAULT 4419 | } 4420 | return p.Success 4421 | } 4422 | 4423 | var SecondaryQRCodeLoginServiceCreateSessionResult_E_DEFAULT *SecondaryQrCodeException 4424 | 4425 | func (p *SecondaryQRCodeLoginServiceCreateSessionResult) GetE() *SecondaryQrCodeException { 4426 | if !p.IsSetE() { 4427 | return SecondaryQRCodeLoginServiceCreateSessionResult_E_DEFAULT 4428 | } 4429 | return p.E 4430 | } 4431 | func (p *SecondaryQRCodeLoginServiceCreateSessionResult) IsSetSuccess() bool { 4432 | return p.Success != nil 4433 | } 4434 | 4435 | func (p *SecondaryQRCodeLoginServiceCreateSessionResult) IsSetE() bool { 4436 | return p.E != nil 4437 | } 4438 | 4439 | func (p *SecondaryQRCodeLoginServiceCreateSessionResult) Read(iprot thrift.TProtocol) error { 4440 | if _, err := iprot.ReadStructBegin(); err != nil { 4441 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 4442 | } 4443 | 4444 | for { 4445 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 4446 | if err != nil { 4447 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 4448 | } 4449 | if fieldTypeId == thrift.STOP { 4450 | break 4451 | } 4452 | switch fieldId { 4453 | case 0: 4454 | if fieldTypeId == thrift.STRUCT { 4455 | if err := p.ReadField0(iprot); err != nil { 4456 | return err 4457 | } 4458 | } else { 4459 | if err := iprot.Skip(fieldTypeId); err != nil { 4460 | return err 4461 | } 4462 | } 4463 | case 1: 4464 | if fieldTypeId == thrift.STRUCT { 4465 | if err := p.ReadField1(iprot); err != nil { 4466 | return err 4467 | } 4468 | } else { 4469 | if err := iprot.Skip(fieldTypeId); err != nil { 4470 | return err 4471 | } 4472 | } 4473 | default: 4474 | if err := iprot.Skip(fieldTypeId); err != nil { 4475 | return err 4476 | } 4477 | } 4478 | if err := iprot.ReadFieldEnd(); err != nil { 4479 | return err 4480 | } 4481 | } 4482 | if err := iprot.ReadStructEnd(); err != nil { 4483 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 4484 | } 4485 | return nil 4486 | } 4487 | 4488 | func (p *SecondaryQRCodeLoginServiceCreateSessionResult) ReadField0(iprot thrift.TProtocol) error { 4489 | p.Success = &CreateQrSessionResponse{} 4490 | if err := p.Success.Read(iprot); err != nil { 4491 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) 4492 | } 4493 | return nil 4494 | } 4495 | 4496 | func (p *SecondaryQRCodeLoginServiceCreateSessionResult) ReadField1(iprot thrift.TProtocol) error { 4497 | p.E = &SecondaryQrCodeException{} 4498 | if err := p.E.Read(iprot); err != nil { 4499 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err) 4500 | } 4501 | return nil 4502 | } 4503 | 4504 | func (p *SecondaryQRCodeLoginServiceCreateSessionResult) Write(oprot thrift.TProtocol) error { 4505 | if err := oprot.WriteStructBegin("createSession_result"); err != nil { 4506 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 4507 | } 4508 | if p != nil { 4509 | if err := p.writeField0(oprot); err != nil { 4510 | return err 4511 | } 4512 | if err := p.writeField1(oprot); err != nil { 4513 | return err 4514 | } 4515 | } 4516 | if err := oprot.WriteFieldStop(); err != nil { 4517 | return thrift.PrependError("write field stop error: ", err) 4518 | } 4519 | if err := oprot.WriteStructEnd(); err != nil { 4520 | return thrift.PrependError("write struct stop error: ", err) 4521 | } 4522 | return nil 4523 | } 4524 | 4525 | func (p *SecondaryQRCodeLoginServiceCreateSessionResult) writeField0(oprot thrift.TProtocol) (err error) { 4526 | if p.IsSetSuccess() { 4527 | if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { 4528 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) 4529 | } 4530 | if err := p.Success.Write(oprot); err != nil { 4531 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) 4532 | } 4533 | if err := oprot.WriteFieldEnd(); err != nil { 4534 | return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) 4535 | } 4536 | } 4537 | return err 4538 | } 4539 | 4540 | func (p *SecondaryQRCodeLoginServiceCreateSessionResult) writeField1(oprot thrift.TProtocol) (err error) { 4541 | if p.IsSetE() { 4542 | if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { 4543 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) 4544 | } 4545 | if err := p.E.Write(oprot); err != nil { 4546 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err) 4547 | } 4548 | if err := oprot.WriteFieldEnd(); err != nil { 4549 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) 4550 | } 4551 | } 4552 | return err 4553 | } 4554 | 4555 | func (p *SecondaryQRCodeLoginServiceCreateSessionResult) String() string { 4556 | if p == nil { 4557 | return "" 4558 | } 4559 | return fmt.Sprintf("SecondaryQRCodeLoginServiceCreateSessionResult(%+v)", *p) 4560 | } 4561 | 4562 | // Attributes: 4563 | // - Request 4564 | type SecondaryQRCodeLoginServiceQrCodeLoginArgs struct { 4565 | Request *QrCodeLoginRequest `thrift:"request,1" db:"request" json:"request"` 4566 | } 4567 | 4568 | func NewSecondaryQRCodeLoginServiceQrCodeLoginArgs() *SecondaryQRCodeLoginServiceQrCodeLoginArgs { 4569 | return &SecondaryQRCodeLoginServiceQrCodeLoginArgs{} 4570 | } 4571 | 4572 | var SecondaryQRCodeLoginServiceQrCodeLoginArgs_Request_DEFAULT *QrCodeLoginRequest 4573 | 4574 | func (p *SecondaryQRCodeLoginServiceQrCodeLoginArgs) GetRequest() *QrCodeLoginRequest { 4575 | if !p.IsSetRequest() { 4576 | return SecondaryQRCodeLoginServiceQrCodeLoginArgs_Request_DEFAULT 4577 | } 4578 | return p.Request 4579 | } 4580 | func (p *SecondaryQRCodeLoginServiceQrCodeLoginArgs) IsSetRequest() bool { 4581 | return p.Request != nil 4582 | } 4583 | 4584 | func (p *SecondaryQRCodeLoginServiceQrCodeLoginArgs) Read(iprot thrift.TProtocol) error { 4585 | if _, err := iprot.ReadStructBegin(); err != nil { 4586 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 4587 | } 4588 | 4589 | for { 4590 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 4591 | if err != nil { 4592 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 4593 | } 4594 | if fieldTypeId == thrift.STOP { 4595 | break 4596 | } 4597 | switch fieldId { 4598 | case 1: 4599 | if fieldTypeId == thrift.STRUCT { 4600 | if err := p.ReadField1(iprot); err != nil { 4601 | return err 4602 | } 4603 | } else { 4604 | if err := iprot.Skip(fieldTypeId); err != nil { 4605 | return err 4606 | } 4607 | } 4608 | default: 4609 | if err := iprot.Skip(fieldTypeId); err != nil { 4610 | return err 4611 | } 4612 | } 4613 | if err := iprot.ReadFieldEnd(); err != nil { 4614 | return err 4615 | } 4616 | } 4617 | if err := iprot.ReadStructEnd(); err != nil { 4618 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 4619 | } 4620 | return nil 4621 | } 4622 | 4623 | func (p *SecondaryQRCodeLoginServiceQrCodeLoginArgs) ReadField1(iprot thrift.TProtocol) error { 4624 | p.Request = &QrCodeLoginRequest{} 4625 | if err := p.Request.Read(iprot); err != nil { 4626 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) 4627 | } 4628 | return nil 4629 | } 4630 | 4631 | func (p *SecondaryQRCodeLoginServiceQrCodeLoginArgs) Write(oprot thrift.TProtocol) error { 4632 | if err := oprot.WriteStructBegin("qrCodeLogin_args"); err != nil { 4633 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 4634 | } 4635 | if p != nil { 4636 | if err := p.writeField1(oprot); err != nil { 4637 | return err 4638 | } 4639 | } 4640 | if err := oprot.WriteFieldStop(); err != nil { 4641 | return thrift.PrependError("write field stop error: ", err) 4642 | } 4643 | if err := oprot.WriteStructEnd(); err != nil { 4644 | return thrift.PrependError("write struct stop error: ", err) 4645 | } 4646 | return nil 4647 | } 4648 | 4649 | func (p *SecondaryQRCodeLoginServiceQrCodeLoginArgs) writeField1(oprot thrift.TProtocol) (err error) { 4650 | if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { 4651 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err) 4652 | } 4653 | if err := p.Request.Write(oprot); err != nil { 4654 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err) 4655 | } 4656 | if err := oprot.WriteFieldEnd(); err != nil { 4657 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err) 4658 | } 4659 | return err 4660 | } 4661 | 4662 | func (p *SecondaryQRCodeLoginServiceQrCodeLoginArgs) String() string { 4663 | if p == nil { 4664 | return "" 4665 | } 4666 | return fmt.Sprintf("SecondaryQRCodeLoginServiceQrCodeLoginArgs(%+v)", *p) 4667 | } 4668 | 4669 | // Attributes: 4670 | // - Success 4671 | // - E 4672 | type SecondaryQRCodeLoginServiceQrCodeLoginResult struct { 4673 | Success *QrCodeLoginResponse `thrift:"success,0" db:"success" json:"success,omitempty"` 4674 | E *SecondaryQrCodeException `thrift:"e,1" db:"e" json:"e,omitempty"` 4675 | } 4676 | 4677 | func NewSecondaryQRCodeLoginServiceQrCodeLoginResult() *SecondaryQRCodeLoginServiceQrCodeLoginResult { 4678 | return &SecondaryQRCodeLoginServiceQrCodeLoginResult{} 4679 | } 4680 | 4681 | var SecondaryQRCodeLoginServiceQrCodeLoginResult_Success_DEFAULT *QrCodeLoginResponse 4682 | 4683 | func (p *SecondaryQRCodeLoginServiceQrCodeLoginResult) GetSuccess() *QrCodeLoginResponse { 4684 | if !p.IsSetSuccess() { 4685 | return SecondaryQRCodeLoginServiceQrCodeLoginResult_Success_DEFAULT 4686 | } 4687 | return p.Success 4688 | } 4689 | 4690 | var SecondaryQRCodeLoginServiceQrCodeLoginResult_E_DEFAULT *SecondaryQrCodeException 4691 | 4692 | func (p *SecondaryQRCodeLoginServiceQrCodeLoginResult) GetE() *SecondaryQrCodeException { 4693 | if !p.IsSetE() { 4694 | return SecondaryQRCodeLoginServiceQrCodeLoginResult_E_DEFAULT 4695 | } 4696 | return p.E 4697 | } 4698 | func (p *SecondaryQRCodeLoginServiceQrCodeLoginResult) IsSetSuccess() bool { 4699 | return p.Success != nil 4700 | } 4701 | 4702 | func (p *SecondaryQRCodeLoginServiceQrCodeLoginResult) IsSetE() bool { 4703 | return p.E != nil 4704 | } 4705 | 4706 | func (p *SecondaryQRCodeLoginServiceQrCodeLoginResult) Read(iprot thrift.TProtocol) error { 4707 | if _, err := iprot.ReadStructBegin(); err != nil { 4708 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 4709 | } 4710 | 4711 | for { 4712 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 4713 | if err != nil { 4714 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 4715 | } 4716 | if fieldTypeId == thrift.STOP { 4717 | break 4718 | } 4719 | switch fieldId { 4720 | case 0: 4721 | if fieldTypeId == thrift.STRUCT { 4722 | if err := p.ReadField0(iprot); err != nil { 4723 | return err 4724 | } 4725 | } else { 4726 | if err := iprot.Skip(fieldTypeId); err != nil { 4727 | return err 4728 | } 4729 | } 4730 | case 1: 4731 | if fieldTypeId == thrift.STRUCT { 4732 | if err := p.ReadField1(iprot); err != nil { 4733 | return err 4734 | } 4735 | } else { 4736 | if err := iprot.Skip(fieldTypeId); err != nil { 4737 | return err 4738 | } 4739 | } 4740 | default: 4741 | if err := iprot.Skip(fieldTypeId); err != nil { 4742 | return err 4743 | } 4744 | } 4745 | if err := iprot.ReadFieldEnd(); err != nil { 4746 | return err 4747 | } 4748 | } 4749 | if err := iprot.ReadStructEnd(); err != nil { 4750 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 4751 | } 4752 | return nil 4753 | } 4754 | 4755 | func (p *SecondaryQRCodeLoginServiceQrCodeLoginResult) ReadField0(iprot thrift.TProtocol) error { 4756 | p.Success = &QrCodeLoginResponse{} 4757 | if err := p.Success.Read(iprot); err != nil { 4758 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) 4759 | } 4760 | return nil 4761 | } 4762 | 4763 | func (p *SecondaryQRCodeLoginServiceQrCodeLoginResult) ReadField1(iprot thrift.TProtocol) error { 4764 | p.E = &SecondaryQrCodeException{} 4765 | if err := p.E.Read(iprot); err != nil { 4766 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err) 4767 | } 4768 | return nil 4769 | } 4770 | 4771 | func (p *SecondaryQRCodeLoginServiceQrCodeLoginResult) Write(oprot thrift.TProtocol) error { 4772 | if err := oprot.WriteStructBegin("qrCodeLogin_result"); err != nil { 4773 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 4774 | } 4775 | if p != nil { 4776 | if err := p.writeField0(oprot); err != nil { 4777 | return err 4778 | } 4779 | if err := p.writeField1(oprot); err != nil { 4780 | return err 4781 | } 4782 | } 4783 | if err := oprot.WriteFieldStop(); err != nil { 4784 | return thrift.PrependError("write field stop error: ", err) 4785 | } 4786 | if err := oprot.WriteStructEnd(); err != nil { 4787 | return thrift.PrependError("write struct stop error: ", err) 4788 | } 4789 | return nil 4790 | } 4791 | 4792 | func (p *SecondaryQRCodeLoginServiceQrCodeLoginResult) writeField0(oprot thrift.TProtocol) (err error) { 4793 | if p.IsSetSuccess() { 4794 | if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { 4795 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) 4796 | } 4797 | if err := p.Success.Write(oprot); err != nil { 4798 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) 4799 | } 4800 | if err := oprot.WriteFieldEnd(); err != nil { 4801 | return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) 4802 | } 4803 | } 4804 | return err 4805 | } 4806 | 4807 | func (p *SecondaryQRCodeLoginServiceQrCodeLoginResult) writeField1(oprot thrift.TProtocol) (err error) { 4808 | if p.IsSetE() { 4809 | if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { 4810 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) 4811 | } 4812 | if err := p.E.Write(oprot); err != nil { 4813 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err) 4814 | } 4815 | if err := oprot.WriteFieldEnd(); err != nil { 4816 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) 4817 | } 4818 | } 4819 | return err 4820 | } 4821 | 4822 | func (p *SecondaryQRCodeLoginServiceQrCodeLoginResult) String() string { 4823 | if p == nil { 4824 | return "" 4825 | } 4826 | return fmt.Sprintf("SecondaryQRCodeLoginServiceQrCodeLoginResult(%+v)", *p) 4827 | } 4828 | 4829 | // Attributes: 4830 | // - Request 4831 | type SecondaryQRCodeLoginServiceVerifyCertificateArgs struct { 4832 | Request *VerifyCertificateRequest `thrift:"request,1" db:"request" json:"request"` 4833 | } 4834 | 4835 | func NewSecondaryQRCodeLoginServiceVerifyCertificateArgs() *SecondaryQRCodeLoginServiceVerifyCertificateArgs { 4836 | return &SecondaryQRCodeLoginServiceVerifyCertificateArgs{} 4837 | } 4838 | 4839 | var SecondaryQRCodeLoginServiceVerifyCertificateArgs_Request_DEFAULT *VerifyCertificateRequest 4840 | 4841 | func (p *SecondaryQRCodeLoginServiceVerifyCertificateArgs) GetRequest() *VerifyCertificateRequest { 4842 | if !p.IsSetRequest() { 4843 | return SecondaryQRCodeLoginServiceVerifyCertificateArgs_Request_DEFAULT 4844 | } 4845 | return p.Request 4846 | } 4847 | func (p *SecondaryQRCodeLoginServiceVerifyCertificateArgs) IsSetRequest() bool { 4848 | return p.Request != nil 4849 | } 4850 | 4851 | func (p *SecondaryQRCodeLoginServiceVerifyCertificateArgs) Read(iprot thrift.TProtocol) error { 4852 | if _, err := iprot.ReadStructBegin(); err != nil { 4853 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 4854 | } 4855 | 4856 | for { 4857 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 4858 | if err != nil { 4859 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 4860 | } 4861 | if fieldTypeId == thrift.STOP { 4862 | break 4863 | } 4864 | switch fieldId { 4865 | case 1: 4866 | if fieldTypeId == thrift.STRUCT { 4867 | if err := p.ReadField1(iprot); err != nil { 4868 | return err 4869 | } 4870 | } else { 4871 | if err := iprot.Skip(fieldTypeId); err != nil { 4872 | return err 4873 | } 4874 | } 4875 | default: 4876 | if err := iprot.Skip(fieldTypeId); err != nil { 4877 | return err 4878 | } 4879 | } 4880 | if err := iprot.ReadFieldEnd(); err != nil { 4881 | return err 4882 | } 4883 | } 4884 | if err := iprot.ReadStructEnd(); err != nil { 4885 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 4886 | } 4887 | return nil 4888 | } 4889 | 4890 | func (p *SecondaryQRCodeLoginServiceVerifyCertificateArgs) ReadField1(iprot thrift.TProtocol) error { 4891 | p.Request = &VerifyCertificateRequest{} 4892 | if err := p.Request.Read(iprot); err != nil { 4893 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) 4894 | } 4895 | return nil 4896 | } 4897 | 4898 | func (p *SecondaryQRCodeLoginServiceVerifyCertificateArgs) Write(oprot thrift.TProtocol) error { 4899 | if err := oprot.WriteStructBegin("verifyCertificate_args"); err != nil { 4900 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 4901 | } 4902 | if p != nil { 4903 | if err := p.writeField1(oprot); err != nil { 4904 | return err 4905 | } 4906 | } 4907 | if err := oprot.WriteFieldStop(); err != nil { 4908 | return thrift.PrependError("write field stop error: ", err) 4909 | } 4910 | if err := oprot.WriteStructEnd(); err != nil { 4911 | return thrift.PrependError("write struct stop error: ", err) 4912 | } 4913 | return nil 4914 | } 4915 | 4916 | func (p *SecondaryQRCodeLoginServiceVerifyCertificateArgs) writeField1(oprot thrift.TProtocol) (err error) { 4917 | if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { 4918 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err) 4919 | } 4920 | if err := p.Request.Write(oprot); err != nil { 4921 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err) 4922 | } 4923 | if err := oprot.WriteFieldEnd(); err != nil { 4924 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err) 4925 | } 4926 | return err 4927 | } 4928 | 4929 | func (p *SecondaryQRCodeLoginServiceVerifyCertificateArgs) String() string { 4930 | if p == nil { 4931 | return "" 4932 | } 4933 | return fmt.Sprintf("SecondaryQRCodeLoginServiceVerifyCertificateArgs(%+v)", *p) 4934 | } 4935 | 4936 | // Attributes: 4937 | // - Success 4938 | // - E 4939 | type SecondaryQRCodeLoginServiceVerifyCertificateResult struct { 4940 | Success *VerifyCertificateResponse `thrift:"success,0" db:"success" json:"success,omitempty"` 4941 | E *SecondaryQrCodeException `thrift:"e,1" db:"e" json:"e,omitempty"` 4942 | } 4943 | 4944 | func NewSecondaryQRCodeLoginServiceVerifyCertificateResult() *SecondaryQRCodeLoginServiceVerifyCertificateResult { 4945 | return &SecondaryQRCodeLoginServiceVerifyCertificateResult{} 4946 | } 4947 | 4948 | var SecondaryQRCodeLoginServiceVerifyCertificateResult_Success_DEFAULT *VerifyCertificateResponse 4949 | 4950 | func (p *SecondaryQRCodeLoginServiceVerifyCertificateResult) GetSuccess() *VerifyCertificateResponse { 4951 | if !p.IsSetSuccess() { 4952 | return SecondaryQRCodeLoginServiceVerifyCertificateResult_Success_DEFAULT 4953 | } 4954 | return p.Success 4955 | } 4956 | 4957 | var SecondaryQRCodeLoginServiceVerifyCertificateResult_E_DEFAULT *SecondaryQrCodeException 4958 | 4959 | func (p *SecondaryQRCodeLoginServiceVerifyCertificateResult) GetE() *SecondaryQrCodeException { 4960 | if !p.IsSetE() { 4961 | return SecondaryQRCodeLoginServiceVerifyCertificateResult_E_DEFAULT 4962 | } 4963 | return p.E 4964 | } 4965 | func (p *SecondaryQRCodeLoginServiceVerifyCertificateResult) IsSetSuccess() bool { 4966 | return p.Success != nil 4967 | } 4968 | 4969 | func (p *SecondaryQRCodeLoginServiceVerifyCertificateResult) IsSetE() bool { 4970 | return p.E != nil 4971 | } 4972 | 4973 | func (p *SecondaryQRCodeLoginServiceVerifyCertificateResult) Read(iprot thrift.TProtocol) error { 4974 | if _, err := iprot.ReadStructBegin(); err != nil { 4975 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 4976 | } 4977 | 4978 | for { 4979 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 4980 | if err != nil { 4981 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 4982 | } 4983 | if fieldTypeId == thrift.STOP { 4984 | break 4985 | } 4986 | switch fieldId { 4987 | case 0: 4988 | if fieldTypeId == thrift.STRUCT { 4989 | if err := p.ReadField0(iprot); err != nil { 4990 | return err 4991 | } 4992 | } else { 4993 | if err := iprot.Skip(fieldTypeId); err != nil { 4994 | return err 4995 | } 4996 | } 4997 | case 1: 4998 | if fieldTypeId == thrift.STRUCT { 4999 | if err := p.ReadField1(iprot); err != nil { 5000 | return err 5001 | } 5002 | } else { 5003 | if err := iprot.Skip(fieldTypeId); err != nil { 5004 | return err 5005 | } 5006 | } 5007 | default: 5008 | if err := iprot.Skip(fieldTypeId); err != nil { 5009 | return err 5010 | } 5011 | } 5012 | if err := iprot.ReadFieldEnd(); err != nil { 5013 | return err 5014 | } 5015 | } 5016 | if err := iprot.ReadStructEnd(); err != nil { 5017 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 5018 | } 5019 | return nil 5020 | } 5021 | 5022 | func (p *SecondaryQRCodeLoginServiceVerifyCertificateResult) ReadField0(iprot thrift.TProtocol) error { 5023 | p.Success = &VerifyCertificateResponse{} 5024 | if err := p.Success.Read(iprot); err != nil { 5025 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) 5026 | } 5027 | return nil 5028 | } 5029 | 5030 | func (p *SecondaryQRCodeLoginServiceVerifyCertificateResult) ReadField1(iprot thrift.TProtocol) error { 5031 | p.E = &SecondaryQrCodeException{} 5032 | if err := p.E.Read(iprot); err != nil { 5033 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err) 5034 | } 5035 | return nil 5036 | } 5037 | 5038 | func (p *SecondaryQRCodeLoginServiceVerifyCertificateResult) Write(oprot thrift.TProtocol) error { 5039 | if err := oprot.WriteStructBegin("verifyCertificate_result"); err != nil { 5040 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 5041 | } 5042 | if p != nil { 5043 | if err := p.writeField0(oprot); err != nil { 5044 | return err 5045 | } 5046 | if err := p.writeField1(oprot); err != nil { 5047 | return err 5048 | } 5049 | } 5050 | if err := oprot.WriteFieldStop(); err != nil { 5051 | return thrift.PrependError("write field stop error: ", err) 5052 | } 5053 | if err := oprot.WriteStructEnd(); err != nil { 5054 | return thrift.PrependError("write struct stop error: ", err) 5055 | } 5056 | return nil 5057 | } 5058 | 5059 | func (p *SecondaryQRCodeLoginServiceVerifyCertificateResult) writeField0(oprot thrift.TProtocol) (err error) { 5060 | if p.IsSetSuccess() { 5061 | if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { 5062 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) 5063 | } 5064 | if err := p.Success.Write(oprot); err != nil { 5065 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) 5066 | } 5067 | if err := oprot.WriteFieldEnd(); err != nil { 5068 | return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) 5069 | } 5070 | } 5071 | return err 5072 | } 5073 | 5074 | func (p *SecondaryQRCodeLoginServiceVerifyCertificateResult) writeField1(oprot thrift.TProtocol) (err error) { 5075 | if p.IsSetE() { 5076 | if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { 5077 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) 5078 | } 5079 | if err := p.E.Write(oprot); err != nil { 5080 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err) 5081 | } 5082 | if err := oprot.WriteFieldEnd(); err != nil { 5083 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) 5084 | } 5085 | } 5086 | return err 5087 | } 5088 | 5089 | func (p *SecondaryQRCodeLoginServiceVerifyCertificateResult) String() string { 5090 | if p == nil { 5091 | return "" 5092 | } 5093 | return fmt.Sprintf("SecondaryQRCodeLoginServiceVerifyCertificateResult(%+v)", *p) 5094 | } 5095 | 5096 | // Attributes: 5097 | // - Request 5098 | type SecondaryQRCodeLoginServiceCheckPinCodeVerifiedArgs struct { 5099 | Request *CheckPinCodeVerifiedRequest `thrift:"request,1" db:"request" json:"request"` 5100 | } 5101 | 5102 | func NewSecondaryQRCodeLoginServiceCheckPinCodeVerifiedArgs() *SecondaryQRCodeLoginServiceCheckPinCodeVerifiedArgs { 5103 | return &SecondaryQRCodeLoginServiceCheckPinCodeVerifiedArgs{} 5104 | } 5105 | 5106 | var SecondaryQRCodeLoginServiceCheckPinCodeVerifiedArgs_Request_DEFAULT *CheckPinCodeVerifiedRequest 5107 | 5108 | func (p *SecondaryQRCodeLoginServiceCheckPinCodeVerifiedArgs) GetRequest() *CheckPinCodeVerifiedRequest { 5109 | if !p.IsSetRequest() { 5110 | return SecondaryQRCodeLoginServiceCheckPinCodeVerifiedArgs_Request_DEFAULT 5111 | } 5112 | return p.Request 5113 | } 5114 | func (p *SecondaryQRCodeLoginServiceCheckPinCodeVerifiedArgs) IsSetRequest() bool { 5115 | return p.Request != nil 5116 | } 5117 | 5118 | func (p *SecondaryQRCodeLoginServiceCheckPinCodeVerifiedArgs) Read(iprot thrift.TProtocol) error { 5119 | if _, err := iprot.ReadStructBegin(); err != nil { 5120 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 5121 | } 5122 | 5123 | for { 5124 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 5125 | if err != nil { 5126 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 5127 | } 5128 | if fieldTypeId == thrift.STOP { 5129 | break 5130 | } 5131 | switch fieldId { 5132 | case 1: 5133 | if fieldTypeId == thrift.STRUCT { 5134 | if err := p.ReadField1(iprot); err != nil { 5135 | return err 5136 | } 5137 | } else { 5138 | if err := iprot.Skip(fieldTypeId); err != nil { 5139 | return err 5140 | } 5141 | } 5142 | default: 5143 | if err := iprot.Skip(fieldTypeId); err != nil { 5144 | return err 5145 | } 5146 | } 5147 | if err := iprot.ReadFieldEnd(); err != nil { 5148 | return err 5149 | } 5150 | } 5151 | if err := iprot.ReadStructEnd(); err != nil { 5152 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 5153 | } 5154 | return nil 5155 | } 5156 | 5157 | func (p *SecondaryQRCodeLoginServiceCheckPinCodeVerifiedArgs) ReadField1(iprot thrift.TProtocol) error { 5158 | p.Request = &CheckPinCodeVerifiedRequest{} 5159 | if err := p.Request.Read(iprot); err != nil { 5160 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) 5161 | } 5162 | return nil 5163 | } 5164 | 5165 | func (p *SecondaryQRCodeLoginServiceCheckPinCodeVerifiedArgs) Write(oprot thrift.TProtocol) error { 5166 | if err := oprot.WriteStructBegin("checkPinCodeVerified_args"); err != nil { 5167 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 5168 | } 5169 | if p != nil { 5170 | if err := p.writeField1(oprot); err != nil { 5171 | return err 5172 | } 5173 | } 5174 | if err := oprot.WriteFieldStop(); err != nil { 5175 | return thrift.PrependError("write field stop error: ", err) 5176 | } 5177 | if err := oprot.WriteStructEnd(); err != nil { 5178 | return thrift.PrependError("write struct stop error: ", err) 5179 | } 5180 | return nil 5181 | } 5182 | 5183 | func (p *SecondaryQRCodeLoginServiceCheckPinCodeVerifiedArgs) writeField1(oprot thrift.TProtocol) (err error) { 5184 | if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { 5185 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err) 5186 | } 5187 | if err := p.Request.Write(oprot); err != nil { 5188 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err) 5189 | } 5190 | if err := oprot.WriteFieldEnd(); err != nil { 5191 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err) 5192 | } 5193 | return err 5194 | } 5195 | 5196 | func (p *SecondaryQRCodeLoginServiceCheckPinCodeVerifiedArgs) String() string { 5197 | if p == nil { 5198 | return "" 5199 | } 5200 | return fmt.Sprintf("SecondaryQRCodeLoginServiceCheckPinCodeVerifiedArgs(%+v)", *p) 5201 | } 5202 | 5203 | // Attributes: 5204 | // - Success 5205 | // - E 5206 | type SecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult struct { 5207 | Success *CheckPinCodeVerifiedResponse `thrift:"success,0" db:"success" json:"success,omitempty"` 5208 | E *SecondaryQrCodeException `thrift:"e,1" db:"e" json:"e,omitempty"` 5209 | } 5210 | 5211 | func NewSecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult() *SecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult { 5212 | return &SecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult{} 5213 | } 5214 | 5215 | var SecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult_Success_DEFAULT *CheckPinCodeVerifiedResponse 5216 | 5217 | func (p *SecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult) GetSuccess() *CheckPinCodeVerifiedResponse { 5218 | if !p.IsSetSuccess() { 5219 | return SecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult_Success_DEFAULT 5220 | } 5221 | return p.Success 5222 | } 5223 | 5224 | var SecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult_E_DEFAULT *SecondaryQrCodeException 5225 | 5226 | func (p *SecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult) GetE() *SecondaryQrCodeException { 5227 | if !p.IsSetE() { 5228 | return SecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult_E_DEFAULT 5229 | } 5230 | return p.E 5231 | } 5232 | func (p *SecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult) IsSetSuccess() bool { 5233 | return p.Success != nil 5234 | } 5235 | 5236 | func (p *SecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult) IsSetE() bool { 5237 | return p.E != nil 5238 | } 5239 | 5240 | func (p *SecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult) Read(iprot thrift.TProtocol) error { 5241 | if _, err := iprot.ReadStructBegin(); err != nil { 5242 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 5243 | } 5244 | 5245 | for { 5246 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 5247 | if err != nil { 5248 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 5249 | } 5250 | if fieldTypeId == thrift.STOP { 5251 | break 5252 | } 5253 | switch fieldId { 5254 | case 0: 5255 | if fieldTypeId == thrift.STRUCT { 5256 | if err := p.ReadField0(iprot); err != nil { 5257 | return err 5258 | } 5259 | } else { 5260 | if err := iprot.Skip(fieldTypeId); err != nil { 5261 | return err 5262 | } 5263 | } 5264 | case 1: 5265 | if fieldTypeId == thrift.STRUCT { 5266 | if err := p.ReadField1(iprot); err != nil { 5267 | return err 5268 | } 5269 | } else { 5270 | if err := iprot.Skip(fieldTypeId); err != nil { 5271 | return err 5272 | } 5273 | } 5274 | default: 5275 | if err := iprot.Skip(fieldTypeId); err != nil { 5276 | return err 5277 | } 5278 | } 5279 | if err := iprot.ReadFieldEnd(); err != nil { 5280 | return err 5281 | } 5282 | } 5283 | if err := iprot.ReadStructEnd(); err != nil { 5284 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 5285 | } 5286 | return nil 5287 | } 5288 | 5289 | func (p *SecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult) ReadField0(iprot thrift.TProtocol) error { 5290 | p.Success = &CheckPinCodeVerifiedResponse{} 5291 | if err := p.Success.Read(iprot); err != nil { 5292 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) 5293 | } 5294 | return nil 5295 | } 5296 | 5297 | func (p *SecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult) ReadField1(iprot thrift.TProtocol) error { 5298 | p.E = &SecondaryQrCodeException{} 5299 | if err := p.E.Read(iprot); err != nil { 5300 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err) 5301 | } 5302 | return nil 5303 | } 5304 | 5305 | func (p *SecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult) Write(oprot thrift.TProtocol) error { 5306 | if err := oprot.WriteStructBegin("checkPinCodeVerified_result"); err != nil { 5307 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 5308 | } 5309 | if p != nil { 5310 | if err := p.writeField0(oprot); err != nil { 5311 | return err 5312 | } 5313 | if err := p.writeField1(oprot); err != nil { 5314 | return err 5315 | } 5316 | } 5317 | if err := oprot.WriteFieldStop(); err != nil { 5318 | return thrift.PrependError("write field stop error: ", err) 5319 | } 5320 | if err := oprot.WriteStructEnd(); err != nil { 5321 | return thrift.PrependError("write struct stop error: ", err) 5322 | } 5323 | return nil 5324 | } 5325 | 5326 | func (p *SecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult) writeField0(oprot thrift.TProtocol) (err error) { 5327 | if p.IsSetSuccess() { 5328 | if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { 5329 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) 5330 | } 5331 | if err := p.Success.Write(oprot); err != nil { 5332 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) 5333 | } 5334 | if err := oprot.WriteFieldEnd(); err != nil { 5335 | return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) 5336 | } 5337 | } 5338 | return err 5339 | } 5340 | 5341 | func (p *SecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult) writeField1(oprot thrift.TProtocol) (err error) { 5342 | if p.IsSetE() { 5343 | if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { 5344 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) 5345 | } 5346 | if err := p.E.Write(oprot); err != nil { 5347 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err) 5348 | } 5349 | if err := oprot.WriteFieldEnd(); err != nil { 5350 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) 5351 | } 5352 | } 5353 | return err 5354 | } 5355 | 5356 | func (p *SecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult) String() string { 5357 | if p == nil { 5358 | return "" 5359 | } 5360 | return fmt.Sprintf("SecondaryQRCodeLoginServiceCheckPinCodeVerifiedResult(%+v)", *p) 5361 | } 5362 | 5363 | // Attributes: 5364 | // - Request 5365 | type SecondaryQRCodeLoginServiceCheckQrCodeVerifiedArgs struct { 5366 | Request *CheckQrCodeVerifiedRequest `thrift:"request,1" db:"request" json:"request"` 5367 | } 5368 | 5369 | func NewSecondaryQRCodeLoginServiceCheckQrCodeVerifiedArgs() *SecondaryQRCodeLoginServiceCheckQrCodeVerifiedArgs { 5370 | return &SecondaryQRCodeLoginServiceCheckQrCodeVerifiedArgs{} 5371 | } 5372 | 5373 | var SecondaryQRCodeLoginServiceCheckQrCodeVerifiedArgs_Request_DEFAULT *CheckQrCodeVerifiedRequest 5374 | 5375 | func (p *SecondaryQRCodeLoginServiceCheckQrCodeVerifiedArgs) GetRequest() *CheckQrCodeVerifiedRequest { 5376 | if !p.IsSetRequest() { 5377 | return SecondaryQRCodeLoginServiceCheckQrCodeVerifiedArgs_Request_DEFAULT 5378 | } 5379 | return p.Request 5380 | } 5381 | func (p *SecondaryQRCodeLoginServiceCheckQrCodeVerifiedArgs) IsSetRequest() bool { 5382 | return p.Request != nil 5383 | } 5384 | 5385 | func (p *SecondaryQRCodeLoginServiceCheckQrCodeVerifiedArgs) Read(iprot thrift.TProtocol) error { 5386 | if _, err := iprot.ReadStructBegin(); err != nil { 5387 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 5388 | } 5389 | 5390 | for { 5391 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 5392 | if err != nil { 5393 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 5394 | } 5395 | if fieldTypeId == thrift.STOP { 5396 | break 5397 | } 5398 | switch fieldId { 5399 | case 1: 5400 | if fieldTypeId == thrift.STRUCT { 5401 | if err := p.ReadField1(iprot); err != nil { 5402 | return err 5403 | } 5404 | } else { 5405 | if err := iprot.Skip(fieldTypeId); err != nil { 5406 | return err 5407 | } 5408 | } 5409 | default: 5410 | if err := iprot.Skip(fieldTypeId); err != nil { 5411 | return err 5412 | } 5413 | } 5414 | if err := iprot.ReadFieldEnd(); err != nil { 5415 | return err 5416 | } 5417 | } 5418 | if err := iprot.ReadStructEnd(); err != nil { 5419 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 5420 | } 5421 | return nil 5422 | } 5423 | 5424 | func (p *SecondaryQRCodeLoginServiceCheckQrCodeVerifiedArgs) ReadField1(iprot thrift.TProtocol) error { 5425 | p.Request = &CheckQrCodeVerifiedRequest{} 5426 | if err := p.Request.Read(iprot); err != nil { 5427 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) 5428 | } 5429 | return nil 5430 | } 5431 | 5432 | func (p *SecondaryQRCodeLoginServiceCheckQrCodeVerifiedArgs) Write(oprot thrift.TProtocol) error { 5433 | if err := oprot.WriteStructBegin("checkQrCodeVerified_args"); err != nil { 5434 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 5435 | } 5436 | if p != nil { 5437 | if err := p.writeField1(oprot); err != nil { 5438 | return err 5439 | } 5440 | } 5441 | if err := oprot.WriteFieldStop(); err != nil { 5442 | return thrift.PrependError("write field stop error: ", err) 5443 | } 5444 | if err := oprot.WriteStructEnd(); err != nil { 5445 | return thrift.PrependError("write struct stop error: ", err) 5446 | } 5447 | return nil 5448 | } 5449 | 5450 | func (p *SecondaryQRCodeLoginServiceCheckQrCodeVerifiedArgs) writeField1(oprot thrift.TProtocol) (err error) { 5451 | if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { 5452 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err) 5453 | } 5454 | if err := p.Request.Write(oprot); err != nil { 5455 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err) 5456 | } 5457 | if err := oprot.WriteFieldEnd(); err != nil { 5458 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err) 5459 | } 5460 | return err 5461 | } 5462 | 5463 | func (p *SecondaryQRCodeLoginServiceCheckQrCodeVerifiedArgs) String() string { 5464 | if p == nil { 5465 | return "" 5466 | } 5467 | return fmt.Sprintf("SecondaryQRCodeLoginServiceCheckQrCodeVerifiedArgs(%+v)", *p) 5468 | } 5469 | 5470 | // Attributes: 5471 | // - Success 5472 | // - E 5473 | type SecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult struct { 5474 | Success *CheckQrCodeVerifiedResponse `thrift:"success,0" db:"success" json:"success,omitempty"` 5475 | E *SecondaryQrCodeException `thrift:"e,1" db:"e" json:"e,omitempty"` 5476 | } 5477 | 5478 | func NewSecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult() *SecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult { 5479 | return &SecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult{} 5480 | } 5481 | 5482 | var SecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult_Success_DEFAULT *CheckQrCodeVerifiedResponse 5483 | 5484 | func (p *SecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult) GetSuccess() *CheckQrCodeVerifiedResponse { 5485 | if !p.IsSetSuccess() { 5486 | return SecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult_Success_DEFAULT 5487 | } 5488 | return p.Success 5489 | } 5490 | 5491 | var SecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult_E_DEFAULT *SecondaryQrCodeException 5492 | 5493 | func (p *SecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult) GetE() *SecondaryQrCodeException { 5494 | if !p.IsSetE() { 5495 | return SecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult_E_DEFAULT 5496 | } 5497 | return p.E 5498 | } 5499 | func (p *SecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult) IsSetSuccess() bool { 5500 | return p.Success != nil 5501 | } 5502 | 5503 | func (p *SecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult) IsSetE() bool { 5504 | return p.E != nil 5505 | } 5506 | 5507 | func (p *SecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult) Read(iprot thrift.TProtocol) error { 5508 | if _, err := iprot.ReadStructBegin(); err != nil { 5509 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 5510 | } 5511 | 5512 | for { 5513 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() 5514 | if err != nil { 5515 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 5516 | } 5517 | if fieldTypeId == thrift.STOP { 5518 | break 5519 | } 5520 | switch fieldId { 5521 | case 0: 5522 | if fieldTypeId == thrift.STRUCT { 5523 | if err := p.ReadField0(iprot); err != nil { 5524 | return err 5525 | } 5526 | } else { 5527 | if err := iprot.Skip(fieldTypeId); err != nil { 5528 | return err 5529 | } 5530 | } 5531 | case 1: 5532 | if fieldTypeId == thrift.STRUCT { 5533 | if err := p.ReadField1(iprot); err != nil { 5534 | return err 5535 | } 5536 | } else { 5537 | if err := iprot.Skip(fieldTypeId); err != nil { 5538 | return err 5539 | } 5540 | } 5541 | default: 5542 | if err := iprot.Skip(fieldTypeId); err != nil { 5543 | return err 5544 | } 5545 | } 5546 | if err := iprot.ReadFieldEnd(); err != nil { 5547 | return err 5548 | } 5549 | } 5550 | if err := iprot.ReadStructEnd(); err != nil { 5551 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 5552 | } 5553 | return nil 5554 | } 5555 | 5556 | func (p *SecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult) ReadField0(iprot thrift.TProtocol) error { 5557 | p.Success = &CheckQrCodeVerifiedResponse{} 5558 | if err := p.Success.Read(iprot); err != nil { 5559 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) 5560 | } 5561 | return nil 5562 | } 5563 | 5564 | func (p *SecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult) ReadField1(iprot thrift.TProtocol) error { 5565 | p.E = &SecondaryQrCodeException{} 5566 | if err := p.E.Read(iprot); err != nil { 5567 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err) 5568 | } 5569 | return nil 5570 | } 5571 | 5572 | func (p *SecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult) Write(oprot thrift.TProtocol) error { 5573 | if err := oprot.WriteStructBegin("checkQrCodeVerified_result"); err != nil { 5574 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 5575 | } 5576 | if p != nil { 5577 | if err := p.writeField0(oprot); err != nil { 5578 | return err 5579 | } 5580 | if err := p.writeField1(oprot); err != nil { 5581 | return err 5582 | } 5583 | } 5584 | if err := oprot.WriteFieldStop(); err != nil { 5585 | return thrift.PrependError("write field stop error: ", err) 5586 | } 5587 | if err := oprot.WriteStructEnd(); err != nil { 5588 | return thrift.PrependError("write struct stop error: ", err) 5589 | } 5590 | return nil 5591 | } 5592 | 5593 | func (p *SecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult) writeField0(oprot thrift.TProtocol) (err error) { 5594 | if p.IsSetSuccess() { 5595 | if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { 5596 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) 5597 | } 5598 | if err := p.Success.Write(oprot); err != nil { 5599 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) 5600 | } 5601 | if err := oprot.WriteFieldEnd(); err != nil { 5602 | return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) 5603 | } 5604 | } 5605 | return err 5606 | } 5607 | 5608 | func (p *SecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult) writeField1(oprot thrift.TProtocol) (err error) { 5609 | if p.IsSetE() { 5610 | if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { 5611 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) 5612 | } 5613 | if err := p.E.Write(oprot); err != nil { 5614 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err) 5615 | } 5616 | if err := oprot.WriteFieldEnd(); err != nil { 5617 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) 5618 | } 5619 | } 5620 | return err 5621 | } 5622 | 5623 | func (p *SecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult) String() string { 5624 | if p == nil { 5625 | return "" 5626 | } 5627 | return fmt.Sprintf("SecondaryQRCodeLoginServiceCheckQrCodeVerifiedResult(%+v)", *p) 5628 | } 5629 | -------------------------------------------------------------------------------- /talkservice/GoUnusedProtection__.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package talkservice 5 | 6 | var GoUnusedProtection__ int 7 | -------------------------------------------------------------------------------- /talkservice/TalkService-consts.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package talkservice 5 | 6 | import ( 7 | "bytes" 8 | "context" 9 | "fmt" 10 | "github.com/apache/thrift/lib/go/thrift" 11 | "reflect" 12 | ) 13 | 14 | // (needed to ensure safety because of naive import list construction.) 15 | var _ = thrift.ZERO 16 | var _ = fmt.Printf 17 | var _ = context.Background 18 | var _ = reflect.DeepEqual 19 | var _ = bytes.Equal 20 | 21 | func init() { 22 | } 23 | --------------------------------------------------------------------------------