github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/protocol/keybase1/paperprovision.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/paperprovision.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 PaperProvisionArg struct {
    13  	SessionID  int    `codec:"sessionID" json:"sessionID"`
    14  	Username   string `codec:"username" json:"username"`
    15  	DeviceName string `codec:"deviceName" json:"deviceName"`
    16  	PaperKey   string `codec:"paperKey" json:"paperKey"`
    17  }
    18  
    19  type PaperprovisionInterface interface {
    20  	// Performs paper provision.
    21  	// If the current device isn't provisioned, this function will
    22  	// provision it.
    23  	PaperProvision(context.Context, PaperProvisionArg) error
    24  }
    25  
    26  func PaperprovisionProtocol(i PaperprovisionInterface) rpc.Protocol {
    27  	return rpc.Protocol{
    28  		Name: "keybase.1.paperprovision",
    29  		Methods: map[string]rpc.ServeHandlerDescription{
    30  			"paperProvision": {
    31  				MakeArg: func() interface{} {
    32  					var ret [1]PaperProvisionArg
    33  					return &ret
    34  				},
    35  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
    36  					typedArgs, ok := args.(*[1]PaperProvisionArg)
    37  					if !ok {
    38  						err = rpc.NewTypeError((*[1]PaperProvisionArg)(nil), args)
    39  						return
    40  					}
    41  					err = i.PaperProvision(ctx, typedArgs[0])
    42  					return
    43  				},
    44  			},
    45  		},
    46  	}
    47  }
    48  
    49  type PaperprovisionClient struct {
    50  	Cli rpc.GenericClient
    51  }
    52  
    53  // Performs paper provision.
    54  // If the current device isn't provisioned, this function will
    55  // provision it.
    56  func (c PaperprovisionClient) PaperProvision(ctx context.Context, __arg PaperProvisionArg) (err error) {
    57  	err = c.Cli.Call(ctx, "keybase.1.paperprovision.paperProvision", []interface{}{__arg}, nil, 0*time.Millisecond)
    58  	return
    59  }