├── config.go ├── rsa_key.go ├── README.md ├── e2ee_key.go ├── aes_ecb.go ├── line_object.go ├── client.go ├── line_crypto.go ├── verify_response.go ├── login.go ├── LICENSE └── linethrift └── line.go /config.go: -------------------------------------------------------------------------------- 1 | package line_login 2 | 3 | const ( 4 | baseUrl = "https://legy-jp-addr.line.naver.jp" 5 | registerUrl = baseUrl + "/api/v4/TalkService.do" 6 | authRegisterUrl = baseUrl + "/api/v4p/rs" 7 | verifyUrl = baseUrl + "/LF1" 8 | 9 | userAgent = "Line/10.17.0" 10 | lineApp = "IOSIPAD\t10.17.0\tiPad OS\t14.1" 11 | ) 12 | -------------------------------------------------------------------------------- /rsa_key.go: -------------------------------------------------------------------------------- 1 | package line_login 2 | 3 | import ( 4 | "github.com/5hields/line-login/linethrift" 5 | "crypto/rsa" 6 | "encoding/hex" 7 | "log" 8 | "math/big" 9 | "strconv" 10 | ) 11 | 12 | func rsaKeyGen(key *linethrift.RSAKey) rsa.PublicKey { 13 | decN, err := hex.DecodeString(key.Nvalue) 14 | if err != nil { 15 | log.Fatal(err) 16 | } 17 | n := big.NewInt(0) 18 | n.SetBytes(decN) 19 | 20 | eVal, err := strconv.ParseInt(key.Evalue, 16, 32) 21 | if err != nil { 22 | log.Fatal(err) 23 | } 24 | e := int(eVal) 25 | returnKey := rsa.PublicKey{N: n, E: e} 26 | 27 | return returnKey 28 | } 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # line-login 2 | 3 | ## _Usage_ 4 | ``` 5 | $ go get -u -v github.com/5hields/line-login 6 | ``` 7 | 8 | ## _Note_ 9 | 1. Enable a LetterSealing 10 | 2. Allow SecondaryLogin (email & password) 11 | 12 | ## _Example_ 13 | ```go 14 | import ( 15 | "fmt" 16 | ll "github.com/5hields/line-login" 17 | ) 18 | 19 | func main() { 20 | token, err := ll.LoginWithCredential("Your Email", "Your Pass") 21 | if err != nil { 22 | // hoge 23 | } 24 | fmt.Println("AuthToken:" + token) 25 | } 26 | ``` 27 | 28 | ## _support_ 29 | LineVersion: 10.17.0 ~
30 | Go Version: go1.15.3 ~ 31 | 32 | ## _BugReport_ 33 | 0authn@protonmail.com 34 | -------------------------------------------------------------------------------- /e2ee_key.go: -------------------------------------------------------------------------------- 1 | package line_login 2 | 3 | import ( 4 | "crypto/rand" 5 | "golang.org/x/crypto/curve25519" 6 | "log" 7 | ) 8 | 9 | type e2eeKeyPair struct { 10 | Pri *[32]byte 11 | Pub *[32]byte 12 | } 13 | 14 | func genKey() (privateKey, publicKey *[32]byte) { 15 | privateKey, publicKey = new([32]byte), new([32]byte) 16 | if _, err := rand.Read(privateKey[:]); err != nil { 17 | log.Fatal(err) 18 | } 19 | 20 | curve25519.ScalarBaseMult(publicKey, privateKey) 21 | return 22 | } 23 | 24 | func newE2EEKeyPair() (r *e2eeKeyPair) { 25 | priKey, pubKey := genKey() 26 | r = &e2eeKeyPair{ 27 | Pri: priKey, Pub: pubKey, 28 | } 29 | return 30 | } 31 | 32 | func (e2ee e2eeKeyPair) GenSharedSecret(keyDate []byte) []byte { 33 | sharedSecret, err := curve25519.X25519(e2ee.Pri[:], keyDate) 34 | if err != nil { 35 | log.Fatal(err) 36 | } 37 | return sharedSecret 38 | } 39 | -------------------------------------------------------------------------------- /aes_ecb.go: -------------------------------------------------------------------------------- 1 | package line_login 2 | 3 | import "crypto/cipher" 4 | 5 | type ecb struct { 6 | b cipher.Block 7 | blockSize int 8 | } 9 | 10 | func newECB(b cipher.Block) *ecb { 11 | return &ecb{ 12 | b: b, 13 | blockSize: b.BlockSize(), 14 | } 15 | } 16 | 17 | type ecbEncrypter ecb 18 | 19 | func newECBEncrypter(b cipher.Block) cipher.BlockMode { 20 | return (*ecbEncrypter)(newECB(b)) 21 | } 22 | 23 | func (x *ecbEncrypter) BlockSize() int { return x.blockSize } 24 | 25 | func (x *ecbEncrypter) CryptBlocks(dst, src []byte) { 26 | if len(src)%x.blockSize != 0 { 27 | panic("crypto/cipher: input not full blocks") 28 | } 29 | if len(dst) < len(src) { 30 | panic("crypto/cipher: output smaller than input") 31 | } 32 | for len(src) > 0 { 33 | x.b.Encrypt(dst, src[:x.blockSize]) 34 | src = src[x.blockSize:] 35 | dst = dst[x.blockSize:] 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /line_object.go: -------------------------------------------------------------------------------- 1 | package line_login 2 | 3 | import ( 4 | "github.com/5hields/line-login/linethrift" 5 | "context" 6 | "log" 7 | ) 8 | 9 | var ctx = context.Background() 10 | 11 | func (c *LineClient) GetRSAKeyInfo() *linethrift.RSAKey { 12 | res, err := c.talkClient.GetRSAKeyInfo(ctx, linethrift.IdentityProvider_LINE) 13 | if err != nil { 14 | log.Fatal(err) 15 | } 16 | 17 | return res 18 | } 19 | 20 | func (c *LineClient) RequestAccountPasswordReset(email string) { 21 | if err := c.talkClient.RequestAccountPasswordReset(ctx, linethrift.IdentityProvider_LINE, email, "ja"); err != nil { 22 | log.Fatal(err) 23 | } 24 | 25 | } 26 | 27 | func (c *LineClient) ConfirmE2EELogin(verifier string, secret []byte) string { 28 | res, err := c.authClient.ConfirmE2EELogin(ctx, verifier, secret) 29 | if err != nil { 30 | log.Fatal(err) 31 | } 32 | return res 33 | } 34 | 35 | func (c *LineClient) LoginZ(req *linethrift.LoginRequest) *linethrift.LoginResult_ { 36 | res, err := c.authClient.LoginZ(ctx, req) 37 | if err != nil { 38 | log.Fatal(err) 39 | } 40 | return res 41 | } 42 | 43 | func (c *LineClient) LogoutZ() { 44 | if err := c.authClient.LogoutZ(ctx); err != nil { 45 | log.Fatal(err) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /client.go: -------------------------------------------------------------------------------- 1 | package line_login 2 | 3 | import ( 4 | "github.com/5hields/line-login/linethrift" 5 | "github.com/apache/thrift/lib/go/thrift" 6 | "log" 7 | ) 8 | 9 | func newThriftClient(apiUrl string) (*thrift.TStandardClient, error) { 10 | trans, err := thrift.NewTHttpClient(apiUrl) 11 | if err != nil { 12 | return nil, err 13 | } 14 | httpTrans := trans.(*thrift.THttpClient) 15 | header := map[string]string{ 16 | "X-Line-Application": lineApp, 17 | "User-Agent": userAgent, 18 | } 19 | for key, val := range header { 20 | httpTrans.SetHeader(key, val) 21 | } 22 | protocol := thrift.NewTCompactProtocolFactory().GetProtocol(trans) 23 | thriftClient := thrift.NewTStandardClient(protocol, protocol) 24 | 25 | return thriftClient, nil 26 | } 27 | 28 | type LineClient struct { 29 | talkClient *linethrift.TalkServiceClient 30 | authClient *linethrift.AuthServiceClient 31 | } 32 | 33 | func NewLineClient() *LineClient { 34 | talk, err := newThriftClient(registerUrl) 35 | if err != nil { 36 | log.Fatal(err) 37 | } 38 | auth, err := newThriftClient(authRegisterUrl) 39 | if err != nil { 40 | log.Fatal(err) 41 | } 42 | return &LineClient{ 43 | talkClient: linethrift.NewTalkServiceClient(talk), 44 | authClient: linethrift.NewAuthServiceClient(auth), 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /line_crypto.go: -------------------------------------------------------------------------------- 1 | package line_login 2 | 3 | import ( 4 | "github.com/5hields/line-login/linethrift" 5 | "crypto/aes" 6 | "crypto/rand" 7 | "crypto/rsa" 8 | "crypto/sha256" 9 | "encoding/hex" 10 | "fmt" 11 | "log" 12 | "math/big" 13 | ) 14 | 15 | func setPassword(msg string) string { 16 | sep := rune(len(msg)) 17 | return string(sep) 18 | } 19 | 20 | func encryptCredential(email, pwd string, key *linethrift.RSAKey) string { 21 | rsaKey := rsaKeyGen(key) 22 | msg := []byte(setPassword(key.SessionKey) + key.SessionKey + setPassword(email) + email + setPassword(pwd) + pwd) 23 | cipherText, err := rsa.EncryptPKCS1v15(rand.Reader, &rsaKey, msg) 24 | if err != nil { 25 | log.Fatal(err) 26 | } 27 | return hex.EncodeToString(cipherText) 28 | } 29 | 30 | func xor(data []byte) (r []byte) { 31 | length := len(data) / 2 32 | r = make([]byte, length) 33 | for i := 0; i < length; i++ { 34 | r[i] = data[i] ^ data[length+i] 35 | } 36 | return 37 | } 38 | 39 | func getSHA256Sum(data ...[]byte) (r []byte) { 40 | sha := sha256.New() 41 | for _, update := range data { 42 | sha.Write(update) 43 | } 44 | r = sha.Sum(nil) 45 | return 46 | } 47 | 48 | func aesECBEncrypt(aesKey, plainText []byte) (cipherText []byte, err error) { 49 | cipherText = make([]byte, len(plainText)) 50 | block, err := aes.NewCipher(aesKey) 51 | ecb := newECBEncrypter(block) 52 | ecb.CryptBlocks(cipherText, plainText) 53 | return 54 | } 55 | 56 | func getHashKeyChain(sharedSecret, encKeyChain []byte) []byte { 57 | hashKey := getSHA256Sum(sharedSecret, []byte("Key")) 58 | data := xor(getSHA256Sum(encKeyChain)) 59 | encKey, _ := aesECBEncrypt(hashKey, data) 60 | return encKey 61 | } 62 | 63 | func createSecret(data []byte) (string, []byte) { 64 | pin, _ := createPinCode() 65 | enc, _ := aesECBEncrypt(getSHA256Sum([]byte(pin)), data) 66 | return pin, enc 67 | } 68 | 69 | func createPinCode() (string, error) { 70 | pin, err := rand.Int(rand.Reader, big.NewInt(999999)) 71 | if err != nil { 72 | return "", err 73 | } 74 | // padding 75 | return fmt.Sprintf("%06d", pin), nil 76 | } 77 | -------------------------------------------------------------------------------- /verify_response.go: -------------------------------------------------------------------------------- 1 | package line_login 2 | 3 | import ( 4 | "encoding/base64" 5 | "encoding/json" 6 | "log" 7 | "net/http" 8 | ) 9 | 10 | type verifyResponse struct { 11 | Result result `json:"result"` 12 | Timestamp string `json:"timestamp"` 13 | AuthPhase string `json:"authPhase"` 14 | } 15 | 16 | type result struct { 17 | Metadata struct { 18 | ErrorCode string `json:"errorCode"` 19 | EncryptedKeyChain string `json:"encryptedKeyChain"` 20 | E2eeVersion string `json:"e2eeVersion"` 21 | KeyId string `json:"keyId"` 22 | PublicKey string `json:"publicKey"` 23 | } `json:"metadata"` 24 | } 25 | 26 | func waitingVerifier(verifier string) ([]byte, []byte) { 27 | res, err := getVerifyURL(verifier) 28 | if err != nil { 29 | log.Fatal(err) 30 | } 31 | 32 | verifyRes, err := decodeToVerifyResponse(res) 33 | if err != nil { 34 | log.Fatal(err) 35 | } 36 | 37 | if verifyRes.IsCanceled() { 38 | log.Fatal("Login Process canceled.") 39 | } 40 | 41 | pubKey, keyChain := verifyRes.GetE2EEKeys() 42 | return pubKey, keyChain 43 | } 44 | 45 | func decodeToVerifyResponse(res *http.Response) (*verifyResponse, error) { 46 | decoder := json.NewDecoder(res.Body) 47 | result := verifyResponse{} 48 | if err := decoder.Decode(&result); err != nil { 49 | return nil, err 50 | } 51 | 52 | defer res.Body.Close() 53 | 54 | return &result, nil 55 | } 56 | 57 | func (r *verifyResponse) GetE2EEKeys() ([]byte, []byte) { 58 | meta := r.Result.Metadata 59 | decPubKey, _ := base64.StdEncoding.DecodeString(meta.PublicKey) 60 | decKeyChain, _ := base64.StdEncoding.DecodeString(meta.EncryptedKeyChain) 61 | 62 | return decPubKey, decKeyChain 63 | } 64 | 65 | func (r *verifyResponse) IsCanceled() bool { 66 | if r.Result.Metadata.ErrorCode == "CANCEL" { 67 | return true 68 | } 69 | return false 70 | } 71 | 72 | func getVerifyURL(verifier string) (*http.Response, error) { 73 | req, err := http.NewRequest("GET", verifyUrl, nil) 74 | if err != nil { 75 | return nil, err 76 | } 77 | req.Header.Set("X-Line-Access", verifier) 78 | req.Header.Set("User-Agent", userAgent) 79 | req.Header.Set("X-Line-Application", lineApp) 80 | 81 | hc := http.Client{} 82 | resp, _ := hc.Do(req) 83 | 84 | return resp, nil 85 | } 86 | -------------------------------------------------------------------------------- /login.go: -------------------------------------------------------------------------------- 1 | package line_login 2 | 3 | import ( 4 | "github.com/5hields/line-login/linethrift" 5 | "fmt" 6 | ) 7 | 8 | type loginOption struct { 9 | Cert string 10 | } 11 | 12 | type option func(*loginOption) 13 | 14 | func newLoginOption() *loginOption { 15 | return &loginOption{ 16 | Cert: "", 17 | } 18 | } 19 | 20 | func Certificate(cert string) func(*loginOption) { 21 | return func(l *loginOption) { 22 | l.Cert = cert 23 | } 24 | } 25 | 26 | func LoginResultDetail(r *linethrift.LoginResult_) { 27 | fmt.Println("Logging in Successful") 28 | fmt.Println("Certificate:", r.Certificate) 29 | fmt.Println("AuthToken:", r.AuthToken) 30 | } 31 | 32 | func newLoginRequestWithE2EE(key *linethrift.RSAKey, secret []byte, encryptedPwd, cert string) *linethrift.LoginRequest { 33 | return &linethrift.LoginRequest{ 34 | Type: linethrift.LoginType_ID_CREDENTIAL_WITH_E2EE, 35 | IdentityProvider: linethrift.IdentityProvider_LINE, 36 | Identifier: key.Keynm, 37 | Password: encryptedPwd, 38 | KeepLoggedIn: true, 39 | Certificate: cert, 40 | SystemName: "Chino", 41 | Secret: secret, 42 | E2eeVersion: 1, 43 | } 44 | } 45 | 46 | func updateLoginRequest(r *linethrift.LoginRequest, verifier string) *linethrift.LoginRequest { 47 | r.Type = linethrift.LoginType_QRCODE 48 | r.Verifier = verifier 49 | return r 50 | } 51 | 52 | func LoginWithCredential(email, pass string, opts ...func(*loginOption)) (string, error) { 53 | line := NewLineClient() 54 | rsaKey := line.GetRSAKeyInfo() 55 | cred := encryptCredential(email, pass, rsaKey) 56 | 57 | keyPair := newE2EEKeyPair() 58 | pin, secret := createSecret(keyPair.Pub[:]) 59 | 60 | c := newLoginOption() 61 | for _, opt := range opts { 62 | opt(c) 63 | } 64 | 65 | req := newLoginRequestWithE2EE(rsaKey, secret, cred, c.Cert) 66 | res := line.LoginZ(req) 67 | 68 | switch res.Type { 69 | case linethrift.LoginResultType_SUCCESS: 70 | res.Certificate = c.Cert 71 | LoginResultDetail(res) 72 | return res.AuthToken, nil 73 | case linethrift.LoginResultType_REQUIRE_DEVICE_CONFIRM: 74 | fmt.Println("Enter [", pin, "] on your mobile device") 75 | pubKey, keyChain := waitingVerifier(res.Verifier) 76 | deviceSecret := getHashKeyChain(keyPair.GenSharedSecret(pubKey), keyChain) 77 | verifier := line.ConfirmE2EELogin(res.Verifier, deviceSecret) 78 | 79 | /* LoginZ E2EE DeviceConfirm */ 80 | updateLoginRequest(req, verifier) 81 | lRes := line.LoginZ(req) 82 | LoginResultDetail(lRes) 83 | return lRes.AuthToken, nil 84 | default: 85 | return "", fmt.Errorf("SecondaryLogin Failed.\n") 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /linethrift/line.go: -------------------------------------------------------------------------------- 1 | // Code generated by Thrift Compiler (0.14.0). DO NOT EDIT. 2 | 3 | package linethrift 4 | 5 | import( 6 | "bytes" 7 | "context" 8 | "reflect" 9 | "database/sql/driver" 10 | "errors" 11 | "fmt" 12 | "time" 13 | "github.com/apache/thrift/lib/go/thrift" 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 _ = time.Now 22 | var _ = bytes.Equal 23 | 24 | type IdentityProvider int64 25 | const ( 26 | IdentityProvider_UNKNOWN IdentityProvider = 0 27 | IdentityProvider_LINE IdentityProvider = 1 28 | IdentityProvider_NAVER_KR IdentityProvider = 2 29 | IdentityProvider_LINE_PHONE IdentityProvider = 3 30 | ) 31 | 32 | func (p IdentityProvider) String() string { 33 | switch p { 34 | case IdentityProvider_UNKNOWN: return "UNKNOWN" 35 | case IdentityProvider_LINE: return "LINE" 36 | case IdentityProvider_NAVER_KR: return "NAVER_KR" 37 | case IdentityProvider_LINE_PHONE: return "LINE_PHONE" 38 | } 39 | return "" 40 | } 41 | 42 | func IdentityProviderFromString(s string) (IdentityProvider, error) { 43 | switch s { 44 | case "UNKNOWN": return IdentityProvider_UNKNOWN, nil 45 | case "LINE": return IdentityProvider_LINE, nil 46 | case "NAVER_KR": return IdentityProvider_NAVER_KR, nil 47 | case "LINE_PHONE": return IdentityProvider_LINE_PHONE, nil 48 | } 49 | return IdentityProvider(0), fmt.Errorf("not a valid IdentityProvider string") 50 | } 51 | 52 | 53 | func IdentityProviderPtr(v IdentityProvider) *IdentityProvider { return &v } 54 | 55 | func (p IdentityProvider) MarshalText() ([]byte, error) { 56 | return []byte(p.String()), nil 57 | } 58 | 59 | func (p *IdentityProvider) UnmarshalText(text []byte) error { 60 | q, err := IdentityProviderFromString(string(text)) 61 | if (err != nil) { 62 | return err 63 | } 64 | *p = q 65 | return nil 66 | } 67 | 68 | func (p *IdentityProvider) Scan(value interface{}) error { 69 | v, ok := value.(int64) 70 | if !ok { 71 | return errors.New("Scan value is not int64") 72 | } 73 | *p = IdentityProvider(v) 74 | return nil 75 | } 76 | 77 | func (p * IdentityProvider) Value() (driver.Value, error) { 78 | if p == nil { 79 | return nil, nil 80 | } 81 | return int64(*p), nil 82 | } 83 | type LoginType int64 84 | const ( 85 | LoginType_ID_CREDENTIAL LoginType = 0 86 | LoginType_QRCODE LoginType = 1 87 | LoginType_ID_CREDENTIAL_WITH_E2EE LoginType = 2 88 | ) 89 | 90 | func (p LoginType) String() string { 91 | switch p { 92 | case LoginType_ID_CREDENTIAL: return "ID_CREDENTIAL" 93 | case LoginType_QRCODE: return "QRCODE" 94 | case LoginType_ID_CREDENTIAL_WITH_E2EE: return "ID_CREDENTIAL_WITH_E2EE" 95 | } 96 | return "" 97 | } 98 | 99 | func LoginTypeFromString(s string) (LoginType, error) { 100 | switch s { 101 | case "ID_CREDENTIAL": return LoginType_ID_CREDENTIAL, nil 102 | case "QRCODE": return LoginType_QRCODE, nil 103 | case "ID_CREDENTIAL_WITH_E2EE": return LoginType_ID_CREDENTIAL_WITH_E2EE, nil 104 | } 105 | return LoginType(0), fmt.Errorf("not a valid LoginType string") 106 | } 107 | 108 | 109 | func LoginTypePtr(v LoginType) *LoginType { return &v } 110 | 111 | func (p LoginType) MarshalText() ([]byte, error) { 112 | return []byte(p.String()), nil 113 | } 114 | 115 | func (p *LoginType) UnmarshalText(text []byte) error { 116 | q, err := LoginTypeFromString(string(text)) 117 | if (err != nil) { 118 | return err 119 | } 120 | *p = q 121 | return nil 122 | } 123 | 124 | func (p *LoginType) Scan(value interface{}) error { 125 | v, ok := value.(int64) 126 | if !ok { 127 | return errors.New("Scan value is not int64") 128 | } 129 | *p = LoginType(v) 130 | return nil 131 | } 132 | 133 | func (p * LoginType) Value() (driver.Value, error) { 134 | if p == nil { 135 | return nil, nil 136 | } 137 | return int64(*p), nil 138 | } 139 | type LoginResultType int64 140 | const ( 141 | LoginResultType_SUCCESS LoginResultType = 1 142 | LoginResultType_REQUIRE_QRCODE LoginResultType = 2 143 | LoginResultType_REQUIRE_DEVICE_CONFIRM LoginResultType = 3 144 | LoginResultType_REQUIRE_SMS_CONFIRM LoginResultType = 4 145 | ) 146 | 147 | func (p LoginResultType) String() string { 148 | switch p { 149 | case LoginResultType_SUCCESS: return "SUCCESS" 150 | case LoginResultType_REQUIRE_QRCODE: return "REQUIRE_QRCODE" 151 | case LoginResultType_REQUIRE_DEVICE_CONFIRM: return "REQUIRE_DEVICE_CONFIRM" 152 | case LoginResultType_REQUIRE_SMS_CONFIRM: return "REQUIRE_SMS_CONFIRM" 153 | } 154 | return "" 155 | } 156 | 157 | func LoginResultTypeFromString(s string) (LoginResultType, error) { 158 | switch s { 159 | case "SUCCESS": return LoginResultType_SUCCESS, nil 160 | case "REQUIRE_QRCODE": return LoginResultType_REQUIRE_QRCODE, nil 161 | case "REQUIRE_DEVICE_CONFIRM": return LoginResultType_REQUIRE_DEVICE_CONFIRM, nil 162 | case "REQUIRE_SMS_CONFIRM": return LoginResultType_REQUIRE_SMS_CONFIRM, nil 163 | } 164 | return LoginResultType(0), fmt.Errorf("not a valid LoginResultType string") 165 | } 166 | 167 | 168 | func LoginResultTypePtr(v LoginResultType) *LoginResultType { return &v } 169 | 170 | func (p LoginResultType) MarshalText() ([]byte, error) { 171 | return []byte(p.String()), nil 172 | } 173 | 174 | func (p *LoginResultType) UnmarshalText(text []byte) error { 175 | q, err := LoginResultTypeFromString(string(text)) 176 | if (err != nil) { 177 | return err 178 | } 179 | *p = q 180 | return nil 181 | } 182 | 183 | func (p *LoginResultType) Scan(value interface{}) error { 184 | v, ok := value.(int64) 185 | if !ok { 186 | return errors.New("Scan value is not int64") 187 | } 188 | *p = LoginResultType(v) 189 | return nil 190 | } 191 | 192 | func (p * LoginResultType) Value() (driver.Value, error) { 193 | if p == nil { 194 | return nil, nil 195 | } 196 | return int64(*p), nil 197 | } 198 | type VerificationMethod int64 199 | const ( 200 | VerificationMethod_NO_AVAILABLE VerificationMethod = 0 201 | VerificationMethod_PIN_VIA_SMS VerificationMethod = 1 202 | VerificationMethod_CALLERID_INDIGO VerificationMethod = 2 203 | VerificationMethod_PIN_VIA_TTS VerificationMethod = 4 204 | VerificationMethod_SKIP VerificationMethod = 10 205 | ) 206 | 207 | func (p VerificationMethod) String() string { 208 | switch p { 209 | case VerificationMethod_NO_AVAILABLE: return "NO_AVAILABLE" 210 | case VerificationMethod_PIN_VIA_SMS: return "PIN_VIA_SMS" 211 | case VerificationMethod_CALLERID_INDIGO: return "CALLERID_INDIGO" 212 | case VerificationMethod_PIN_VIA_TTS: return "PIN_VIA_TTS" 213 | case VerificationMethod_SKIP: return "SKIP" 214 | } 215 | return "" 216 | } 217 | 218 | func VerificationMethodFromString(s string) (VerificationMethod, error) { 219 | switch s { 220 | case "NO_AVAILABLE": return VerificationMethod_NO_AVAILABLE, nil 221 | case "PIN_VIA_SMS": return VerificationMethod_PIN_VIA_SMS, nil 222 | case "CALLERID_INDIGO": return VerificationMethod_CALLERID_INDIGO, nil 223 | case "PIN_VIA_TTS": return VerificationMethod_PIN_VIA_TTS, nil 224 | case "SKIP": return VerificationMethod_SKIP, nil 225 | } 226 | return VerificationMethod(0), fmt.Errorf("not a valid VerificationMethod string") 227 | } 228 | 229 | 230 | func VerificationMethodPtr(v VerificationMethod) *VerificationMethod { return &v } 231 | 232 | func (p VerificationMethod) MarshalText() ([]byte, error) { 233 | return []byte(p.String()), nil 234 | } 235 | 236 | func (p *VerificationMethod) UnmarshalText(text []byte) error { 237 | q, err := VerificationMethodFromString(string(text)) 238 | if (err != nil) { 239 | return err 240 | } 241 | *p = q 242 | return nil 243 | } 244 | 245 | func (p *VerificationMethod) Scan(value interface{}) error { 246 | v, ok := value.(int64) 247 | if !ok { 248 | return errors.New("Scan value is not int64") 249 | } 250 | *p = VerificationMethod(v) 251 | return nil 252 | } 253 | 254 | func (p * VerificationMethod) Value() (driver.Value, error) { 255 | if p == nil { 256 | return nil, nil 257 | } 258 | return int64(*p), nil 259 | } 260 | type ErrorCode int64 261 | const ( 262 | ErrorCode_ILLEGAL_ARGUMENT ErrorCode = 0 263 | ErrorCode_AUTHENTICATION_FAILED ErrorCode = 1 264 | ErrorCode_DB_FAILED ErrorCode = 2 265 | ErrorCode_INVALID_STATE ErrorCode = 3 266 | ErrorCode_EXCESSIVE_ACCESS ErrorCode = 4 267 | ErrorCode_NOT_FOUND ErrorCode = 5 268 | ErrorCode_INVALID_LENGTH ErrorCode = 6 269 | ErrorCode_NOT_AVAILABLE_USER ErrorCode = 7 270 | ErrorCode_NOT_AUTHORIZED_DEVICE ErrorCode = 8 271 | ErrorCode_INVALID_MID ErrorCode = 9 272 | ErrorCode_NOT_A_MEMBER ErrorCode = 10 273 | ErrorCode_INCOMPATIBLE_APP_VERSION ErrorCode = 11 274 | ErrorCode_NOT_READY ErrorCode = 12 275 | ErrorCode_NOT_AVAILABLE_SESSION ErrorCode = 13 276 | ErrorCode_NOT_AUTHORIZED_SESSION ErrorCode = 14 277 | ErrorCode_SYSTEM_ERROR ErrorCode = 15 278 | ErrorCode_NO_AVAILABLE_VERIFICATION_METHOD ErrorCode = 16 279 | ErrorCode_NOT_AUTHENTICATED ErrorCode = 17 280 | ErrorCode_INVALID_IDENTITY_CREDENTIAL ErrorCode = 18 281 | ErrorCode_NOT_AVAILABLE_IDENTITY_IDENTIFIER ErrorCode = 19 282 | ErrorCode_INTERNAL_ERROR ErrorCode = 20 283 | ErrorCode_NO_SUCH_IDENTITY_IDENFIER ErrorCode = 21 284 | ErrorCode_DEACTIVATED_ACCOUNT_BOUND_TO_THIS_IDENTITY ErrorCode = 22 285 | ErrorCode_ILLEGAL_IDENTITY_CREDENTIAL ErrorCode = 23 286 | ErrorCode_UNKNOWN_CHANNEL ErrorCode = 24 287 | ErrorCode_NO_SUCH_MESSAGE_BOX ErrorCode = 25 288 | ErrorCode_NOT_AVAILABLE_MESSAGE_BOX ErrorCode = 26 289 | ErrorCode_CHANNEL_DOES_NOT_MATCH ErrorCode = 27 290 | ErrorCode_NOT_YOUR_MESSAGE ErrorCode = 28 291 | ErrorCode_MESSAGE_DEFINED_ERROR ErrorCode = 29 292 | ErrorCode_USER_CANNOT_ACCEPT_PRESENTS ErrorCode = 30 293 | ErrorCode_USER_NOT_STICKER_OWNER ErrorCode = 32 294 | ErrorCode_MAINTENANCE_ERROR ErrorCode = 33 295 | ErrorCode_ACCOUNT_NOT_MATCHED ErrorCode = 34 296 | ErrorCode_ABUSE_BLOCK ErrorCode = 35 297 | ErrorCode_NOT_FRIEND ErrorCode = 36 298 | ErrorCode_NOT_ALLOWED_CALL ErrorCode = 37 299 | ErrorCode_BLOCK_FRIEND ErrorCode = 38 300 | ErrorCode_INCOMPATIBLE_VOIP_VERSION ErrorCode = 39 301 | ErrorCode_INVALID_SNS_ACCESS_TOKEN ErrorCode = 40 302 | ErrorCode_EXTERNAL_SERVICE_NOT_AVAILABLE ErrorCode = 41 303 | ErrorCode_NOT_ALLOWED_ADD_CONTACT ErrorCode = 42 304 | ErrorCode_NOT_CERTIFICATED ErrorCode = 43 305 | ErrorCode_NOT_ALLOWED_SECONDARY_DEVICE ErrorCode = 44 306 | ErrorCode_INVALID_PIN_CODE ErrorCode = 45 307 | ErrorCode_NOT_FOUND_IDENTITY_CREDENTIAL ErrorCode = 46 308 | ErrorCode_EXCEED_FILE_MAX_SIZE ErrorCode = 47 309 | ErrorCode_EXCEED_DAILY_QUOTA ErrorCode = 48 310 | ErrorCode_NOT_SUPPORT_SEND_FILE ErrorCode = 49 311 | ErrorCode_MUST_UPGRADE ErrorCode = 50 312 | ErrorCode_NOT_AVAILABLE_PIN_CODE_SESSION ErrorCode = 51 313 | ErrorCode_EXPIRED_REVISION ErrorCode = 52 314 | ErrorCode_NOT_YET_PHONE_NUMBER ErrorCode = 54 315 | ErrorCode_BAD_CALL_NUMBER ErrorCode = 55 316 | ErrorCode_UNAVAILABLE_CALL_NUMBER ErrorCode = 56 317 | ErrorCode_NOT_SUPPORT_CALL_SERVICE ErrorCode = 57 318 | ErrorCode_CONGESTION_CONTROL ErrorCode = 58 319 | ErrorCode_NO_BALANCE ErrorCode = 59 320 | ErrorCode_NOT_PERMITTED_CALLER_ID ErrorCode = 60 321 | ErrorCode_NO_CALLER_ID_LIMIT_EXCEEDED ErrorCode = 61 322 | ErrorCode_CALLER_ID_VERIFICATION_REQUIRED ErrorCode = 62 323 | ErrorCode_NO_CALLER_ID_LIMIT_EXCEEDED_AND_VERIFICATION_REQUIRED ErrorCode = 63 324 | ErrorCode_MESSAGE_NOT_FOUND ErrorCode = 64 325 | ErrorCode_INVALID_ACCOUNT_MIGRATION_PINCODE_FORMAT ErrorCode = 65 326 | ErrorCode_ACCOUNT_MIGRATION_PINCODE_NOT_MATCHED ErrorCode = 66 327 | ErrorCode_ACCOUNT_MIGRATION_PINCODE_BLOCKED ErrorCode = 67 328 | ErrorCode_INVALID_PASSWORD_FORMAT ErrorCode = 69 329 | ErrorCode_FEATURE_RESTRICTED ErrorCode = 70 330 | ErrorCode_MESSAGE_NOT_DESTRUCTIBLE ErrorCode = 71 331 | ErrorCode_PAID_CALL_REDEEM_FAILED ErrorCode = 72 332 | ErrorCode_PREVENTED_JOIN_BY_TICKET ErrorCode = 73 333 | ErrorCode_SEND_MESSAGE_NOT_PERMITTED_FROM_LINE_AT ErrorCode = 75 334 | ErrorCode_SEND_MESSAGE_NOT_PERMITTED_WHILE_AUTO_REPLY ErrorCode = 76 335 | ErrorCode_SECURITY_CENTER_NOT_VERIFIED ErrorCode = 77 336 | ErrorCode_SECURITY_CENTER_BLOCKED_BY_SETTING ErrorCode = 78 337 | ErrorCode_SECURITY_CENTER_BLOCKED ErrorCode = 79 338 | ErrorCode_TALK_PROXY_EXCEPTION ErrorCode = 80 339 | ErrorCode_E2EE_INVALID_PROTOCOL ErrorCode = 81 340 | ErrorCode_E2EE_RETRY_ENCRYPT ErrorCode = 82 341 | ErrorCode_E2EE_UPDATE_SENDER_KEY ErrorCode = 83 342 | ErrorCode_E2EE_UPDATE_RECEIVER_KEY ErrorCode = 84 343 | ErrorCode_E2EE_INVALID_ARGUMENT ErrorCode = 85 344 | ErrorCode_E2EE_INVALID_VERSION ErrorCode = 86 345 | ErrorCode_E2EE_SENDER_DISABLED ErrorCode = 87 346 | ErrorCode_E2EE_RECEIVER_DISABLED ErrorCode = 88 347 | ErrorCode_E2EE_SENDER_NOT_ALLOWED ErrorCode = 89 348 | ErrorCode_E2EE_RECEIVER_NOT_ALLOWED ErrorCode = 90 349 | ErrorCode_E2EE_RESEND_FAIL ErrorCode = 91 350 | ErrorCode_E2EE_RESEND_OK ErrorCode = 92 351 | ErrorCode_HITOKOTO_BACKUP_NO_AVAILABLE_DATA ErrorCode = 93 352 | ErrorCode_E2EE_UPDATE_PRIMARY_DEVICE ErrorCode = 94 353 | ErrorCode_SUCCESS ErrorCode = 95 354 | ErrorCode_CANCEL ErrorCode = 96 355 | ErrorCode_E2EE_PRIMARY_NOT_SUPPORT ErrorCode = 97 356 | ErrorCode_E2EE_RETRY_PLAIN ErrorCode = 98 357 | ErrorCode_E2EE_RECREATE_GROUP_KEY ErrorCode = 99 358 | ErrorCode_E2EE_GROUP_TOO_MANY_MEMBERS ErrorCode = 100 359 | ErrorCode_SERVER_BUSY ErrorCode = 101 360 | ErrorCode_NOT_ALLOWED_ADD_FOLLOW ErrorCode = 102 361 | ErrorCode_INCOMING_FRIEND_REQUEST_LIMIT ErrorCode = 103 362 | ErrorCode_OUTGOING_FRIEND_REQUEST_LIMIT ErrorCode = 104 363 | ErrorCode_OUTGOING_FRIEND_REQUEST_QUOTA ErrorCode = 105 364 | ErrorCode_DUPLICATED ErrorCode = 106 365 | ErrorCode_BANNED ErrorCode = 107 366 | ErrorCode_NOT_AN_INVITEE ErrorCode = 108 367 | ErrorCode_NOT_AN_OUTSIDER ErrorCode = 109 368 | ErrorCode_EMPTY_GROUP ErrorCode = 111 369 | ErrorCode_EXCEED_FOLLOW_LIMIT ErrorCode = 112 370 | ErrorCode_UNSUPPORTED_ACCOUNT_TYPE ErrorCode = 113 371 | ErrorCode_AGREEMENT_REQUIRED ErrorCode = 114 372 | ErrorCode_SHOULD_RETRY ErrorCode = 115 373 | ErrorCode_OVER_MAX_CHATS_PER_USER ErrorCode = 116 374 | ErrorCode_NOT_AVAILABLE_API ErrorCode = 117 375 | ) 376 | 377 | func (p ErrorCode) String() string { 378 | switch p { 379 | case ErrorCode_ILLEGAL_ARGUMENT: return "ILLEGAL_ARGUMENT" 380 | case ErrorCode_AUTHENTICATION_FAILED: return "AUTHENTICATION_FAILED" 381 | case ErrorCode_DB_FAILED: return "DB_FAILED" 382 | case ErrorCode_INVALID_STATE: return "INVALID_STATE" 383 | case ErrorCode_EXCESSIVE_ACCESS: return "EXCESSIVE_ACCESS" 384 | case ErrorCode_NOT_FOUND: return "NOT_FOUND" 385 | case ErrorCode_INVALID_LENGTH: return "INVALID_LENGTH" 386 | case ErrorCode_NOT_AVAILABLE_USER: return "NOT_AVAILABLE_USER" 387 | case ErrorCode_NOT_AUTHORIZED_DEVICE: return "NOT_AUTHORIZED_DEVICE" 388 | case ErrorCode_INVALID_MID: return "INVALID_MID" 389 | case ErrorCode_NOT_A_MEMBER: return "NOT_A_MEMBER" 390 | case ErrorCode_INCOMPATIBLE_APP_VERSION: return "INCOMPATIBLE_APP_VERSION" 391 | case ErrorCode_NOT_READY: return "NOT_READY" 392 | case ErrorCode_NOT_AVAILABLE_SESSION: return "NOT_AVAILABLE_SESSION" 393 | case ErrorCode_NOT_AUTHORIZED_SESSION: return "NOT_AUTHORIZED_SESSION" 394 | case ErrorCode_SYSTEM_ERROR: return "SYSTEM_ERROR" 395 | case ErrorCode_NO_AVAILABLE_VERIFICATION_METHOD: return "NO_AVAILABLE_VERIFICATION_METHOD" 396 | case ErrorCode_NOT_AUTHENTICATED: return "NOT_AUTHENTICATED" 397 | case ErrorCode_INVALID_IDENTITY_CREDENTIAL: return "INVALID_IDENTITY_CREDENTIAL" 398 | case ErrorCode_NOT_AVAILABLE_IDENTITY_IDENTIFIER: return "NOT_AVAILABLE_IDENTITY_IDENTIFIER" 399 | case ErrorCode_INTERNAL_ERROR: return "INTERNAL_ERROR" 400 | case ErrorCode_NO_SUCH_IDENTITY_IDENFIER: return "NO_SUCH_IDENTITY_IDENFIER" 401 | case ErrorCode_DEACTIVATED_ACCOUNT_BOUND_TO_THIS_IDENTITY: return "DEACTIVATED_ACCOUNT_BOUND_TO_THIS_IDENTITY" 402 | case ErrorCode_ILLEGAL_IDENTITY_CREDENTIAL: return "ILLEGAL_IDENTITY_CREDENTIAL" 403 | case ErrorCode_UNKNOWN_CHANNEL: return "UNKNOWN_CHANNEL" 404 | case ErrorCode_NO_SUCH_MESSAGE_BOX: return "NO_SUCH_MESSAGE_BOX" 405 | case ErrorCode_NOT_AVAILABLE_MESSAGE_BOX: return "NOT_AVAILABLE_MESSAGE_BOX" 406 | case ErrorCode_CHANNEL_DOES_NOT_MATCH: return "CHANNEL_DOES_NOT_MATCH" 407 | case ErrorCode_NOT_YOUR_MESSAGE: return "NOT_YOUR_MESSAGE" 408 | case ErrorCode_MESSAGE_DEFINED_ERROR: return "MESSAGE_DEFINED_ERROR" 409 | case ErrorCode_USER_CANNOT_ACCEPT_PRESENTS: return "USER_CANNOT_ACCEPT_PRESENTS" 410 | case ErrorCode_USER_NOT_STICKER_OWNER: return "USER_NOT_STICKER_OWNER" 411 | case ErrorCode_MAINTENANCE_ERROR: return "MAINTENANCE_ERROR" 412 | case ErrorCode_ACCOUNT_NOT_MATCHED: return "ACCOUNT_NOT_MATCHED" 413 | case ErrorCode_ABUSE_BLOCK: return "ABUSE_BLOCK" 414 | case ErrorCode_NOT_FRIEND: return "NOT_FRIEND" 415 | case ErrorCode_NOT_ALLOWED_CALL: return "NOT_ALLOWED_CALL" 416 | case ErrorCode_BLOCK_FRIEND: return "BLOCK_FRIEND" 417 | case ErrorCode_INCOMPATIBLE_VOIP_VERSION: return "INCOMPATIBLE_VOIP_VERSION" 418 | case ErrorCode_INVALID_SNS_ACCESS_TOKEN: return "INVALID_SNS_ACCESS_TOKEN" 419 | case ErrorCode_EXTERNAL_SERVICE_NOT_AVAILABLE: return "EXTERNAL_SERVICE_NOT_AVAILABLE" 420 | case ErrorCode_NOT_ALLOWED_ADD_CONTACT: return "NOT_ALLOWED_ADD_CONTACT" 421 | case ErrorCode_NOT_CERTIFICATED: return "NOT_CERTIFICATED" 422 | case ErrorCode_NOT_ALLOWED_SECONDARY_DEVICE: return "NOT_ALLOWED_SECONDARY_DEVICE" 423 | case ErrorCode_INVALID_PIN_CODE: return "INVALID_PIN_CODE" 424 | case ErrorCode_NOT_FOUND_IDENTITY_CREDENTIAL: return "NOT_FOUND_IDENTITY_CREDENTIAL" 425 | case ErrorCode_EXCEED_FILE_MAX_SIZE: return "EXCEED_FILE_MAX_SIZE" 426 | case ErrorCode_EXCEED_DAILY_QUOTA: return "EXCEED_DAILY_QUOTA" 427 | case ErrorCode_NOT_SUPPORT_SEND_FILE: return "NOT_SUPPORT_SEND_FILE" 428 | case ErrorCode_MUST_UPGRADE: return "MUST_UPGRADE" 429 | case ErrorCode_NOT_AVAILABLE_PIN_CODE_SESSION: return "NOT_AVAILABLE_PIN_CODE_SESSION" 430 | case ErrorCode_EXPIRED_REVISION: return "EXPIRED_REVISION" 431 | case ErrorCode_NOT_YET_PHONE_NUMBER: return "NOT_YET_PHONE_NUMBER" 432 | case ErrorCode_BAD_CALL_NUMBER: return "BAD_CALL_NUMBER" 433 | case ErrorCode_UNAVAILABLE_CALL_NUMBER: return "UNAVAILABLE_CALL_NUMBER" 434 | case ErrorCode_NOT_SUPPORT_CALL_SERVICE: return "NOT_SUPPORT_CALL_SERVICE" 435 | case ErrorCode_CONGESTION_CONTROL: return "CONGESTION_CONTROL" 436 | case ErrorCode_NO_BALANCE: return "NO_BALANCE" 437 | case ErrorCode_NOT_PERMITTED_CALLER_ID: return "NOT_PERMITTED_CALLER_ID" 438 | case ErrorCode_NO_CALLER_ID_LIMIT_EXCEEDED: return "NO_CALLER_ID_LIMIT_EXCEEDED" 439 | case ErrorCode_CALLER_ID_VERIFICATION_REQUIRED: return "CALLER_ID_VERIFICATION_REQUIRED" 440 | case ErrorCode_NO_CALLER_ID_LIMIT_EXCEEDED_AND_VERIFICATION_REQUIRED: return "NO_CALLER_ID_LIMIT_EXCEEDED_AND_VERIFICATION_REQUIRED" 441 | case ErrorCode_MESSAGE_NOT_FOUND: return "MESSAGE_NOT_FOUND" 442 | case ErrorCode_INVALID_ACCOUNT_MIGRATION_PINCODE_FORMAT: return "INVALID_ACCOUNT_MIGRATION_PINCODE_FORMAT" 443 | case ErrorCode_ACCOUNT_MIGRATION_PINCODE_NOT_MATCHED: return "ACCOUNT_MIGRATION_PINCODE_NOT_MATCHED" 444 | case ErrorCode_ACCOUNT_MIGRATION_PINCODE_BLOCKED: return "ACCOUNT_MIGRATION_PINCODE_BLOCKED" 445 | case ErrorCode_INVALID_PASSWORD_FORMAT: return "INVALID_PASSWORD_FORMAT" 446 | case ErrorCode_FEATURE_RESTRICTED: return "FEATURE_RESTRICTED" 447 | case ErrorCode_MESSAGE_NOT_DESTRUCTIBLE: return "MESSAGE_NOT_DESTRUCTIBLE" 448 | case ErrorCode_PAID_CALL_REDEEM_FAILED: return "PAID_CALL_REDEEM_FAILED" 449 | case ErrorCode_PREVENTED_JOIN_BY_TICKET: return "PREVENTED_JOIN_BY_TICKET" 450 | case ErrorCode_SEND_MESSAGE_NOT_PERMITTED_FROM_LINE_AT: return "SEND_MESSAGE_NOT_PERMITTED_FROM_LINE_AT" 451 | case ErrorCode_SEND_MESSAGE_NOT_PERMITTED_WHILE_AUTO_REPLY: return "SEND_MESSAGE_NOT_PERMITTED_WHILE_AUTO_REPLY" 452 | case ErrorCode_SECURITY_CENTER_NOT_VERIFIED: return "SECURITY_CENTER_NOT_VERIFIED" 453 | case ErrorCode_SECURITY_CENTER_BLOCKED_BY_SETTING: return "SECURITY_CENTER_BLOCKED_BY_SETTING" 454 | case ErrorCode_SECURITY_CENTER_BLOCKED: return "SECURITY_CENTER_BLOCKED" 455 | case ErrorCode_TALK_PROXY_EXCEPTION: return "TALK_PROXY_EXCEPTION" 456 | case ErrorCode_E2EE_INVALID_PROTOCOL: return "E2EE_INVALID_PROTOCOL" 457 | case ErrorCode_E2EE_RETRY_ENCRYPT: return "E2EE_RETRY_ENCRYPT" 458 | case ErrorCode_E2EE_UPDATE_SENDER_KEY: return "E2EE_UPDATE_SENDER_KEY" 459 | case ErrorCode_E2EE_UPDATE_RECEIVER_KEY: return "E2EE_UPDATE_RECEIVER_KEY" 460 | case ErrorCode_E2EE_INVALID_ARGUMENT: return "E2EE_INVALID_ARGUMENT" 461 | case ErrorCode_E2EE_INVALID_VERSION: return "E2EE_INVALID_VERSION" 462 | case ErrorCode_E2EE_SENDER_DISABLED: return "E2EE_SENDER_DISABLED" 463 | case ErrorCode_E2EE_RECEIVER_DISABLED: return "E2EE_RECEIVER_DISABLED" 464 | case ErrorCode_E2EE_SENDER_NOT_ALLOWED: return "E2EE_SENDER_NOT_ALLOWED" 465 | case ErrorCode_E2EE_RECEIVER_NOT_ALLOWED: return "E2EE_RECEIVER_NOT_ALLOWED" 466 | case ErrorCode_E2EE_RESEND_FAIL: return "E2EE_RESEND_FAIL" 467 | case ErrorCode_E2EE_RESEND_OK: return "E2EE_RESEND_OK" 468 | case ErrorCode_HITOKOTO_BACKUP_NO_AVAILABLE_DATA: return "HITOKOTO_BACKUP_NO_AVAILABLE_DATA" 469 | case ErrorCode_E2EE_UPDATE_PRIMARY_DEVICE: return "E2EE_UPDATE_PRIMARY_DEVICE" 470 | case ErrorCode_SUCCESS: return "SUCCESS" 471 | case ErrorCode_CANCEL: return "CANCEL" 472 | case ErrorCode_E2EE_PRIMARY_NOT_SUPPORT: return "E2EE_PRIMARY_NOT_SUPPORT" 473 | case ErrorCode_E2EE_RETRY_PLAIN: return "E2EE_RETRY_PLAIN" 474 | case ErrorCode_E2EE_RECREATE_GROUP_KEY: return "E2EE_RECREATE_GROUP_KEY" 475 | case ErrorCode_E2EE_GROUP_TOO_MANY_MEMBERS: return "E2EE_GROUP_TOO_MANY_MEMBERS" 476 | case ErrorCode_SERVER_BUSY: return "SERVER_BUSY" 477 | case ErrorCode_NOT_ALLOWED_ADD_FOLLOW: return "NOT_ALLOWED_ADD_FOLLOW" 478 | case ErrorCode_INCOMING_FRIEND_REQUEST_LIMIT: return "INCOMING_FRIEND_REQUEST_LIMIT" 479 | case ErrorCode_OUTGOING_FRIEND_REQUEST_LIMIT: return "OUTGOING_FRIEND_REQUEST_LIMIT" 480 | case ErrorCode_OUTGOING_FRIEND_REQUEST_QUOTA: return "OUTGOING_FRIEND_REQUEST_QUOTA" 481 | case ErrorCode_DUPLICATED: return "DUPLICATED" 482 | case ErrorCode_BANNED: return "BANNED" 483 | case ErrorCode_NOT_AN_INVITEE: return "NOT_AN_INVITEE" 484 | case ErrorCode_NOT_AN_OUTSIDER: return "NOT_AN_OUTSIDER" 485 | case ErrorCode_EMPTY_GROUP: return "EMPTY_GROUP" 486 | case ErrorCode_EXCEED_FOLLOW_LIMIT: return "EXCEED_FOLLOW_LIMIT" 487 | case ErrorCode_UNSUPPORTED_ACCOUNT_TYPE: return "UNSUPPORTED_ACCOUNT_TYPE" 488 | case ErrorCode_AGREEMENT_REQUIRED: return "AGREEMENT_REQUIRED" 489 | case ErrorCode_SHOULD_RETRY: return "SHOULD_RETRY" 490 | case ErrorCode_OVER_MAX_CHATS_PER_USER: return "OVER_MAX_CHATS_PER_USER" 491 | case ErrorCode_NOT_AVAILABLE_API: return "NOT_AVAILABLE_API" 492 | } 493 | return "" 494 | } 495 | 496 | func ErrorCodeFromString(s string) (ErrorCode, error) { 497 | switch s { 498 | case "ILLEGAL_ARGUMENT": return ErrorCode_ILLEGAL_ARGUMENT, nil 499 | case "AUTHENTICATION_FAILED": return ErrorCode_AUTHENTICATION_FAILED, nil 500 | case "DB_FAILED": return ErrorCode_DB_FAILED, nil 501 | case "INVALID_STATE": return ErrorCode_INVALID_STATE, nil 502 | case "EXCESSIVE_ACCESS": return ErrorCode_EXCESSIVE_ACCESS, nil 503 | case "NOT_FOUND": return ErrorCode_NOT_FOUND, nil 504 | case "INVALID_LENGTH": return ErrorCode_INVALID_LENGTH, nil 505 | case "NOT_AVAILABLE_USER": return ErrorCode_NOT_AVAILABLE_USER, nil 506 | case "NOT_AUTHORIZED_DEVICE": return ErrorCode_NOT_AUTHORIZED_DEVICE, nil 507 | case "INVALID_MID": return ErrorCode_INVALID_MID, nil 508 | case "NOT_A_MEMBER": return ErrorCode_NOT_A_MEMBER, nil 509 | case "INCOMPATIBLE_APP_VERSION": return ErrorCode_INCOMPATIBLE_APP_VERSION, nil 510 | case "NOT_READY": return ErrorCode_NOT_READY, nil 511 | case "NOT_AVAILABLE_SESSION": return ErrorCode_NOT_AVAILABLE_SESSION, nil 512 | case "NOT_AUTHORIZED_SESSION": return ErrorCode_NOT_AUTHORIZED_SESSION, nil 513 | case "SYSTEM_ERROR": return ErrorCode_SYSTEM_ERROR, nil 514 | case "NO_AVAILABLE_VERIFICATION_METHOD": return ErrorCode_NO_AVAILABLE_VERIFICATION_METHOD, nil 515 | case "NOT_AUTHENTICATED": return ErrorCode_NOT_AUTHENTICATED, nil 516 | case "INVALID_IDENTITY_CREDENTIAL": return ErrorCode_INVALID_IDENTITY_CREDENTIAL, nil 517 | case "NOT_AVAILABLE_IDENTITY_IDENTIFIER": return ErrorCode_NOT_AVAILABLE_IDENTITY_IDENTIFIER, nil 518 | case "INTERNAL_ERROR": return ErrorCode_INTERNAL_ERROR, nil 519 | case "NO_SUCH_IDENTITY_IDENFIER": return ErrorCode_NO_SUCH_IDENTITY_IDENFIER, nil 520 | case "DEACTIVATED_ACCOUNT_BOUND_TO_THIS_IDENTITY": return ErrorCode_DEACTIVATED_ACCOUNT_BOUND_TO_THIS_IDENTITY, nil 521 | case "ILLEGAL_IDENTITY_CREDENTIAL": return ErrorCode_ILLEGAL_IDENTITY_CREDENTIAL, nil 522 | case "UNKNOWN_CHANNEL": return ErrorCode_UNKNOWN_CHANNEL, nil 523 | case "NO_SUCH_MESSAGE_BOX": return ErrorCode_NO_SUCH_MESSAGE_BOX, nil 524 | case "NOT_AVAILABLE_MESSAGE_BOX": return ErrorCode_NOT_AVAILABLE_MESSAGE_BOX, nil 525 | case "CHANNEL_DOES_NOT_MATCH": return ErrorCode_CHANNEL_DOES_NOT_MATCH, nil 526 | case "NOT_YOUR_MESSAGE": return ErrorCode_NOT_YOUR_MESSAGE, nil 527 | case "MESSAGE_DEFINED_ERROR": return ErrorCode_MESSAGE_DEFINED_ERROR, nil 528 | case "USER_CANNOT_ACCEPT_PRESENTS": return ErrorCode_USER_CANNOT_ACCEPT_PRESENTS, nil 529 | case "USER_NOT_STICKER_OWNER": return ErrorCode_USER_NOT_STICKER_OWNER, nil 530 | case "MAINTENANCE_ERROR": return ErrorCode_MAINTENANCE_ERROR, nil 531 | case "ACCOUNT_NOT_MATCHED": return ErrorCode_ACCOUNT_NOT_MATCHED, nil 532 | case "ABUSE_BLOCK": return ErrorCode_ABUSE_BLOCK, nil 533 | case "NOT_FRIEND": return ErrorCode_NOT_FRIEND, nil 534 | case "NOT_ALLOWED_CALL": return ErrorCode_NOT_ALLOWED_CALL, nil 535 | case "BLOCK_FRIEND": return ErrorCode_BLOCK_FRIEND, nil 536 | case "INCOMPATIBLE_VOIP_VERSION": return ErrorCode_INCOMPATIBLE_VOIP_VERSION, nil 537 | case "INVALID_SNS_ACCESS_TOKEN": return ErrorCode_INVALID_SNS_ACCESS_TOKEN, nil 538 | case "EXTERNAL_SERVICE_NOT_AVAILABLE": return ErrorCode_EXTERNAL_SERVICE_NOT_AVAILABLE, nil 539 | case "NOT_ALLOWED_ADD_CONTACT": return ErrorCode_NOT_ALLOWED_ADD_CONTACT, nil 540 | case "NOT_CERTIFICATED": return ErrorCode_NOT_CERTIFICATED, nil 541 | case "NOT_ALLOWED_SECONDARY_DEVICE": return ErrorCode_NOT_ALLOWED_SECONDARY_DEVICE, nil 542 | case "INVALID_PIN_CODE": return ErrorCode_INVALID_PIN_CODE, nil 543 | case "NOT_FOUND_IDENTITY_CREDENTIAL": return ErrorCode_NOT_FOUND_IDENTITY_CREDENTIAL, nil 544 | case "EXCEED_FILE_MAX_SIZE": return ErrorCode_EXCEED_FILE_MAX_SIZE, nil 545 | case "EXCEED_DAILY_QUOTA": return ErrorCode_EXCEED_DAILY_QUOTA, nil 546 | case "NOT_SUPPORT_SEND_FILE": return ErrorCode_NOT_SUPPORT_SEND_FILE, nil 547 | case "MUST_UPGRADE": return ErrorCode_MUST_UPGRADE, nil 548 | case "NOT_AVAILABLE_PIN_CODE_SESSION": return ErrorCode_NOT_AVAILABLE_PIN_CODE_SESSION, nil 549 | case "EXPIRED_REVISION": return ErrorCode_EXPIRED_REVISION, nil 550 | case "NOT_YET_PHONE_NUMBER": return ErrorCode_NOT_YET_PHONE_NUMBER, nil 551 | case "BAD_CALL_NUMBER": return ErrorCode_BAD_CALL_NUMBER, nil 552 | case "UNAVAILABLE_CALL_NUMBER": return ErrorCode_UNAVAILABLE_CALL_NUMBER, nil 553 | case "NOT_SUPPORT_CALL_SERVICE": return ErrorCode_NOT_SUPPORT_CALL_SERVICE, nil 554 | case "CONGESTION_CONTROL": return ErrorCode_CONGESTION_CONTROL, nil 555 | case "NO_BALANCE": return ErrorCode_NO_BALANCE, nil 556 | case "NOT_PERMITTED_CALLER_ID": return ErrorCode_NOT_PERMITTED_CALLER_ID, nil 557 | case "NO_CALLER_ID_LIMIT_EXCEEDED": return ErrorCode_NO_CALLER_ID_LIMIT_EXCEEDED, nil 558 | case "CALLER_ID_VERIFICATION_REQUIRED": return ErrorCode_CALLER_ID_VERIFICATION_REQUIRED, nil 559 | case "NO_CALLER_ID_LIMIT_EXCEEDED_AND_VERIFICATION_REQUIRED": return ErrorCode_NO_CALLER_ID_LIMIT_EXCEEDED_AND_VERIFICATION_REQUIRED, nil 560 | case "MESSAGE_NOT_FOUND": return ErrorCode_MESSAGE_NOT_FOUND, nil 561 | case "INVALID_ACCOUNT_MIGRATION_PINCODE_FORMAT": return ErrorCode_INVALID_ACCOUNT_MIGRATION_PINCODE_FORMAT, nil 562 | case "ACCOUNT_MIGRATION_PINCODE_NOT_MATCHED": return ErrorCode_ACCOUNT_MIGRATION_PINCODE_NOT_MATCHED, nil 563 | case "ACCOUNT_MIGRATION_PINCODE_BLOCKED": return ErrorCode_ACCOUNT_MIGRATION_PINCODE_BLOCKED, nil 564 | case "INVALID_PASSWORD_FORMAT": return ErrorCode_INVALID_PASSWORD_FORMAT, nil 565 | case "FEATURE_RESTRICTED": return ErrorCode_FEATURE_RESTRICTED, nil 566 | case "MESSAGE_NOT_DESTRUCTIBLE": return ErrorCode_MESSAGE_NOT_DESTRUCTIBLE, nil 567 | case "PAID_CALL_REDEEM_FAILED": return ErrorCode_PAID_CALL_REDEEM_FAILED, nil 568 | case "PREVENTED_JOIN_BY_TICKET": return ErrorCode_PREVENTED_JOIN_BY_TICKET, nil 569 | case "SEND_MESSAGE_NOT_PERMITTED_FROM_LINE_AT": return ErrorCode_SEND_MESSAGE_NOT_PERMITTED_FROM_LINE_AT, nil 570 | case "SEND_MESSAGE_NOT_PERMITTED_WHILE_AUTO_REPLY": return ErrorCode_SEND_MESSAGE_NOT_PERMITTED_WHILE_AUTO_REPLY, nil 571 | case "SECURITY_CENTER_NOT_VERIFIED": return ErrorCode_SECURITY_CENTER_NOT_VERIFIED, nil 572 | case "SECURITY_CENTER_BLOCKED_BY_SETTING": return ErrorCode_SECURITY_CENTER_BLOCKED_BY_SETTING, nil 573 | case "SECURITY_CENTER_BLOCKED": return ErrorCode_SECURITY_CENTER_BLOCKED, nil 574 | case "TALK_PROXY_EXCEPTION": return ErrorCode_TALK_PROXY_EXCEPTION, nil 575 | case "E2EE_INVALID_PROTOCOL": return ErrorCode_E2EE_INVALID_PROTOCOL, nil 576 | case "E2EE_RETRY_ENCRYPT": return ErrorCode_E2EE_RETRY_ENCRYPT, nil 577 | case "E2EE_UPDATE_SENDER_KEY": return ErrorCode_E2EE_UPDATE_SENDER_KEY, nil 578 | case "E2EE_UPDATE_RECEIVER_KEY": return ErrorCode_E2EE_UPDATE_RECEIVER_KEY, nil 579 | case "E2EE_INVALID_ARGUMENT": return ErrorCode_E2EE_INVALID_ARGUMENT, nil 580 | case "E2EE_INVALID_VERSION": return ErrorCode_E2EE_INVALID_VERSION, nil 581 | case "E2EE_SENDER_DISABLED": return ErrorCode_E2EE_SENDER_DISABLED, nil 582 | case "E2EE_RECEIVER_DISABLED": return ErrorCode_E2EE_RECEIVER_DISABLED, nil 583 | case "E2EE_SENDER_NOT_ALLOWED": return ErrorCode_E2EE_SENDER_NOT_ALLOWED, nil 584 | case "E2EE_RECEIVER_NOT_ALLOWED": return ErrorCode_E2EE_RECEIVER_NOT_ALLOWED, nil 585 | case "E2EE_RESEND_FAIL": return ErrorCode_E2EE_RESEND_FAIL, nil 586 | case "E2EE_RESEND_OK": return ErrorCode_E2EE_RESEND_OK, nil 587 | case "HITOKOTO_BACKUP_NO_AVAILABLE_DATA": return ErrorCode_HITOKOTO_BACKUP_NO_AVAILABLE_DATA, nil 588 | case "E2EE_UPDATE_PRIMARY_DEVICE": return ErrorCode_E2EE_UPDATE_PRIMARY_DEVICE, nil 589 | case "SUCCESS": return ErrorCode_SUCCESS, nil 590 | case "CANCEL": return ErrorCode_CANCEL, nil 591 | case "E2EE_PRIMARY_NOT_SUPPORT": return ErrorCode_E2EE_PRIMARY_NOT_SUPPORT, nil 592 | case "E2EE_RETRY_PLAIN": return ErrorCode_E2EE_RETRY_PLAIN, nil 593 | case "E2EE_RECREATE_GROUP_KEY": return ErrorCode_E2EE_RECREATE_GROUP_KEY, nil 594 | case "E2EE_GROUP_TOO_MANY_MEMBERS": return ErrorCode_E2EE_GROUP_TOO_MANY_MEMBERS, nil 595 | case "SERVER_BUSY": return ErrorCode_SERVER_BUSY, nil 596 | case "NOT_ALLOWED_ADD_FOLLOW": return ErrorCode_NOT_ALLOWED_ADD_FOLLOW, nil 597 | case "INCOMING_FRIEND_REQUEST_LIMIT": return ErrorCode_INCOMING_FRIEND_REQUEST_LIMIT, nil 598 | case "OUTGOING_FRIEND_REQUEST_LIMIT": return ErrorCode_OUTGOING_FRIEND_REQUEST_LIMIT, nil 599 | case "OUTGOING_FRIEND_REQUEST_QUOTA": return ErrorCode_OUTGOING_FRIEND_REQUEST_QUOTA, nil 600 | case "DUPLICATED": return ErrorCode_DUPLICATED, nil 601 | case "BANNED": return ErrorCode_BANNED, nil 602 | case "NOT_AN_INVITEE": return ErrorCode_NOT_AN_INVITEE, nil 603 | case "NOT_AN_OUTSIDER": return ErrorCode_NOT_AN_OUTSIDER, nil 604 | case "EMPTY_GROUP": return ErrorCode_EMPTY_GROUP, nil 605 | case "EXCEED_FOLLOW_LIMIT": return ErrorCode_EXCEED_FOLLOW_LIMIT, nil 606 | case "UNSUPPORTED_ACCOUNT_TYPE": return ErrorCode_UNSUPPORTED_ACCOUNT_TYPE, nil 607 | case "AGREEMENT_REQUIRED": return ErrorCode_AGREEMENT_REQUIRED, nil 608 | case "SHOULD_RETRY": return ErrorCode_SHOULD_RETRY, nil 609 | case "OVER_MAX_CHATS_PER_USER": return ErrorCode_OVER_MAX_CHATS_PER_USER, nil 610 | case "NOT_AVAILABLE_API": return ErrorCode_NOT_AVAILABLE_API, nil 611 | } 612 | return ErrorCode(0), fmt.Errorf("not a valid ErrorCode string") 613 | } 614 | 615 | 616 | func ErrorCodePtr(v ErrorCode) *ErrorCode { return &v } 617 | 618 | func (p ErrorCode) MarshalText() ([]byte, error) { 619 | return []byte(p.String()), nil 620 | } 621 | 622 | func (p *ErrorCode) UnmarshalText(text []byte) error { 623 | q, err := ErrorCodeFromString(string(text)) 624 | if (err != nil) { 625 | return err 626 | } 627 | *p = q 628 | return nil 629 | } 630 | 631 | func (p *ErrorCode) Scan(value interface{}) error { 632 | v, ok := value.(int64) 633 | if !ok { 634 | return errors.New("Scan value is not int64") 635 | } 636 | *p = ErrorCode(v) 637 | return nil 638 | } 639 | 640 | func (p * ErrorCode) Value() (driver.Value, error) { 641 | if p == nil { 642 | return nil, nil 643 | } 644 | return int64(*p), nil 645 | } 646 | // Attributes: 647 | // - Keynm 648 | // - Nvalue 649 | // - Evalue 650 | // - SessionKey 651 | type RSAKey struct { 652 | Keynm string `thrift:"keynm,1" db:"keynm" json:"keynm"` 653 | Nvalue string `thrift:"nvalue,2" db:"nvalue" json:"nvalue"` 654 | Evalue string `thrift:"evalue,3" db:"evalue" json:"evalue"` 655 | SessionKey string `thrift:"sessionKey,4" db:"sessionKey" json:"sessionKey"` 656 | } 657 | 658 | func NewRSAKey() *RSAKey { 659 | return &RSAKey{} 660 | } 661 | 662 | 663 | func (p *RSAKey) GetKeynm() string { 664 | return p.Keynm 665 | } 666 | 667 | func (p *RSAKey) GetNvalue() string { 668 | return p.Nvalue 669 | } 670 | 671 | func (p *RSAKey) GetEvalue() string { 672 | return p.Evalue 673 | } 674 | 675 | func (p *RSAKey) GetSessionKey() string { 676 | return p.SessionKey 677 | } 678 | func (p *RSAKey) Read(ctx context.Context, iprot thrift.TProtocol) error { 679 | if _, err := iprot.ReadStructBegin(ctx); err != nil { 680 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 681 | } 682 | 683 | 684 | for { 685 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) 686 | if err != nil { 687 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 688 | } 689 | if fieldTypeId == thrift.STOP { break; } 690 | switch fieldId { 691 | case 1: 692 | if fieldTypeId == thrift.STRING { 693 | if err := p.ReadField1(ctx, iprot); err != nil { 694 | return err 695 | } 696 | } else { 697 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 698 | return err 699 | } 700 | } 701 | case 2: 702 | if fieldTypeId == thrift.STRING { 703 | if err := p.ReadField2(ctx, iprot); err != nil { 704 | return err 705 | } 706 | } else { 707 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 708 | return err 709 | } 710 | } 711 | case 3: 712 | if fieldTypeId == thrift.STRING { 713 | if err := p.ReadField3(ctx, iprot); err != nil { 714 | return err 715 | } 716 | } else { 717 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 718 | return err 719 | } 720 | } 721 | case 4: 722 | if fieldTypeId == thrift.STRING { 723 | if err := p.ReadField4(ctx, iprot); err != nil { 724 | return err 725 | } 726 | } else { 727 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 728 | return err 729 | } 730 | } 731 | default: 732 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 733 | return err 734 | } 735 | } 736 | if err := iprot.ReadFieldEnd(ctx); err != nil { 737 | return err 738 | } 739 | } 740 | if err := iprot.ReadStructEnd(ctx); err != nil { 741 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 742 | } 743 | return nil 744 | } 745 | 746 | func (p *RSAKey) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { 747 | if v, err := iprot.ReadString(ctx); err != nil { 748 | return thrift.PrependError("error reading field 1: ", err) 749 | } else { 750 | p.Keynm = v 751 | } 752 | return nil 753 | } 754 | 755 | func (p *RSAKey) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { 756 | if v, err := iprot.ReadString(ctx); err != nil { 757 | return thrift.PrependError("error reading field 2: ", err) 758 | } else { 759 | p.Nvalue = v 760 | } 761 | return nil 762 | } 763 | 764 | func (p *RSAKey) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { 765 | if v, err := iprot.ReadString(ctx); err != nil { 766 | return thrift.PrependError("error reading field 3: ", err) 767 | } else { 768 | p.Evalue = v 769 | } 770 | return nil 771 | } 772 | 773 | func (p *RSAKey) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { 774 | if v, err := iprot.ReadString(ctx); err != nil { 775 | return thrift.PrependError("error reading field 4: ", err) 776 | } else { 777 | p.SessionKey = v 778 | } 779 | return nil 780 | } 781 | 782 | func (p *RSAKey) Write(ctx context.Context, oprot thrift.TProtocol) error { 783 | if err := oprot.WriteStructBegin(ctx, "RSAKey"); err != nil { 784 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } 785 | if p != nil { 786 | if err := p.writeField1(ctx, oprot); err != nil { return err } 787 | if err := p.writeField2(ctx, oprot); err != nil { return err } 788 | if err := p.writeField3(ctx, oprot); err != nil { return err } 789 | if err := p.writeField4(ctx, oprot); err != nil { return err } 790 | } 791 | if err := oprot.WriteFieldStop(ctx); err != nil { 792 | return thrift.PrependError("write field stop error: ", err) } 793 | if err := oprot.WriteStructEnd(ctx); err != nil { 794 | return thrift.PrependError("write struct stop error: ", err) } 795 | return nil 796 | } 797 | 798 | func (p *RSAKey) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { 799 | if err := oprot.WriteFieldBegin(ctx, "keynm", thrift.STRING, 1); err != nil { 800 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:keynm: ", p), err) } 801 | if err := oprot.WriteString(ctx, string(p.Keynm)); err != nil { 802 | return thrift.PrependError(fmt.Sprintf("%T.keynm (1) field write error: ", p), err) } 803 | if err := oprot.WriteFieldEnd(ctx); err != nil { 804 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:keynm: ", p), err) } 805 | return err 806 | } 807 | 808 | func (p *RSAKey) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { 809 | if err := oprot.WriteFieldBegin(ctx, "nvalue", thrift.STRING, 2); err != nil { 810 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nvalue: ", p), err) } 811 | if err := oprot.WriteString(ctx, string(p.Nvalue)); err != nil { 812 | return thrift.PrependError(fmt.Sprintf("%T.nvalue (2) field write error: ", p), err) } 813 | if err := oprot.WriteFieldEnd(ctx); err != nil { 814 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nvalue: ", p), err) } 815 | return err 816 | } 817 | 818 | func (p *RSAKey) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { 819 | if err := oprot.WriteFieldBegin(ctx, "evalue", thrift.STRING, 3); err != nil { 820 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:evalue: ", p), err) } 821 | if err := oprot.WriteString(ctx, string(p.Evalue)); err != nil { 822 | return thrift.PrependError(fmt.Sprintf("%T.evalue (3) field write error: ", p), err) } 823 | if err := oprot.WriteFieldEnd(ctx); err != nil { 824 | return thrift.PrependError(fmt.Sprintf("%T write field end error 3:evalue: ", p), err) } 825 | return err 826 | } 827 | 828 | func (p *RSAKey) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { 829 | if err := oprot.WriteFieldBegin(ctx, "sessionKey", thrift.STRING, 4); err != nil { 830 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:sessionKey: ", p), err) } 831 | if err := oprot.WriteString(ctx, string(p.SessionKey)); err != nil { 832 | return thrift.PrependError(fmt.Sprintf("%T.sessionKey (4) field write error: ", p), err) } 833 | if err := oprot.WriteFieldEnd(ctx); err != nil { 834 | return thrift.PrependError(fmt.Sprintf("%T write field end error 4:sessionKey: ", p), err) } 835 | return err 836 | } 837 | 838 | func (p *RSAKey) String() string { 839 | if p == nil { 840 | return "" 841 | } 842 | return fmt.Sprintf("RSAKey(%+v)", *p) 843 | } 844 | 845 | // Attributes: 846 | // - Type 847 | // - IdentityProvider 848 | // - Identifier 849 | // - Password 850 | // - KeepLoggedIn 851 | // - AccessLocation 852 | // - SystemName 853 | // - Certificate 854 | // - Verifier 855 | // - Secret 856 | // - E2eeVersion 857 | type LoginRequest struct { 858 | Type LoginType `thrift:"type,1" db:"type" json:"type"` 859 | IdentityProvider IdentityProvider `thrift:"identityProvider,2" db:"identityProvider" json:"identityProvider"` 860 | Identifier string `thrift:"identifier,3" db:"identifier" json:"identifier"` 861 | Password string `thrift:"password,4" db:"password" json:"password"` 862 | KeepLoggedIn bool `thrift:"keepLoggedIn,5" db:"keepLoggedIn" json:"keepLoggedIn"` 863 | AccessLocation string `thrift:"accessLocation,6" db:"accessLocation" json:"accessLocation"` 864 | SystemName string `thrift:"systemName,7" db:"systemName" json:"systemName"` 865 | Certificate string `thrift:"certificate,8" db:"certificate" json:"certificate"` 866 | Verifier string `thrift:"verifier,9" db:"verifier" json:"verifier"` 867 | Secret []byte `thrift:"secret,10" db:"secret" json:"secret"` 868 | E2eeVersion int32 `thrift:"e2eeVersion,11" db:"e2eeVersion" json:"e2eeVersion"` 869 | } 870 | 871 | func NewLoginRequest() *LoginRequest { 872 | return &LoginRequest{} 873 | } 874 | 875 | 876 | func (p *LoginRequest) GetType() LoginType { 877 | return p.Type 878 | } 879 | 880 | func (p *LoginRequest) GetIdentityProvider() IdentityProvider { 881 | return p.IdentityProvider 882 | } 883 | 884 | func (p *LoginRequest) GetIdentifier() string { 885 | return p.Identifier 886 | } 887 | 888 | func (p *LoginRequest) GetPassword() string { 889 | return p.Password 890 | } 891 | 892 | func (p *LoginRequest) GetKeepLoggedIn() bool { 893 | return p.KeepLoggedIn 894 | } 895 | 896 | func (p *LoginRequest) GetAccessLocation() string { 897 | return p.AccessLocation 898 | } 899 | 900 | func (p *LoginRequest) GetSystemName() string { 901 | return p.SystemName 902 | } 903 | 904 | func (p *LoginRequest) GetCertificate() string { 905 | return p.Certificate 906 | } 907 | 908 | func (p *LoginRequest) GetVerifier() string { 909 | return p.Verifier 910 | } 911 | 912 | func (p *LoginRequest) GetSecret() []byte { 913 | return p.Secret 914 | } 915 | 916 | func (p *LoginRequest) GetE2eeVersion() int32 { 917 | return p.E2eeVersion 918 | } 919 | func (p *LoginRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { 920 | if _, err := iprot.ReadStructBegin(ctx); err != nil { 921 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 922 | } 923 | 924 | 925 | for { 926 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) 927 | if err != nil { 928 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 929 | } 930 | if fieldTypeId == thrift.STOP { break; } 931 | switch fieldId { 932 | case 1: 933 | if fieldTypeId == thrift.I32 { 934 | if err := p.ReadField1(ctx, iprot); err != nil { 935 | return err 936 | } 937 | } else { 938 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 939 | return err 940 | } 941 | } 942 | case 2: 943 | if fieldTypeId == thrift.I32 { 944 | if err := p.ReadField2(ctx, iprot); err != nil { 945 | return err 946 | } 947 | } else { 948 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 949 | return err 950 | } 951 | } 952 | case 3: 953 | if fieldTypeId == thrift.STRING { 954 | if err := p.ReadField3(ctx, iprot); err != nil { 955 | return err 956 | } 957 | } else { 958 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 959 | return err 960 | } 961 | } 962 | case 4: 963 | if fieldTypeId == thrift.STRING { 964 | if err := p.ReadField4(ctx, iprot); err != nil { 965 | return err 966 | } 967 | } else { 968 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 969 | return err 970 | } 971 | } 972 | case 5: 973 | if fieldTypeId == thrift.BOOL { 974 | if err := p.ReadField5(ctx, iprot); err != nil { 975 | return err 976 | } 977 | } else { 978 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 979 | return err 980 | } 981 | } 982 | case 6: 983 | if fieldTypeId == thrift.STRING { 984 | if err := p.ReadField6(ctx, iprot); err != nil { 985 | return err 986 | } 987 | } else { 988 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 989 | return err 990 | } 991 | } 992 | case 7: 993 | if fieldTypeId == thrift.STRING { 994 | if err := p.ReadField7(ctx, iprot); err != nil { 995 | return err 996 | } 997 | } else { 998 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 999 | return err 1000 | } 1001 | } 1002 | case 8: 1003 | if fieldTypeId == thrift.STRING { 1004 | if err := p.ReadField8(ctx, iprot); err != nil { 1005 | return err 1006 | } 1007 | } else { 1008 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1009 | return err 1010 | } 1011 | } 1012 | case 9: 1013 | if fieldTypeId == thrift.STRING { 1014 | if err := p.ReadField9(ctx, iprot); err != nil { 1015 | return err 1016 | } 1017 | } else { 1018 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1019 | return err 1020 | } 1021 | } 1022 | case 10: 1023 | if fieldTypeId == thrift.STRING { 1024 | if err := p.ReadField10(ctx, iprot); err != nil { 1025 | return err 1026 | } 1027 | } else { 1028 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1029 | return err 1030 | } 1031 | } 1032 | case 11: 1033 | if fieldTypeId == thrift.I32 { 1034 | if err := p.ReadField11(ctx, iprot); err != nil { 1035 | return err 1036 | } 1037 | } else { 1038 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1039 | return err 1040 | } 1041 | } 1042 | default: 1043 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1044 | return err 1045 | } 1046 | } 1047 | if err := iprot.ReadFieldEnd(ctx); err != nil { 1048 | return err 1049 | } 1050 | } 1051 | if err := iprot.ReadStructEnd(ctx); err != nil { 1052 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 1053 | } 1054 | return nil 1055 | } 1056 | 1057 | func (p *LoginRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { 1058 | if v, err := iprot.ReadI32(ctx); err != nil { 1059 | return thrift.PrependError("error reading field 1: ", err) 1060 | } else { 1061 | temp := LoginType(v) 1062 | p.Type = temp 1063 | } 1064 | return nil 1065 | } 1066 | 1067 | func (p *LoginRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { 1068 | if v, err := iprot.ReadI32(ctx); err != nil { 1069 | return thrift.PrependError("error reading field 2: ", err) 1070 | } else { 1071 | temp := IdentityProvider(v) 1072 | p.IdentityProvider = temp 1073 | } 1074 | return nil 1075 | } 1076 | 1077 | func (p *LoginRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { 1078 | if v, err := iprot.ReadString(ctx); err != nil { 1079 | return thrift.PrependError("error reading field 3: ", err) 1080 | } else { 1081 | p.Identifier = v 1082 | } 1083 | return nil 1084 | } 1085 | 1086 | func (p *LoginRequest) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { 1087 | if v, err := iprot.ReadString(ctx); err != nil { 1088 | return thrift.PrependError("error reading field 4: ", err) 1089 | } else { 1090 | p.Password = v 1091 | } 1092 | return nil 1093 | } 1094 | 1095 | func (p *LoginRequest) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { 1096 | if v, err := iprot.ReadBool(ctx); err != nil { 1097 | return thrift.PrependError("error reading field 5: ", err) 1098 | } else { 1099 | p.KeepLoggedIn = v 1100 | } 1101 | return nil 1102 | } 1103 | 1104 | func (p *LoginRequest) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { 1105 | if v, err := iprot.ReadString(ctx); err != nil { 1106 | return thrift.PrependError("error reading field 6: ", err) 1107 | } else { 1108 | p.AccessLocation = v 1109 | } 1110 | return nil 1111 | } 1112 | 1113 | func (p *LoginRequest) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { 1114 | if v, err := iprot.ReadString(ctx); err != nil { 1115 | return thrift.PrependError("error reading field 7: ", err) 1116 | } else { 1117 | p.SystemName = v 1118 | } 1119 | return nil 1120 | } 1121 | 1122 | func (p *LoginRequest) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { 1123 | if v, err := iprot.ReadString(ctx); err != nil { 1124 | return thrift.PrependError("error reading field 8: ", err) 1125 | } else { 1126 | p.Certificate = v 1127 | } 1128 | return nil 1129 | } 1130 | 1131 | func (p *LoginRequest) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { 1132 | if v, err := iprot.ReadString(ctx); err != nil { 1133 | return thrift.PrependError("error reading field 9: ", err) 1134 | } else { 1135 | p.Verifier = v 1136 | } 1137 | return nil 1138 | } 1139 | 1140 | func (p *LoginRequest) ReadField10(ctx context.Context, iprot thrift.TProtocol) error { 1141 | if v, err := iprot.ReadBinary(ctx); err != nil { 1142 | return thrift.PrependError("error reading field 10: ", err) 1143 | } else { 1144 | p.Secret = v 1145 | } 1146 | return nil 1147 | } 1148 | 1149 | func (p *LoginRequest) ReadField11(ctx context.Context, iprot thrift.TProtocol) error { 1150 | if v, err := iprot.ReadI32(ctx); err != nil { 1151 | return thrift.PrependError("error reading field 11: ", err) 1152 | } else { 1153 | p.E2eeVersion = v 1154 | } 1155 | return nil 1156 | } 1157 | 1158 | func (p *LoginRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { 1159 | if err := oprot.WriteStructBegin(ctx, "LoginRequest"); err != nil { 1160 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } 1161 | if p != nil { 1162 | if err := p.writeField1(ctx, oprot); err != nil { return err } 1163 | if err := p.writeField2(ctx, oprot); err != nil { return err } 1164 | if err := p.writeField3(ctx, oprot); err != nil { return err } 1165 | if err := p.writeField4(ctx, oprot); err != nil { return err } 1166 | if err := p.writeField5(ctx, oprot); err != nil { return err } 1167 | if err := p.writeField6(ctx, oprot); err != nil { return err } 1168 | if err := p.writeField7(ctx, oprot); err != nil { return err } 1169 | if err := p.writeField8(ctx, oprot); err != nil { return err } 1170 | if err := p.writeField9(ctx, oprot); err != nil { return err } 1171 | if err := p.writeField10(ctx, oprot); err != nil { return err } 1172 | if err := p.writeField11(ctx, oprot); err != nil { return err } 1173 | } 1174 | if err := oprot.WriteFieldStop(ctx); err != nil { 1175 | return thrift.PrependError("write field stop error: ", err) } 1176 | if err := oprot.WriteStructEnd(ctx); err != nil { 1177 | return thrift.PrependError("write struct stop error: ", err) } 1178 | return nil 1179 | } 1180 | 1181 | func (p *LoginRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { 1182 | if err := oprot.WriteFieldBegin(ctx, "type", thrift.I32, 1); err != nil { 1183 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } 1184 | if err := oprot.WriteI32(ctx, int32(p.Type)); err != nil { 1185 | return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } 1186 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1187 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } 1188 | return err 1189 | } 1190 | 1191 | func (p *LoginRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { 1192 | if err := oprot.WriteFieldBegin(ctx, "identityProvider", thrift.I32, 2); err != nil { 1193 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:identityProvider: ", p), err) } 1194 | if err := oprot.WriteI32(ctx, int32(p.IdentityProvider)); err != nil { 1195 | return thrift.PrependError(fmt.Sprintf("%T.identityProvider (2) field write error: ", p), err) } 1196 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1197 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:identityProvider: ", p), err) } 1198 | return err 1199 | } 1200 | 1201 | func (p *LoginRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { 1202 | if err := oprot.WriteFieldBegin(ctx, "identifier", thrift.STRING, 3); err != nil { 1203 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:identifier: ", p), err) } 1204 | if err := oprot.WriteString(ctx, string(p.Identifier)); err != nil { 1205 | return thrift.PrependError(fmt.Sprintf("%T.identifier (3) field write error: ", p), err) } 1206 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1207 | return thrift.PrependError(fmt.Sprintf("%T write field end error 3:identifier: ", p), err) } 1208 | return err 1209 | } 1210 | 1211 | func (p *LoginRequest) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { 1212 | if err := oprot.WriteFieldBegin(ctx, "password", thrift.STRING, 4); err != nil { 1213 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:password: ", p), err) } 1214 | if err := oprot.WriteString(ctx, string(p.Password)); err != nil { 1215 | return thrift.PrependError(fmt.Sprintf("%T.password (4) field write error: ", p), err) } 1216 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1217 | return thrift.PrependError(fmt.Sprintf("%T write field end error 4:password: ", p), err) } 1218 | return err 1219 | } 1220 | 1221 | func (p *LoginRequest) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { 1222 | if err := oprot.WriteFieldBegin(ctx, "keepLoggedIn", thrift.BOOL, 5); err != nil { 1223 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:keepLoggedIn: ", p), err) } 1224 | if err := oprot.WriteBool(ctx, bool(p.KeepLoggedIn)); err != nil { 1225 | return thrift.PrependError(fmt.Sprintf("%T.keepLoggedIn (5) field write error: ", p), err) } 1226 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1227 | return thrift.PrependError(fmt.Sprintf("%T write field end error 5:keepLoggedIn: ", p), err) } 1228 | return err 1229 | } 1230 | 1231 | func (p *LoginRequest) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { 1232 | if err := oprot.WriteFieldBegin(ctx, "accessLocation", thrift.STRING, 6); err != nil { 1233 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:accessLocation: ", p), err) } 1234 | if err := oprot.WriteString(ctx, string(p.AccessLocation)); err != nil { 1235 | return thrift.PrependError(fmt.Sprintf("%T.accessLocation (6) field write error: ", p), err) } 1236 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1237 | return thrift.PrependError(fmt.Sprintf("%T write field end error 6:accessLocation: ", p), err) } 1238 | return err 1239 | } 1240 | 1241 | func (p *LoginRequest) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { 1242 | if err := oprot.WriteFieldBegin(ctx, "systemName", thrift.STRING, 7); err != nil { 1243 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:systemName: ", p), err) } 1244 | if err := oprot.WriteString(ctx, string(p.SystemName)); err != nil { 1245 | return thrift.PrependError(fmt.Sprintf("%T.systemName (7) field write error: ", p), err) } 1246 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1247 | return thrift.PrependError(fmt.Sprintf("%T write field end error 7:systemName: ", p), err) } 1248 | return err 1249 | } 1250 | 1251 | func (p *LoginRequest) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { 1252 | if err := oprot.WriteFieldBegin(ctx, "certificate", thrift.STRING, 8); err != nil { 1253 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:certificate: ", p), err) } 1254 | if err := oprot.WriteString(ctx, string(p.Certificate)); err != nil { 1255 | return thrift.PrependError(fmt.Sprintf("%T.certificate (8) field write error: ", p), err) } 1256 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1257 | return thrift.PrependError(fmt.Sprintf("%T write field end error 8:certificate: ", p), err) } 1258 | return err 1259 | } 1260 | 1261 | func (p *LoginRequest) writeField9(ctx context.Context, oprot thrift.TProtocol) (err error) { 1262 | if err := oprot.WriteFieldBegin(ctx, "verifier", thrift.STRING, 9); err != nil { 1263 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:verifier: ", p), err) } 1264 | if err := oprot.WriteString(ctx, string(p.Verifier)); err != nil { 1265 | return thrift.PrependError(fmt.Sprintf("%T.verifier (9) field write error: ", p), err) } 1266 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1267 | return thrift.PrependError(fmt.Sprintf("%T write field end error 9:verifier: ", p), err) } 1268 | return err 1269 | } 1270 | 1271 | func (p *LoginRequest) writeField10(ctx context.Context, oprot thrift.TProtocol) (err error) { 1272 | if err := oprot.WriteFieldBegin(ctx, "secret", thrift.STRING, 10); err != nil { 1273 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:secret: ", p), err) } 1274 | if err := oprot.WriteBinary(ctx, p.Secret); err != nil { 1275 | return thrift.PrependError(fmt.Sprintf("%T.secret (10) field write error: ", p), err) } 1276 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1277 | return thrift.PrependError(fmt.Sprintf("%T write field end error 10:secret: ", p), err) } 1278 | return err 1279 | } 1280 | 1281 | func (p *LoginRequest) writeField11(ctx context.Context, oprot thrift.TProtocol) (err error) { 1282 | if err := oprot.WriteFieldBegin(ctx, "e2eeVersion", thrift.I32, 11); err != nil { 1283 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:e2eeVersion: ", p), err) } 1284 | if err := oprot.WriteI32(ctx, int32(p.E2eeVersion)); err != nil { 1285 | return thrift.PrependError(fmt.Sprintf("%T.e2eeVersion (11) field write error: ", p), err) } 1286 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1287 | return thrift.PrependError(fmt.Sprintf("%T write field end error 11:e2eeVersion: ", p), err) } 1288 | return err 1289 | } 1290 | 1291 | func (p *LoginRequest) String() string { 1292 | if p == nil { 1293 | return "" 1294 | } 1295 | return fmt.Sprintf("LoginRequest(%+v)", *p) 1296 | } 1297 | 1298 | // Attributes: 1299 | // - SessionId 1300 | // - Method 1301 | // - Callback 1302 | // - NormalizedPhone 1303 | // - CountryCode 1304 | // - NationalSignificantNumber 1305 | // - AvailableVerificationMethods 1306 | // - CallerIdMask 1307 | type VerificationSessionData struct { 1308 | SessionId string `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` 1309 | Method VerificationMethod `thrift:"method,2" db:"method" json:"method"` 1310 | Callback string `thrift:"callback,3" db:"callback" json:"callback"` 1311 | NormalizedPhone string `thrift:"normalizedPhone,4" db:"normalizedPhone" json:"normalizedPhone"` 1312 | CountryCode string `thrift:"countryCode,5" db:"countryCode" json:"countryCode"` 1313 | NationalSignificantNumber string `thrift:"nationalSignificantNumber,6" db:"nationalSignificantNumber" json:"nationalSignificantNumber"` 1314 | AvailableVerificationMethods []VerificationMethod `thrift:"availableVerificationMethods,7" db:"availableVerificationMethods" json:"availableVerificationMethods"` 1315 | CallerIdMask string `thrift:"callerIdMask,8" db:"callerIdMask" json:"callerIdMask"` 1316 | } 1317 | 1318 | func NewVerificationSessionData() *VerificationSessionData { 1319 | return &VerificationSessionData{} 1320 | } 1321 | 1322 | 1323 | func (p *VerificationSessionData) GetSessionId() string { 1324 | return p.SessionId 1325 | } 1326 | 1327 | func (p *VerificationSessionData) GetMethod() VerificationMethod { 1328 | return p.Method 1329 | } 1330 | 1331 | func (p *VerificationSessionData) GetCallback() string { 1332 | return p.Callback 1333 | } 1334 | 1335 | func (p *VerificationSessionData) GetNormalizedPhone() string { 1336 | return p.NormalizedPhone 1337 | } 1338 | 1339 | func (p *VerificationSessionData) GetCountryCode() string { 1340 | return p.CountryCode 1341 | } 1342 | 1343 | func (p *VerificationSessionData) GetNationalSignificantNumber() string { 1344 | return p.NationalSignificantNumber 1345 | } 1346 | 1347 | func (p *VerificationSessionData) GetAvailableVerificationMethods() []VerificationMethod { 1348 | return p.AvailableVerificationMethods 1349 | } 1350 | 1351 | func (p *VerificationSessionData) GetCallerIdMask() string { 1352 | return p.CallerIdMask 1353 | } 1354 | func (p *VerificationSessionData) Read(ctx context.Context, iprot thrift.TProtocol) error { 1355 | if _, err := iprot.ReadStructBegin(ctx); err != nil { 1356 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 1357 | } 1358 | 1359 | 1360 | for { 1361 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) 1362 | if err != nil { 1363 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 1364 | } 1365 | if fieldTypeId == thrift.STOP { break; } 1366 | switch fieldId { 1367 | case 1: 1368 | if fieldTypeId == thrift.STRING { 1369 | if err := p.ReadField1(ctx, iprot); err != nil { 1370 | return err 1371 | } 1372 | } else { 1373 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1374 | return err 1375 | } 1376 | } 1377 | case 2: 1378 | if fieldTypeId == thrift.I32 { 1379 | if err := p.ReadField2(ctx, iprot); err != nil { 1380 | return err 1381 | } 1382 | } else { 1383 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1384 | return err 1385 | } 1386 | } 1387 | case 3: 1388 | if fieldTypeId == thrift.STRING { 1389 | if err := p.ReadField3(ctx, iprot); err != nil { 1390 | return err 1391 | } 1392 | } else { 1393 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1394 | return err 1395 | } 1396 | } 1397 | case 4: 1398 | if fieldTypeId == thrift.STRING { 1399 | if err := p.ReadField4(ctx, iprot); err != nil { 1400 | return err 1401 | } 1402 | } else { 1403 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1404 | return err 1405 | } 1406 | } 1407 | case 5: 1408 | if fieldTypeId == thrift.STRING { 1409 | if err := p.ReadField5(ctx, iprot); err != nil { 1410 | return err 1411 | } 1412 | } else { 1413 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1414 | return err 1415 | } 1416 | } 1417 | case 6: 1418 | if fieldTypeId == thrift.STRING { 1419 | if err := p.ReadField6(ctx, iprot); err != nil { 1420 | return err 1421 | } 1422 | } else { 1423 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1424 | return err 1425 | } 1426 | } 1427 | case 7: 1428 | if fieldTypeId == thrift.LIST { 1429 | if err := p.ReadField7(ctx, iprot); err != nil { 1430 | return err 1431 | } 1432 | } else { 1433 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1434 | return err 1435 | } 1436 | } 1437 | case 8: 1438 | if fieldTypeId == thrift.STRING { 1439 | if err := p.ReadField8(ctx, iprot); err != nil { 1440 | return err 1441 | } 1442 | } else { 1443 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1444 | return err 1445 | } 1446 | } 1447 | default: 1448 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1449 | return err 1450 | } 1451 | } 1452 | if err := iprot.ReadFieldEnd(ctx); err != nil { 1453 | return err 1454 | } 1455 | } 1456 | if err := iprot.ReadStructEnd(ctx); err != nil { 1457 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 1458 | } 1459 | return nil 1460 | } 1461 | 1462 | func (p *VerificationSessionData) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { 1463 | if v, err := iprot.ReadString(ctx); err != nil { 1464 | return thrift.PrependError("error reading field 1: ", err) 1465 | } else { 1466 | p.SessionId = v 1467 | } 1468 | return nil 1469 | } 1470 | 1471 | func (p *VerificationSessionData) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { 1472 | if v, err := iprot.ReadI32(ctx); err != nil { 1473 | return thrift.PrependError("error reading field 2: ", err) 1474 | } else { 1475 | temp := VerificationMethod(v) 1476 | p.Method = temp 1477 | } 1478 | return nil 1479 | } 1480 | 1481 | func (p *VerificationSessionData) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { 1482 | if v, err := iprot.ReadString(ctx); err != nil { 1483 | return thrift.PrependError("error reading field 3: ", err) 1484 | } else { 1485 | p.Callback = v 1486 | } 1487 | return nil 1488 | } 1489 | 1490 | func (p *VerificationSessionData) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { 1491 | if v, err := iprot.ReadString(ctx); err != nil { 1492 | return thrift.PrependError("error reading field 4: ", err) 1493 | } else { 1494 | p.NormalizedPhone = v 1495 | } 1496 | return nil 1497 | } 1498 | 1499 | func (p *VerificationSessionData) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { 1500 | if v, err := iprot.ReadString(ctx); err != nil { 1501 | return thrift.PrependError("error reading field 5: ", err) 1502 | } else { 1503 | p.CountryCode = v 1504 | } 1505 | return nil 1506 | } 1507 | 1508 | func (p *VerificationSessionData) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { 1509 | if v, err := iprot.ReadString(ctx); err != nil { 1510 | return thrift.PrependError("error reading field 6: ", err) 1511 | } else { 1512 | p.NationalSignificantNumber = v 1513 | } 1514 | return nil 1515 | } 1516 | 1517 | func (p *VerificationSessionData) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { 1518 | _, size, err := iprot.ReadListBegin(ctx) 1519 | if err != nil { 1520 | return thrift.PrependError("error reading list begin: ", err) 1521 | } 1522 | tSlice := make([]VerificationMethod, 0, size) 1523 | p.AvailableVerificationMethods = tSlice 1524 | for i := 0; i < size; i ++ { 1525 | var _elem0 VerificationMethod 1526 | if v, err := iprot.ReadI32(ctx); err != nil { 1527 | return thrift.PrependError("error reading field 0: ", err) 1528 | } else { 1529 | temp := VerificationMethod(v) 1530 | _elem0 = temp 1531 | } 1532 | p.AvailableVerificationMethods = append(p.AvailableVerificationMethods, _elem0) 1533 | } 1534 | if err := iprot.ReadListEnd(ctx); err != nil { 1535 | return thrift.PrependError("error reading list end: ", err) 1536 | } 1537 | return nil 1538 | } 1539 | 1540 | func (p *VerificationSessionData) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { 1541 | if v, err := iprot.ReadString(ctx); err != nil { 1542 | return thrift.PrependError("error reading field 8: ", err) 1543 | } else { 1544 | p.CallerIdMask = v 1545 | } 1546 | return nil 1547 | } 1548 | 1549 | func (p *VerificationSessionData) Write(ctx context.Context, oprot thrift.TProtocol) error { 1550 | if err := oprot.WriteStructBegin(ctx, "VerificationSessionData"); err != nil { 1551 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } 1552 | if p != nil { 1553 | if err := p.writeField1(ctx, oprot); err != nil { return err } 1554 | if err := p.writeField2(ctx, oprot); err != nil { return err } 1555 | if err := p.writeField3(ctx, oprot); err != nil { return err } 1556 | if err := p.writeField4(ctx, oprot); err != nil { return err } 1557 | if err := p.writeField5(ctx, oprot); err != nil { return err } 1558 | if err := p.writeField6(ctx, oprot); err != nil { return err } 1559 | if err := p.writeField7(ctx, oprot); err != nil { return err } 1560 | if err := p.writeField8(ctx, oprot); err != nil { return err } 1561 | } 1562 | if err := oprot.WriteFieldStop(ctx); err != nil { 1563 | return thrift.PrependError("write field stop error: ", err) } 1564 | if err := oprot.WriteStructEnd(ctx); err != nil { 1565 | return thrift.PrependError("write struct stop error: ", err) } 1566 | return nil 1567 | } 1568 | 1569 | func (p *VerificationSessionData) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { 1570 | if err := oprot.WriteFieldBegin(ctx, "sessionId", thrift.STRING, 1); err != nil { 1571 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) } 1572 | if err := oprot.WriteString(ctx, string(p.SessionId)); err != nil { 1573 | return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) } 1574 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1575 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) } 1576 | return err 1577 | } 1578 | 1579 | func (p *VerificationSessionData) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { 1580 | if err := oprot.WriteFieldBegin(ctx, "method", thrift.I32, 2); err != nil { 1581 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:method: ", p), err) } 1582 | if err := oprot.WriteI32(ctx, int32(p.Method)); err != nil { 1583 | return thrift.PrependError(fmt.Sprintf("%T.method (2) field write error: ", p), err) } 1584 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1585 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:method: ", p), err) } 1586 | return err 1587 | } 1588 | 1589 | func (p *VerificationSessionData) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { 1590 | if err := oprot.WriteFieldBegin(ctx, "callback", thrift.STRING, 3); err != nil { 1591 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:callback: ", p), err) } 1592 | if err := oprot.WriteString(ctx, string(p.Callback)); err != nil { 1593 | return thrift.PrependError(fmt.Sprintf("%T.callback (3) field write error: ", p), err) } 1594 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1595 | return thrift.PrependError(fmt.Sprintf("%T write field end error 3:callback: ", p), err) } 1596 | return err 1597 | } 1598 | 1599 | func (p *VerificationSessionData) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { 1600 | if err := oprot.WriteFieldBegin(ctx, "normalizedPhone", thrift.STRING, 4); err != nil { 1601 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:normalizedPhone: ", p), err) } 1602 | if err := oprot.WriteString(ctx, string(p.NormalizedPhone)); err != nil { 1603 | return thrift.PrependError(fmt.Sprintf("%T.normalizedPhone (4) field write error: ", p), err) } 1604 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1605 | return thrift.PrependError(fmt.Sprintf("%T write field end error 4:normalizedPhone: ", p), err) } 1606 | return err 1607 | } 1608 | 1609 | func (p *VerificationSessionData) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { 1610 | if err := oprot.WriteFieldBegin(ctx, "countryCode", thrift.STRING, 5); err != nil { 1611 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:countryCode: ", p), err) } 1612 | if err := oprot.WriteString(ctx, string(p.CountryCode)); err != nil { 1613 | return thrift.PrependError(fmt.Sprintf("%T.countryCode (5) field write error: ", p), err) } 1614 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1615 | return thrift.PrependError(fmt.Sprintf("%T write field end error 5:countryCode: ", p), err) } 1616 | return err 1617 | } 1618 | 1619 | func (p *VerificationSessionData) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { 1620 | if err := oprot.WriteFieldBegin(ctx, "nationalSignificantNumber", thrift.STRING, 6); err != nil { 1621 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:nationalSignificantNumber: ", p), err) } 1622 | if err := oprot.WriteString(ctx, string(p.NationalSignificantNumber)); err != nil { 1623 | return thrift.PrependError(fmt.Sprintf("%T.nationalSignificantNumber (6) field write error: ", p), err) } 1624 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1625 | return thrift.PrependError(fmt.Sprintf("%T write field end error 6:nationalSignificantNumber: ", p), err) } 1626 | return err 1627 | } 1628 | 1629 | func (p *VerificationSessionData) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { 1630 | if err := oprot.WriteFieldBegin(ctx, "availableVerificationMethods", thrift.LIST, 7); err != nil { 1631 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:availableVerificationMethods: ", p), err) } 1632 | if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.AvailableVerificationMethods)); err != nil { 1633 | return thrift.PrependError("error writing list begin: ", err) 1634 | } 1635 | for _, v := range p.AvailableVerificationMethods { 1636 | if err := oprot.WriteI32(ctx, int32(v)); err != nil { 1637 | return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } 1638 | } 1639 | if err := oprot.WriteListEnd(ctx); err != nil { 1640 | return thrift.PrependError("error writing list end: ", err) 1641 | } 1642 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1643 | return thrift.PrependError(fmt.Sprintf("%T write field end error 7:availableVerificationMethods: ", p), err) } 1644 | return err 1645 | } 1646 | 1647 | func (p *VerificationSessionData) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { 1648 | if err := oprot.WriteFieldBegin(ctx, "callerIdMask", thrift.STRING, 8); err != nil { 1649 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:callerIdMask: ", p), err) } 1650 | if err := oprot.WriteString(ctx, string(p.CallerIdMask)); err != nil { 1651 | return thrift.PrependError(fmt.Sprintf("%T.callerIdMask (8) field write error: ", p), err) } 1652 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1653 | return thrift.PrependError(fmt.Sprintf("%T write field end error 8:callerIdMask: ", p), err) } 1654 | return err 1655 | } 1656 | 1657 | func (p *VerificationSessionData) String() string { 1658 | if p == nil { 1659 | return "" 1660 | } 1661 | return fmt.Sprintf("VerificationSessionData(%+v)", *p) 1662 | } 1663 | 1664 | // Attributes: 1665 | // - AccessToken 1666 | // - RefreshToken 1667 | // - AppId 1668 | // - DurationUntilRefreshInSec 1669 | type TokenIssueResult_ struct { 1670 | AccessToken string `thrift:"accessToken,1" db:"accessToken" json:"accessToken"` 1671 | RefreshToken string `thrift:"refreshToken,2" db:"refreshToken" json:"refreshToken"` 1672 | AppId string `thrift:"appId,3" db:"appId" json:"appId"` 1673 | DurationUntilRefreshInSec int64 `thrift:"durationUntilRefreshInSec,4" db:"durationUntilRefreshInSec" json:"durationUntilRefreshInSec"` 1674 | } 1675 | 1676 | func NewTokenIssueResult_() *TokenIssueResult_ { 1677 | return &TokenIssueResult_{} 1678 | } 1679 | 1680 | 1681 | func (p *TokenIssueResult_) GetAccessToken() string { 1682 | return p.AccessToken 1683 | } 1684 | 1685 | func (p *TokenIssueResult_) GetRefreshToken() string { 1686 | return p.RefreshToken 1687 | } 1688 | 1689 | func (p *TokenIssueResult_) GetAppId() string { 1690 | return p.AppId 1691 | } 1692 | 1693 | func (p *TokenIssueResult_) GetDurationUntilRefreshInSec() int64 { 1694 | return p.DurationUntilRefreshInSec 1695 | } 1696 | func (p *TokenIssueResult_) Read(ctx context.Context, iprot thrift.TProtocol) error { 1697 | if _, err := iprot.ReadStructBegin(ctx); err != nil { 1698 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 1699 | } 1700 | 1701 | 1702 | for { 1703 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) 1704 | if err != nil { 1705 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 1706 | } 1707 | if fieldTypeId == thrift.STOP { break; } 1708 | switch fieldId { 1709 | case 1: 1710 | if fieldTypeId == thrift.STRING { 1711 | if err := p.ReadField1(ctx, iprot); err != nil { 1712 | return err 1713 | } 1714 | } else { 1715 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1716 | return err 1717 | } 1718 | } 1719 | case 2: 1720 | if fieldTypeId == thrift.STRING { 1721 | if err := p.ReadField2(ctx, iprot); err != nil { 1722 | return err 1723 | } 1724 | } else { 1725 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1726 | return err 1727 | } 1728 | } 1729 | case 3: 1730 | if fieldTypeId == thrift.STRING { 1731 | if err := p.ReadField3(ctx, iprot); err != nil { 1732 | return err 1733 | } 1734 | } else { 1735 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1736 | return err 1737 | } 1738 | } 1739 | case 4: 1740 | if fieldTypeId == thrift.I64 { 1741 | if err := p.ReadField4(ctx, iprot); err != nil { 1742 | return err 1743 | } 1744 | } else { 1745 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1746 | return err 1747 | } 1748 | } 1749 | default: 1750 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1751 | return err 1752 | } 1753 | } 1754 | if err := iprot.ReadFieldEnd(ctx); err != nil { 1755 | return err 1756 | } 1757 | } 1758 | if err := iprot.ReadStructEnd(ctx); err != nil { 1759 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 1760 | } 1761 | return nil 1762 | } 1763 | 1764 | func (p *TokenIssueResult_) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { 1765 | if v, err := iprot.ReadString(ctx); err != nil { 1766 | return thrift.PrependError("error reading field 1: ", err) 1767 | } else { 1768 | p.AccessToken = v 1769 | } 1770 | return nil 1771 | } 1772 | 1773 | func (p *TokenIssueResult_) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { 1774 | if v, err := iprot.ReadString(ctx); err != nil { 1775 | return thrift.PrependError("error reading field 2: ", err) 1776 | } else { 1777 | p.RefreshToken = v 1778 | } 1779 | return nil 1780 | } 1781 | 1782 | func (p *TokenIssueResult_) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { 1783 | if v, err := iprot.ReadString(ctx); err != nil { 1784 | return thrift.PrependError("error reading field 3: ", err) 1785 | } else { 1786 | p.AppId = v 1787 | } 1788 | return nil 1789 | } 1790 | 1791 | func (p *TokenIssueResult_) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { 1792 | if v, err := iprot.ReadI64(ctx); err != nil { 1793 | return thrift.PrependError("error reading field 4: ", err) 1794 | } else { 1795 | p.DurationUntilRefreshInSec = v 1796 | } 1797 | return nil 1798 | } 1799 | 1800 | func (p *TokenIssueResult_) Write(ctx context.Context, oprot thrift.TProtocol) error { 1801 | if err := oprot.WriteStructBegin(ctx, "TokenIssueResult"); err != nil { 1802 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } 1803 | if p != nil { 1804 | if err := p.writeField1(ctx, oprot); err != nil { return err } 1805 | if err := p.writeField2(ctx, oprot); err != nil { return err } 1806 | if err := p.writeField3(ctx, oprot); err != nil { return err } 1807 | if err := p.writeField4(ctx, oprot); err != nil { return err } 1808 | } 1809 | if err := oprot.WriteFieldStop(ctx); err != nil { 1810 | return thrift.PrependError("write field stop error: ", err) } 1811 | if err := oprot.WriteStructEnd(ctx); err != nil { 1812 | return thrift.PrependError("write struct stop error: ", err) } 1813 | return nil 1814 | } 1815 | 1816 | func (p *TokenIssueResult_) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { 1817 | if err := oprot.WriteFieldBegin(ctx, "accessToken", thrift.STRING, 1); err != nil { 1818 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:accessToken: ", p), err) } 1819 | if err := oprot.WriteString(ctx, string(p.AccessToken)); err != nil { 1820 | return thrift.PrependError(fmt.Sprintf("%T.accessToken (1) field write error: ", p), err) } 1821 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1822 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:accessToken: ", p), err) } 1823 | return err 1824 | } 1825 | 1826 | func (p *TokenIssueResult_) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { 1827 | if err := oprot.WriteFieldBegin(ctx, "refreshToken", thrift.STRING, 2); err != nil { 1828 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:refreshToken: ", p), err) } 1829 | if err := oprot.WriteString(ctx, string(p.RefreshToken)); err != nil { 1830 | return thrift.PrependError(fmt.Sprintf("%T.refreshToken (2) field write error: ", p), err) } 1831 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1832 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:refreshToken: ", p), err) } 1833 | return err 1834 | } 1835 | 1836 | func (p *TokenIssueResult_) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { 1837 | if err := oprot.WriteFieldBegin(ctx, "appId", thrift.STRING, 3); err != nil { 1838 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:appId: ", p), err) } 1839 | if err := oprot.WriteString(ctx, string(p.AppId)); err != nil { 1840 | return thrift.PrependError(fmt.Sprintf("%T.appId (3) field write error: ", p), err) } 1841 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1842 | return thrift.PrependError(fmt.Sprintf("%T write field end error 3:appId: ", p), err) } 1843 | return err 1844 | } 1845 | 1846 | func (p *TokenIssueResult_) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { 1847 | if err := oprot.WriteFieldBegin(ctx, "durationUntilRefreshInSec", thrift.I64, 4); err != nil { 1848 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:durationUntilRefreshInSec: ", p), err) } 1849 | if err := oprot.WriteI64(ctx, int64(p.DurationUntilRefreshInSec)); err != nil { 1850 | return thrift.PrependError(fmt.Sprintf("%T.durationUntilRefreshInSec (4) field write error: ", p), err) } 1851 | if err := oprot.WriteFieldEnd(ctx); err != nil { 1852 | return thrift.PrependError(fmt.Sprintf("%T write field end error 4:durationUntilRefreshInSec: ", p), err) } 1853 | return err 1854 | } 1855 | 1856 | func (p *TokenIssueResult_) String() string { 1857 | if p == nil { 1858 | return "" 1859 | } 1860 | return fmt.Sprintf("TokenIssueResult_(%+v)", *p) 1861 | } 1862 | 1863 | // Attributes: 1864 | // - AuthToken 1865 | // - Certificate 1866 | // - Verifier 1867 | // - PinCode 1868 | // - Type 1869 | // - LastPrimaryBindTime 1870 | // - DisplayMessage 1871 | // - SessionForSMSConfirm 1872 | // - TokenIssueResult_ 1873 | type LoginResult_ struct { 1874 | AuthToken string `thrift:"authToken,1" db:"authToken" json:"authToken"` 1875 | Certificate string `thrift:"certificate,2" db:"certificate" json:"certificate"` 1876 | Verifier string `thrift:"verifier,3" db:"verifier" json:"verifier"` 1877 | PinCode string `thrift:"pinCode,4" db:"pinCode" json:"pinCode"` 1878 | Type LoginResultType `thrift:"type,5" db:"type" json:"type"` 1879 | LastPrimaryBindTime int64 `thrift:"lastPrimaryBindTime,6" db:"lastPrimaryBindTime" json:"lastPrimaryBindTime"` 1880 | DisplayMessage string `thrift:"displayMessage,7" db:"displayMessage" json:"displayMessage"` 1881 | SessionForSMSConfirm *VerificationSessionData `thrift:"sessionForSMSConfirm,8" db:"sessionForSMSConfirm" json:"sessionForSMSConfirm"` 1882 | TokenIssueResult_ *TokenIssueResult_ `thrift:"tokenIssueResult,9" db:"tokenIssueResult" json:"tokenIssueResult"` 1883 | } 1884 | 1885 | func NewLoginResult_() *LoginResult_ { 1886 | return &LoginResult_{} 1887 | } 1888 | 1889 | 1890 | func (p *LoginResult_) GetAuthToken() string { 1891 | return p.AuthToken 1892 | } 1893 | 1894 | func (p *LoginResult_) GetCertificate() string { 1895 | return p.Certificate 1896 | } 1897 | 1898 | func (p *LoginResult_) GetVerifier() string { 1899 | return p.Verifier 1900 | } 1901 | 1902 | func (p *LoginResult_) GetPinCode() string { 1903 | return p.PinCode 1904 | } 1905 | 1906 | func (p *LoginResult_) GetType() LoginResultType { 1907 | return p.Type 1908 | } 1909 | 1910 | func (p *LoginResult_) GetLastPrimaryBindTime() int64 { 1911 | return p.LastPrimaryBindTime 1912 | } 1913 | 1914 | func (p *LoginResult_) GetDisplayMessage() string { 1915 | return p.DisplayMessage 1916 | } 1917 | var LoginResult__SessionForSMSConfirm_DEFAULT *VerificationSessionData 1918 | func (p *LoginResult_) GetSessionForSMSConfirm() *VerificationSessionData { 1919 | if !p.IsSetSessionForSMSConfirm() { 1920 | return LoginResult__SessionForSMSConfirm_DEFAULT 1921 | } 1922 | return p.SessionForSMSConfirm 1923 | } 1924 | var LoginResult__TokenIssueResult__DEFAULT *TokenIssueResult_ 1925 | func (p *LoginResult_) GetTokenIssueResult_() *TokenIssueResult_ { 1926 | if !p.IsSetTokenIssueResult_() { 1927 | return LoginResult__TokenIssueResult__DEFAULT 1928 | } 1929 | return p.TokenIssueResult_ 1930 | } 1931 | func (p *LoginResult_) IsSetSessionForSMSConfirm() bool { 1932 | return p.SessionForSMSConfirm != nil 1933 | } 1934 | 1935 | func (p *LoginResult_) IsSetTokenIssueResult_() bool { 1936 | return p.TokenIssueResult_ != nil 1937 | } 1938 | 1939 | func (p *LoginResult_) Read(ctx context.Context, iprot thrift.TProtocol) error { 1940 | if _, err := iprot.ReadStructBegin(ctx); err != nil { 1941 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 1942 | } 1943 | 1944 | 1945 | for { 1946 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) 1947 | if err != nil { 1948 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 1949 | } 1950 | if fieldTypeId == thrift.STOP { break; } 1951 | switch fieldId { 1952 | case 1: 1953 | if fieldTypeId == thrift.STRING { 1954 | if err := p.ReadField1(ctx, iprot); err != nil { 1955 | return err 1956 | } 1957 | } else { 1958 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1959 | return err 1960 | } 1961 | } 1962 | case 2: 1963 | if fieldTypeId == thrift.STRING { 1964 | if err := p.ReadField2(ctx, iprot); err != nil { 1965 | return err 1966 | } 1967 | } else { 1968 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1969 | return err 1970 | } 1971 | } 1972 | case 3: 1973 | if fieldTypeId == thrift.STRING { 1974 | if err := p.ReadField3(ctx, iprot); err != nil { 1975 | return err 1976 | } 1977 | } else { 1978 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1979 | return err 1980 | } 1981 | } 1982 | case 4: 1983 | if fieldTypeId == thrift.STRING { 1984 | if err := p.ReadField4(ctx, iprot); err != nil { 1985 | return err 1986 | } 1987 | } else { 1988 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1989 | return err 1990 | } 1991 | } 1992 | case 5: 1993 | if fieldTypeId == thrift.I32 { 1994 | if err := p.ReadField5(ctx, iprot); err != nil { 1995 | return err 1996 | } 1997 | } else { 1998 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 1999 | return err 2000 | } 2001 | } 2002 | case 6: 2003 | if fieldTypeId == thrift.I64 { 2004 | if err := p.ReadField6(ctx, iprot); err != nil { 2005 | return err 2006 | } 2007 | } else { 2008 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 2009 | return err 2010 | } 2011 | } 2012 | case 7: 2013 | if fieldTypeId == thrift.STRING { 2014 | if err := p.ReadField7(ctx, iprot); err != nil { 2015 | return err 2016 | } 2017 | } else { 2018 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 2019 | return err 2020 | } 2021 | } 2022 | case 8: 2023 | if fieldTypeId == thrift.STRUCT { 2024 | if err := p.ReadField8(ctx, iprot); err != nil { 2025 | return err 2026 | } 2027 | } else { 2028 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 2029 | return err 2030 | } 2031 | } 2032 | case 9: 2033 | if fieldTypeId == thrift.STRUCT { 2034 | if err := p.ReadField9(ctx, iprot); err != nil { 2035 | return err 2036 | } 2037 | } else { 2038 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 2039 | return err 2040 | } 2041 | } 2042 | default: 2043 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 2044 | return err 2045 | } 2046 | } 2047 | if err := iprot.ReadFieldEnd(ctx); err != nil { 2048 | return err 2049 | } 2050 | } 2051 | if err := iprot.ReadStructEnd(ctx); err != nil { 2052 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 2053 | } 2054 | return nil 2055 | } 2056 | 2057 | func (p *LoginResult_) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { 2058 | if v, err := iprot.ReadString(ctx); err != nil { 2059 | return thrift.PrependError("error reading field 1: ", err) 2060 | } else { 2061 | p.AuthToken = v 2062 | } 2063 | return nil 2064 | } 2065 | 2066 | func (p *LoginResult_) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { 2067 | if v, err := iprot.ReadString(ctx); err != nil { 2068 | return thrift.PrependError("error reading field 2: ", err) 2069 | } else { 2070 | p.Certificate = v 2071 | } 2072 | return nil 2073 | } 2074 | 2075 | func (p *LoginResult_) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { 2076 | if v, err := iprot.ReadString(ctx); err != nil { 2077 | return thrift.PrependError("error reading field 3: ", err) 2078 | } else { 2079 | p.Verifier = v 2080 | } 2081 | return nil 2082 | } 2083 | 2084 | func (p *LoginResult_) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { 2085 | if v, err := iprot.ReadString(ctx); err != nil { 2086 | return thrift.PrependError("error reading field 4: ", err) 2087 | } else { 2088 | p.PinCode = v 2089 | } 2090 | return nil 2091 | } 2092 | 2093 | func (p *LoginResult_) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { 2094 | if v, err := iprot.ReadI32(ctx); err != nil { 2095 | return thrift.PrependError("error reading field 5: ", err) 2096 | } else { 2097 | temp := LoginResultType(v) 2098 | p.Type = temp 2099 | } 2100 | return nil 2101 | } 2102 | 2103 | func (p *LoginResult_) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { 2104 | if v, err := iprot.ReadI64(ctx); err != nil { 2105 | return thrift.PrependError("error reading field 6: ", err) 2106 | } else { 2107 | p.LastPrimaryBindTime = v 2108 | } 2109 | return nil 2110 | } 2111 | 2112 | func (p *LoginResult_) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { 2113 | if v, err := iprot.ReadString(ctx); err != nil { 2114 | return thrift.PrependError("error reading field 7: ", err) 2115 | } else { 2116 | p.DisplayMessage = v 2117 | } 2118 | return nil 2119 | } 2120 | 2121 | func (p *LoginResult_) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { 2122 | p.SessionForSMSConfirm = &VerificationSessionData{} 2123 | if err := p.SessionForSMSConfirm.Read(ctx, iprot); err != nil { 2124 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionForSMSConfirm), err) 2125 | } 2126 | return nil 2127 | } 2128 | 2129 | func (p *LoginResult_) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { 2130 | p.TokenIssueResult_ = &TokenIssueResult_{} 2131 | if err := p.TokenIssueResult_.Read(ctx, iprot); err != nil { 2132 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TokenIssueResult_), err) 2133 | } 2134 | return nil 2135 | } 2136 | 2137 | func (p *LoginResult_) Write(ctx context.Context, oprot thrift.TProtocol) error { 2138 | if err := oprot.WriteStructBegin(ctx, "LoginResult"); err != nil { 2139 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } 2140 | if p != nil { 2141 | if err := p.writeField1(ctx, oprot); err != nil { return err } 2142 | if err := p.writeField2(ctx, oprot); err != nil { return err } 2143 | if err := p.writeField3(ctx, oprot); err != nil { return err } 2144 | if err := p.writeField4(ctx, oprot); err != nil { return err } 2145 | if err := p.writeField5(ctx, oprot); err != nil { return err } 2146 | if err := p.writeField6(ctx, oprot); err != nil { return err } 2147 | if err := p.writeField7(ctx, oprot); err != nil { return err } 2148 | if err := p.writeField8(ctx, oprot); err != nil { return err } 2149 | if err := p.writeField9(ctx, oprot); err != nil { return err } 2150 | } 2151 | if err := oprot.WriteFieldStop(ctx); err != nil { 2152 | return thrift.PrependError("write field stop error: ", err) } 2153 | if err := oprot.WriteStructEnd(ctx); err != nil { 2154 | return thrift.PrependError("write struct stop error: ", err) } 2155 | return nil 2156 | } 2157 | 2158 | func (p *LoginResult_) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { 2159 | if err := oprot.WriteFieldBegin(ctx, "authToken", thrift.STRING, 1); err != nil { 2160 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:authToken: ", p), err) } 2161 | if err := oprot.WriteString(ctx, string(p.AuthToken)); err != nil { 2162 | return thrift.PrependError(fmt.Sprintf("%T.authToken (1) field write error: ", p), err) } 2163 | if err := oprot.WriteFieldEnd(ctx); err != nil { 2164 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:authToken: ", p), err) } 2165 | return err 2166 | } 2167 | 2168 | func (p *LoginResult_) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { 2169 | if err := oprot.WriteFieldBegin(ctx, "certificate", thrift.STRING, 2); err != nil { 2170 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:certificate: ", p), err) } 2171 | if err := oprot.WriteString(ctx, string(p.Certificate)); err != nil { 2172 | return thrift.PrependError(fmt.Sprintf("%T.certificate (2) field write error: ", p), err) } 2173 | if err := oprot.WriteFieldEnd(ctx); err != nil { 2174 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:certificate: ", p), err) } 2175 | return err 2176 | } 2177 | 2178 | func (p *LoginResult_) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { 2179 | if err := oprot.WriteFieldBegin(ctx, "verifier", thrift.STRING, 3); err != nil { 2180 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:verifier: ", p), err) } 2181 | if err := oprot.WriteString(ctx, string(p.Verifier)); err != nil { 2182 | return thrift.PrependError(fmt.Sprintf("%T.verifier (3) field write error: ", p), err) } 2183 | if err := oprot.WriteFieldEnd(ctx); err != nil { 2184 | return thrift.PrependError(fmt.Sprintf("%T write field end error 3:verifier: ", p), err) } 2185 | return err 2186 | } 2187 | 2188 | func (p *LoginResult_) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { 2189 | if err := oprot.WriteFieldBegin(ctx, "pinCode", thrift.STRING, 4); err != nil { 2190 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:pinCode: ", p), err) } 2191 | if err := oprot.WriteString(ctx, string(p.PinCode)); err != nil { 2192 | return thrift.PrependError(fmt.Sprintf("%T.pinCode (4) field write error: ", p), err) } 2193 | if err := oprot.WriteFieldEnd(ctx); err != nil { 2194 | return thrift.PrependError(fmt.Sprintf("%T write field end error 4:pinCode: ", p), err) } 2195 | return err 2196 | } 2197 | 2198 | func (p *LoginResult_) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { 2199 | if err := oprot.WriteFieldBegin(ctx, "type", thrift.I32, 5); err != nil { 2200 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:type: ", p), err) } 2201 | if err := oprot.WriteI32(ctx, int32(p.Type)); err != nil { 2202 | return thrift.PrependError(fmt.Sprintf("%T.type (5) field write error: ", p), err) } 2203 | if err := oprot.WriteFieldEnd(ctx); err != nil { 2204 | return thrift.PrependError(fmt.Sprintf("%T write field end error 5:type: ", p), err) } 2205 | return err 2206 | } 2207 | 2208 | func (p *LoginResult_) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { 2209 | if err := oprot.WriteFieldBegin(ctx, "lastPrimaryBindTime", thrift.I64, 6); err != nil { 2210 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:lastPrimaryBindTime: ", p), err) } 2211 | if err := oprot.WriteI64(ctx, int64(p.LastPrimaryBindTime)); err != nil { 2212 | return thrift.PrependError(fmt.Sprintf("%T.lastPrimaryBindTime (6) field write error: ", p), err) } 2213 | if err := oprot.WriteFieldEnd(ctx); err != nil { 2214 | return thrift.PrependError(fmt.Sprintf("%T write field end error 6:lastPrimaryBindTime: ", p), err) } 2215 | return err 2216 | } 2217 | 2218 | func (p *LoginResult_) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { 2219 | if err := oprot.WriteFieldBegin(ctx, "displayMessage", thrift.STRING, 7); err != nil { 2220 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:displayMessage: ", p), err) } 2221 | if err := oprot.WriteString(ctx, string(p.DisplayMessage)); err != nil { 2222 | return thrift.PrependError(fmt.Sprintf("%T.displayMessage (7) field write error: ", p), err) } 2223 | if err := oprot.WriteFieldEnd(ctx); err != nil { 2224 | return thrift.PrependError(fmt.Sprintf("%T write field end error 7:displayMessage: ", p), err) } 2225 | return err 2226 | } 2227 | 2228 | func (p *LoginResult_) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { 2229 | if err := oprot.WriteFieldBegin(ctx, "sessionForSMSConfirm", thrift.STRUCT, 8); err != nil { 2230 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:sessionForSMSConfirm: ", p), err) } 2231 | if err := p.SessionForSMSConfirm.Write(ctx, oprot); err != nil { 2232 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionForSMSConfirm), err) 2233 | } 2234 | if err := oprot.WriteFieldEnd(ctx); err != nil { 2235 | return thrift.PrependError(fmt.Sprintf("%T write field end error 8:sessionForSMSConfirm: ", p), err) } 2236 | return err 2237 | } 2238 | 2239 | func (p *LoginResult_) writeField9(ctx context.Context, oprot thrift.TProtocol) (err error) { 2240 | if err := oprot.WriteFieldBegin(ctx, "tokenIssueResult", thrift.STRUCT, 9); err != nil { 2241 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:tokenIssueResult: ", p), err) } 2242 | if err := p.TokenIssueResult_.Write(ctx, oprot); err != nil { 2243 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TokenIssueResult_), err) 2244 | } 2245 | if err := oprot.WriteFieldEnd(ctx); err != nil { 2246 | return thrift.PrependError(fmt.Sprintf("%T write field end error 9:tokenIssueResult: ", p), err) } 2247 | return err 2248 | } 2249 | 2250 | func (p *LoginResult_) String() string { 2251 | if p == nil { 2252 | return "" 2253 | } 2254 | return fmt.Sprintf("LoginResult_(%+v)", *p) 2255 | } 2256 | 2257 | // Attributes: 2258 | // - Code 2259 | // - Reason 2260 | // - ParameterMap 2261 | type TalkException struct { 2262 | Code ErrorCode `thrift:"code,1" db:"code" json:"code"` 2263 | Reason string `thrift:"reason,2" db:"reason" json:"reason"` 2264 | ParameterMap map[string]string `thrift:"parameterMap,3" db:"parameterMap" json:"parameterMap"` 2265 | } 2266 | 2267 | func NewTalkException() *TalkException { 2268 | return &TalkException{} 2269 | } 2270 | 2271 | 2272 | func (p *TalkException) GetCode() ErrorCode { 2273 | return p.Code 2274 | } 2275 | 2276 | func (p *TalkException) GetReason() string { 2277 | return p.Reason 2278 | } 2279 | 2280 | func (p *TalkException) GetParameterMap() map[string]string { 2281 | return p.ParameterMap 2282 | } 2283 | func (p *TalkException) Read(ctx context.Context, iprot thrift.TProtocol) error { 2284 | if _, err := iprot.ReadStructBegin(ctx); err != nil { 2285 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 2286 | } 2287 | 2288 | 2289 | for { 2290 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) 2291 | if err != nil { 2292 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 2293 | } 2294 | if fieldTypeId == thrift.STOP { break; } 2295 | switch fieldId { 2296 | case 1: 2297 | if fieldTypeId == thrift.I32 { 2298 | if err := p.ReadField1(ctx, iprot); err != nil { 2299 | return err 2300 | } 2301 | } else { 2302 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 2303 | return err 2304 | } 2305 | } 2306 | case 2: 2307 | if fieldTypeId == thrift.STRING { 2308 | if err := p.ReadField2(ctx, iprot); err != nil { 2309 | return err 2310 | } 2311 | } else { 2312 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 2313 | return err 2314 | } 2315 | } 2316 | case 3: 2317 | if fieldTypeId == thrift.MAP { 2318 | if err := p.ReadField3(ctx, iprot); err != nil { 2319 | return err 2320 | } 2321 | } else { 2322 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 2323 | return err 2324 | } 2325 | } 2326 | default: 2327 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 2328 | return err 2329 | } 2330 | } 2331 | if err := iprot.ReadFieldEnd(ctx); err != nil { 2332 | return err 2333 | } 2334 | } 2335 | if err := iprot.ReadStructEnd(ctx); err != nil { 2336 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 2337 | } 2338 | return nil 2339 | } 2340 | 2341 | func (p *TalkException) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { 2342 | if v, err := iprot.ReadI32(ctx); err != nil { 2343 | return thrift.PrependError("error reading field 1: ", err) 2344 | } else { 2345 | temp := ErrorCode(v) 2346 | p.Code = temp 2347 | } 2348 | return nil 2349 | } 2350 | 2351 | func (p *TalkException) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { 2352 | if v, err := iprot.ReadString(ctx); err != nil { 2353 | return thrift.PrependError("error reading field 2: ", err) 2354 | } else { 2355 | p.Reason = v 2356 | } 2357 | return nil 2358 | } 2359 | 2360 | func (p *TalkException) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { 2361 | _, _, size, err := iprot.ReadMapBegin(ctx) 2362 | if err != nil { 2363 | return thrift.PrependError("error reading map begin: ", err) 2364 | } 2365 | tMap := make(map[string]string, size) 2366 | p.ParameterMap = tMap 2367 | for i := 0; i < size; i ++ { 2368 | var _key1 string 2369 | if v, err := iprot.ReadString(ctx); err != nil { 2370 | return thrift.PrependError("error reading field 0: ", err) 2371 | } else { 2372 | _key1 = v 2373 | } 2374 | var _val2 string 2375 | if v, err := iprot.ReadString(ctx); err != nil { 2376 | return thrift.PrependError("error reading field 0: ", err) 2377 | } else { 2378 | _val2 = v 2379 | } 2380 | p.ParameterMap[_key1] = _val2 2381 | } 2382 | if err := iprot.ReadMapEnd(ctx); err != nil { 2383 | return thrift.PrependError("error reading map end: ", err) 2384 | } 2385 | return nil 2386 | } 2387 | 2388 | func (p *TalkException) Write(ctx context.Context, oprot thrift.TProtocol) error { 2389 | if err := oprot.WriteStructBegin(ctx, "TalkException"); err != nil { 2390 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } 2391 | if p != nil { 2392 | if err := p.writeField1(ctx, oprot); err != nil { return err } 2393 | if err := p.writeField2(ctx, oprot); err != nil { return err } 2394 | if err := p.writeField3(ctx, oprot); err != nil { return err } 2395 | } 2396 | if err := oprot.WriteFieldStop(ctx); err != nil { 2397 | return thrift.PrependError("write field stop error: ", err) } 2398 | if err := oprot.WriteStructEnd(ctx); err != nil { 2399 | return thrift.PrependError("write struct stop error: ", err) } 2400 | return nil 2401 | } 2402 | 2403 | func (p *TalkException) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { 2404 | if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { 2405 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } 2406 | if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { 2407 | return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } 2408 | if err := oprot.WriteFieldEnd(ctx); err != nil { 2409 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } 2410 | return err 2411 | } 2412 | 2413 | func (p *TalkException) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { 2414 | if err := oprot.WriteFieldBegin(ctx, "reason", thrift.STRING, 2); err != nil { 2415 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:reason: ", p), err) } 2416 | if err := oprot.WriteString(ctx, string(p.Reason)); err != nil { 2417 | return thrift.PrependError(fmt.Sprintf("%T.reason (2) field write error: ", p), err) } 2418 | if err := oprot.WriteFieldEnd(ctx); err != nil { 2419 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:reason: ", p), err) } 2420 | return err 2421 | } 2422 | 2423 | func (p *TalkException) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { 2424 | if err := oprot.WriteFieldBegin(ctx, "parameterMap", thrift.MAP, 3); err != nil { 2425 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parameterMap: ", p), err) } 2426 | if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.ParameterMap)); err != nil { 2427 | return thrift.PrependError("error writing map begin: ", err) 2428 | } 2429 | for k, v := range p.ParameterMap { 2430 | if err := oprot.WriteString(ctx, string(k)); err != nil { 2431 | return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } 2432 | if err := oprot.WriteString(ctx, string(v)); err != nil { 2433 | return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } 2434 | } 2435 | if err := oprot.WriteMapEnd(ctx); err != nil { 2436 | return thrift.PrependError("error writing map end: ", err) 2437 | } 2438 | if err := oprot.WriteFieldEnd(ctx); err != nil { 2439 | return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parameterMap: ", p), err) } 2440 | return err 2441 | } 2442 | 2443 | func (p *TalkException) String() string { 2444 | if p == nil { 2445 | return "" 2446 | } 2447 | return fmt.Sprintf("TalkException(%+v)", *p) 2448 | } 2449 | 2450 | func (p *TalkException) Error() string { 2451 | return p.String() 2452 | } 2453 | 2454 | type TalkService interface { 2455 | // Parameters: 2456 | // - Provider 2457 | GetRSAKeyInfo(ctx context.Context, provider IdentityProvider) (r *RSAKey, err error) 2458 | // Parameters: 2459 | // - Provider 2460 | // - Identifier 2461 | // - Locale 2462 | RequestAccountPasswordReset(ctx context.Context, provider IdentityProvider, identifier string, locale string) (err error) 2463 | } 2464 | 2465 | type TalkServiceClient struct { 2466 | c thrift.TClient 2467 | } 2468 | 2469 | func NewTalkServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *TalkServiceClient { 2470 | return &TalkServiceClient{ 2471 | c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), 2472 | } 2473 | } 2474 | 2475 | func NewTalkServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *TalkServiceClient { 2476 | return &TalkServiceClient{ 2477 | c: thrift.NewTStandardClient(iprot, oprot), 2478 | } 2479 | } 2480 | 2481 | func NewTalkServiceClient(c thrift.TClient) *TalkServiceClient { 2482 | return &TalkServiceClient{ 2483 | c: c, 2484 | } 2485 | } 2486 | 2487 | func (p *TalkServiceClient) Client_() thrift.TClient { 2488 | return p.c 2489 | } 2490 | // Parameters: 2491 | // - Provider 2492 | func (p *TalkServiceClient) GetRSAKeyInfo(ctx context.Context, provider IdentityProvider) (r *RSAKey, err error) { 2493 | var _args3 TalkServiceGetRSAKeyInfoArgs 2494 | _args3.Provider = provider 2495 | var _result4 TalkServiceGetRSAKeyInfoResult 2496 | if err = p.Client_().Call(ctx, "getRSAKeyInfo", &_args3, &_result4); err != nil { 2497 | return 2498 | } 2499 | switch { 2500 | case _result4.E!= nil: 2501 | return r, _result4.E 2502 | } 2503 | 2504 | return _result4.GetSuccess(), nil 2505 | } 2506 | 2507 | // Parameters: 2508 | // - Provider 2509 | // - Identifier 2510 | // - Locale 2511 | func (p *TalkServiceClient) RequestAccountPasswordReset(ctx context.Context, provider IdentityProvider, identifier string, locale string) (err error) { 2512 | var _args5 TalkServiceRequestAccountPasswordResetArgs 2513 | _args5.Provider = provider 2514 | _args5.Identifier = identifier 2515 | _args5.Locale = locale 2516 | var _result6 TalkServiceRequestAccountPasswordResetResult 2517 | if err = p.Client_().Call(ctx, "requestAccountPasswordReset", &_args5, &_result6); err != nil { 2518 | return 2519 | } 2520 | switch { 2521 | case _result6.E!= nil: 2522 | return _result6.E 2523 | } 2524 | 2525 | return nil 2526 | } 2527 | 2528 | type TalkServiceProcessor struct { 2529 | processorMap map[string]thrift.TProcessorFunction 2530 | handler TalkService 2531 | } 2532 | 2533 | func (p *TalkServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { 2534 | p.processorMap[key] = processor 2535 | } 2536 | 2537 | func (p *TalkServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { 2538 | processor, ok = p.processorMap[key] 2539 | return processor, ok 2540 | } 2541 | 2542 | func (p *TalkServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { 2543 | return p.processorMap 2544 | } 2545 | 2546 | func NewTalkServiceProcessor(handler TalkService) *TalkServiceProcessor { 2547 | 2548 | self7 := &TalkServiceProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} 2549 | self7.processorMap["getRSAKeyInfo"] = &talkServiceProcessorGetRSAKeyInfo{handler:handler} 2550 | self7.processorMap["requestAccountPasswordReset"] = &talkServiceProcessorRequestAccountPasswordReset{handler:handler} 2551 | return self7 2552 | } 2553 | 2554 | func (p *TalkServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 2555 | name, _, seqId, err := iprot.ReadMessageBegin(ctx) 2556 | if err != nil { return false, err } 2557 | if processor, ok := p.GetProcessorFunction(name); ok { 2558 | return processor.Process(ctx, seqId, iprot, oprot) 2559 | } 2560 | iprot.Skip(ctx, thrift.STRUCT) 2561 | iprot.ReadMessageEnd(ctx) 2562 | x8 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) 2563 | oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) 2564 | x8.Write(ctx, oprot) 2565 | oprot.WriteMessageEnd(ctx) 2566 | oprot.Flush(ctx) 2567 | return false, x8 2568 | 2569 | } 2570 | 2571 | type talkServiceProcessorGetRSAKeyInfo struct { 2572 | handler TalkService 2573 | } 2574 | 2575 | func (p *talkServiceProcessorGetRSAKeyInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 2576 | args := TalkServiceGetRSAKeyInfoArgs{} 2577 | if err = args.Read(ctx, iprot); err != nil { 2578 | iprot.ReadMessageEnd(ctx) 2579 | x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) 2580 | oprot.WriteMessageBegin(ctx, "getRSAKeyInfo", thrift.EXCEPTION, seqId) 2581 | x.Write(ctx, oprot) 2582 | oprot.WriteMessageEnd(ctx) 2583 | oprot.Flush(ctx) 2584 | return false, err 2585 | } 2586 | iprot.ReadMessageEnd(ctx) 2587 | 2588 | tickerCancel := func() {} 2589 | // Start a goroutine to do server side connectivity check. 2590 | if thrift.ServerConnectivityCheckInterval > 0 { 2591 | var cancel context.CancelFunc 2592 | ctx, cancel = context.WithCancel(ctx) 2593 | defer cancel() 2594 | var tickerCtx context.Context 2595 | tickerCtx, tickerCancel = context.WithCancel(context.Background()) 2596 | defer tickerCancel() 2597 | go func(ctx context.Context, cancel context.CancelFunc) { 2598 | ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) 2599 | defer ticker.Stop() 2600 | for { 2601 | select { 2602 | case <-ctx.Done(): 2603 | return 2604 | case <-ticker.C: 2605 | if !iprot.Transport().IsOpen() { 2606 | cancel() 2607 | return 2608 | } 2609 | } 2610 | } 2611 | }(tickerCtx, cancel) 2612 | } 2613 | 2614 | result := TalkServiceGetRSAKeyInfoResult{} 2615 | var retval *RSAKey 2616 | var err2 error 2617 | if retval, err2 = p.handler.GetRSAKeyInfo(ctx, args.Provider); err2 != nil { 2618 | tickerCancel() 2619 | switch v := err2.(type) { 2620 | case *TalkException: 2621 | result.E = v 2622 | default: 2623 | if err2 == thrift.ErrAbandonRequest { 2624 | return false, err2 2625 | } 2626 | x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getRSAKeyInfo: " + err2.Error()) 2627 | oprot.WriteMessageBegin(ctx, "getRSAKeyInfo", thrift.EXCEPTION, seqId) 2628 | x.Write(ctx, oprot) 2629 | oprot.WriteMessageEnd(ctx) 2630 | oprot.Flush(ctx) 2631 | return true, err2 2632 | } 2633 | } else { 2634 | result.Success = retval 2635 | } 2636 | tickerCancel() 2637 | if err2 = oprot.WriteMessageBegin(ctx, "getRSAKeyInfo", thrift.REPLY, seqId); err2 != nil { 2638 | err = err2 2639 | } 2640 | if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { 2641 | err = err2 2642 | } 2643 | if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { 2644 | err = err2 2645 | } 2646 | if err2 = oprot.Flush(ctx); err == nil && err2 != nil { 2647 | err = err2 2648 | } 2649 | if err != nil { 2650 | return 2651 | } 2652 | return true, err 2653 | } 2654 | 2655 | type talkServiceProcessorRequestAccountPasswordReset struct { 2656 | handler TalkService 2657 | } 2658 | 2659 | func (p *talkServiceProcessorRequestAccountPasswordReset) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 2660 | args := TalkServiceRequestAccountPasswordResetArgs{} 2661 | if err = args.Read(ctx, iprot); err != nil { 2662 | iprot.ReadMessageEnd(ctx) 2663 | x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) 2664 | oprot.WriteMessageBegin(ctx, "requestAccountPasswordReset", thrift.EXCEPTION, seqId) 2665 | x.Write(ctx, oprot) 2666 | oprot.WriteMessageEnd(ctx) 2667 | oprot.Flush(ctx) 2668 | return false, err 2669 | } 2670 | iprot.ReadMessageEnd(ctx) 2671 | 2672 | tickerCancel := func() {} 2673 | // Start a goroutine to do server side connectivity check. 2674 | if thrift.ServerConnectivityCheckInterval > 0 { 2675 | var cancel context.CancelFunc 2676 | ctx, cancel = context.WithCancel(ctx) 2677 | defer cancel() 2678 | var tickerCtx context.Context 2679 | tickerCtx, tickerCancel = context.WithCancel(context.Background()) 2680 | defer tickerCancel() 2681 | go func(ctx context.Context, cancel context.CancelFunc) { 2682 | ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) 2683 | defer ticker.Stop() 2684 | for { 2685 | select { 2686 | case <-ctx.Done(): 2687 | return 2688 | case <-ticker.C: 2689 | if !iprot.Transport().IsOpen() { 2690 | cancel() 2691 | return 2692 | } 2693 | } 2694 | } 2695 | }(tickerCtx, cancel) 2696 | } 2697 | 2698 | result := TalkServiceRequestAccountPasswordResetResult{} 2699 | var err2 error 2700 | if err2 = p.handler.RequestAccountPasswordReset(ctx, args.Provider, args.Identifier, args.Locale); err2 != nil { 2701 | tickerCancel() 2702 | switch v := err2.(type) { 2703 | case *TalkException: 2704 | result.E = v 2705 | default: 2706 | if err2 == thrift.ErrAbandonRequest { 2707 | return false, err2 2708 | } 2709 | x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing requestAccountPasswordReset: " + err2.Error()) 2710 | oprot.WriteMessageBegin(ctx, "requestAccountPasswordReset", thrift.EXCEPTION, seqId) 2711 | x.Write(ctx, oprot) 2712 | oprot.WriteMessageEnd(ctx) 2713 | oprot.Flush(ctx) 2714 | return true, err2 2715 | } 2716 | } 2717 | tickerCancel() 2718 | if err2 = oprot.WriteMessageBegin(ctx, "requestAccountPasswordReset", thrift.REPLY, seqId); err2 != nil { 2719 | err = err2 2720 | } 2721 | if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { 2722 | err = err2 2723 | } 2724 | if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { 2725 | err = err2 2726 | } 2727 | if err2 = oprot.Flush(ctx); err == nil && err2 != nil { 2728 | err = err2 2729 | } 2730 | if err != nil { 2731 | return 2732 | } 2733 | return true, err 2734 | } 2735 | 2736 | 2737 | // HELPER FUNCTIONS AND STRUCTURES 2738 | 2739 | // Attributes: 2740 | // - Provider 2741 | type TalkServiceGetRSAKeyInfoArgs struct { 2742 | // unused field # 1 2743 | Provider IdentityProvider `thrift:"provider,2" db:"provider" json:"provider"` 2744 | } 2745 | 2746 | func NewTalkServiceGetRSAKeyInfoArgs() *TalkServiceGetRSAKeyInfoArgs { 2747 | return &TalkServiceGetRSAKeyInfoArgs{} 2748 | } 2749 | 2750 | 2751 | func (p *TalkServiceGetRSAKeyInfoArgs) GetProvider() IdentityProvider { 2752 | return p.Provider 2753 | } 2754 | func (p *TalkServiceGetRSAKeyInfoArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { 2755 | if _, err := iprot.ReadStructBegin(ctx); err != nil { 2756 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 2757 | } 2758 | 2759 | 2760 | for { 2761 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) 2762 | if err != nil { 2763 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 2764 | } 2765 | if fieldTypeId == thrift.STOP { break; } 2766 | switch fieldId { 2767 | case 2: 2768 | if fieldTypeId == thrift.I32 { 2769 | if err := p.ReadField2(ctx, iprot); err != nil { 2770 | return err 2771 | } 2772 | } else { 2773 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 2774 | return err 2775 | } 2776 | } 2777 | default: 2778 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 2779 | return err 2780 | } 2781 | } 2782 | if err := iprot.ReadFieldEnd(ctx); err != nil { 2783 | return err 2784 | } 2785 | } 2786 | if err := iprot.ReadStructEnd(ctx); err != nil { 2787 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 2788 | } 2789 | return nil 2790 | } 2791 | 2792 | func (p *TalkServiceGetRSAKeyInfoArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { 2793 | if v, err := iprot.ReadI32(ctx); err != nil { 2794 | return thrift.PrependError("error reading field 2: ", err) 2795 | } else { 2796 | temp := IdentityProvider(v) 2797 | p.Provider = temp 2798 | } 2799 | return nil 2800 | } 2801 | 2802 | func (p *TalkServiceGetRSAKeyInfoArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { 2803 | if err := oprot.WriteStructBegin(ctx, "getRSAKeyInfo_args"); err != nil { 2804 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } 2805 | if p != nil { 2806 | if err := p.writeField2(ctx, oprot); err != nil { return err } 2807 | } 2808 | if err := oprot.WriteFieldStop(ctx); err != nil { 2809 | return thrift.PrependError("write field stop error: ", err) } 2810 | if err := oprot.WriteStructEnd(ctx); err != nil { 2811 | return thrift.PrependError("write struct stop error: ", err) } 2812 | return nil 2813 | } 2814 | 2815 | func (p *TalkServiceGetRSAKeyInfoArgs) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { 2816 | if err := oprot.WriteFieldBegin(ctx, "provider", thrift.I32, 2); err != nil { 2817 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:provider: ", p), err) } 2818 | if err := oprot.WriteI32(ctx, int32(p.Provider)); err != nil { 2819 | return thrift.PrependError(fmt.Sprintf("%T.provider (2) field write error: ", p), err) } 2820 | if err := oprot.WriteFieldEnd(ctx); err != nil { 2821 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:provider: ", p), err) } 2822 | return err 2823 | } 2824 | 2825 | func (p *TalkServiceGetRSAKeyInfoArgs) String() string { 2826 | if p == nil { 2827 | return "" 2828 | } 2829 | return fmt.Sprintf("TalkServiceGetRSAKeyInfoArgs(%+v)", *p) 2830 | } 2831 | 2832 | // Attributes: 2833 | // - Success 2834 | // - E 2835 | type TalkServiceGetRSAKeyInfoResult struct { 2836 | Success *RSAKey `thrift:"success,0" db:"success" json:"success,omitempty"` 2837 | E *TalkException `thrift:"e,1" db:"e" json:"e,omitempty"` 2838 | } 2839 | 2840 | func NewTalkServiceGetRSAKeyInfoResult() *TalkServiceGetRSAKeyInfoResult { 2841 | return &TalkServiceGetRSAKeyInfoResult{} 2842 | } 2843 | 2844 | var TalkServiceGetRSAKeyInfoResult_Success_DEFAULT *RSAKey 2845 | func (p *TalkServiceGetRSAKeyInfoResult) GetSuccess() *RSAKey { 2846 | if !p.IsSetSuccess() { 2847 | return TalkServiceGetRSAKeyInfoResult_Success_DEFAULT 2848 | } 2849 | return p.Success 2850 | } 2851 | var TalkServiceGetRSAKeyInfoResult_E_DEFAULT *TalkException 2852 | func (p *TalkServiceGetRSAKeyInfoResult) GetE() *TalkException { 2853 | if !p.IsSetE() { 2854 | return TalkServiceGetRSAKeyInfoResult_E_DEFAULT 2855 | } 2856 | return p.E 2857 | } 2858 | func (p *TalkServiceGetRSAKeyInfoResult) IsSetSuccess() bool { 2859 | return p.Success != nil 2860 | } 2861 | 2862 | func (p *TalkServiceGetRSAKeyInfoResult) IsSetE() bool { 2863 | return p.E != nil 2864 | } 2865 | 2866 | func (p *TalkServiceGetRSAKeyInfoResult) Read(ctx context.Context, iprot thrift.TProtocol) error { 2867 | if _, err := iprot.ReadStructBegin(ctx); err != nil { 2868 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 2869 | } 2870 | 2871 | 2872 | for { 2873 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) 2874 | if err != nil { 2875 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 2876 | } 2877 | if fieldTypeId == thrift.STOP { break; } 2878 | switch fieldId { 2879 | case 0: 2880 | if fieldTypeId == thrift.STRUCT { 2881 | if err := p.ReadField0(ctx, iprot); err != nil { 2882 | return err 2883 | } 2884 | } else { 2885 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 2886 | return err 2887 | } 2888 | } 2889 | case 1: 2890 | if fieldTypeId == thrift.STRUCT { 2891 | if err := p.ReadField1(ctx, iprot); err != nil { 2892 | return err 2893 | } 2894 | } else { 2895 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 2896 | return err 2897 | } 2898 | } 2899 | default: 2900 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 2901 | return err 2902 | } 2903 | } 2904 | if err := iprot.ReadFieldEnd(ctx); err != nil { 2905 | return err 2906 | } 2907 | } 2908 | if err := iprot.ReadStructEnd(ctx); err != nil { 2909 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 2910 | } 2911 | return nil 2912 | } 2913 | 2914 | func (p *TalkServiceGetRSAKeyInfoResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { 2915 | p.Success = &RSAKey{} 2916 | if err := p.Success.Read(ctx, iprot); err != nil { 2917 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) 2918 | } 2919 | return nil 2920 | } 2921 | 2922 | func (p *TalkServiceGetRSAKeyInfoResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { 2923 | p.E = &TalkException{} 2924 | if err := p.E.Read(ctx, iprot); err != nil { 2925 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err) 2926 | } 2927 | return nil 2928 | } 2929 | 2930 | func (p *TalkServiceGetRSAKeyInfoResult) Write(ctx context.Context, oprot thrift.TProtocol) error { 2931 | if err := oprot.WriteStructBegin(ctx, "getRSAKeyInfo_result"); err != nil { 2932 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } 2933 | if p != nil { 2934 | if err := p.writeField0(ctx, oprot); err != nil { return err } 2935 | if err := p.writeField1(ctx, oprot); err != nil { return err } 2936 | } 2937 | if err := oprot.WriteFieldStop(ctx); err != nil { 2938 | return thrift.PrependError("write field stop error: ", err) } 2939 | if err := oprot.WriteStructEnd(ctx); err != nil { 2940 | return thrift.PrependError("write struct stop error: ", err) } 2941 | return nil 2942 | } 2943 | 2944 | func (p *TalkServiceGetRSAKeyInfoResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { 2945 | if p.IsSetSuccess() { 2946 | if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { 2947 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } 2948 | if err := p.Success.Write(ctx, oprot); err != nil { 2949 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) 2950 | } 2951 | if err := oprot.WriteFieldEnd(ctx); err != nil { 2952 | return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } 2953 | } 2954 | return err 2955 | } 2956 | 2957 | func (p *TalkServiceGetRSAKeyInfoResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { 2958 | if p.IsSetE() { 2959 | if err := oprot.WriteFieldBegin(ctx, "e", thrift.STRUCT, 1); err != nil { 2960 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) } 2961 | if err := p.E.Write(ctx, oprot); err != nil { 2962 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err) 2963 | } 2964 | if err := oprot.WriteFieldEnd(ctx); err != nil { 2965 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) } 2966 | } 2967 | return err 2968 | } 2969 | 2970 | func (p *TalkServiceGetRSAKeyInfoResult) String() string { 2971 | if p == nil { 2972 | return "" 2973 | } 2974 | return fmt.Sprintf("TalkServiceGetRSAKeyInfoResult(%+v)", *p) 2975 | } 2976 | 2977 | // Attributes: 2978 | // - Provider 2979 | // - Identifier 2980 | // - Locale 2981 | type TalkServiceRequestAccountPasswordResetArgs struct { 2982 | // unused field # 1 2983 | Identifier string `thrift:"identifier,2" db:"identifier" json:"identifier"` 2984 | // unused field # 3 2985 | Provider IdentityProvider `thrift:"provider,4" db:"provider" json:"provider"` 2986 | Locale string `thrift:"locale,5" db:"locale" json:"locale"` 2987 | } 2988 | 2989 | func NewTalkServiceRequestAccountPasswordResetArgs() *TalkServiceRequestAccountPasswordResetArgs { 2990 | return &TalkServiceRequestAccountPasswordResetArgs{} 2991 | } 2992 | 2993 | 2994 | func (p *TalkServiceRequestAccountPasswordResetArgs) GetProvider() IdentityProvider { 2995 | return p.Provider 2996 | } 2997 | 2998 | func (p *TalkServiceRequestAccountPasswordResetArgs) GetIdentifier() string { 2999 | return p.Identifier 3000 | } 3001 | 3002 | func (p *TalkServiceRequestAccountPasswordResetArgs) GetLocale() string { 3003 | return p.Locale 3004 | } 3005 | func (p *TalkServiceRequestAccountPasswordResetArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { 3006 | if _, err := iprot.ReadStructBegin(ctx); err != nil { 3007 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 3008 | } 3009 | 3010 | 3011 | for { 3012 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) 3013 | if err != nil { 3014 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 3015 | } 3016 | if fieldTypeId == thrift.STOP { break; } 3017 | switch fieldId { 3018 | case 4: 3019 | if fieldTypeId == thrift.I32 { 3020 | if err := p.ReadField4(ctx, iprot); err != nil { 3021 | return err 3022 | } 3023 | } else { 3024 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 3025 | return err 3026 | } 3027 | } 3028 | case 2: 3029 | if fieldTypeId == thrift.STRING { 3030 | if err := p.ReadField2(ctx, iprot); err != nil { 3031 | return err 3032 | } 3033 | } else { 3034 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 3035 | return err 3036 | } 3037 | } 3038 | case 5: 3039 | if fieldTypeId == thrift.STRING { 3040 | if err := p.ReadField5(ctx, iprot); err != nil { 3041 | return err 3042 | } 3043 | } else { 3044 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 3045 | return err 3046 | } 3047 | } 3048 | default: 3049 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 3050 | return err 3051 | } 3052 | } 3053 | if err := iprot.ReadFieldEnd(ctx); err != nil { 3054 | return err 3055 | } 3056 | } 3057 | if err := iprot.ReadStructEnd(ctx); err != nil { 3058 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 3059 | } 3060 | return nil 3061 | } 3062 | 3063 | func (p *TalkServiceRequestAccountPasswordResetArgs) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { 3064 | if v, err := iprot.ReadI32(ctx); err != nil { 3065 | return thrift.PrependError("error reading field 4: ", err) 3066 | } else { 3067 | temp := IdentityProvider(v) 3068 | p.Provider = temp 3069 | } 3070 | return nil 3071 | } 3072 | 3073 | func (p *TalkServiceRequestAccountPasswordResetArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { 3074 | if v, err := iprot.ReadString(ctx); err != nil { 3075 | return thrift.PrependError("error reading field 2: ", err) 3076 | } else { 3077 | p.Identifier = v 3078 | } 3079 | return nil 3080 | } 3081 | 3082 | func (p *TalkServiceRequestAccountPasswordResetArgs) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { 3083 | if v, err := iprot.ReadString(ctx); err != nil { 3084 | return thrift.PrependError("error reading field 5: ", err) 3085 | } else { 3086 | p.Locale = v 3087 | } 3088 | return nil 3089 | } 3090 | 3091 | func (p *TalkServiceRequestAccountPasswordResetArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { 3092 | if err := oprot.WriteStructBegin(ctx, "requestAccountPasswordReset_args"); err != nil { 3093 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } 3094 | if p != nil { 3095 | if err := p.writeField2(ctx, oprot); err != nil { return err } 3096 | if err := p.writeField4(ctx, oprot); err != nil { return err } 3097 | if err := p.writeField5(ctx, oprot); err != nil { return err } 3098 | } 3099 | if err := oprot.WriteFieldStop(ctx); err != nil { 3100 | return thrift.PrependError("write field stop error: ", err) } 3101 | if err := oprot.WriteStructEnd(ctx); err != nil { 3102 | return thrift.PrependError("write struct stop error: ", err) } 3103 | return nil 3104 | } 3105 | 3106 | func (p *TalkServiceRequestAccountPasswordResetArgs) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { 3107 | if err := oprot.WriteFieldBegin(ctx, "identifier", thrift.STRING, 2); err != nil { 3108 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:identifier: ", p), err) } 3109 | if err := oprot.WriteString(ctx, string(p.Identifier)); err != nil { 3110 | return thrift.PrependError(fmt.Sprintf("%T.identifier (2) field write error: ", p), err) } 3111 | if err := oprot.WriteFieldEnd(ctx); err != nil { 3112 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:identifier: ", p), err) } 3113 | return err 3114 | } 3115 | 3116 | func (p *TalkServiceRequestAccountPasswordResetArgs) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { 3117 | if err := oprot.WriteFieldBegin(ctx, "provider", thrift.I32, 4); err != nil { 3118 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:provider: ", p), err) } 3119 | if err := oprot.WriteI32(ctx, int32(p.Provider)); err != nil { 3120 | return thrift.PrependError(fmt.Sprintf("%T.provider (4) field write error: ", p), err) } 3121 | if err := oprot.WriteFieldEnd(ctx); err != nil { 3122 | return thrift.PrependError(fmt.Sprintf("%T write field end error 4:provider: ", p), err) } 3123 | return err 3124 | } 3125 | 3126 | func (p *TalkServiceRequestAccountPasswordResetArgs) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { 3127 | if err := oprot.WriteFieldBegin(ctx, "locale", thrift.STRING, 5); err != nil { 3128 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:locale: ", p), err) } 3129 | if err := oprot.WriteString(ctx, string(p.Locale)); err != nil { 3130 | return thrift.PrependError(fmt.Sprintf("%T.locale (5) field write error: ", p), err) } 3131 | if err := oprot.WriteFieldEnd(ctx); err != nil { 3132 | return thrift.PrependError(fmt.Sprintf("%T write field end error 5:locale: ", p), err) } 3133 | return err 3134 | } 3135 | 3136 | func (p *TalkServiceRequestAccountPasswordResetArgs) String() string { 3137 | if p == nil { 3138 | return "" 3139 | } 3140 | return fmt.Sprintf("TalkServiceRequestAccountPasswordResetArgs(%+v)", *p) 3141 | } 3142 | 3143 | // Attributes: 3144 | // - E 3145 | type TalkServiceRequestAccountPasswordResetResult struct { 3146 | E *TalkException `thrift:"e,1" db:"e" json:"e,omitempty"` 3147 | } 3148 | 3149 | func NewTalkServiceRequestAccountPasswordResetResult() *TalkServiceRequestAccountPasswordResetResult { 3150 | return &TalkServiceRequestAccountPasswordResetResult{} 3151 | } 3152 | 3153 | var TalkServiceRequestAccountPasswordResetResult_E_DEFAULT *TalkException 3154 | func (p *TalkServiceRequestAccountPasswordResetResult) GetE() *TalkException { 3155 | if !p.IsSetE() { 3156 | return TalkServiceRequestAccountPasswordResetResult_E_DEFAULT 3157 | } 3158 | return p.E 3159 | } 3160 | func (p *TalkServiceRequestAccountPasswordResetResult) IsSetE() bool { 3161 | return p.E != nil 3162 | } 3163 | 3164 | func (p *TalkServiceRequestAccountPasswordResetResult) Read(ctx context.Context, iprot thrift.TProtocol) error { 3165 | if _, err := iprot.ReadStructBegin(ctx); err != nil { 3166 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 3167 | } 3168 | 3169 | 3170 | for { 3171 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) 3172 | if err != nil { 3173 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 3174 | } 3175 | if fieldTypeId == thrift.STOP { break; } 3176 | switch fieldId { 3177 | case 1: 3178 | if fieldTypeId == thrift.STRUCT { 3179 | if err := p.ReadField1(ctx, iprot); err != nil { 3180 | return err 3181 | } 3182 | } else { 3183 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 3184 | return err 3185 | } 3186 | } 3187 | default: 3188 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 3189 | return err 3190 | } 3191 | } 3192 | if err := iprot.ReadFieldEnd(ctx); err != nil { 3193 | return err 3194 | } 3195 | } 3196 | if err := iprot.ReadStructEnd(ctx); err != nil { 3197 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 3198 | } 3199 | return nil 3200 | } 3201 | 3202 | func (p *TalkServiceRequestAccountPasswordResetResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { 3203 | p.E = &TalkException{} 3204 | if err := p.E.Read(ctx, iprot); err != nil { 3205 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err) 3206 | } 3207 | return nil 3208 | } 3209 | 3210 | func (p *TalkServiceRequestAccountPasswordResetResult) Write(ctx context.Context, oprot thrift.TProtocol) error { 3211 | if err := oprot.WriteStructBegin(ctx, "requestAccountPasswordReset_result"); err != nil { 3212 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } 3213 | if p != nil { 3214 | if err := p.writeField1(ctx, oprot); err != nil { return err } 3215 | } 3216 | if err := oprot.WriteFieldStop(ctx); err != nil { 3217 | return thrift.PrependError("write field stop error: ", err) } 3218 | if err := oprot.WriteStructEnd(ctx); err != nil { 3219 | return thrift.PrependError("write struct stop error: ", err) } 3220 | return nil 3221 | } 3222 | 3223 | func (p *TalkServiceRequestAccountPasswordResetResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { 3224 | if p.IsSetE() { 3225 | if err := oprot.WriteFieldBegin(ctx, "e", thrift.STRUCT, 1); err != nil { 3226 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) } 3227 | if err := p.E.Write(ctx, oprot); err != nil { 3228 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err) 3229 | } 3230 | if err := oprot.WriteFieldEnd(ctx); err != nil { 3231 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) } 3232 | } 3233 | return err 3234 | } 3235 | 3236 | func (p *TalkServiceRequestAccountPasswordResetResult) String() string { 3237 | if p == nil { 3238 | return "" 3239 | } 3240 | return fmt.Sprintf("TalkServiceRequestAccountPasswordResetResult(%+v)", *p) 3241 | } 3242 | 3243 | 3244 | type AuthService interface { 3245 | // Parameters: 3246 | // - Verifier 3247 | // - DeviceSecret 3248 | ConfirmE2EELogin(ctx context.Context, verifier string, deviceSecret []byte) (r string, err error) 3249 | // Parameters: 3250 | // - LoginRequest 3251 | LoginZ(ctx context.Context, loginRequest *LoginRequest) (r *LoginResult_, err error) 3252 | LogoutZ(ctx context.Context) (err error) 3253 | } 3254 | 3255 | type AuthServiceClient struct { 3256 | c thrift.TClient 3257 | } 3258 | 3259 | func NewAuthServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *AuthServiceClient { 3260 | return &AuthServiceClient{ 3261 | c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), 3262 | } 3263 | } 3264 | 3265 | func NewAuthServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *AuthServiceClient { 3266 | return &AuthServiceClient{ 3267 | c: thrift.NewTStandardClient(iprot, oprot), 3268 | } 3269 | } 3270 | 3271 | func NewAuthServiceClient(c thrift.TClient) *AuthServiceClient { 3272 | return &AuthServiceClient{ 3273 | c: c, 3274 | } 3275 | } 3276 | 3277 | func (p *AuthServiceClient) Client_() thrift.TClient { 3278 | return p.c 3279 | } 3280 | // Parameters: 3281 | // - Verifier 3282 | // - DeviceSecret 3283 | func (p *AuthServiceClient) ConfirmE2EELogin(ctx context.Context, verifier string, deviceSecret []byte) (r string, err error) { 3284 | var _args11 AuthServiceConfirmE2EELoginArgs 3285 | _args11.Verifier = verifier 3286 | _args11.DeviceSecret = deviceSecret 3287 | var _result12 AuthServiceConfirmE2EELoginResult 3288 | if err = p.Client_().Call(ctx, "confirmE2EELogin", &_args11, &_result12); err != nil { 3289 | return 3290 | } 3291 | switch { 3292 | case _result12.E!= nil: 3293 | return r, _result12.E 3294 | } 3295 | 3296 | return _result12.GetSuccess(), nil 3297 | } 3298 | 3299 | // Parameters: 3300 | // - LoginRequest 3301 | func (p *AuthServiceClient) LoginZ(ctx context.Context, loginRequest *LoginRequest) (r *LoginResult_, err error) { 3302 | var _args13 AuthServiceLoginZArgs 3303 | _args13.LoginRequest = loginRequest 3304 | var _result14 AuthServiceLoginZResult 3305 | if err = p.Client_().Call(ctx, "loginZ", &_args13, &_result14); err != nil { 3306 | return 3307 | } 3308 | switch { 3309 | case _result14.E!= nil: 3310 | return r, _result14.E 3311 | } 3312 | 3313 | return _result14.GetSuccess(), nil 3314 | } 3315 | 3316 | func (p *AuthServiceClient) LogoutZ(ctx context.Context) (err error) { 3317 | var _args15 AuthServiceLogoutZArgs 3318 | var _result16 AuthServiceLogoutZResult 3319 | if err = p.Client_().Call(ctx, "logoutZ", &_args15, &_result16); err != nil { 3320 | return 3321 | } 3322 | switch { 3323 | case _result16.E!= nil: 3324 | return _result16.E 3325 | } 3326 | 3327 | return nil 3328 | } 3329 | 3330 | type AuthServiceProcessor struct { 3331 | processorMap map[string]thrift.TProcessorFunction 3332 | handler AuthService 3333 | } 3334 | 3335 | func (p *AuthServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { 3336 | p.processorMap[key] = processor 3337 | } 3338 | 3339 | func (p *AuthServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { 3340 | processor, ok = p.processorMap[key] 3341 | return processor, ok 3342 | } 3343 | 3344 | func (p *AuthServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { 3345 | return p.processorMap 3346 | } 3347 | 3348 | func NewAuthServiceProcessor(handler AuthService) *AuthServiceProcessor { 3349 | 3350 | self17 := &AuthServiceProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} 3351 | self17.processorMap["confirmE2EELogin"] = &authServiceProcessorConfirmE2EELogin{handler:handler} 3352 | self17.processorMap["loginZ"] = &authServiceProcessorLoginZ{handler:handler} 3353 | self17.processorMap["logoutZ"] = &authServiceProcessorLogoutZ{handler:handler} 3354 | return self17 3355 | } 3356 | 3357 | func (p *AuthServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 3358 | name, _, seqId, err := iprot.ReadMessageBegin(ctx) 3359 | if err != nil { return false, err } 3360 | if processor, ok := p.GetProcessorFunction(name); ok { 3361 | return processor.Process(ctx, seqId, iprot, oprot) 3362 | } 3363 | iprot.Skip(ctx, thrift.STRUCT) 3364 | iprot.ReadMessageEnd(ctx) 3365 | x18 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) 3366 | oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) 3367 | x18.Write(ctx, oprot) 3368 | oprot.WriteMessageEnd(ctx) 3369 | oprot.Flush(ctx) 3370 | return false, x18 3371 | 3372 | } 3373 | 3374 | type authServiceProcessorConfirmE2EELogin struct { 3375 | handler AuthService 3376 | } 3377 | 3378 | func (p *authServiceProcessorConfirmE2EELogin) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 3379 | args := AuthServiceConfirmE2EELoginArgs{} 3380 | if err = args.Read(ctx, iprot); err != nil { 3381 | iprot.ReadMessageEnd(ctx) 3382 | x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) 3383 | oprot.WriteMessageBegin(ctx, "confirmE2EELogin", thrift.EXCEPTION, seqId) 3384 | x.Write(ctx, oprot) 3385 | oprot.WriteMessageEnd(ctx) 3386 | oprot.Flush(ctx) 3387 | return false, err 3388 | } 3389 | iprot.ReadMessageEnd(ctx) 3390 | 3391 | tickerCancel := func() {} 3392 | // Start a goroutine to do server side connectivity check. 3393 | if thrift.ServerConnectivityCheckInterval > 0 { 3394 | var cancel context.CancelFunc 3395 | ctx, cancel = context.WithCancel(ctx) 3396 | defer cancel() 3397 | var tickerCtx context.Context 3398 | tickerCtx, tickerCancel = context.WithCancel(context.Background()) 3399 | defer tickerCancel() 3400 | go func(ctx context.Context, cancel context.CancelFunc) { 3401 | ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) 3402 | defer ticker.Stop() 3403 | for { 3404 | select { 3405 | case <-ctx.Done(): 3406 | return 3407 | case <-ticker.C: 3408 | if !iprot.Transport().IsOpen() { 3409 | cancel() 3410 | return 3411 | } 3412 | } 3413 | } 3414 | }(tickerCtx, cancel) 3415 | } 3416 | 3417 | result := AuthServiceConfirmE2EELoginResult{} 3418 | var retval string 3419 | var err2 error 3420 | if retval, err2 = p.handler.ConfirmE2EELogin(ctx, args.Verifier, args.DeviceSecret); err2 != nil { 3421 | tickerCancel() 3422 | switch v := err2.(type) { 3423 | case *TalkException: 3424 | result.E = v 3425 | default: 3426 | if err2 == thrift.ErrAbandonRequest { 3427 | return false, err2 3428 | } 3429 | x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing confirmE2EELogin: " + err2.Error()) 3430 | oprot.WriteMessageBegin(ctx, "confirmE2EELogin", thrift.EXCEPTION, seqId) 3431 | x.Write(ctx, oprot) 3432 | oprot.WriteMessageEnd(ctx) 3433 | oprot.Flush(ctx) 3434 | return true, err2 3435 | } 3436 | } else { 3437 | result.Success = &retval 3438 | } 3439 | tickerCancel() 3440 | if err2 = oprot.WriteMessageBegin(ctx, "confirmE2EELogin", thrift.REPLY, seqId); err2 != nil { 3441 | err = err2 3442 | } 3443 | if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { 3444 | err = err2 3445 | } 3446 | if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { 3447 | err = err2 3448 | } 3449 | if err2 = oprot.Flush(ctx); err == nil && err2 != nil { 3450 | err = err2 3451 | } 3452 | if err != nil { 3453 | return 3454 | } 3455 | return true, err 3456 | } 3457 | 3458 | type authServiceProcessorLoginZ struct { 3459 | handler AuthService 3460 | } 3461 | 3462 | func (p *authServiceProcessorLoginZ) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 3463 | args := AuthServiceLoginZArgs{} 3464 | if err = args.Read(ctx, iprot); err != nil { 3465 | iprot.ReadMessageEnd(ctx) 3466 | x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) 3467 | oprot.WriteMessageBegin(ctx, "loginZ", thrift.EXCEPTION, seqId) 3468 | x.Write(ctx, oprot) 3469 | oprot.WriteMessageEnd(ctx) 3470 | oprot.Flush(ctx) 3471 | return false, err 3472 | } 3473 | iprot.ReadMessageEnd(ctx) 3474 | 3475 | tickerCancel := func() {} 3476 | // Start a goroutine to do server side connectivity check. 3477 | if thrift.ServerConnectivityCheckInterval > 0 { 3478 | var cancel context.CancelFunc 3479 | ctx, cancel = context.WithCancel(ctx) 3480 | defer cancel() 3481 | var tickerCtx context.Context 3482 | tickerCtx, tickerCancel = context.WithCancel(context.Background()) 3483 | defer tickerCancel() 3484 | go func(ctx context.Context, cancel context.CancelFunc) { 3485 | ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) 3486 | defer ticker.Stop() 3487 | for { 3488 | select { 3489 | case <-ctx.Done(): 3490 | return 3491 | case <-ticker.C: 3492 | if !iprot.Transport().IsOpen() { 3493 | cancel() 3494 | return 3495 | } 3496 | } 3497 | } 3498 | }(tickerCtx, cancel) 3499 | } 3500 | 3501 | result := AuthServiceLoginZResult{} 3502 | var retval *LoginResult_ 3503 | var err2 error 3504 | if retval, err2 = p.handler.LoginZ(ctx, args.LoginRequest); err2 != nil { 3505 | tickerCancel() 3506 | switch v := err2.(type) { 3507 | case *TalkException: 3508 | result.E = v 3509 | default: 3510 | if err2 == thrift.ErrAbandonRequest { 3511 | return false, err2 3512 | } 3513 | x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing loginZ: " + err2.Error()) 3514 | oprot.WriteMessageBegin(ctx, "loginZ", thrift.EXCEPTION, seqId) 3515 | x.Write(ctx, oprot) 3516 | oprot.WriteMessageEnd(ctx) 3517 | oprot.Flush(ctx) 3518 | return true, err2 3519 | } 3520 | } else { 3521 | result.Success = retval 3522 | } 3523 | tickerCancel() 3524 | if err2 = oprot.WriteMessageBegin(ctx, "loginZ", thrift.REPLY, seqId); err2 != nil { 3525 | err = err2 3526 | } 3527 | if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { 3528 | err = err2 3529 | } 3530 | if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { 3531 | err = err2 3532 | } 3533 | if err2 = oprot.Flush(ctx); err == nil && err2 != nil { 3534 | err = err2 3535 | } 3536 | if err != nil { 3537 | return 3538 | } 3539 | return true, err 3540 | } 3541 | 3542 | type authServiceProcessorLogoutZ struct { 3543 | handler AuthService 3544 | } 3545 | 3546 | func (p *authServiceProcessorLogoutZ) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 3547 | args := AuthServiceLogoutZArgs{} 3548 | if err = args.Read(ctx, iprot); err != nil { 3549 | iprot.ReadMessageEnd(ctx) 3550 | x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) 3551 | oprot.WriteMessageBegin(ctx, "logoutZ", thrift.EXCEPTION, seqId) 3552 | x.Write(ctx, oprot) 3553 | oprot.WriteMessageEnd(ctx) 3554 | oprot.Flush(ctx) 3555 | return false, err 3556 | } 3557 | iprot.ReadMessageEnd(ctx) 3558 | 3559 | tickerCancel := func() {} 3560 | // Start a goroutine to do server side connectivity check. 3561 | if thrift.ServerConnectivityCheckInterval > 0 { 3562 | var cancel context.CancelFunc 3563 | ctx, cancel = context.WithCancel(ctx) 3564 | defer cancel() 3565 | var tickerCtx context.Context 3566 | tickerCtx, tickerCancel = context.WithCancel(context.Background()) 3567 | defer tickerCancel() 3568 | go func(ctx context.Context, cancel context.CancelFunc) { 3569 | ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) 3570 | defer ticker.Stop() 3571 | for { 3572 | select { 3573 | case <-ctx.Done(): 3574 | return 3575 | case <-ticker.C: 3576 | if !iprot.Transport().IsOpen() { 3577 | cancel() 3578 | return 3579 | } 3580 | } 3581 | } 3582 | }(tickerCtx, cancel) 3583 | } 3584 | 3585 | result := AuthServiceLogoutZResult{} 3586 | var err2 error 3587 | if err2 = p.handler.LogoutZ(ctx); err2 != nil { 3588 | tickerCancel() 3589 | switch v := err2.(type) { 3590 | case *TalkException: 3591 | result.E = v 3592 | default: 3593 | if err2 == thrift.ErrAbandonRequest { 3594 | return false, err2 3595 | } 3596 | x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing logoutZ: " + err2.Error()) 3597 | oprot.WriteMessageBegin(ctx, "logoutZ", thrift.EXCEPTION, seqId) 3598 | x.Write(ctx, oprot) 3599 | oprot.WriteMessageEnd(ctx) 3600 | oprot.Flush(ctx) 3601 | return true, err2 3602 | } 3603 | } 3604 | tickerCancel() 3605 | if err2 = oprot.WriteMessageBegin(ctx, "logoutZ", thrift.REPLY, seqId); err2 != nil { 3606 | err = err2 3607 | } 3608 | if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { 3609 | err = err2 3610 | } 3611 | if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { 3612 | err = err2 3613 | } 3614 | if err2 = oprot.Flush(ctx); err == nil && err2 != nil { 3615 | err = err2 3616 | } 3617 | if err != nil { 3618 | return 3619 | } 3620 | return true, err 3621 | } 3622 | 3623 | 3624 | // HELPER FUNCTIONS AND STRUCTURES 3625 | 3626 | // Attributes: 3627 | // - Verifier 3628 | // - DeviceSecret 3629 | type AuthServiceConfirmE2EELoginArgs struct { 3630 | Verifier string `thrift:"verifier,1" db:"verifier" json:"verifier"` 3631 | DeviceSecret []byte `thrift:"deviceSecret,2" db:"deviceSecret" json:"deviceSecret"` 3632 | } 3633 | 3634 | func NewAuthServiceConfirmE2EELoginArgs() *AuthServiceConfirmE2EELoginArgs { 3635 | return &AuthServiceConfirmE2EELoginArgs{} 3636 | } 3637 | 3638 | 3639 | func (p *AuthServiceConfirmE2EELoginArgs) GetVerifier() string { 3640 | return p.Verifier 3641 | } 3642 | 3643 | func (p *AuthServiceConfirmE2EELoginArgs) GetDeviceSecret() []byte { 3644 | return p.DeviceSecret 3645 | } 3646 | func (p *AuthServiceConfirmE2EELoginArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { 3647 | if _, err := iprot.ReadStructBegin(ctx); err != nil { 3648 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 3649 | } 3650 | 3651 | 3652 | for { 3653 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) 3654 | if err != nil { 3655 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 3656 | } 3657 | if fieldTypeId == thrift.STOP { break; } 3658 | switch fieldId { 3659 | case 1: 3660 | if fieldTypeId == thrift.STRING { 3661 | if err := p.ReadField1(ctx, iprot); err != nil { 3662 | return err 3663 | } 3664 | } else { 3665 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 3666 | return err 3667 | } 3668 | } 3669 | case 2: 3670 | if fieldTypeId == thrift.STRING { 3671 | if err := p.ReadField2(ctx, iprot); err != nil { 3672 | return err 3673 | } 3674 | } else { 3675 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 3676 | return err 3677 | } 3678 | } 3679 | default: 3680 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 3681 | return err 3682 | } 3683 | } 3684 | if err := iprot.ReadFieldEnd(ctx); err != nil { 3685 | return err 3686 | } 3687 | } 3688 | if err := iprot.ReadStructEnd(ctx); err != nil { 3689 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 3690 | } 3691 | return nil 3692 | } 3693 | 3694 | func (p *AuthServiceConfirmE2EELoginArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { 3695 | if v, err := iprot.ReadString(ctx); err != nil { 3696 | return thrift.PrependError("error reading field 1: ", err) 3697 | } else { 3698 | p.Verifier = v 3699 | } 3700 | return nil 3701 | } 3702 | 3703 | func (p *AuthServiceConfirmE2EELoginArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { 3704 | if v, err := iprot.ReadBinary(ctx); err != nil { 3705 | return thrift.PrependError("error reading field 2: ", err) 3706 | } else { 3707 | p.DeviceSecret = v 3708 | } 3709 | return nil 3710 | } 3711 | 3712 | func (p *AuthServiceConfirmE2EELoginArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { 3713 | if err := oprot.WriteStructBegin(ctx, "confirmE2EELogin_args"); err != nil { 3714 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } 3715 | if p != nil { 3716 | if err := p.writeField1(ctx, oprot); err != nil { return err } 3717 | if err := p.writeField2(ctx, oprot); err != nil { return err } 3718 | } 3719 | if err := oprot.WriteFieldStop(ctx); err != nil { 3720 | return thrift.PrependError("write field stop error: ", err) } 3721 | if err := oprot.WriteStructEnd(ctx); err != nil { 3722 | return thrift.PrependError("write struct stop error: ", err) } 3723 | return nil 3724 | } 3725 | 3726 | func (p *AuthServiceConfirmE2EELoginArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { 3727 | if err := oprot.WriteFieldBegin(ctx, "verifier", thrift.STRING, 1); err != nil { 3728 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:verifier: ", p), err) } 3729 | if err := oprot.WriteString(ctx, string(p.Verifier)); err != nil { 3730 | return thrift.PrependError(fmt.Sprintf("%T.verifier (1) field write error: ", p), err) } 3731 | if err := oprot.WriteFieldEnd(ctx); err != nil { 3732 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:verifier: ", p), err) } 3733 | return err 3734 | } 3735 | 3736 | func (p *AuthServiceConfirmE2EELoginArgs) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { 3737 | if err := oprot.WriteFieldBegin(ctx, "deviceSecret", thrift.STRING, 2); err != nil { 3738 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:deviceSecret: ", p), err) } 3739 | if err := oprot.WriteBinary(ctx, p.DeviceSecret); err != nil { 3740 | return thrift.PrependError(fmt.Sprintf("%T.deviceSecret (2) field write error: ", p), err) } 3741 | if err := oprot.WriteFieldEnd(ctx); err != nil { 3742 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:deviceSecret: ", p), err) } 3743 | return err 3744 | } 3745 | 3746 | func (p *AuthServiceConfirmE2EELoginArgs) String() string { 3747 | if p == nil { 3748 | return "" 3749 | } 3750 | return fmt.Sprintf("AuthServiceConfirmE2EELoginArgs(%+v)", *p) 3751 | } 3752 | 3753 | // Attributes: 3754 | // - Success 3755 | // - E 3756 | type AuthServiceConfirmE2EELoginResult struct { 3757 | Success *string `thrift:"success,0" db:"success" json:"success,omitempty"` 3758 | E *TalkException `thrift:"e,1" db:"e" json:"e,omitempty"` 3759 | } 3760 | 3761 | func NewAuthServiceConfirmE2EELoginResult() *AuthServiceConfirmE2EELoginResult { 3762 | return &AuthServiceConfirmE2EELoginResult{} 3763 | } 3764 | 3765 | var AuthServiceConfirmE2EELoginResult_Success_DEFAULT string 3766 | func (p *AuthServiceConfirmE2EELoginResult) GetSuccess() string { 3767 | if !p.IsSetSuccess() { 3768 | return AuthServiceConfirmE2EELoginResult_Success_DEFAULT 3769 | } 3770 | return *p.Success 3771 | } 3772 | var AuthServiceConfirmE2EELoginResult_E_DEFAULT *TalkException 3773 | func (p *AuthServiceConfirmE2EELoginResult) GetE() *TalkException { 3774 | if !p.IsSetE() { 3775 | return AuthServiceConfirmE2EELoginResult_E_DEFAULT 3776 | } 3777 | return p.E 3778 | } 3779 | func (p *AuthServiceConfirmE2EELoginResult) IsSetSuccess() bool { 3780 | return p.Success != nil 3781 | } 3782 | 3783 | func (p *AuthServiceConfirmE2EELoginResult) IsSetE() bool { 3784 | return p.E != nil 3785 | } 3786 | 3787 | func (p *AuthServiceConfirmE2EELoginResult) Read(ctx context.Context, iprot thrift.TProtocol) error { 3788 | if _, err := iprot.ReadStructBegin(ctx); err != nil { 3789 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 3790 | } 3791 | 3792 | 3793 | for { 3794 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) 3795 | if err != nil { 3796 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 3797 | } 3798 | if fieldTypeId == thrift.STOP { break; } 3799 | switch fieldId { 3800 | case 0: 3801 | if fieldTypeId == thrift.STRING { 3802 | if err := p.ReadField0(ctx, iprot); err != nil { 3803 | return err 3804 | } 3805 | } else { 3806 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 3807 | return err 3808 | } 3809 | } 3810 | case 1: 3811 | if fieldTypeId == thrift.STRUCT { 3812 | if err := p.ReadField1(ctx, iprot); err != nil { 3813 | return err 3814 | } 3815 | } else { 3816 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 3817 | return err 3818 | } 3819 | } 3820 | default: 3821 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 3822 | return err 3823 | } 3824 | } 3825 | if err := iprot.ReadFieldEnd(ctx); err != nil { 3826 | return err 3827 | } 3828 | } 3829 | if err := iprot.ReadStructEnd(ctx); err != nil { 3830 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 3831 | } 3832 | return nil 3833 | } 3834 | 3835 | func (p *AuthServiceConfirmE2EELoginResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { 3836 | if v, err := iprot.ReadString(ctx); err != nil { 3837 | return thrift.PrependError("error reading field 0: ", err) 3838 | } else { 3839 | p.Success = &v 3840 | } 3841 | return nil 3842 | } 3843 | 3844 | func (p *AuthServiceConfirmE2EELoginResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { 3845 | p.E = &TalkException{} 3846 | if err := p.E.Read(ctx, iprot); err != nil { 3847 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err) 3848 | } 3849 | return nil 3850 | } 3851 | 3852 | func (p *AuthServiceConfirmE2EELoginResult) Write(ctx context.Context, oprot thrift.TProtocol) error { 3853 | if err := oprot.WriteStructBegin(ctx, "confirmE2EELogin_result"); err != nil { 3854 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } 3855 | if p != nil { 3856 | if err := p.writeField0(ctx, oprot); err != nil { return err } 3857 | if err := p.writeField1(ctx, oprot); err != nil { return err } 3858 | } 3859 | if err := oprot.WriteFieldStop(ctx); err != nil { 3860 | return thrift.PrependError("write field stop error: ", err) } 3861 | if err := oprot.WriteStructEnd(ctx); err != nil { 3862 | return thrift.PrependError("write struct stop error: ", err) } 3863 | return nil 3864 | } 3865 | 3866 | func (p *AuthServiceConfirmE2EELoginResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { 3867 | if p.IsSetSuccess() { 3868 | if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRING, 0); err != nil { 3869 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } 3870 | if err := oprot.WriteString(ctx, string(*p.Success)); err != nil { 3871 | return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) } 3872 | if err := oprot.WriteFieldEnd(ctx); err != nil { 3873 | return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } 3874 | } 3875 | return err 3876 | } 3877 | 3878 | func (p *AuthServiceConfirmE2EELoginResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { 3879 | if p.IsSetE() { 3880 | if err := oprot.WriteFieldBegin(ctx, "e", thrift.STRUCT, 1); err != nil { 3881 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) } 3882 | if err := p.E.Write(ctx, oprot); err != nil { 3883 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err) 3884 | } 3885 | if err := oprot.WriteFieldEnd(ctx); err != nil { 3886 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) } 3887 | } 3888 | return err 3889 | } 3890 | 3891 | func (p *AuthServiceConfirmE2EELoginResult) String() string { 3892 | if p == nil { 3893 | return "" 3894 | } 3895 | return fmt.Sprintf("AuthServiceConfirmE2EELoginResult(%+v)", *p) 3896 | } 3897 | 3898 | // Attributes: 3899 | // - LoginRequest 3900 | type AuthServiceLoginZArgs struct { 3901 | // unused field # 1 3902 | LoginRequest *LoginRequest `thrift:"loginRequest,2" db:"loginRequest" json:"loginRequest"` 3903 | } 3904 | 3905 | func NewAuthServiceLoginZArgs() *AuthServiceLoginZArgs { 3906 | return &AuthServiceLoginZArgs{} 3907 | } 3908 | 3909 | var AuthServiceLoginZArgs_LoginRequest_DEFAULT *LoginRequest 3910 | func (p *AuthServiceLoginZArgs) GetLoginRequest() *LoginRequest { 3911 | if !p.IsSetLoginRequest() { 3912 | return AuthServiceLoginZArgs_LoginRequest_DEFAULT 3913 | } 3914 | return p.LoginRequest 3915 | } 3916 | func (p *AuthServiceLoginZArgs) IsSetLoginRequest() bool { 3917 | return p.LoginRequest != nil 3918 | } 3919 | 3920 | func (p *AuthServiceLoginZArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { 3921 | if _, err := iprot.ReadStructBegin(ctx); err != nil { 3922 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 3923 | } 3924 | 3925 | 3926 | for { 3927 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) 3928 | if err != nil { 3929 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 3930 | } 3931 | if fieldTypeId == thrift.STOP { break; } 3932 | switch fieldId { 3933 | case 2: 3934 | if fieldTypeId == thrift.STRUCT { 3935 | if err := p.ReadField2(ctx, iprot); err != nil { 3936 | return err 3937 | } 3938 | } else { 3939 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 3940 | return err 3941 | } 3942 | } 3943 | default: 3944 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 3945 | return err 3946 | } 3947 | } 3948 | if err := iprot.ReadFieldEnd(ctx); err != nil { 3949 | return err 3950 | } 3951 | } 3952 | if err := iprot.ReadStructEnd(ctx); err != nil { 3953 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 3954 | } 3955 | return nil 3956 | } 3957 | 3958 | func (p *AuthServiceLoginZArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { 3959 | p.LoginRequest = &LoginRequest{} 3960 | if err := p.LoginRequest.Read(ctx, iprot); err != nil { 3961 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.LoginRequest), err) 3962 | } 3963 | return nil 3964 | } 3965 | 3966 | func (p *AuthServiceLoginZArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { 3967 | if err := oprot.WriteStructBegin(ctx, "loginZ_args"); err != nil { 3968 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } 3969 | if p != nil { 3970 | if err := p.writeField2(ctx, oprot); err != nil { return err } 3971 | } 3972 | if err := oprot.WriteFieldStop(ctx); err != nil { 3973 | return thrift.PrependError("write field stop error: ", err) } 3974 | if err := oprot.WriteStructEnd(ctx); err != nil { 3975 | return thrift.PrependError("write struct stop error: ", err) } 3976 | return nil 3977 | } 3978 | 3979 | func (p *AuthServiceLoginZArgs) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { 3980 | if err := oprot.WriteFieldBegin(ctx, "loginRequest", thrift.STRUCT, 2); err != nil { 3981 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:loginRequest: ", p), err) } 3982 | if err := p.LoginRequest.Write(ctx, oprot); err != nil { 3983 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.LoginRequest), err) 3984 | } 3985 | if err := oprot.WriteFieldEnd(ctx); err != nil { 3986 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:loginRequest: ", p), err) } 3987 | return err 3988 | } 3989 | 3990 | func (p *AuthServiceLoginZArgs) String() string { 3991 | if p == nil { 3992 | return "" 3993 | } 3994 | return fmt.Sprintf("AuthServiceLoginZArgs(%+v)", *p) 3995 | } 3996 | 3997 | // Attributes: 3998 | // - Success 3999 | // - E 4000 | type AuthServiceLoginZResult struct { 4001 | Success *LoginResult_ `thrift:"success,0" db:"success" json:"success,omitempty"` 4002 | E *TalkException `thrift:"e,1" db:"e" json:"e,omitempty"` 4003 | } 4004 | 4005 | func NewAuthServiceLoginZResult() *AuthServiceLoginZResult { 4006 | return &AuthServiceLoginZResult{} 4007 | } 4008 | 4009 | var AuthServiceLoginZResult_Success_DEFAULT *LoginResult_ 4010 | func (p *AuthServiceLoginZResult) GetSuccess() *LoginResult_ { 4011 | if !p.IsSetSuccess() { 4012 | return AuthServiceLoginZResult_Success_DEFAULT 4013 | } 4014 | return p.Success 4015 | } 4016 | var AuthServiceLoginZResult_E_DEFAULT *TalkException 4017 | func (p *AuthServiceLoginZResult) GetE() *TalkException { 4018 | if !p.IsSetE() { 4019 | return AuthServiceLoginZResult_E_DEFAULT 4020 | } 4021 | return p.E 4022 | } 4023 | func (p *AuthServiceLoginZResult) IsSetSuccess() bool { 4024 | return p.Success != nil 4025 | } 4026 | 4027 | func (p *AuthServiceLoginZResult) IsSetE() bool { 4028 | return p.E != nil 4029 | } 4030 | 4031 | func (p *AuthServiceLoginZResult) Read(ctx context.Context, iprot thrift.TProtocol) error { 4032 | if _, err := iprot.ReadStructBegin(ctx); err != nil { 4033 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 4034 | } 4035 | 4036 | 4037 | for { 4038 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) 4039 | if err != nil { 4040 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 4041 | } 4042 | if fieldTypeId == thrift.STOP { break; } 4043 | switch fieldId { 4044 | case 0: 4045 | if fieldTypeId == thrift.STRUCT { 4046 | if err := p.ReadField0(ctx, iprot); err != nil { 4047 | return err 4048 | } 4049 | } else { 4050 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 4051 | return err 4052 | } 4053 | } 4054 | case 1: 4055 | if fieldTypeId == thrift.STRUCT { 4056 | if err := p.ReadField1(ctx, iprot); err != nil { 4057 | return err 4058 | } 4059 | } else { 4060 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 4061 | return err 4062 | } 4063 | } 4064 | default: 4065 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 4066 | return err 4067 | } 4068 | } 4069 | if err := iprot.ReadFieldEnd(ctx); err != nil { 4070 | return err 4071 | } 4072 | } 4073 | if err := iprot.ReadStructEnd(ctx); err != nil { 4074 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 4075 | } 4076 | return nil 4077 | } 4078 | 4079 | func (p *AuthServiceLoginZResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { 4080 | p.Success = &LoginResult_{} 4081 | if err := p.Success.Read(ctx, iprot); err != nil { 4082 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) 4083 | } 4084 | return nil 4085 | } 4086 | 4087 | func (p *AuthServiceLoginZResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { 4088 | p.E = &TalkException{} 4089 | if err := p.E.Read(ctx, iprot); err != nil { 4090 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err) 4091 | } 4092 | return nil 4093 | } 4094 | 4095 | func (p *AuthServiceLoginZResult) Write(ctx context.Context, oprot thrift.TProtocol) error { 4096 | if err := oprot.WriteStructBegin(ctx, "loginZ_result"); err != nil { 4097 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } 4098 | if p != nil { 4099 | if err := p.writeField0(ctx, oprot); err != nil { return err } 4100 | if err := p.writeField1(ctx, oprot); err != nil { return err } 4101 | } 4102 | if err := oprot.WriteFieldStop(ctx); err != nil { 4103 | return thrift.PrependError("write field stop error: ", err) } 4104 | if err := oprot.WriteStructEnd(ctx); err != nil { 4105 | return thrift.PrependError("write struct stop error: ", err) } 4106 | return nil 4107 | } 4108 | 4109 | func (p *AuthServiceLoginZResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { 4110 | if p.IsSetSuccess() { 4111 | if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { 4112 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } 4113 | if err := p.Success.Write(ctx, oprot); err != nil { 4114 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) 4115 | } 4116 | if err := oprot.WriteFieldEnd(ctx); err != nil { 4117 | return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } 4118 | } 4119 | return err 4120 | } 4121 | 4122 | func (p *AuthServiceLoginZResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { 4123 | if p.IsSetE() { 4124 | if err := oprot.WriteFieldBegin(ctx, "e", thrift.STRUCT, 1); err != nil { 4125 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) } 4126 | if err := p.E.Write(ctx, oprot); err != nil { 4127 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err) 4128 | } 4129 | if err := oprot.WriteFieldEnd(ctx); err != nil { 4130 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) } 4131 | } 4132 | return err 4133 | } 4134 | 4135 | func (p *AuthServiceLoginZResult) String() string { 4136 | if p == nil { 4137 | return "" 4138 | } 4139 | return fmt.Sprintf("AuthServiceLoginZResult(%+v)", *p) 4140 | } 4141 | 4142 | type AuthServiceLogoutZArgs struct { 4143 | } 4144 | 4145 | func NewAuthServiceLogoutZArgs() *AuthServiceLogoutZArgs { 4146 | return &AuthServiceLogoutZArgs{} 4147 | } 4148 | 4149 | func (p *AuthServiceLogoutZArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { 4150 | if _, err := iprot.ReadStructBegin(ctx); err != nil { 4151 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 4152 | } 4153 | 4154 | 4155 | for { 4156 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) 4157 | if err != nil { 4158 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 4159 | } 4160 | if fieldTypeId == thrift.STOP { break; } 4161 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 4162 | return err 4163 | } 4164 | if err := iprot.ReadFieldEnd(ctx); err != nil { 4165 | return err 4166 | } 4167 | } 4168 | if err := iprot.ReadStructEnd(ctx); err != nil { 4169 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 4170 | } 4171 | return nil 4172 | } 4173 | 4174 | func (p *AuthServiceLogoutZArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { 4175 | if err := oprot.WriteStructBegin(ctx, "logoutZ_args"); err != nil { 4176 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } 4177 | if p != nil { 4178 | } 4179 | if err := oprot.WriteFieldStop(ctx); err != nil { 4180 | return thrift.PrependError("write field stop error: ", err) } 4181 | if err := oprot.WriteStructEnd(ctx); err != nil { 4182 | return thrift.PrependError("write struct stop error: ", err) } 4183 | return nil 4184 | } 4185 | 4186 | func (p *AuthServiceLogoutZArgs) String() string { 4187 | if p == nil { 4188 | return "" 4189 | } 4190 | return fmt.Sprintf("AuthServiceLogoutZArgs(%+v)", *p) 4191 | } 4192 | 4193 | // Attributes: 4194 | // - E 4195 | type AuthServiceLogoutZResult struct { 4196 | E *TalkException `thrift:"e,1" db:"e" json:"e,omitempty"` 4197 | } 4198 | 4199 | func NewAuthServiceLogoutZResult() *AuthServiceLogoutZResult { 4200 | return &AuthServiceLogoutZResult{} 4201 | } 4202 | 4203 | var AuthServiceLogoutZResult_E_DEFAULT *TalkException 4204 | func (p *AuthServiceLogoutZResult) GetE() *TalkException { 4205 | if !p.IsSetE() { 4206 | return AuthServiceLogoutZResult_E_DEFAULT 4207 | } 4208 | return p.E 4209 | } 4210 | func (p *AuthServiceLogoutZResult) IsSetE() bool { 4211 | return p.E != nil 4212 | } 4213 | 4214 | func (p *AuthServiceLogoutZResult) Read(ctx context.Context, iprot thrift.TProtocol) error { 4215 | if _, err := iprot.ReadStructBegin(ctx); err != nil { 4216 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) 4217 | } 4218 | 4219 | 4220 | for { 4221 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) 4222 | if err != nil { 4223 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) 4224 | } 4225 | if fieldTypeId == thrift.STOP { break; } 4226 | switch fieldId { 4227 | case 1: 4228 | if fieldTypeId == thrift.STRUCT { 4229 | if err := p.ReadField1(ctx, iprot); err != nil { 4230 | return err 4231 | } 4232 | } else { 4233 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 4234 | return err 4235 | } 4236 | } 4237 | default: 4238 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { 4239 | return err 4240 | } 4241 | } 4242 | if err := iprot.ReadFieldEnd(ctx); err != nil { 4243 | return err 4244 | } 4245 | } 4246 | if err := iprot.ReadStructEnd(ctx); err != nil { 4247 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 4248 | } 4249 | return nil 4250 | } 4251 | 4252 | func (p *AuthServiceLogoutZResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { 4253 | p.E = &TalkException{} 4254 | if err := p.E.Read(ctx, iprot); err != nil { 4255 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err) 4256 | } 4257 | return nil 4258 | } 4259 | 4260 | func (p *AuthServiceLogoutZResult) Write(ctx context.Context, oprot thrift.TProtocol) error { 4261 | if err := oprot.WriteStructBegin(ctx, "logoutZ_result"); err != nil { 4262 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } 4263 | if p != nil { 4264 | if err := p.writeField1(ctx, oprot); err != nil { return err } 4265 | } 4266 | if err := oprot.WriteFieldStop(ctx); err != nil { 4267 | return thrift.PrependError("write field stop error: ", err) } 4268 | if err := oprot.WriteStructEnd(ctx); err != nil { 4269 | return thrift.PrependError("write struct stop error: ", err) } 4270 | return nil 4271 | } 4272 | 4273 | func (p *AuthServiceLogoutZResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { 4274 | if p.IsSetE() { 4275 | if err := oprot.WriteFieldBegin(ctx, "e", thrift.STRUCT, 1); err != nil { 4276 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) } 4277 | if err := p.E.Write(ctx, oprot); err != nil { 4278 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err) 4279 | } 4280 | if err := oprot.WriteFieldEnd(ctx); err != nil { 4281 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) } 4282 | } 4283 | return err 4284 | } 4285 | 4286 | func (p *AuthServiceLogoutZResult) String() string { 4287 | if p == nil { 4288 | return "" 4289 | } 4290 | return fmt.Sprintf("AuthServiceLogoutZResult(%+v)", *p) 4291 | } 4292 | 4293 | 4294 | --------------------------------------------------------------------------------