github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/protocol/keybase1/notify_phone.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/keybase1/notify_phone.avdl 3 4 package keybase1 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 PhoneNumbersChangedArg struct { 13 List []UserPhoneNumber `codec:"list" json:"list"` 14 Category string `codec:"category" json:"category"` 15 PhoneNumber PhoneNumber `codec:"phoneNumber" json:"phoneNumber"` 16 } 17 18 type NotifyPhoneNumberInterface interface { 19 PhoneNumbersChanged(context.Context, PhoneNumbersChangedArg) error 20 } 21 22 func NotifyPhoneNumberProtocol(i NotifyPhoneNumberInterface) rpc.Protocol { 23 return rpc.Protocol{ 24 Name: "keybase.1.NotifyPhoneNumber", 25 Methods: map[string]rpc.ServeHandlerDescription{ 26 "phoneNumbersChanged": { 27 MakeArg: func() interface{} { 28 var ret [1]PhoneNumbersChangedArg 29 return &ret 30 }, 31 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 32 typedArgs, ok := args.(*[1]PhoneNumbersChangedArg) 33 if !ok { 34 err = rpc.NewTypeError((*[1]PhoneNumbersChangedArg)(nil), args) 35 return 36 } 37 err = i.PhoneNumbersChanged(ctx, typedArgs[0]) 38 return 39 }, 40 }, 41 }, 42 } 43 } 44 45 type NotifyPhoneNumberClient struct { 46 Cli rpc.GenericClient 47 } 48 49 func (c NotifyPhoneNumberClient) PhoneNumbersChanged(ctx context.Context, __arg PhoneNumbersChangedArg) (err error) { 50 err = c.Cli.Notify(ctx, "keybase.1.NotifyPhoneNumber.phoneNumbersChanged", []interface{}{__arg}, 0*time.Millisecond) 51 return 52 }