github.com/argoproj/argo-cd/v2@v2.10.9/pkg/apiclient/notification/notification.pb.gw.go (about)

     1  // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
     2  // source: server/notification/notification.proto
     3  
     4  /*
     5  Package notification is a reverse proxy.
     6  
     7  It translates gRPC into RESTful JSON APIs.
     8  */
     9  package notification
    10  
    11  import (
    12  	"context"
    13  	"io"
    14  	"net/http"
    15  
    16  	"github.com/golang/protobuf/descriptor"
    17  	"github.com/golang/protobuf/proto"
    18  	"github.com/grpc-ecosystem/grpc-gateway/runtime"
    19  	"github.com/grpc-ecosystem/grpc-gateway/utilities"
    20  	"google.golang.org/grpc"
    21  	"google.golang.org/grpc/codes"
    22  	"google.golang.org/grpc/grpclog"
    23  	"google.golang.org/grpc/metadata"
    24  	"google.golang.org/grpc/status"
    25  )
    26  
    27  // Suppress "imported and not used" errors
    28  var _ codes.Code
    29  var _ io.Reader
    30  var _ status.Status
    31  var _ = runtime.String
    32  var _ = utilities.NewDoubleArray
    33  var _ = descriptor.ForMessage
    34  var _ = metadata.Join
    35  
    36  func request_NotificationService_ListTriggers_0(ctx context.Context, marshaler runtime.Marshaler, client NotificationServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
    37  	var protoReq TriggersListRequest
    38  	var metadata runtime.ServerMetadata
    39  
    40  	msg, err := client.ListTriggers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
    41  	return msg, metadata, err
    42  
    43  }
    44  
    45  func local_request_NotificationService_ListTriggers_0(ctx context.Context, marshaler runtime.Marshaler, server NotificationServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
    46  	var protoReq TriggersListRequest
    47  	var metadata runtime.ServerMetadata
    48  
    49  	msg, err := server.ListTriggers(ctx, &protoReq)
    50  	return msg, metadata, err
    51  
    52  }
    53  
    54  func request_NotificationService_ListServices_0(ctx context.Context, marshaler runtime.Marshaler, client NotificationServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
    55  	var protoReq ServicesListRequest
    56  	var metadata runtime.ServerMetadata
    57  
    58  	msg, err := client.ListServices(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
    59  	return msg, metadata, err
    60  
    61  }
    62  
    63  func local_request_NotificationService_ListServices_0(ctx context.Context, marshaler runtime.Marshaler, server NotificationServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
    64  	var protoReq ServicesListRequest
    65  	var metadata runtime.ServerMetadata
    66  
    67  	msg, err := server.ListServices(ctx, &protoReq)
    68  	return msg, metadata, err
    69  
    70  }
    71  
    72  func request_NotificationService_ListTemplates_0(ctx context.Context, marshaler runtime.Marshaler, client NotificationServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
    73  	var protoReq TemplatesListRequest
    74  	var metadata runtime.ServerMetadata
    75  
    76  	msg, err := client.ListTemplates(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
    77  	return msg, metadata, err
    78  
    79  }
    80  
    81  func local_request_NotificationService_ListTemplates_0(ctx context.Context, marshaler runtime.Marshaler, server NotificationServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
    82  	var protoReq TemplatesListRequest
    83  	var metadata runtime.ServerMetadata
    84  
    85  	msg, err := server.ListTemplates(ctx, &protoReq)
    86  	return msg, metadata, err
    87  
    88  }
    89  
    90  // RegisterNotificationServiceHandlerServer registers the http handlers for service NotificationService to "mux".
    91  // UnaryRPC     :call NotificationServiceServer directly.
    92  // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
    93  // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterNotificationServiceHandlerFromEndpoint instead.
    94  func RegisterNotificationServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NotificationServiceServer) error {
    95  
    96  	mux.Handle("GET", pattern_NotificationService_ListTriggers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
    97  		ctx, cancel := context.WithCancel(req.Context())
    98  		defer cancel()
    99  		var stream runtime.ServerTransportStream
   100  		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
   101  		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
   102  		rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
   103  		if err != nil {
   104  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   105  			return
   106  		}
   107  		resp, md, err := local_request_NotificationService_ListTriggers_0(rctx, inboundMarshaler, server, req, pathParams)
   108  		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
   109  		ctx = runtime.NewServerMetadataContext(ctx, md)
   110  		if err != nil {
   111  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   112  			return
   113  		}
   114  
   115  		forward_NotificationService_ListTriggers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
   116  
   117  	})
   118  
   119  	mux.Handle("GET", pattern_NotificationService_ListServices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
   120  		ctx, cancel := context.WithCancel(req.Context())
   121  		defer cancel()
   122  		var stream runtime.ServerTransportStream
   123  		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
   124  		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
   125  		rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
   126  		if err != nil {
   127  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   128  			return
   129  		}
   130  		resp, md, err := local_request_NotificationService_ListServices_0(rctx, inboundMarshaler, server, req, pathParams)
   131  		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
   132  		ctx = runtime.NewServerMetadataContext(ctx, md)
   133  		if err != nil {
   134  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   135  			return
   136  		}
   137  
   138  		forward_NotificationService_ListServices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
   139  
   140  	})
   141  
   142  	mux.Handle("GET", pattern_NotificationService_ListTemplates_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
   143  		ctx, cancel := context.WithCancel(req.Context())
   144  		defer cancel()
   145  		var stream runtime.ServerTransportStream
   146  		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
   147  		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
   148  		rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
   149  		if err != nil {
   150  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   151  			return
   152  		}
   153  		resp, md, err := local_request_NotificationService_ListTemplates_0(rctx, inboundMarshaler, server, req, pathParams)
   154  		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
   155  		ctx = runtime.NewServerMetadataContext(ctx, md)
   156  		if err != nil {
   157  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   158  			return
   159  		}
   160  
   161  		forward_NotificationService_ListTemplates_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
   162  
   163  	})
   164  
   165  	return nil
   166  }
   167  
   168  // RegisterNotificationServiceHandlerFromEndpoint is same as RegisterNotificationServiceHandler but
   169  // automatically dials to "endpoint" and closes the connection when "ctx" gets done.
   170  func RegisterNotificationServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
   171  	conn, err := grpc.Dial(endpoint, opts...)
   172  	if err != nil {
   173  		return err
   174  	}
   175  	defer func() {
   176  		if err != nil {
   177  			if cerr := conn.Close(); cerr != nil {
   178  				grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
   179  			}
   180  			return
   181  		}
   182  		go func() {
   183  			<-ctx.Done()
   184  			if cerr := conn.Close(); cerr != nil {
   185  				grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
   186  			}
   187  		}()
   188  	}()
   189  
   190  	return RegisterNotificationServiceHandler(ctx, mux, conn)
   191  }
   192  
   193  // RegisterNotificationServiceHandler registers the http handlers for service NotificationService to "mux".
   194  // The handlers forward requests to the grpc endpoint over "conn".
   195  func RegisterNotificationServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
   196  	return RegisterNotificationServiceHandlerClient(ctx, mux, NewNotificationServiceClient(conn))
   197  }
   198  
   199  // RegisterNotificationServiceHandlerClient registers the http handlers for service NotificationService
   200  // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NotificationServiceClient".
   201  // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NotificationServiceClient"
   202  // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
   203  // "NotificationServiceClient" to call the correct interceptors.
   204  func RegisterNotificationServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NotificationServiceClient) error {
   205  
   206  	mux.Handle("GET", pattern_NotificationService_ListTriggers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
   207  		ctx, cancel := context.WithCancel(req.Context())
   208  		defer cancel()
   209  		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
   210  		rctx, err := runtime.AnnotateContext(ctx, mux, req)
   211  		if err != nil {
   212  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   213  			return
   214  		}
   215  		resp, md, err := request_NotificationService_ListTriggers_0(rctx, inboundMarshaler, client, req, pathParams)
   216  		ctx = runtime.NewServerMetadataContext(ctx, md)
   217  		if err != nil {
   218  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   219  			return
   220  		}
   221  
   222  		forward_NotificationService_ListTriggers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
   223  
   224  	})
   225  
   226  	mux.Handle("GET", pattern_NotificationService_ListServices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
   227  		ctx, cancel := context.WithCancel(req.Context())
   228  		defer cancel()
   229  		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
   230  		rctx, err := runtime.AnnotateContext(ctx, mux, req)
   231  		if err != nil {
   232  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   233  			return
   234  		}
   235  		resp, md, err := request_NotificationService_ListServices_0(rctx, inboundMarshaler, client, req, pathParams)
   236  		ctx = runtime.NewServerMetadataContext(ctx, md)
   237  		if err != nil {
   238  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   239  			return
   240  		}
   241  
   242  		forward_NotificationService_ListServices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
   243  
   244  	})
   245  
   246  	mux.Handle("GET", pattern_NotificationService_ListTemplates_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
   247  		ctx, cancel := context.WithCancel(req.Context())
   248  		defer cancel()
   249  		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
   250  		rctx, err := runtime.AnnotateContext(ctx, mux, req)
   251  		if err != nil {
   252  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   253  			return
   254  		}
   255  		resp, md, err := request_NotificationService_ListTemplates_0(rctx, inboundMarshaler, client, req, pathParams)
   256  		ctx = runtime.NewServerMetadataContext(ctx, md)
   257  		if err != nil {
   258  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   259  			return
   260  		}
   261  
   262  		forward_NotificationService_ListTemplates_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
   263  
   264  	})
   265  
   266  	return nil
   267  }
   268  
   269  var (
   270  	pattern_NotificationService_ListTriggers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "notifications", "triggers"}, "", runtime.AssumeColonVerbOpt(true)))
   271  
   272  	pattern_NotificationService_ListServices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "notifications", "services"}, "", runtime.AssumeColonVerbOpt(true)))
   273  
   274  	pattern_NotificationService_ListTemplates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "notifications", "templates"}, "", runtime.AssumeColonVerbOpt(true)))
   275  )
   276  
   277  var (
   278  	forward_NotificationService_ListTriggers_0 = runtime.ForwardResponseMessage
   279  
   280  	forward_NotificationService_ListServices_0 = runtime.ForwardResponseMessage
   281  
   282  	forward_NotificationService_ListTemplates_0 = runtime.ForwardResponseMessage
   283  )