github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/protocol/keybase1/notify_fs.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_fs.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 FSActivityArg struct {
    13  	Notification FSNotification `codec:"notification" json:"notification"`
    14  }
    15  
    16  type FSPathUpdatedArg struct {
    17  	Path string `codec:"path" json:"path"`
    18  }
    19  
    20  type FSSyncActivityArg struct {
    21  	Status FSPathSyncStatus `codec:"status" json:"status"`
    22  }
    23  
    24  type FSEditListResponseArg struct {
    25  	Edits     FSFolderEditHistory `codec:"edits" json:"edits"`
    26  	RequestID int                 `codec:"requestID" json:"requestID"`
    27  }
    28  
    29  type FSSyncStatusResponseArg struct {
    30  	Status    FSSyncStatus `codec:"status" json:"status"`
    31  	RequestID int          `codec:"requestID" json:"requestID"`
    32  }
    33  
    34  type FSOverallSyncStatusChangedArg struct {
    35  	Status FolderSyncStatus `codec:"status" json:"status"`
    36  }
    37  
    38  type FSFavoritesChangedArg struct {
    39  }
    40  
    41  type FSOnlineStatusChangedArg struct {
    42  	Online bool `codec:"online" json:"online"`
    43  }
    44  
    45  type FSSubscriptionNotifyPathArg struct {
    46  	ClientID        string                  `codec:"clientID" json:"clientID"`
    47  	SubscriptionIDs []string                `codec:"subscriptionIDs" json:"subscriptionIDs"`
    48  	Path            string                  `codec:"path" json:"path"`
    49  	Topics          []PathSubscriptionTopic `codec:"topics" json:"topics"`
    50  }
    51  
    52  type FSSubscriptionNotifyArg struct {
    53  	ClientID        string            `codec:"clientID" json:"clientID"`
    54  	SubscriptionIDs []string          `codec:"subscriptionIDs" json:"subscriptionIDs"`
    55  	Topic           SubscriptionTopic `codec:"topic" json:"topic"`
    56  }
    57  
    58  type NotifyFSInterface interface {
    59  	FSActivity(context.Context, FSNotification) error
    60  	FSPathUpdated(context.Context, string) error
    61  	FSSyncActivity(context.Context, FSPathSyncStatus) error
    62  	FSEditListResponse(context.Context, FSEditListResponseArg) error
    63  	FSSyncStatusResponse(context.Context, FSSyncStatusResponseArg) error
    64  	FSOverallSyncStatusChanged(context.Context, FolderSyncStatus) error
    65  	FSFavoritesChanged(context.Context) error
    66  	FSOnlineStatusChanged(context.Context, bool) error
    67  	FSSubscriptionNotifyPath(context.Context, FSSubscriptionNotifyPathArg) error
    68  	FSSubscriptionNotify(context.Context, FSSubscriptionNotifyArg) error
    69  }
    70  
    71  func NotifyFSProtocol(i NotifyFSInterface) rpc.Protocol {
    72  	return rpc.Protocol{
    73  		Name: "keybase.1.NotifyFS",
    74  		Methods: map[string]rpc.ServeHandlerDescription{
    75  			"FSActivity": {
    76  				MakeArg: func() interface{} {
    77  					var ret [1]FSActivityArg
    78  					return &ret
    79  				},
    80  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
    81  					typedArgs, ok := args.(*[1]FSActivityArg)
    82  					if !ok {
    83  						err = rpc.NewTypeError((*[1]FSActivityArg)(nil), args)
    84  						return
    85  					}
    86  					err = i.FSActivity(ctx, typedArgs[0].Notification)
    87  					return
    88  				},
    89  			},
    90  			"FSPathUpdated": {
    91  				MakeArg: func() interface{} {
    92  					var ret [1]FSPathUpdatedArg
    93  					return &ret
    94  				},
    95  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
    96  					typedArgs, ok := args.(*[1]FSPathUpdatedArg)
    97  					if !ok {
    98  						err = rpc.NewTypeError((*[1]FSPathUpdatedArg)(nil), args)
    99  						return
   100  					}
   101  					err = i.FSPathUpdated(ctx, typedArgs[0].Path)
   102  					return
   103  				},
   104  			},
   105  			"FSSyncActivity": {
   106  				MakeArg: func() interface{} {
   107  					var ret [1]FSSyncActivityArg
   108  					return &ret
   109  				},
   110  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
   111  					typedArgs, ok := args.(*[1]FSSyncActivityArg)
   112  					if !ok {
   113  						err = rpc.NewTypeError((*[1]FSSyncActivityArg)(nil), args)
   114  						return
   115  					}
   116  					err = i.FSSyncActivity(ctx, typedArgs[0].Status)
   117  					return
   118  				},
   119  			},
   120  			"FSEditListResponse": {
   121  				MakeArg: func() interface{} {
   122  					var ret [1]FSEditListResponseArg
   123  					return &ret
   124  				},
   125  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
   126  					typedArgs, ok := args.(*[1]FSEditListResponseArg)
   127  					if !ok {
   128  						err = rpc.NewTypeError((*[1]FSEditListResponseArg)(nil), args)
   129  						return
   130  					}
   131  					err = i.FSEditListResponse(ctx, typedArgs[0])
   132  					return
   133  				},
   134  			},
   135  			"FSSyncStatusResponse": {
   136  				MakeArg: func() interface{} {
   137  					var ret [1]FSSyncStatusResponseArg
   138  					return &ret
   139  				},
   140  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
   141  					typedArgs, ok := args.(*[1]FSSyncStatusResponseArg)
   142  					if !ok {
   143  						err = rpc.NewTypeError((*[1]FSSyncStatusResponseArg)(nil), args)
   144  						return
   145  					}
   146  					err = i.FSSyncStatusResponse(ctx, typedArgs[0])
   147  					return
   148  				},
   149  			},
   150  			"FSOverallSyncStatusChanged": {
   151  				MakeArg: func() interface{} {
   152  					var ret [1]FSOverallSyncStatusChangedArg
   153  					return &ret
   154  				},
   155  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
   156  					typedArgs, ok := args.(*[1]FSOverallSyncStatusChangedArg)
   157  					if !ok {
   158  						err = rpc.NewTypeError((*[1]FSOverallSyncStatusChangedArg)(nil), args)
   159  						return
   160  					}
   161  					err = i.FSOverallSyncStatusChanged(ctx, typedArgs[0].Status)
   162  					return
   163  				},
   164  			},
   165  			"FSFavoritesChanged": {
   166  				MakeArg: func() interface{} {
   167  					var ret [1]FSFavoritesChangedArg
   168  					return &ret
   169  				},
   170  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
   171  					err = i.FSFavoritesChanged(ctx)
   172  					return
   173  				},
   174  			},
   175  			"FSOnlineStatusChanged": {
   176  				MakeArg: func() interface{} {
   177  					var ret [1]FSOnlineStatusChangedArg
   178  					return &ret
   179  				},
   180  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
   181  					typedArgs, ok := args.(*[1]FSOnlineStatusChangedArg)
   182  					if !ok {
   183  						err = rpc.NewTypeError((*[1]FSOnlineStatusChangedArg)(nil), args)
   184  						return
   185  					}
   186  					err = i.FSOnlineStatusChanged(ctx, typedArgs[0].Online)
   187  					return
   188  				},
   189  			},
   190  			"FSSubscriptionNotifyPath": {
   191  				MakeArg: func() interface{} {
   192  					var ret [1]FSSubscriptionNotifyPathArg
   193  					return &ret
   194  				},
   195  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
   196  					typedArgs, ok := args.(*[1]FSSubscriptionNotifyPathArg)
   197  					if !ok {
   198  						err = rpc.NewTypeError((*[1]FSSubscriptionNotifyPathArg)(nil), args)
   199  						return
   200  					}
   201  					err = i.FSSubscriptionNotifyPath(ctx, typedArgs[0])
   202  					return
   203  				},
   204  			},
   205  			"FSSubscriptionNotify": {
   206  				MakeArg: func() interface{} {
   207  					var ret [1]FSSubscriptionNotifyArg
   208  					return &ret
   209  				},
   210  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
   211  					typedArgs, ok := args.(*[1]FSSubscriptionNotifyArg)
   212  					if !ok {
   213  						err = rpc.NewTypeError((*[1]FSSubscriptionNotifyArg)(nil), args)
   214  						return
   215  					}
   216  					err = i.FSSubscriptionNotify(ctx, typedArgs[0])
   217  					return
   218  				},
   219  			},
   220  		},
   221  	}
   222  }
   223  
   224  type NotifyFSClient struct {
   225  	Cli rpc.GenericClient
   226  }
   227  
   228  func (c NotifyFSClient) FSActivity(ctx context.Context, notification FSNotification) (err error) {
   229  	__arg := FSActivityArg{Notification: notification}
   230  	err = c.Cli.Notify(ctx, "keybase.1.NotifyFS.FSActivity", []interface{}{__arg}, 0*time.Millisecond)
   231  	return
   232  }
   233  
   234  func (c NotifyFSClient) FSPathUpdated(ctx context.Context, path string) (err error) {
   235  	__arg := FSPathUpdatedArg{Path: path}
   236  	err = c.Cli.Notify(ctx, "keybase.1.NotifyFS.FSPathUpdated", []interface{}{__arg}, 0*time.Millisecond)
   237  	return
   238  }
   239  
   240  func (c NotifyFSClient) FSSyncActivity(ctx context.Context, status FSPathSyncStatus) (err error) {
   241  	__arg := FSSyncActivityArg{Status: status}
   242  	err = c.Cli.Notify(ctx, "keybase.1.NotifyFS.FSSyncActivity", []interface{}{__arg}, 0*time.Millisecond)
   243  	return
   244  }
   245  
   246  func (c NotifyFSClient) FSEditListResponse(ctx context.Context, __arg FSEditListResponseArg) (err error) {
   247  	err = c.Cli.Notify(ctx, "keybase.1.NotifyFS.FSEditListResponse", []interface{}{__arg}, 0*time.Millisecond)
   248  	return
   249  }
   250  
   251  func (c NotifyFSClient) FSSyncStatusResponse(ctx context.Context, __arg FSSyncStatusResponseArg) (err error) {
   252  	err = c.Cli.Notify(ctx, "keybase.1.NotifyFS.FSSyncStatusResponse", []interface{}{__arg}, 0*time.Millisecond)
   253  	return
   254  }
   255  
   256  func (c NotifyFSClient) FSOverallSyncStatusChanged(ctx context.Context, status FolderSyncStatus) (err error) {
   257  	__arg := FSOverallSyncStatusChangedArg{Status: status}
   258  	err = c.Cli.Notify(ctx, "keybase.1.NotifyFS.FSOverallSyncStatusChanged", []interface{}{__arg}, 0*time.Millisecond)
   259  	return
   260  }
   261  
   262  func (c NotifyFSClient) FSFavoritesChanged(ctx context.Context) (err error) {
   263  	err = c.Cli.Notify(ctx, "keybase.1.NotifyFS.FSFavoritesChanged", []interface{}{FSFavoritesChangedArg{}}, 0*time.Millisecond)
   264  	return
   265  }
   266  
   267  func (c NotifyFSClient) FSOnlineStatusChanged(ctx context.Context, online bool) (err error) {
   268  	__arg := FSOnlineStatusChangedArg{Online: online}
   269  	err = c.Cli.Notify(ctx, "keybase.1.NotifyFS.FSOnlineStatusChanged", []interface{}{__arg}, 0*time.Millisecond)
   270  	return
   271  }
   272  
   273  func (c NotifyFSClient) FSSubscriptionNotifyPath(ctx context.Context, __arg FSSubscriptionNotifyPathArg) (err error) {
   274  	err = c.Cli.Notify(ctx, "keybase.1.NotifyFS.FSSubscriptionNotifyPath", []interface{}{__arg}, 0*time.Millisecond)
   275  	return
   276  }
   277  
   278  func (c NotifyFSClient) FSSubscriptionNotify(ctx context.Context, __arg FSSubscriptionNotifyArg) (err error) {
   279  	err = c.Cli.Notify(ctx, "keybase.1.NotifyFS.FSSubscriptionNotify", []interface{}{__arg}, 0*time.Millisecond)
   280  	return
   281  }