github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/protocol/keybase1/implicit_team_migration.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/implicit_team_migration.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 StartMigrationArg struct {
    13  	Folder Folder `codec:"folder" json:"folder"`
    14  }
    15  
    16  type FinalizeMigrationArg struct {
    17  	Folder Folder `codec:"folder" json:"folder"`
    18  }
    19  
    20  type ImplicitTeamMigrationInterface interface {
    21  	StartMigration(context.Context, Folder) error
    22  	FinalizeMigration(context.Context, Folder) error
    23  }
    24  
    25  func ImplicitTeamMigrationProtocol(i ImplicitTeamMigrationInterface) rpc.Protocol {
    26  	return rpc.Protocol{
    27  		Name: "keybase.1.implicitTeamMigration",
    28  		Methods: map[string]rpc.ServeHandlerDescription{
    29  			"startMigration": {
    30  				MakeArg: func() interface{} {
    31  					var ret [1]StartMigrationArg
    32  					return &ret
    33  				},
    34  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
    35  					typedArgs, ok := args.(*[1]StartMigrationArg)
    36  					if !ok {
    37  						err = rpc.NewTypeError((*[1]StartMigrationArg)(nil), args)
    38  						return
    39  					}
    40  					err = i.StartMigration(ctx, typedArgs[0].Folder)
    41  					return
    42  				},
    43  			},
    44  			"finalizeMigration": {
    45  				MakeArg: func() interface{} {
    46  					var ret [1]FinalizeMigrationArg
    47  					return &ret
    48  				},
    49  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
    50  					typedArgs, ok := args.(*[1]FinalizeMigrationArg)
    51  					if !ok {
    52  						err = rpc.NewTypeError((*[1]FinalizeMigrationArg)(nil), args)
    53  						return
    54  					}
    55  					err = i.FinalizeMigration(ctx, typedArgs[0].Folder)
    56  					return
    57  				},
    58  			},
    59  		},
    60  	}
    61  }
    62  
    63  type ImplicitTeamMigrationClient struct {
    64  	Cli rpc.GenericClient
    65  }
    66  
    67  func (c ImplicitTeamMigrationClient) StartMigration(ctx context.Context, folder Folder) (err error) {
    68  	__arg := StartMigrationArg{Folder: folder}
    69  	err = c.Cli.Call(ctx, "keybase.1.implicitTeamMigration.startMigration", []interface{}{__arg}, nil, 0*time.Millisecond)
    70  	return
    71  }
    72  
    73  func (c ImplicitTeamMigrationClient) FinalizeMigration(ctx context.Context, folder Folder) (err error) {
    74  	__arg := FinalizeMigrationArg{Folder: folder}
    75  	err = c.Cli.Call(ctx, "keybase.1.implicitTeamMigration.finalizeMigration", []interface{}{__arg}, nil, 0*time.Millisecond)
    76  	return
    77  }