github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/protocol/stellar1/ui.go (about) 1 // Auto-generated to Go types and interfaces using avdl-compiler v1.4.10 (https://github.com/keybase/node-avdl-compiler) 2 // Input file: avdl/stellar1/ui.avdl 3 4 package stellar1 5 6 import ( 7 "github.com/keybase/go-framed-msgpack-rpc/rpc" 8 context "golang.org/x/net/context" 9 "time" 10 ) 11 12 type UIPaymentReviewed struct { 13 Bid BuildPaymentID `codec:"bid" json:"bid"` 14 ReviewID int `codec:"reviewID" json:"reviewID"` 15 Seqno int `codec:"seqno" json:"seqno"` 16 Banners []SendBannerLocal `codec:"banners" json:"banners"` 17 NextButton string `codec:"nextButton" json:"nextButton"` 18 } 19 20 func (o UIPaymentReviewed) DeepCopy() UIPaymentReviewed { 21 return UIPaymentReviewed{ 22 Bid: o.Bid.DeepCopy(), 23 ReviewID: o.ReviewID, 24 Seqno: o.Seqno, 25 Banners: (func(x []SendBannerLocal) []SendBannerLocal { 26 if x == nil { 27 return nil 28 } 29 ret := make([]SendBannerLocal, len(x)) 30 for i, v := range x { 31 vCopy := v.DeepCopy() 32 ret[i] = vCopy 33 } 34 return ret 35 })(o.Banners), 36 NextButton: o.NextButton, 37 } 38 } 39 40 type PaymentReviewedArg struct { 41 SessionID int `codec:"sessionID" json:"sessionID"` 42 Msg UIPaymentReviewed `codec:"msg" json:"msg"` 43 } 44 45 type UiInterface interface { 46 PaymentReviewed(context.Context, PaymentReviewedArg) error 47 } 48 49 func UiProtocol(i UiInterface) rpc.Protocol { 50 return rpc.Protocol{ 51 Name: "stellar.1.ui", 52 Methods: map[string]rpc.ServeHandlerDescription{ 53 "paymentReviewed": { 54 MakeArg: func() interface{} { 55 var ret [1]PaymentReviewedArg 56 return &ret 57 }, 58 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 59 typedArgs, ok := args.(*[1]PaymentReviewedArg) 60 if !ok { 61 err = rpc.NewTypeError((*[1]PaymentReviewedArg)(nil), args) 62 return 63 } 64 err = i.PaymentReviewed(ctx, typedArgs[0]) 65 return 66 }, 67 }, 68 }, 69 } 70 } 71 72 type UiClient struct { 73 Cli rpc.GenericClient 74 } 75 76 func (c UiClient) PaymentReviewed(ctx context.Context, __arg PaymentReviewedArg) (err error) { 77 err = c.Cli.Call(ctx, "stellar.1.ui.paymentReviewed", []interface{}{__arg}, nil, 0*time.Millisecond) 78 return 79 }