Path: blob/main/components/supervisor-api/go/notification_grpc.pb.go
2498 views
// Copyright (c) 2023 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34// Code generated by protoc-gen-go-grpc. DO NOT EDIT.5// versions:6// - protoc-gen-go-grpc v1.2.07// - protoc v3.20.18// source: notification.proto910package api1112import (13context "context"14grpc "google.golang.org/grpc"15codes "google.golang.org/grpc/codes"16status "google.golang.org/grpc/status"17)1819// This is a compile-time assertion to ensure that this generated file20// is compatible with the grpc package it is being compiled against.21// Requires gRPC-Go v1.32.0 or later.22const _ = grpc.SupportPackageIsVersion72324// NotificationServiceClient is the client API for NotificationService service.25//26// 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.27type NotificationServiceClient interface {28// Prompts the user and asks for a decision. Typically called by some external29// process. If the list of actions is empty this service returns immediately,30// otherwise it blocks until the user has made their choice.31Notify(ctx context.Context, in *NotifyRequest, opts ...grpc.CallOption) (*NotifyResponse, error)32// Subscribe to notifications. Typically called by the IDE.33Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (NotificationService_SubscribeClient, error)34// Report a user's choice as a response to a notification. Typically called by35// the IDE.36Respond(ctx context.Context, in *RespondRequest, opts ...grpc.CallOption) (*RespondResponse, error)37// Called by the IDE to inform supervisor about which is the latest client38// actively used by the user. We consider active the last IDE with focus.39// Only 1 stream is kept open at any given time. A new subscription40// overrides the previous one, causing the stream to close.41// Supervisor will respond with a stream to which the IDE will listen42// waiting to receive actions to run, for example: `open` or `preview`43SubscribeActive(ctx context.Context, in *SubscribeActiveRequest, opts ...grpc.CallOption) (NotificationService_SubscribeActiveClient, error)44// Used by gp-cli to ask supervisor to request the active client45// to run a given command (eg. open or preview)46NotifyActive(ctx context.Context, in *NotifyActiveRequest, opts ...grpc.CallOption) (*NotifyActiveResponse, error)47// Used by the IDE to inform supervisor about the result (eg. success or48// failure) of the action (eg. open or preview) requested via NotifyActive49NotifyActiveRespond(ctx context.Context, in *NotifyActiveRespondRequest, opts ...grpc.CallOption) (*NotifyActiveRespondResponse, error)50}5152type notificationServiceClient struct {53cc grpc.ClientConnInterface54}5556func NewNotificationServiceClient(cc grpc.ClientConnInterface) NotificationServiceClient {57return ¬ificationServiceClient{cc}58}5960func (c *notificationServiceClient) Notify(ctx context.Context, in *NotifyRequest, opts ...grpc.CallOption) (*NotifyResponse, error) {61out := new(NotifyResponse)62err := c.cc.Invoke(ctx, "/supervisor.NotificationService/Notify", in, out, opts...)63if err != nil {64return nil, err65}66return out, nil67}6869func (c *notificationServiceClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (NotificationService_SubscribeClient, error) {70stream, err := c.cc.NewStream(ctx, &NotificationService_ServiceDesc.Streams[0], "/supervisor.NotificationService/Subscribe", opts...)71if err != nil {72return nil, err73}74x := ¬ificationServiceSubscribeClient{stream}75if err := x.ClientStream.SendMsg(in); err != nil {76return nil, err77}78if err := x.ClientStream.CloseSend(); err != nil {79return nil, err80}81return x, nil82}8384type NotificationService_SubscribeClient interface {85Recv() (*SubscribeResponse, error)86grpc.ClientStream87}8889type notificationServiceSubscribeClient struct {90grpc.ClientStream91}9293func (x *notificationServiceSubscribeClient) Recv() (*SubscribeResponse, error) {94m := new(SubscribeResponse)95if err := x.ClientStream.RecvMsg(m); err != nil {96return nil, err97}98return m, nil99}100101func (c *notificationServiceClient) Respond(ctx context.Context, in *RespondRequest, opts ...grpc.CallOption) (*RespondResponse, error) {102out := new(RespondResponse)103err := c.cc.Invoke(ctx, "/supervisor.NotificationService/Respond", in, out, opts...)104if err != nil {105return nil, err106}107return out, nil108}109110func (c *notificationServiceClient) SubscribeActive(ctx context.Context, in *SubscribeActiveRequest, opts ...grpc.CallOption) (NotificationService_SubscribeActiveClient, error) {111stream, err := c.cc.NewStream(ctx, &NotificationService_ServiceDesc.Streams[1], "/supervisor.NotificationService/SubscribeActive", opts...)112if err != nil {113return nil, err114}115x := ¬ificationServiceSubscribeActiveClient{stream}116if err := x.ClientStream.SendMsg(in); err != nil {117return nil, err118}119if err := x.ClientStream.CloseSend(); err != nil {120return nil, err121}122return x, nil123}124125type NotificationService_SubscribeActiveClient interface {126Recv() (*SubscribeActiveResponse, error)127grpc.ClientStream128}129130type notificationServiceSubscribeActiveClient struct {131grpc.ClientStream132}133134func (x *notificationServiceSubscribeActiveClient) Recv() (*SubscribeActiveResponse, error) {135m := new(SubscribeActiveResponse)136if err := x.ClientStream.RecvMsg(m); err != nil {137return nil, err138}139return m, nil140}141142func (c *notificationServiceClient) NotifyActive(ctx context.Context, in *NotifyActiveRequest, opts ...grpc.CallOption) (*NotifyActiveResponse, error) {143out := new(NotifyActiveResponse)144err := c.cc.Invoke(ctx, "/supervisor.NotificationService/NotifyActive", in, out, opts...)145if err != nil {146return nil, err147}148return out, nil149}150151func (c *notificationServiceClient) NotifyActiveRespond(ctx context.Context, in *NotifyActiveRespondRequest, opts ...grpc.CallOption) (*NotifyActiveRespondResponse, error) {152out := new(NotifyActiveRespondResponse)153err := c.cc.Invoke(ctx, "/supervisor.NotificationService/NotifyActiveRespond", in, out, opts...)154if err != nil {155return nil, err156}157return out, nil158}159160// NotificationServiceServer is the server API for NotificationService service.161// All implementations must embed UnimplementedNotificationServiceServer162// for forward compatibility163type NotificationServiceServer interface {164// Prompts the user and asks for a decision. Typically called by some external165// process. If the list of actions is empty this service returns immediately,166// otherwise it blocks until the user has made their choice.167Notify(context.Context, *NotifyRequest) (*NotifyResponse, error)168// Subscribe to notifications. Typically called by the IDE.169Subscribe(*SubscribeRequest, NotificationService_SubscribeServer) error170// Report a user's choice as a response to a notification. Typically called by171// the IDE.172Respond(context.Context, *RespondRequest) (*RespondResponse, error)173// Called by the IDE to inform supervisor about which is the latest client174// actively used by the user. We consider active the last IDE with focus.175// Only 1 stream is kept open at any given time. A new subscription176// overrides the previous one, causing the stream to close.177// Supervisor will respond with a stream to which the IDE will listen178// waiting to receive actions to run, for example: `open` or `preview`179SubscribeActive(*SubscribeActiveRequest, NotificationService_SubscribeActiveServer) error180// Used by gp-cli to ask supervisor to request the active client181// to run a given command (eg. open or preview)182NotifyActive(context.Context, *NotifyActiveRequest) (*NotifyActiveResponse, error)183// Used by the IDE to inform supervisor about the result (eg. success or184// failure) of the action (eg. open or preview) requested via NotifyActive185NotifyActiveRespond(context.Context, *NotifyActiveRespondRequest) (*NotifyActiveRespondResponse, error)186mustEmbedUnimplementedNotificationServiceServer()187}188189// UnimplementedNotificationServiceServer must be embedded to have forward compatible implementations.190type UnimplementedNotificationServiceServer struct {191}192193func (UnimplementedNotificationServiceServer) Notify(context.Context, *NotifyRequest) (*NotifyResponse, error) {194return nil, status.Errorf(codes.Unimplemented, "method Notify not implemented")195}196func (UnimplementedNotificationServiceServer) Subscribe(*SubscribeRequest, NotificationService_SubscribeServer) error {197return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")198}199func (UnimplementedNotificationServiceServer) Respond(context.Context, *RespondRequest) (*RespondResponse, error) {200return nil, status.Errorf(codes.Unimplemented, "method Respond not implemented")201}202func (UnimplementedNotificationServiceServer) SubscribeActive(*SubscribeActiveRequest, NotificationService_SubscribeActiveServer) error {203return status.Errorf(codes.Unimplemented, "method SubscribeActive not implemented")204}205func (UnimplementedNotificationServiceServer) NotifyActive(context.Context, *NotifyActiveRequest) (*NotifyActiveResponse, error) {206return nil, status.Errorf(codes.Unimplemented, "method NotifyActive not implemented")207}208func (UnimplementedNotificationServiceServer) NotifyActiveRespond(context.Context, *NotifyActiveRespondRequest) (*NotifyActiveRespondResponse, error) {209return nil, status.Errorf(codes.Unimplemented, "method NotifyActiveRespond not implemented")210}211func (UnimplementedNotificationServiceServer) mustEmbedUnimplementedNotificationServiceServer() {}212213// UnsafeNotificationServiceServer may be embedded to opt out of forward compatibility for this service.214// Use of this interface is not recommended, as added methods to NotificationServiceServer will215// result in compilation errors.216type UnsafeNotificationServiceServer interface {217mustEmbedUnimplementedNotificationServiceServer()218}219220func RegisterNotificationServiceServer(s grpc.ServiceRegistrar, srv NotificationServiceServer) {221s.RegisterService(&NotificationService_ServiceDesc, srv)222}223224func _NotificationService_Notify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {225in := new(NotifyRequest)226if err := dec(in); err != nil {227return nil, err228}229if interceptor == nil {230return srv.(NotificationServiceServer).Notify(ctx, in)231}232info := &grpc.UnaryServerInfo{233Server: srv,234FullMethod: "/supervisor.NotificationService/Notify",235}236handler := func(ctx context.Context, req interface{}) (interface{}, error) {237return srv.(NotificationServiceServer).Notify(ctx, req.(*NotifyRequest))238}239return interceptor(ctx, in, info, handler)240}241242func _NotificationService_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error {243m := new(SubscribeRequest)244if err := stream.RecvMsg(m); err != nil {245return err246}247return srv.(NotificationServiceServer).Subscribe(m, ¬ificationServiceSubscribeServer{stream})248}249250type NotificationService_SubscribeServer interface {251Send(*SubscribeResponse) error252grpc.ServerStream253}254255type notificationServiceSubscribeServer struct {256grpc.ServerStream257}258259func (x *notificationServiceSubscribeServer) Send(m *SubscribeResponse) error {260return x.ServerStream.SendMsg(m)261}262263func _NotificationService_Respond_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {264in := new(RespondRequest)265if err := dec(in); err != nil {266return nil, err267}268if interceptor == nil {269return srv.(NotificationServiceServer).Respond(ctx, in)270}271info := &grpc.UnaryServerInfo{272Server: srv,273FullMethod: "/supervisor.NotificationService/Respond",274}275handler := func(ctx context.Context, req interface{}) (interface{}, error) {276return srv.(NotificationServiceServer).Respond(ctx, req.(*RespondRequest))277}278return interceptor(ctx, in, info, handler)279}280281func _NotificationService_SubscribeActive_Handler(srv interface{}, stream grpc.ServerStream) error {282m := new(SubscribeActiveRequest)283if err := stream.RecvMsg(m); err != nil {284return err285}286return srv.(NotificationServiceServer).SubscribeActive(m, ¬ificationServiceSubscribeActiveServer{stream})287}288289type NotificationService_SubscribeActiveServer interface {290Send(*SubscribeActiveResponse) error291grpc.ServerStream292}293294type notificationServiceSubscribeActiveServer struct {295grpc.ServerStream296}297298func (x *notificationServiceSubscribeActiveServer) Send(m *SubscribeActiveResponse) error {299return x.ServerStream.SendMsg(m)300}301302func _NotificationService_NotifyActive_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {303in := new(NotifyActiveRequest)304if err := dec(in); err != nil {305return nil, err306}307if interceptor == nil {308return srv.(NotificationServiceServer).NotifyActive(ctx, in)309}310info := &grpc.UnaryServerInfo{311Server: srv,312FullMethod: "/supervisor.NotificationService/NotifyActive",313}314handler := func(ctx context.Context, req interface{}) (interface{}, error) {315return srv.(NotificationServiceServer).NotifyActive(ctx, req.(*NotifyActiveRequest))316}317return interceptor(ctx, in, info, handler)318}319320func _NotificationService_NotifyActiveRespond_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {321in := new(NotifyActiveRespondRequest)322if err := dec(in); err != nil {323return nil, err324}325if interceptor == nil {326return srv.(NotificationServiceServer).NotifyActiveRespond(ctx, in)327}328info := &grpc.UnaryServerInfo{329Server: srv,330FullMethod: "/supervisor.NotificationService/NotifyActiveRespond",331}332handler := func(ctx context.Context, req interface{}) (interface{}, error) {333return srv.(NotificationServiceServer).NotifyActiveRespond(ctx, req.(*NotifyActiveRespondRequest))334}335return interceptor(ctx, in, info, handler)336}337338// NotificationService_ServiceDesc is the grpc.ServiceDesc for NotificationService service.339// It's only intended for direct use with grpc.RegisterService,340// and not to be introspected or modified (even as a copy)341var NotificationService_ServiceDesc = grpc.ServiceDesc{342ServiceName: "supervisor.NotificationService",343HandlerType: (*NotificationServiceServer)(nil),344Methods: []grpc.MethodDesc{345{346MethodName: "Notify",347Handler: _NotificationService_Notify_Handler,348},349{350MethodName: "Respond",351Handler: _NotificationService_Respond_Handler,352},353{354MethodName: "NotifyActive",355Handler: _NotificationService_NotifyActive_Handler,356},357{358MethodName: "NotifyActiveRespond",359Handler: _NotificationService_NotifyActiveRespond_Handler,360},361},362Streams: []grpc.StreamDesc{363{364StreamName: "Subscribe",365Handler: _NotificationService_Subscribe_Handler,366ServerStreams: true,367},368{369StreamName: "SubscribeActive",370Handler: _NotificationService_SubscribeActive_Handler,371ServerStreams: true,372},373},374Metadata: "notification.proto",375}376377378