go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/swarming/proto/api_v2/swarming_grpc.pb.go (about)

     1  // Copyright 2022 The LUCI Authors. All rights reserved.
     2  // Use of this source code is governed under the Apache License, Version 2.0
     3  // that can be found in the LICENSE file.
     4  
     5  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     6  // versions:
     7  // - protoc-gen-go-grpc v1.3.0
     8  // - protoc             v3.21.7
     9  // source: go.chromium.org/luci/swarming/proto/api_v2/swarming.proto
    10  
    11  package apipb
    12  
    13  import (
    14  	context "context"
    15  	grpc "google.golang.org/grpc"
    16  	codes "google.golang.org/grpc/codes"
    17  	status "google.golang.org/grpc/status"
    18  	emptypb "google.golang.org/protobuf/types/known/emptypb"
    19  )
    20  
    21  // This is a compile-time assertion to ensure that this generated file
    22  // is compatible with the grpc package it is being compiled against.
    23  // Requires gRPC-Go v1.32.0 or later.
    24  const _ = grpc.SupportPackageIsVersion7
    25  
    26  const (
    27  	Bots_GetBot_FullMethodName           = "/swarming.v2.Bots/GetBot"
    28  	Bots_DeleteBot_FullMethodName        = "/swarming.v2.Bots/DeleteBot"
    29  	Bots_ListBotEvents_FullMethodName    = "/swarming.v2.Bots/ListBotEvents"
    30  	Bots_TerminateBot_FullMethodName     = "/swarming.v2.Bots/TerminateBot"
    31  	Bots_ListBotTasks_FullMethodName     = "/swarming.v2.Bots/ListBotTasks"
    32  	Bots_ListBots_FullMethodName         = "/swarming.v2.Bots/ListBots"
    33  	Bots_CountBots_FullMethodName        = "/swarming.v2.Bots/CountBots"
    34  	Bots_GetBotDimensions_FullMethodName = "/swarming.v2.Bots/GetBotDimensions"
    35  )
    36  
    37  // BotsClient is the client API for Bots service.
    38  //
    39  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
    40  type BotsClient interface {
    41  	// GetBot returns information on a single bot
    42  	GetBot(ctx context.Context, in *BotRequest, opts ...grpc.CallOption) (*BotInfo, error)
    43  	// DeleteBot makes Swarming forget about a single bot.
    44  	//
    45  	// This includes the event history, task history and current state (dimensions,
    46  	// cache state, etc). Once deleted, Swarming will not send tasks to this bot.
    47  	// A still running bot will fininsh executing its task and then not have any
    48  	// further tasks queued on it.
    49  	//
    50  	// For non-GCE-Provider bots, this does not remove any data on the bot
    51  	// machine itself, and if the bot is still running on that machine, it will
    52  	// likely show up again in swarming shortly after calling this API.
    53  	//
    54  	// If this bot is managed with GCE Provider, the underlying VM will be recycled
    55  	// and all data on that VM will be lost.
    56  	//
    57  	// If you wish to shut the bot down, call TerminateBot.
    58  	DeleteBot(ctx context.Context, in *BotRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
    59  	// ListBotEvents returns a section of the Events (limited in quantity, time range)
    60  	// related to a single Bot.
    61  	//
    62  	// The bot in question must still be 'known' to Swarming.
    63  	ListBotEvents(ctx context.Context, in *BotEventsRequest, opts ...grpc.CallOption) (*BotEventsResponse, error)
    64  	// TerminateBot asks a bot to terminate itself gracefully.
    65  	// The bot will stay in the DB, use 'delete' to remove it from the DB
    66  	// afterward. This request returns a pseudo-taskid that can be waited for to
    67  	// wait for the bot to turn down.
    68  	// This command is particularly useful when a privileged user needs to safely
    69  	// debug a machine specific issue. The user can trigger a terminate for one of
    70  	// the bot exhibiting the issue, wait for the pseudo-task to run then access
    71  	// the machine with the guarantee that the bot is not running anymore.
    72  	TerminateBot(ctx context.Context, in *TerminateRequest, opts ...grpc.CallOption) (*TerminateResponse, error)
    73  	// ListBotTasks returns a section of the Task history (limited in quantity, time
    74  	// range) in the context of a single bot.
    75  	//
    76  	// The bot in question must still be 'known' to Swarming.
    77  	ListBotTasks(ctx context.Context, in *BotTasksRequest, opts ...grpc.CallOption) (*TaskListResponse, error)
    78  	// ListBots returns the state of a filtered (dimensions, state) list of known bots.
    79  	ListBots(ctx context.Context, in *BotsRequest, opts ...grpc.CallOption) (*BotInfoListResponse, error)
    80  	// CountBots returns the number of bots which match given set of filters.
    81  	CountBots(ctx context.Context, in *BotsCountRequest, opts ...grpc.CallOption) (*BotsCount, error)
    82  	// GetBotDimensions returns a list of known dimensions/values for bots currently
    83  	// connected to a given pool.
    84  	GetBotDimensions(ctx context.Context, in *BotsDimensionsRequest, opts ...grpc.CallOption) (*BotsDimensions, error)
    85  }
    86  
    87  type botsClient struct {
    88  	cc grpc.ClientConnInterface
    89  }
    90  
    91  func NewBotsClient(cc grpc.ClientConnInterface) BotsClient {
    92  	return &botsClient{cc}
    93  }
    94  
    95  func (c *botsClient) GetBot(ctx context.Context, in *BotRequest, opts ...grpc.CallOption) (*BotInfo, error) {
    96  	out := new(BotInfo)
    97  	err := c.cc.Invoke(ctx, Bots_GetBot_FullMethodName, in, out, opts...)
    98  	if err != nil {
    99  		return nil, err
   100  	}
   101  	return out, nil
   102  }
   103  
   104  func (c *botsClient) DeleteBot(ctx context.Context, in *BotRequest, opts ...grpc.CallOption) (*DeleteResponse, error) {
   105  	out := new(DeleteResponse)
   106  	err := c.cc.Invoke(ctx, Bots_DeleteBot_FullMethodName, in, out, opts...)
   107  	if err != nil {
   108  		return nil, err
   109  	}
   110  	return out, nil
   111  }
   112  
   113  func (c *botsClient) ListBotEvents(ctx context.Context, in *BotEventsRequest, opts ...grpc.CallOption) (*BotEventsResponse, error) {
   114  	out := new(BotEventsResponse)
   115  	err := c.cc.Invoke(ctx, Bots_ListBotEvents_FullMethodName, in, out, opts...)
   116  	if err != nil {
   117  		return nil, err
   118  	}
   119  	return out, nil
   120  }
   121  
   122  func (c *botsClient) TerminateBot(ctx context.Context, in *TerminateRequest, opts ...grpc.CallOption) (*TerminateResponse, error) {
   123  	out := new(TerminateResponse)
   124  	err := c.cc.Invoke(ctx, Bots_TerminateBot_FullMethodName, in, out, opts...)
   125  	if err != nil {
   126  		return nil, err
   127  	}
   128  	return out, nil
   129  }
   130  
   131  func (c *botsClient) ListBotTasks(ctx context.Context, in *BotTasksRequest, opts ...grpc.CallOption) (*TaskListResponse, error) {
   132  	out := new(TaskListResponse)
   133  	err := c.cc.Invoke(ctx, Bots_ListBotTasks_FullMethodName, in, out, opts...)
   134  	if err != nil {
   135  		return nil, err
   136  	}
   137  	return out, nil
   138  }
   139  
   140  func (c *botsClient) ListBots(ctx context.Context, in *BotsRequest, opts ...grpc.CallOption) (*BotInfoListResponse, error) {
   141  	out := new(BotInfoListResponse)
   142  	err := c.cc.Invoke(ctx, Bots_ListBots_FullMethodName, in, out, opts...)
   143  	if err != nil {
   144  		return nil, err
   145  	}
   146  	return out, nil
   147  }
   148  
   149  func (c *botsClient) CountBots(ctx context.Context, in *BotsCountRequest, opts ...grpc.CallOption) (*BotsCount, error) {
   150  	out := new(BotsCount)
   151  	err := c.cc.Invoke(ctx, Bots_CountBots_FullMethodName, in, out, opts...)
   152  	if err != nil {
   153  		return nil, err
   154  	}
   155  	return out, nil
   156  }
   157  
   158  func (c *botsClient) GetBotDimensions(ctx context.Context, in *BotsDimensionsRequest, opts ...grpc.CallOption) (*BotsDimensions, error) {
   159  	out := new(BotsDimensions)
   160  	err := c.cc.Invoke(ctx, Bots_GetBotDimensions_FullMethodName, in, out, opts...)
   161  	if err != nil {
   162  		return nil, err
   163  	}
   164  	return out, nil
   165  }
   166  
   167  // BotsServer is the server API for Bots service.
   168  // All implementations must embed UnimplementedBotsServer
   169  // for forward compatibility
   170  type BotsServer interface {
   171  	// GetBot returns information on a single bot
   172  	GetBot(context.Context, *BotRequest) (*BotInfo, error)
   173  	// DeleteBot makes Swarming forget about a single bot.
   174  	//
   175  	// This includes the event history, task history and current state (dimensions,
   176  	// cache state, etc). Once deleted, Swarming will not send tasks to this bot.
   177  	// A still running bot will fininsh executing its task and then not have any
   178  	// further tasks queued on it.
   179  	//
   180  	// For non-GCE-Provider bots, this does not remove any data on the bot
   181  	// machine itself, and if the bot is still running on that machine, it will
   182  	// likely show up again in swarming shortly after calling this API.
   183  	//
   184  	// If this bot is managed with GCE Provider, the underlying VM will be recycled
   185  	// and all data on that VM will be lost.
   186  	//
   187  	// If you wish to shut the bot down, call TerminateBot.
   188  	DeleteBot(context.Context, *BotRequest) (*DeleteResponse, error)
   189  	// ListBotEvents returns a section of the Events (limited in quantity, time range)
   190  	// related to a single Bot.
   191  	//
   192  	// The bot in question must still be 'known' to Swarming.
   193  	ListBotEvents(context.Context, *BotEventsRequest) (*BotEventsResponse, error)
   194  	// TerminateBot asks a bot to terminate itself gracefully.
   195  	// The bot will stay in the DB, use 'delete' to remove it from the DB
   196  	// afterward. This request returns a pseudo-taskid that can be waited for to
   197  	// wait for the bot to turn down.
   198  	// This command is particularly useful when a privileged user needs to safely
   199  	// debug a machine specific issue. The user can trigger a terminate for one of
   200  	// the bot exhibiting the issue, wait for the pseudo-task to run then access
   201  	// the machine with the guarantee that the bot is not running anymore.
   202  	TerminateBot(context.Context, *TerminateRequest) (*TerminateResponse, error)
   203  	// ListBotTasks returns a section of the Task history (limited in quantity, time
   204  	// range) in the context of a single bot.
   205  	//
   206  	// The bot in question must still be 'known' to Swarming.
   207  	ListBotTasks(context.Context, *BotTasksRequest) (*TaskListResponse, error)
   208  	// ListBots returns the state of a filtered (dimensions, state) list of known bots.
   209  	ListBots(context.Context, *BotsRequest) (*BotInfoListResponse, error)
   210  	// CountBots returns the number of bots which match given set of filters.
   211  	CountBots(context.Context, *BotsCountRequest) (*BotsCount, error)
   212  	// GetBotDimensions returns a list of known dimensions/values for bots currently
   213  	// connected to a given pool.
   214  	GetBotDimensions(context.Context, *BotsDimensionsRequest) (*BotsDimensions, error)
   215  	mustEmbedUnimplementedBotsServer()
   216  }
   217  
   218  // UnimplementedBotsServer must be embedded to have forward compatible implementations.
   219  type UnimplementedBotsServer struct {
   220  }
   221  
   222  func (UnimplementedBotsServer) GetBot(context.Context, *BotRequest) (*BotInfo, error) {
   223  	return nil, status.Errorf(codes.Unimplemented, "method GetBot not implemented")
   224  }
   225  func (UnimplementedBotsServer) DeleteBot(context.Context, *BotRequest) (*DeleteResponse, error) {
   226  	return nil, status.Errorf(codes.Unimplemented, "method DeleteBot not implemented")
   227  }
   228  func (UnimplementedBotsServer) ListBotEvents(context.Context, *BotEventsRequest) (*BotEventsResponse, error) {
   229  	return nil, status.Errorf(codes.Unimplemented, "method ListBotEvents not implemented")
   230  }
   231  func (UnimplementedBotsServer) TerminateBot(context.Context, *TerminateRequest) (*TerminateResponse, error) {
   232  	return nil, status.Errorf(codes.Unimplemented, "method TerminateBot not implemented")
   233  }
   234  func (UnimplementedBotsServer) ListBotTasks(context.Context, *BotTasksRequest) (*TaskListResponse, error) {
   235  	return nil, status.Errorf(codes.Unimplemented, "method ListBotTasks not implemented")
   236  }
   237  func (UnimplementedBotsServer) ListBots(context.Context, *BotsRequest) (*BotInfoListResponse, error) {
   238  	return nil, status.Errorf(codes.Unimplemented, "method ListBots not implemented")
   239  }
   240  func (UnimplementedBotsServer) CountBots(context.Context, *BotsCountRequest) (*BotsCount, error) {
   241  	return nil, status.Errorf(codes.Unimplemented, "method CountBots not implemented")
   242  }
   243  func (UnimplementedBotsServer) GetBotDimensions(context.Context, *BotsDimensionsRequest) (*BotsDimensions, error) {
   244  	return nil, status.Errorf(codes.Unimplemented, "method GetBotDimensions not implemented")
   245  }
   246  func (UnimplementedBotsServer) mustEmbedUnimplementedBotsServer() {}
   247  
   248  // UnsafeBotsServer may be embedded to opt out of forward compatibility for this service.
   249  // Use of this interface is not recommended, as added methods to BotsServer will
   250  // result in compilation errors.
   251  type UnsafeBotsServer interface {
   252  	mustEmbedUnimplementedBotsServer()
   253  }
   254  
   255  func RegisterBotsServer(s grpc.ServiceRegistrar, srv BotsServer) {
   256  	s.RegisterService(&Bots_ServiceDesc, srv)
   257  }
   258  
   259  func _Bots_GetBot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   260  	in := new(BotRequest)
   261  	if err := dec(in); err != nil {
   262  		return nil, err
   263  	}
   264  	if interceptor == nil {
   265  		return srv.(BotsServer).GetBot(ctx, in)
   266  	}
   267  	info := &grpc.UnaryServerInfo{
   268  		Server:     srv,
   269  		FullMethod: Bots_GetBot_FullMethodName,
   270  	}
   271  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   272  		return srv.(BotsServer).GetBot(ctx, req.(*BotRequest))
   273  	}
   274  	return interceptor(ctx, in, info, handler)
   275  }
   276  
   277  func _Bots_DeleteBot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   278  	in := new(BotRequest)
   279  	if err := dec(in); err != nil {
   280  		return nil, err
   281  	}
   282  	if interceptor == nil {
   283  		return srv.(BotsServer).DeleteBot(ctx, in)
   284  	}
   285  	info := &grpc.UnaryServerInfo{
   286  		Server:     srv,
   287  		FullMethod: Bots_DeleteBot_FullMethodName,
   288  	}
   289  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   290  		return srv.(BotsServer).DeleteBot(ctx, req.(*BotRequest))
   291  	}
   292  	return interceptor(ctx, in, info, handler)
   293  }
   294  
   295  func _Bots_ListBotEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   296  	in := new(BotEventsRequest)
   297  	if err := dec(in); err != nil {
   298  		return nil, err
   299  	}
   300  	if interceptor == nil {
   301  		return srv.(BotsServer).ListBotEvents(ctx, in)
   302  	}
   303  	info := &grpc.UnaryServerInfo{
   304  		Server:     srv,
   305  		FullMethod: Bots_ListBotEvents_FullMethodName,
   306  	}
   307  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   308  		return srv.(BotsServer).ListBotEvents(ctx, req.(*BotEventsRequest))
   309  	}
   310  	return interceptor(ctx, in, info, handler)
   311  }
   312  
   313  func _Bots_TerminateBot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   314  	in := new(TerminateRequest)
   315  	if err := dec(in); err != nil {
   316  		return nil, err
   317  	}
   318  	if interceptor == nil {
   319  		return srv.(BotsServer).TerminateBot(ctx, in)
   320  	}
   321  	info := &grpc.UnaryServerInfo{
   322  		Server:     srv,
   323  		FullMethod: Bots_TerminateBot_FullMethodName,
   324  	}
   325  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   326  		return srv.(BotsServer).TerminateBot(ctx, req.(*TerminateRequest))
   327  	}
   328  	return interceptor(ctx, in, info, handler)
   329  }
   330  
   331  func _Bots_ListBotTasks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   332  	in := new(BotTasksRequest)
   333  	if err := dec(in); err != nil {
   334  		return nil, err
   335  	}
   336  	if interceptor == nil {
   337  		return srv.(BotsServer).ListBotTasks(ctx, in)
   338  	}
   339  	info := &grpc.UnaryServerInfo{
   340  		Server:     srv,
   341  		FullMethod: Bots_ListBotTasks_FullMethodName,
   342  	}
   343  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   344  		return srv.(BotsServer).ListBotTasks(ctx, req.(*BotTasksRequest))
   345  	}
   346  	return interceptor(ctx, in, info, handler)
   347  }
   348  
   349  func _Bots_ListBots_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   350  	in := new(BotsRequest)
   351  	if err := dec(in); err != nil {
   352  		return nil, err
   353  	}
   354  	if interceptor == nil {
   355  		return srv.(BotsServer).ListBots(ctx, in)
   356  	}
   357  	info := &grpc.UnaryServerInfo{
   358  		Server:     srv,
   359  		FullMethod: Bots_ListBots_FullMethodName,
   360  	}
   361  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   362  		return srv.(BotsServer).ListBots(ctx, req.(*BotsRequest))
   363  	}
   364  	return interceptor(ctx, in, info, handler)
   365  }
   366  
   367  func _Bots_CountBots_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   368  	in := new(BotsCountRequest)
   369  	if err := dec(in); err != nil {
   370  		return nil, err
   371  	}
   372  	if interceptor == nil {
   373  		return srv.(BotsServer).CountBots(ctx, in)
   374  	}
   375  	info := &grpc.UnaryServerInfo{
   376  		Server:     srv,
   377  		FullMethod: Bots_CountBots_FullMethodName,
   378  	}
   379  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   380  		return srv.(BotsServer).CountBots(ctx, req.(*BotsCountRequest))
   381  	}
   382  	return interceptor(ctx, in, info, handler)
   383  }
   384  
   385  func _Bots_GetBotDimensions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   386  	in := new(BotsDimensionsRequest)
   387  	if err := dec(in); err != nil {
   388  		return nil, err
   389  	}
   390  	if interceptor == nil {
   391  		return srv.(BotsServer).GetBotDimensions(ctx, in)
   392  	}
   393  	info := &grpc.UnaryServerInfo{
   394  		Server:     srv,
   395  		FullMethod: Bots_GetBotDimensions_FullMethodName,
   396  	}
   397  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   398  		return srv.(BotsServer).GetBotDimensions(ctx, req.(*BotsDimensionsRequest))
   399  	}
   400  	return interceptor(ctx, in, info, handler)
   401  }
   402  
   403  // Bots_ServiceDesc is the grpc.ServiceDesc for Bots service.
   404  // It's only intended for direct use with grpc.RegisterService,
   405  // and not to be introspected or modified (even as a copy)
   406  var Bots_ServiceDesc = grpc.ServiceDesc{
   407  	ServiceName: "swarming.v2.Bots",
   408  	HandlerType: (*BotsServer)(nil),
   409  	Methods: []grpc.MethodDesc{
   410  		{
   411  			MethodName: "GetBot",
   412  			Handler:    _Bots_GetBot_Handler,
   413  		},
   414  		{
   415  			MethodName: "DeleteBot",
   416  			Handler:    _Bots_DeleteBot_Handler,
   417  		},
   418  		{
   419  			MethodName: "ListBotEvents",
   420  			Handler:    _Bots_ListBotEvents_Handler,
   421  		},
   422  		{
   423  			MethodName: "TerminateBot",
   424  			Handler:    _Bots_TerminateBot_Handler,
   425  		},
   426  		{
   427  			MethodName: "ListBotTasks",
   428  			Handler:    _Bots_ListBotTasks_Handler,
   429  		},
   430  		{
   431  			MethodName: "ListBots",
   432  			Handler:    _Bots_ListBots_Handler,
   433  		},
   434  		{
   435  			MethodName: "CountBots",
   436  			Handler:    _Bots_CountBots_Handler,
   437  		},
   438  		{
   439  			MethodName: "GetBotDimensions",
   440  			Handler:    _Bots_GetBotDimensions_Handler,
   441  		},
   442  	},
   443  	Streams:  []grpc.StreamDesc{},
   444  	Metadata: "go.chromium.org/luci/swarming/proto/api_v2/swarming.proto",
   445  }
   446  
   447  const (
   448  	Tasks_GetResult_FullMethodName        = "/swarming.v2.Tasks/GetResult"
   449  	Tasks_BatchGetResult_FullMethodName   = "/swarming.v2.Tasks/BatchGetResult"
   450  	Tasks_GetRequest_FullMethodName       = "/swarming.v2.Tasks/GetRequest"
   451  	Tasks_CancelTask_FullMethodName       = "/swarming.v2.Tasks/CancelTask"
   452  	Tasks_GetStdout_FullMethodName        = "/swarming.v2.Tasks/GetStdout"
   453  	Tasks_NewTask_FullMethodName          = "/swarming.v2.Tasks/NewTask"
   454  	Tasks_ListTasks_FullMethodName        = "/swarming.v2.Tasks/ListTasks"
   455  	Tasks_ListTaskStates_FullMethodName   = "/swarming.v2.Tasks/ListTaskStates"
   456  	Tasks_ListTaskRequests_FullMethodName = "/swarming.v2.Tasks/ListTaskRequests"
   457  	Tasks_CancelTasks_FullMethodName      = "/swarming.v2.Tasks/CancelTasks"
   458  	Tasks_CountTasks_FullMethodName       = "/swarming.v2.Tasks/CountTasks"
   459  )
   460  
   461  // TasksClient is the client API for Tasks service.
   462  //
   463  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
   464  type TasksClient interface {
   465  	// GetResult reports the result of the task corresponding to a task ID.
   466  	// It can be a 'run' ID specifying a specific retry or a 'summary' ID hidding
   467  	// the fact that a task may have been retried transparently, when a bot reports
   468  	// BOT_DIED.
   469  	// A summary ID ends with '0', a run ID ends with '1' or '2'.
   470  	//
   471  	// TODO(vadimsh): Require the summary ID ending with '0'.
   472  	GetResult(ctx context.Context, in *TaskIdWithPerfRequest, opts ...grpc.CallOption) (*TaskResultResponse, error)
   473  	// BatchGetResult returns results of many tasks at once.
   474  	BatchGetResult(ctx context.Context, in *BatchGetResultRequest, opts ...grpc.CallOption) (*BatchGetResultResponse, error)
   475  	// GetRequest returns the task request corresponding to a task ID.
   476  	GetRequest(ctx context.Context, in *TaskIdRequest, opts ...grpc.CallOption) (*TaskRequestResponse, error)
   477  	// CancelTask cancels a task. If a bot was running the task, the bot will forcibly cancel the task.
   478  	CancelTask(ctx context.Context, in *TaskCancelRequest, opts ...grpc.CallOption) (*CancelResponse, error)
   479  	// GetStdout returns the output of the task corresponding to a task ID.
   480  	GetStdout(ctx context.Context, in *TaskIdWithOffsetRequest, opts ...grpc.CallOption) (*TaskOutputResponse, error)
   481  	// NewTask creates a new task.
   482  	// The task will be enqueued in the tasks list and will be executed at the
   483  	// earliest opportunity by a bot that has at least the dimensions as described
   484  	// in the task request.
   485  	NewTask(ctx context.Context, in *NewTaskRequest, opts ...grpc.CallOption) (*TaskRequestMetadataResponse, error)
   486  	// ListTasks returns full task results based on the filters.
   487  	// This endpoint is significantly slower than 'count'. Use 'count' when
   488  	// possible. If you just want the state of tasks, use 'get_states'.
   489  	ListTasks(ctx context.Context, in *TasksWithPerfRequest, opts ...grpc.CallOption) (*TaskListResponse, error)
   490  	// ListTaskStates returns task state for a specific set of tasks."""
   491  	ListTaskStates(ctx context.Context, in *TaskStatesRequest, opts ...grpc.CallOption) (*TaskStates, error)
   492  	// GetTaskRequests returns the task request corresponding to a task ID.
   493  	ListTaskRequests(ctx context.Context, in *TasksRequest, opts ...grpc.CallOption) (*TaskRequestsResponse, error)
   494  	// CancelTasks cancels a subset of pending tasks based on the tags.
   495  	// Cancellation happens asynchronously, so when this call returns,
   496  	// cancellations will not have completed yet.
   497  	CancelTasks(ctx context.Context, in *TasksCancelRequest, opts ...grpc.CallOption) (*TasksCancelResponse, error)
   498  	// CountTasks returns the number of tasks in a given state."""
   499  	CountTasks(ctx context.Context, in *TasksCountRequest, opts ...grpc.CallOption) (*TasksCount, error)
   500  }
   501  
   502  type tasksClient struct {
   503  	cc grpc.ClientConnInterface
   504  }
   505  
   506  func NewTasksClient(cc grpc.ClientConnInterface) TasksClient {
   507  	return &tasksClient{cc}
   508  }
   509  
   510  func (c *tasksClient) GetResult(ctx context.Context, in *TaskIdWithPerfRequest, opts ...grpc.CallOption) (*TaskResultResponse, error) {
   511  	out := new(TaskResultResponse)
   512  	err := c.cc.Invoke(ctx, Tasks_GetResult_FullMethodName, in, out, opts...)
   513  	if err != nil {
   514  		return nil, err
   515  	}
   516  	return out, nil
   517  }
   518  
   519  func (c *tasksClient) BatchGetResult(ctx context.Context, in *BatchGetResultRequest, opts ...grpc.CallOption) (*BatchGetResultResponse, error) {
   520  	out := new(BatchGetResultResponse)
   521  	err := c.cc.Invoke(ctx, Tasks_BatchGetResult_FullMethodName, in, out, opts...)
   522  	if err != nil {
   523  		return nil, err
   524  	}
   525  	return out, nil
   526  }
   527  
   528  func (c *tasksClient) GetRequest(ctx context.Context, in *TaskIdRequest, opts ...grpc.CallOption) (*TaskRequestResponse, error) {
   529  	out := new(TaskRequestResponse)
   530  	err := c.cc.Invoke(ctx, Tasks_GetRequest_FullMethodName, in, out, opts...)
   531  	if err != nil {
   532  		return nil, err
   533  	}
   534  	return out, nil
   535  }
   536  
   537  func (c *tasksClient) CancelTask(ctx context.Context, in *TaskCancelRequest, opts ...grpc.CallOption) (*CancelResponse, error) {
   538  	out := new(CancelResponse)
   539  	err := c.cc.Invoke(ctx, Tasks_CancelTask_FullMethodName, in, out, opts...)
   540  	if err != nil {
   541  		return nil, err
   542  	}
   543  	return out, nil
   544  }
   545  
   546  func (c *tasksClient) GetStdout(ctx context.Context, in *TaskIdWithOffsetRequest, opts ...grpc.CallOption) (*TaskOutputResponse, error) {
   547  	out := new(TaskOutputResponse)
   548  	err := c.cc.Invoke(ctx, Tasks_GetStdout_FullMethodName, in, out, opts...)
   549  	if err != nil {
   550  		return nil, err
   551  	}
   552  	return out, nil
   553  }
   554  
   555  func (c *tasksClient) NewTask(ctx context.Context, in *NewTaskRequest, opts ...grpc.CallOption) (*TaskRequestMetadataResponse, error) {
   556  	out := new(TaskRequestMetadataResponse)
   557  	err := c.cc.Invoke(ctx, Tasks_NewTask_FullMethodName, in, out, opts...)
   558  	if err != nil {
   559  		return nil, err
   560  	}
   561  	return out, nil
   562  }
   563  
   564  func (c *tasksClient) ListTasks(ctx context.Context, in *TasksWithPerfRequest, opts ...grpc.CallOption) (*TaskListResponse, error) {
   565  	out := new(TaskListResponse)
   566  	err := c.cc.Invoke(ctx, Tasks_ListTasks_FullMethodName, in, out, opts...)
   567  	if err != nil {
   568  		return nil, err
   569  	}
   570  	return out, nil
   571  }
   572  
   573  func (c *tasksClient) ListTaskStates(ctx context.Context, in *TaskStatesRequest, opts ...grpc.CallOption) (*TaskStates, error) {
   574  	out := new(TaskStates)
   575  	err := c.cc.Invoke(ctx, Tasks_ListTaskStates_FullMethodName, in, out, opts...)
   576  	if err != nil {
   577  		return nil, err
   578  	}
   579  	return out, nil
   580  }
   581  
   582  func (c *tasksClient) ListTaskRequests(ctx context.Context, in *TasksRequest, opts ...grpc.CallOption) (*TaskRequestsResponse, error) {
   583  	out := new(TaskRequestsResponse)
   584  	err := c.cc.Invoke(ctx, Tasks_ListTaskRequests_FullMethodName, in, out, opts...)
   585  	if err != nil {
   586  		return nil, err
   587  	}
   588  	return out, nil
   589  }
   590  
   591  func (c *tasksClient) CancelTasks(ctx context.Context, in *TasksCancelRequest, opts ...grpc.CallOption) (*TasksCancelResponse, error) {
   592  	out := new(TasksCancelResponse)
   593  	err := c.cc.Invoke(ctx, Tasks_CancelTasks_FullMethodName, in, out, opts...)
   594  	if err != nil {
   595  		return nil, err
   596  	}
   597  	return out, nil
   598  }
   599  
   600  func (c *tasksClient) CountTasks(ctx context.Context, in *TasksCountRequest, opts ...grpc.CallOption) (*TasksCount, error) {
   601  	out := new(TasksCount)
   602  	err := c.cc.Invoke(ctx, Tasks_CountTasks_FullMethodName, in, out, opts...)
   603  	if err != nil {
   604  		return nil, err
   605  	}
   606  	return out, nil
   607  }
   608  
   609  // TasksServer is the server API for Tasks service.
   610  // All implementations must embed UnimplementedTasksServer
   611  // for forward compatibility
   612  type TasksServer interface {
   613  	// GetResult reports the result of the task corresponding to a task ID.
   614  	// It can be a 'run' ID specifying a specific retry or a 'summary' ID hidding
   615  	// the fact that a task may have been retried transparently, when a bot reports
   616  	// BOT_DIED.
   617  	// A summary ID ends with '0', a run ID ends with '1' or '2'.
   618  	//
   619  	// TODO(vadimsh): Require the summary ID ending with '0'.
   620  	GetResult(context.Context, *TaskIdWithPerfRequest) (*TaskResultResponse, error)
   621  	// BatchGetResult returns results of many tasks at once.
   622  	BatchGetResult(context.Context, *BatchGetResultRequest) (*BatchGetResultResponse, error)
   623  	// GetRequest returns the task request corresponding to a task ID.
   624  	GetRequest(context.Context, *TaskIdRequest) (*TaskRequestResponse, error)
   625  	// CancelTask cancels a task. If a bot was running the task, the bot will forcibly cancel the task.
   626  	CancelTask(context.Context, *TaskCancelRequest) (*CancelResponse, error)
   627  	// GetStdout returns the output of the task corresponding to a task ID.
   628  	GetStdout(context.Context, *TaskIdWithOffsetRequest) (*TaskOutputResponse, error)
   629  	// NewTask creates a new task.
   630  	// The task will be enqueued in the tasks list and will be executed at the
   631  	// earliest opportunity by a bot that has at least the dimensions as described
   632  	// in the task request.
   633  	NewTask(context.Context, *NewTaskRequest) (*TaskRequestMetadataResponse, error)
   634  	// ListTasks returns full task results based on the filters.
   635  	// This endpoint is significantly slower than 'count'. Use 'count' when
   636  	// possible. If you just want the state of tasks, use 'get_states'.
   637  	ListTasks(context.Context, *TasksWithPerfRequest) (*TaskListResponse, error)
   638  	// ListTaskStates returns task state for a specific set of tasks."""
   639  	ListTaskStates(context.Context, *TaskStatesRequest) (*TaskStates, error)
   640  	// GetTaskRequests returns the task request corresponding to a task ID.
   641  	ListTaskRequests(context.Context, *TasksRequest) (*TaskRequestsResponse, error)
   642  	// CancelTasks cancels a subset of pending tasks based on the tags.
   643  	// Cancellation happens asynchronously, so when this call returns,
   644  	// cancellations will not have completed yet.
   645  	CancelTasks(context.Context, *TasksCancelRequest) (*TasksCancelResponse, error)
   646  	// CountTasks returns the number of tasks in a given state."""
   647  	CountTasks(context.Context, *TasksCountRequest) (*TasksCount, error)
   648  	mustEmbedUnimplementedTasksServer()
   649  }
   650  
   651  // UnimplementedTasksServer must be embedded to have forward compatible implementations.
   652  type UnimplementedTasksServer struct {
   653  }
   654  
   655  func (UnimplementedTasksServer) GetResult(context.Context, *TaskIdWithPerfRequest) (*TaskResultResponse, error) {
   656  	return nil, status.Errorf(codes.Unimplemented, "method GetResult not implemented")
   657  }
   658  func (UnimplementedTasksServer) BatchGetResult(context.Context, *BatchGetResultRequest) (*BatchGetResultResponse, error) {
   659  	return nil, status.Errorf(codes.Unimplemented, "method BatchGetResult not implemented")
   660  }
   661  func (UnimplementedTasksServer) GetRequest(context.Context, *TaskIdRequest) (*TaskRequestResponse, error) {
   662  	return nil, status.Errorf(codes.Unimplemented, "method GetRequest not implemented")
   663  }
   664  func (UnimplementedTasksServer) CancelTask(context.Context, *TaskCancelRequest) (*CancelResponse, error) {
   665  	return nil, status.Errorf(codes.Unimplemented, "method CancelTask not implemented")
   666  }
   667  func (UnimplementedTasksServer) GetStdout(context.Context, *TaskIdWithOffsetRequest) (*TaskOutputResponse, error) {
   668  	return nil, status.Errorf(codes.Unimplemented, "method GetStdout not implemented")
   669  }
   670  func (UnimplementedTasksServer) NewTask(context.Context, *NewTaskRequest) (*TaskRequestMetadataResponse, error) {
   671  	return nil, status.Errorf(codes.Unimplemented, "method NewTask not implemented")
   672  }
   673  func (UnimplementedTasksServer) ListTasks(context.Context, *TasksWithPerfRequest) (*TaskListResponse, error) {
   674  	return nil, status.Errorf(codes.Unimplemented, "method ListTasks not implemented")
   675  }
   676  func (UnimplementedTasksServer) ListTaskStates(context.Context, *TaskStatesRequest) (*TaskStates, error) {
   677  	return nil, status.Errorf(codes.Unimplemented, "method ListTaskStates not implemented")
   678  }
   679  func (UnimplementedTasksServer) ListTaskRequests(context.Context, *TasksRequest) (*TaskRequestsResponse, error) {
   680  	return nil, status.Errorf(codes.Unimplemented, "method ListTaskRequests not implemented")
   681  }
   682  func (UnimplementedTasksServer) CancelTasks(context.Context, *TasksCancelRequest) (*TasksCancelResponse, error) {
   683  	return nil, status.Errorf(codes.Unimplemented, "method CancelTasks not implemented")
   684  }
   685  func (UnimplementedTasksServer) CountTasks(context.Context, *TasksCountRequest) (*TasksCount, error) {
   686  	return nil, status.Errorf(codes.Unimplemented, "method CountTasks not implemented")
   687  }
   688  func (UnimplementedTasksServer) mustEmbedUnimplementedTasksServer() {}
   689  
   690  // UnsafeTasksServer may be embedded to opt out of forward compatibility for this service.
   691  // Use of this interface is not recommended, as added methods to TasksServer will
   692  // result in compilation errors.
   693  type UnsafeTasksServer interface {
   694  	mustEmbedUnimplementedTasksServer()
   695  }
   696  
   697  func RegisterTasksServer(s grpc.ServiceRegistrar, srv TasksServer) {
   698  	s.RegisterService(&Tasks_ServiceDesc, srv)
   699  }
   700  
   701  func _Tasks_GetResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   702  	in := new(TaskIdWithPerfRequest)
   703  	if err := dec(in); err != nil {
   704  		return nil, err
   705  	}
   706  	if interceptor == nil {
   707  		return srv.(TasksServer).GetResult(ctx, in)
   708  	}
   709  	info := &grpc.UnaryServerInfo{
   710  		Server:     srv,
   711  		FullMethod: Tasks_GetResult_FullMethodName,
   712  	}
   713  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   714  		return srv.(TasksServer).GetResult(ctx, req.(*TaskIdWithPerfRequest))
   715  	}
   716  	return interceptor(ctx, in, info, handler)
   717  }
   718  
   719  func _Tasks_BatchGetResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   720  	in := new(BatchGetResultRequest)
   721  	if err := dec(in); err != nil {
   722  		return nil, err
   723  	}
   724  	if interceptor == nil {
   725  		return srv.(TasksServer).BatchGetResult(ctx, in)
   726  	}
   727  	info := &grpc.UnaryServerInfo{
   728  		Server:     srv,
   729  		FullMethod: Tasks_BatchGetResult_FullMethodName,
   730  	}
   731  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   732  		return srv.(TasksServer).BatchGetResult(ctx, req.(*BatchGetResultRequest))
   733  	}
   734  	return interceptor(ctx, in, info, handler)
   735  }
   736  
   737  func _Tasks_GetRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   738  	in := new(TaskIdRequest)
   739  	if err := dec(in); err != nil {
   740  		return nil, err
   741  	}
   742  	if interceptor == nil {
   743  		return srv.(TasksServer).GetRequest(ctx, in)
   744  	}
   745  	info := &grpc.UnaryServerInfo{
   746  		Server:     srv,
   747  		FullMethod: Tasks_GetRequest_FullMethodName,
   748  	}
   749  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   750  		return srv.(TasksServer).GetRequest(ctx, req.(*TaskIdRequest))
   751  	}
   752  	return interceptor(ctx, in, info, handler)
   753  }
   754  
   755  func _Tasks_CancelTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   756  	in := new(TaskCancelRequest)
   757  	if err := dec(in); err != nil {
   758  		return nil, err
   759  	}
   760  	if interceptor == nil {
   761  		return srv.(TasksServer).CancelTask(ctx, in)
   762  	}
   763  	info := &grpc.UnaryServerInfo{
   764  		Server:     srv,
   765  		FullMethod: Tasks_CancelTask_FullMethodName,
   766  	}
   767  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   768  		return srv.(TasksServer).CancelTask(ctx, req.(*TaskCancelRequest))
   769  	}
   770  	return interceptor(ctx, in, info, handler)
   771  }
   772  
   773  func _Tasks_GetStdout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   774  	in := new(TaskIdWithOffsetRequest)
   775  	if err := dec(in); err != nil {
   776  		return nil, err
   777  	}
   778  	if interceptor == nil {
   779  		return srv.(TasksServer).GetStdout(ctx, in)
   780  	}
   781  	info := &grpc.UnaryServerInfo{
   782  		Server:     srv,
   783  		FullMethod: Tasks_GetStdout_FullMethodName,
   784  	}
   785  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   786  		return srv.(TasksServer).GetStdout(ctx, req.(*TaskIdWithOffsetRequest))
   787  	}
   788  	return interceptor(ctx, in, info, handler)
   789  }
   790  
   791  func _Tasks_NewTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   792  	in := new(NewTaskRequest)
   793  	if err := dec(in); err != nil {
   794  		return nil, err
   795  	}
   796  	if interceptor == nil {
   797  		return srv.(TasksServer).NewTask(ctx, in)
   798  	}
   799  	info := &grpc.UnaryServerInfo{
   800  		Server:     srv,
   801  		FullMethod: Tasks_NewTask_FullMethodName,
   802  	}
   803  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   804  		return srv.(TasksServer).NewTask(ctx, req.(*NewTaskRequest))
   805  	}
   806  	return interceptor(ctx, in, info, handler)
   807  }
   808  
   809  func _Tasks_ListTasks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   810  	in := new(TasksWithPerfRequest)
   811  	if err := dec(in); err != nil {
   812  		return nil, err
   813  	}
   814  	if interceptor == nil {
   815  		return srv.(TasksServer).ListTasks(ctx, in)
   816  	}
   817  	info := &grpc.UnaryServerInfo{
   818  		Server:     srv,
   819  		FullMethod: Tasks_ListTasks_FullMethodName,
   820  	}
   821  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   822  		return srv.(TasksServer).ListTasks(ctx, req.(*TasksWithPerfRequest))
   823  	}
   824  	return interceptor(ctx, in, info, handler)
   825  }
   826  
   827  func _Tasks_ListTaskStates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   828  	in := new(TaskStatesRequest)
   829  	if err := dec(in); err != nil {
   830  		return nil, err
   831  	}
   832  	if interceptor == nil {
   833  		return srv.(TasksServer).ListTaskStates(ctx, in)
   834  	}
   835  	info := &grpc.UnaryServerInfo{
   836  		Server:     srv,
   837  		FullMethod: Tasks_ListTaskStates_FullMethodName,
   838  	}
   839  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   840  		return srv.(TasksServer).ListTaskStates(ctx, req.(*TaskStatesRequest))
   841  	}
   842  	return interceptor(ctx, in, info, handler)
   843  }
   844  
   845  func _Tasks_ListTaskRequests_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   846  	in := new(TasksRequest)
   847  	if err := dec(in); err != nil {
   848  		return nil, err
   849  	}
   850  	if interceptor == nil {
   851  		return srv.(TasksServer).ListTaskRequests(ctx, in)
   852  	}
   853  	info := &grpc.UnaryServerInfo{
   854  		Server:     srv,
   855  		FullMethod: Tasks_ListTaskRequests_FullMethodName,
   856  	}
   857  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   858  		return srv.(TasksServer).ListTaskRequests(ctx, req.(*TasksRequest))
   859  	}
   860  	return interceptor(ctx, in, info, handler)
   861  }
   862  
   863  func _Tasks_CancelTasks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   864  	in := new(TasksCancelRequest)
   865  	if err := dec(in); err != nil {
   866  		return nil, err
   867  	}
   868  	if interceptor == nil {
   869  		return srv.(TasksServer).CancelTasks(ctx, in)
   870  	}
   871  	info := &grpc.UnaryServerInfo{
   872  		Server:     srv,
   873  		FullMethod: Tasks_CancelTasks_FullMethodName,
   874  	}
   875  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   876  		return srv.(TasksServer).CancelTasks(ctx, req.(*TasksCancelRequest))
   877  	}
   878  	return interceptor(ctx, in, info, handler)
   879  }
   880  
   881  func _Tasks_CountTasks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   882  	in := new(TasksCountRequest)
   883  	if err := dec(in); err != nil {
   884  		return nil, err
   885  	}
   886  	if interceptor == nil {
   887  		return srv.(TasksServer).CountTasks(ctx, in)
   888  	}
   889  	info := &grpc.UnaryServerInfo{
   890  		Server:     srv,
   891  		FullMethod: Tasks_CountTasks_FullMethodName,
   892  	}
   893  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   894  		return srv.(TasksServer).CountTasks(ctx, req.(*TasksCountRequest))
   895  	}
   896  	return interceptor(ctx, in, info, handler)
   897  }
   898  
   899  // Tasks_ServiceDesc is the grpc.ServiceDesc for Tasks service.
   900  // It's only intended for direct use with grpc.RegisterService,
   901  // and not to be introspected or modified (even as a copy)
   902  var Tasks_ServiceDesc = grpc.ServiceDesc{
   903  	ServiceName: "swarming.v2.Tasks",
   904  	HandlerType: (*TasksServer)(nil),
   905  	Methods: []grpc.MethodDesc{
   906  		{
   907  			MethodName: "GetResult",
   908  			Handler:    _Tasks_GetResult_Handler,
   909  		},
   910  		{
   911  			MethodName: "BatchGetResult",
   912  			Handler:    _Tasks_BatchGetResult_Handler,
   913  		},
   914  		{
   915  			MethodName: "GetRequest",
   916  			Handler:    _Tasks_GetRequest_Handler,
   917  		},
   918  		{
   919  			MethodName: "CancelTask",
   920  			Handler:    _Tasks_CancelTask_Handler,
   921  		},
   922  		{
   923  			MethodName: "GetStdout",
   924  			Handler:    _Tasks_GetStdout_Handler,
   925  		},
   926  		{
   927  			MethodName: "NewTask",
   928  			Handler:    _Tasks_NewTask_Handler,
   929  		},
   930  		{
   931  			MethodName: "ListTasks",
   932  			Handler:    _Tasks_ListTasks_Handler,
   933  		},
   934  		{
   935  			MethodName: "ListTaskStates",
   936  			Handler:    _Tasks_ListTaskStates_Handler,
   937  		},
   938  		{
   939  			MethodName: "ListTaskRequests",
   940  			Handler:    _Tasks_ListTaskRequests_Handler,
   941  		},
   942  		{
   943  			MethodName: "CancelTasks",
   944  			Handler:    _Tasks_CancelTasks_Handler,
   945  		},
   946  		{
   947  			MethodName: "CountTasks",
   948  			Handler:    _Tasks_CountTasks_Handler,
   949  		},
   950  	},
   951  	Streams:  []grpc.StreamDesc{},
   952  	Metadata: "go.chromium.org/luci/swarming/proto/api_v2/swarming.proto",
   953  }
   954  
   955  const (
   956  	Swarming_GetDetails_FullMethodName     = "/swarming.v2.Swarming/GetDetails"
   957  	Swarming_GetToken_FullMethodName       = "/swarming.v2.Swarming/GetToken"
   958  	Swarming_GetPermissions_FullMethodName = "/swarming.v2.Swarming/GetPermissions"
   959  )
   960  
   961  // SwarmingClient is the client API for Swarming service.
   962  //
   963  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
   964  type SwarmingClient interface {
   965  	// GetDetails returns public information about the Swarming instance.
   966  	GetDetails(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ServerDetails, error)
   967  	// GetToken returns a token to bootstrap a new bot.
   968  	GetToken(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*BootstrapToken, error)
   969  	// GetPermissions returns the caller's permissions.
   970  	GetPermissions(ctx context.Context, in *PermissionsRequest, opts ...grpc.CallOption) (*ClientPermissions, error)
   971  }
   972  
   973  type swarmingClient struct {
   974  	cc grpc.ClientConnInterface
   975  }
   976  
   977  func NewSwarmingClient(cc grpc.ClientConnInterface) SwarmingClient {
   978  	return &swarmingClient{cc}
   979  }
   980  
   981  func (c *swarmingClient) GetDetails(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ServerDetails, error) {
   982  	out := new(ServerDetails)
   983  	err := c.cc.Invoke(ctx, Swarming_GetDetails_FullMethodName, in, out, opts...)
   984  	if err != nil {
   985  		return nil, err
   986  	}
   987  	return out, nil
   988  }
   989  
   990  func (c *swarmingClient) GetToken(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*BootstrapToken, error) {
   991  	out := new(BootstrapToken)
   992  	err := c.cc.Invoke(ctx, Swarming_GetToken_FullMethodName, in, out, opts...)
   993  	if err != nil {
   994  		return nil, err
   995  	}
   996  	return out, nil
   997  }
   998  
   999  func (c *swarmingClient) GetPermissions(ctx context.Context, in *PermissionsRequest, opts ...grpc.CallOption) (*ClientPermissions, error) {
  1000  	out := new(ClientPermissions)
  1001  	err := c.cc.Invoke(ctx, Swarming_GetPermissions_FullMethodName, in, out, opts...)
  1002  	if err != nil {
  1003  		return nil, err
  1004  	}
  1005  	return out, nil
  1006  }
  1007  
  1008  // SwarmingServer is the server API for Swarming service.
  1009  // All implementations must embed UnimplementedSwarmingServer
  1010  // for forward compatibility
  1011  type SwarmingServer interface {
  1012  	// GetDetails returns public information about the Swarming instance.
  1013  	GetDetails(context.Context, *emptypb.Empty) (*ServerDetails, error)
  1014  	// GetToken returns a token to bootstrap a new bot.
  1015  	GetToken(context.Context, *emptypb.Empty) (*BootstrapToken, error)
  1016  	// GetPermissions returns the caller's permissions.
  1017  	GetPermissions(context.Context, *PermissionsRequest) (*ClientPermissions, error)
  1018  	mustEmbedUnimplementedSwarmingServer()
  1019  }
  1020  
  1021  // UnimplementedSwarmingServer must be embedded to have forward compatible implementations.
  1022  type UnimplementedSwarmingServer struct {
  1023  }
  1024  
  1025  func (UnimplementedSwarmingServer) GetDetails(context.Context, *emptypb.Empty) (*ServerDetails, error) {
  1026  	return nil, status.Errorf(codes.Unimplemented, "method GetDetails not implemented")
  1027  }
  1028  func (UnimplementedSwarmingServer) GetToken(context.Context, *emptypb.Empty) (*BootstrapToken, error) {
  1029  	return nil, status.Errorf(codes.Unimplemented, "method GetToken not implemented")
  1030  }
  1031  func (UnimplementedSwarmingServer) GetPermissions(context.Context, *PermissionsRequest) (*ClientPermissions, error) {
  1032  	return nil, status.Errorf(codes.Unimplemented, "method GetPermissions not implemented")
  1033  }
  1034  func (UnimplementedSwarmingServer) mustEmbedUnimplementedSwarmingServer() {}
  1035  
  1036  // UnsafeSwarmingServer may be embedded to opt out of forward compatibility for this service.
  1037  // Use of this interface is not recommended, as added methods to SwarmingServer will
  1038  // result in compilation errors.
  1039  type UnsafeSwarmingServer interface {
  1040  	mustEmbedUnimplementedSwarmingServer()
  1041  }
  1042  
  1043  func RegisterSwarmingServer(s grpc.ServiceRegistrar, srv SwarmingServer) {
  1044  	s.RegisterService(&Swarming_ServiceDesc, srv)
  1045  }
  1046  
  1047  func _Swarming_GetDetails_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  1048  	in := new(emptypb.Empty)
  1049  	if err := dec(in); err != nil {
  1050  		return nil, err
  1051  	}
  1052  	if interceptor == nil {
  1053  		return srv.(SwarmingServer).GetDetails(ctx, in)
  1054  	}
  1055  	info := &grpc.UnaryServerInfo{
  1056  		Server:     srv,
  1057  		FullMethod: Swarming_GetDetails_FullMethodName,
  1058  	}
  1059  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  1060  		return srv.(SwarmingServer).GetDetails(ctx, req.(*emptypb.Empty))
  1061  	}
  1062  	return interceptor(ctx, in, info, handler)
  1063  }
  1064  
  1065  func _Swarming_GetToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  1066  	in := new(emptypb.Empty)
  1067  	if err := dec(in); err != nil {
  1068  		return nil, err
  1069  	}
  1070  	if interceptor == nil {
  1071  		return srv.(SwarmingServer).GetToken(ctx, in)
  1072  	}
  1073  	info := &grpc.UnaryServerInfo{
  1074  		Server:     srv,
  1075  		FullMethod: Swarming_GetToken_FullMethodName,
  1076  	}
  1077  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  1078  		return srv.(SwarmingServer).GetToken(ctx, req.(*emptypb.Empty))
  1079  	}
  1080  	return interceptor(ctx, in, info, handler)
  1081  }
  1082  
  1083  func _Swarming_GetPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  1084  	in := new(PermissionsRequest)
  1085  	if err := dec(in); err != nil {
  1086  		return nil, err
  1087  	}
  1088  	if interceptor == nil {
  1089  		return srv.(SwarmingServer).GetPermissions(ctx, in)
  1090  	}
  1091  	info := &grpc.UnaryServerInfo{
  1092  		Server:     srv,
  1093  		FullMethod: Swarming_GetPermissions_FullMethodName,
  1094  	}
  1095  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  1096  		return srv.(SwarmingServer).GetPermissions(ctx, req.(*PermissionsRequest))
  1097  	}
  1098  	return interceptor(ctx, in, info, handler)
  1099  }
  1100  
  1101  // Swarming_ServiceDesc is the grpc.ServiceDesc for Swarming service.
  1102  // It's only intended for direct use with grpc.RegisterService,
  1103  // and not to be introspected or modified (even as a copy)
  1104  var Swarming_ServiceDesc = grpc.ServiceDesc{
  1105  	ServiceName: "swarming.v2.Swarming",
  1106  	HandlerType: (*SwarmingServer)(nil),
  1107  	Methods: []grpc.MethodDesc{
  1108  		{
  1109  			MethodName: "GetDetails",
  1110  			Handler:    _Swarming_GetDetails_Handler,
  1111  		},
  1112  		{
  1113  			MethodName: "GetToken",
  1114  			Handler:    _Swarming_GetToken_Handler,
  1115  		},
  1116  		{
  1117  			MethodName: "GetPermissions",
  1118  			Handler:    _Swarming_GetPermissions_Handler,
  1119  		},
  1120  	},
  1121  	Streams:  []grpc.StreamDesc{},
  1122  	Metadata: "go.chromium.org/luci/swarming/proto/api_v2/swarming.proto",
  1123  }