1// SPDX-License-Identifier: MIT
2
3// Code generated by protoc-gen-connect-go. DO NOT EDIT.
4//
5// Source: ermite/merge_request.proto
6
7package ermiteconnect
8
9import (
10 ermite "bnema.dev/ermite-api/gen/ermite"
11 connect "connectrpc.com/connect"
12 context "context"
13 errors "errors"
14 http "net/http"
15 strings "strings"
16)
17
18// This is a compile-time assertion to ensure that this generated file and the connect package are
19// compatible. If you get a compiler error that this constant is not defined, this code was
20// generated with a version of connect newer than the one compiled into your binary. You can fix the
21// problem by either regenerating this code with an older version of connect or updating the connect
22// version compiled into your binary.
23const _ = connect.IsAtLeastVersion1_13_0
24
25const (
26 // MergeRequestServiceName is the fully-qualified name of the MergeRequestService service.
27 MergeRequestServiceName = "ermite.MergeRequestService"
28)
29
30// These constants are the fully-qualified names of the RPCs defined in this package. They're
31// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
32//
33// Note that these are different from the fully-qualified method names used by
34// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
35// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
36// period.
37const (
38 // MergeRequestServiceCreateMergeRequestProcedure is the fully-qualified name of the
39 // MergeRequestService's CreateMergeRequest RPC.
40 MergeRequestServiceCreateMergeRequestProcedure = "/ermite.MergeRequestService/CreateMergeRequest"
41 // MergeRequestServiceListMergeRequestsProcedure is the fully-qualified name of the
42 // MergeRequestService's ListMergeRequests RPC.
43 MergeRequestServiceListMergeRequestsProcedure = "/ermite.MergeRequestService/ListMergeRequests"
44 // MergeRequestServiceGetMergeRequestProcedure is the fully-qualified name of the
45 // MergeRequestService's GetMergeRequest RPC.
46 MergeRequestServiceGetMergeRequestProcedure = "/ermite.MergeRequestService/GetMergeRequest"
47 // MergeRequestServiceAddCommentProcedure is the fully-qualified name of the MergeRequestService's
48 // AddComment RPC.
49 MergeRequestServiceAddCommentProcedure = "/ermite.MergeRequestService/AddComment"
50 // MergeRequestServiceEditCommentProcedure is the fully-qualified name of the MergeRequestService's
51 // EditComment RPC.
52 MergeRequestServiceEditCommentProcedure = "/ermite.MergeRequestService/EditComment"
53 // MergeRequestServiceDeleteCommentProcedure is the fully-qualified name of the
54 // MergeRequestService's DeleteComment RPC.
55 MergeRequestServiceDeleteCommentProcedure = "/ermite.MergeRequestService/DeleteComment"
56 // MergeRequestServiceResolveCommentProcedure is the fully-qualified name of the
57 // MergeRequestService's ResolveComment RPC.
58 MergeRequestServiceResolveCommentProcedure = "/ermite.MergeRequestService/ResolveComment"
59 // MergeRequestServiceCloseMergeRequestProcedure is the fully-qualified name of the
60 // MergeRequestService's CloseMergeRequest RPC.
61 MergeRequestServiceCloseMergeRequestProcedure = "/ermite.MergeRequestService/CloseMergeRequest"
62 // MergeRequestServiceMergeMergeRequestProcedure is the fully-qualified name of the
63 // MergeRequestService's MergeMergeRequest RPC.
64 MergeRequestServiceMergeMergeRequestProcedure = "/ermite.MergeRequestService/MergeMergeRequest"
65 // MergeRequestServiceMarkReadProcedure is the fully-qualified name of the MergeRequestService's
66 // MarkRead RPC.
67 MergeRequestServiceMarkReadProcedure = "/ermite.MergeRequestService/MarkRead"
68)
69
70// MergeRequestServiceClient is a client for the ermite.MergeRequestService service.
71type MergeRequestServiceClient interface {
72 // CreateMergeRequest opens a merge request. Needs the mr:write scope. Fails
73 // with invalid_argument if a text rule is broken, if a branch does not exist
74 // or if source and target are the same branch, and with already_exists if an
75 // open merge request already has the same source and target.
76 CreateMergeRequest(context.Context, *connect.Request[ermite.CreateMergeRequestRequest]) (*connect.Response[ermite.CreateMergeRequestResponse], error)
77 // ListMergeRequests lists the merge requests of a repository, highest
78 // number (newest) first, optionally restricted to one state. The listed
79 // merge requests carry no diff or comments; head_id is set. Fails with
80 // not_found if the repository does not exist or is not readable.
81 ListMergeRequests(context.Context, *connect.Request[ermite.ListMergeRequestsRequest]) (*connect.Response[ermite.ListMergeRequestsResponse], error)
82 // GetMergeRequest returns one merge request with its commits, its diff and
83 // its comments. The diff compares the target with the head (what the merge
84 // would bring: "target...head"), or, with since_last_read, the head the
85 // caller last marked read with the current head. Fails with not_found if
86 // the repository or the number is unknown.
87 GetMergeRequest(context.Context, *connect.Request[ermite.GetMergeRequestRequest]) (*connect.Response[ermite.GetMergeRequestResponse], error)
88 // AddComment adds a general comment, a comment on a line or a range of
89 // lines of the diff, or a reply to a root comment. Needs the mr:write
90 // scope; setting a verdict also needs the mr:review scope (permission_denied
91 // without it). Fails with invalid_argument if the text breaks a rule (it may
92 // be empty only with a verdict), if path, line, start_line and side do not
93 // designate lines of the current diff of the merge request, if reply_to is
94 // not the id of a root comment that is not deleted, if a reply sets path,
95 // line, start_line, side or verdict, or if a verdict is set on a reply; and
96 // with failed_precondition if the merge request is not open. A comment with
97 // VERDICT_APPROVE is created resolved.
98 AddComment(context.Context, *connect.Request[ermite.AddCommentRequest]) (*connect.Response[ermite.AddCommentResponse], error)
99 // EditComment replaces the text of a comment. Needs the mr:write scope, and
100 // only the author of the comment can edit it (permission_denied
101 // otherwise). Fails with invalid_argument if the text breaks a rule (it may
102 // be empty only for a comment with a verdict), with not_found if the comment
103 // is unknown, and with failed_precondition if the merge request is not open
104 // or the comment was deleted. Sending the current text succeeds and changes
105 // nothing.
106 EditComment(context.Context, *connect.Request[ermite.EditCommentRequest]) (*connect.Response[ermite.EditCommentResponse], error)
107 // DeleteComment deletes a comment: its text is emptied and deleted is set,
108 // while its id, anchor, replies and verdict remain. Needs the mr:write
109 // scope, and only the author of the comment can delete it
110 // (permission_denied otherwise). Fails with not_found if the comment is
111 // unknown and with failed_precondition if the merge request is not open.
112 // Deleting a comment already deleted succeeds and changes nothing.
113 DeleteComment(context.Context, *connect.Request[ermite.DeleteCommentRequest]) (*connect.Response[ermite.DeleteCommentResponse], error)
114 // ResolveComment marks a thread resolved or unresolved. Needs the mr:write
115 // scope. Resolution belongs to the root comment: on a reply it fails with
116 // invalid_argument. Fails with not_found if the comment is unknown and with
117 // failed_precondition if the merge request is not open. Setting the state
118 // the comment already has succeeds and changes nothing.
119 ResolveComment(context.Context, *connect.Request[ermite.ResolveCommentRequest]) (*connect.Response[ermite.ResolveCommentResponse], error)
120 // CloseMergeRequest closes an open merge request without merging it. Needs
121 // the mr:write scope. Fails with failed_precondition if the merge request
122 // is not open. A closed merge request cannot be reopened: open a new one.
123 CloseMergeRequest(context.Context, *connect.Request[ermite.CloseMergeRequestRequest]) (*connect.Response[ermite.CloseMergeRequestResponse], error)
124 // MergeMergeRequest merges an open merge request. Needs the mr:merge scope.
125 // The caller passes the head it reviewed: the server merges only if the
126 // source branch still points to it, so a push between review and merge is
127 // never merged unseen. Fails with invalid_argument if head_id is empty or
128 // not a commit id, and with failed_precondition if the merge request is not
129 // open, if the source branch no longer points to head_id ("branch moved,
130 // read again"), if the mode is fast-forward and the target is not an
131 // ancestor of the head (rebase and push again, or merge with squash or
132 // merge commit), if the mode is squash or merge commit and the head
133 // conflicts with the target or shares no history with it (rebase and push
134 // again), if the mode is not allowed by RepoSettings, or if a check fails
135 // and RepoSettings.failing_checks_block is set. Merges of one
136 // repository run one at a time. Repeating a call that succeeded fails with
137 // failed_precondition (not open). On success the server publishes
138 // MergeRequestMerged then Pushed for the target branch.
139 MergeMergeRequest(context.Context, *connect.Request[ermite.MergeMergeRequestRequest]) (*connect.Response[ermite.MergeMergeRequestResponse], error)
140 // MarkRead records the head the caller has reviewed, for the since_last_read
141 // option of GetMergeRequest. There is one read position per merge request,
142 // the reviewer's. Needs the mr:write scope. Marking a commit that does not
143 // exist in the repository is invalid_argument.
144 MarkRead(context.Context, *connect.Request[ermite.MarkReadRequest]) (*connect.Response[ermite.MarkReadResponse], error)
145}
146
147// NewMergeRequestServiceClient constructs a client for the ermite.MergeRequestService service. By
148// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses,
149// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the
150// connect.WithGRPC() or connect.WithGRPCWeb() options.
151//
152// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
153// http://api.acme.com or https://acme.com/grpc).
154func NewMergeRequestServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) MergeRequestServiceClient {
155 baseURL = strings.TrimRight(baseURL, "/")
156 mergeRequestServiceMethods := ermite.File_ermite_merge_request_proto.Services().ByName("MergeRequestService").Methods()
157 return &mergeRequestServiceClient{
158 createMergeRequest: connect.NewClient[ermite.CreateMergeRequestRequest, ermite.CreateMergeRequestResponse](
159 httpClient,
160 baseURL+MergeRequestServiceCreateMergeRequestProcedure,
161 connect.WithSchema(mergeRequestServiceMethods.ByName("CreateMergeRequest")),
162 connect.WithClientOptions(opts...),
163 ),
164 listMergeRequests: connect.NewClient[ermite.ListMergeRequestsRequest, ermite.ListMergeRequestsResponse](
165 httpClient,
166 baseURL+MergeRequestServiceListMergeRequestsProcedure,
167 connect.WithSchema(mergeRequestServiceMethods.ByName("ListMergeRequests")),
168 connect.WithClientOptions(opts...),
169 ),
170 getMergeRequest: connect.NewClient[ermite.GetMergeRequestRequest, ermite.GetMergeRequestResponse](
171 httpClient,
172 baseURL+MergeRequestServiceGetMergeRequestProcedure,
173 connect.WithSchema(mergeRequestServiceMethods.ByName("GetMergeRequest")),
174 connect.WithClientOptions(opts...),
175 ),
176 addComment: connect.NewClient[ermite.AddCommentRequest, ermite.AddCommentResponse](
177 httpClient,
178 baseURL+MergeRequestServiceAddCommentProcedure,
179 connect.WithSchema(mergeRequestServiceMethods.ByName("AddComment")),
180 connect.WithClientOptions(opts...),
181 ),
182 editComment: connect.NewClient[ermite.EditCommentRequest, ermite.EditCommentResponse](
183 httpClient,
184 baseURL+MergeRequestServiceEditCommentProcedure,
185 connect.WithSchema(mergeRequestServiceMethods.ByName("EditComment")),
186 connect.WithClientOptions(opts...),
187 ),
188 deleteComment: connect.NewClient[ermite.DeleteCommentRequest, ermite.DeleteCommentResponse](
189 httpClient,
190 baseURL+MergeRequestServiceDeleteCommentProcedure,
191 connect.WithSchema(mergeRequestServiceMethods.ByName("DeleteComment")),
192 connect.WithClientOptions(opts...),
193 ),
194 resolveComment: connect.NewClient[ermite.ResolveCommentRequest, ermite.ResolveCommentResponse](
195 httpClient,
196 baseURL+MergeRequestServiceResolveCommentProcedure,
197 connect.WithSchema(mergeRequestServiceMethods.ByName("ResolveComment")),
198 connect.WithClientOptions(opts...),
199 ),
200 closeMergeRequest: connect.NewClient[ermite.CloseMergeRequestRequest, ermite.CloseMergeRequestResponse](
201 httpClient,
202 baseURL+MergeRequestServiceCloseMergeRequestProcedure,
203 connect.WithSchema(mergeRequestServiceMethods.ByName("CloseMergeRequest")),
204 connect.WithClientOptions(opts...),
205 ),
206 mergeMergeRequest: connect.NewClient[ermite.MergeMergeRequestRequest, ermite.MergeMergeRequestResponse](
207 httpClient,
208 baseURL+MergeRequestServiceMergeMergeRequestProcedure,
209 connect.WithSchema(mergeRequestServiceMethods.ByName("MergeMergeRequest")),
210 connect.WithClientOptions(opts...),
211 ),
212 markRead: connect.NewClient[ermite.MarkReadRequest, ermite.MarkReadResponse](
213 httpClient,
214 baseURL+MergeRequestServiceMarkReadProcedure,
215 connect.WithSchema(mergeRequestServiceMethods.ByName("MarkRead")),
216 connect.WithClientOptions(opts...),
217 ),
218 }
219}
220
221// mergeRequestServiceClient implements MergeRequestServiceClient.
222type mergeRequestServiceClient struct {
223 createMergeRequest *connect.Client[ermite.CreateMergeRequestRequest, ermite.CreateMergeRequestResponse]
224 listMergeRequests *connect.Client[ermite.ListMergeRequestsRequest, ermite.ListMergeRequestsResponse]
225 getMergeRequest *connect.Client[ermite.GetMergeRequestRequest, ermite.GetMergeRequestResponse]
226 addComment *connect.Client[ermite.AddCommentRequest, ermite.AddCommentResponse]
227 editComment *connect.Client[ermite.EditCommentRequest, ermite.EditCommentResponse]
228 deleteComment *connect.Client[ermite.DeleteCommentRequest, ermite.DeleteCommentResponse]
229 resolveComment *connect.Client[ermite.ResolveCommentRequest, ermite.ResolveCommentResponse]
230 closeMergeRequest *connect.Client[ermite.CloseMergeRequestRequest, ermite.CloseMergeRequestResponse]
231 mergeMergeRequest *connect.Client[ermite.MergeMergeRequestRequest, ermite.MergeMergeRequestResponse]
232 markRead *connect.Client[ermite.MarkReadRequest, ermite.MarkReadResponse]
233}
234
235// CreateMergeRequest calls ermite.MergeRequestService.CreateMergeRequest.
236func (c *mergeRequestServiceClient) CreateMergeRequest(ctx context.Context, req *connect.Request[ermite.CreateMergeRequestRequest]) (*connect.Response[ermite.CreateMergeRequestResponse], error) {
237 return c.createMergeRequest.CallUnary(ctx, req)
238}
239
240// ListMergeRequests calls ermite.MergeRequestService.ListMergeRequests.
241func (c *mergeRequestServiceClient) ListMergeRequests(ctx context.Context, req *connect.Request[ermite.ListMergeRequestsRequest]) (*connect.Response[ermite.ListMergeRequestsResponse], error) {
242 return c.listMergeRequests.CallUnary(ctx, req)
243}
244
245// GetMergeRequest calls ermite.MergeRequestService.GetMergeRequest.
246func (c *mergeRequestServiceClient) GetMergeRequest(ctx context.Context, req *connect.Request[ermite.GetMergeRequestRequest]) (*connect.Response[ermite.GetMergeRequestResponse], error) {
247 return c.getMergeRequest.CallUnary(ctx, req)
248}
249
250// AddComment calls ermite.MergeRequestService.AddComment.
251func (c *mergeRequestServiceClient) AddComment(ctx context.Context, req *connect.Request[ermite.AddCommentRequest]) (*connect.Response[ermite.AddCommentResponse], error) {
252 return c.addComment.CallUnary(ctx, req)
253}
254
255// EditComment calls ermite.MergeRequestService.EditComment.
256func (c *mergeRequestServiceClient) EditComment(ctx context.Context, req *connect.Request[ermite.EditCommentRequest]) (*connect.Response[ermite.EditCommentResponse], error) {
257 return c.editComment.CallUnary(ctx, req)
258}
259
260// DeleteComment calls ermite.MergeRequestService.DeleteComment.
261func (c *mergeRequestServiceClient) DeleteComment(ctx context.Context, req *connect.Request[ermite.DeleteCommentRequest]) (*connect.Response[ermite.DeleteCommentResponse], error) {
262 return c.deleteComment.CallUnary(ctx, req)
263}
264
265// ResolveComment calls ermite.MergeRequestService.ResolveComment.
266func (c *mergeRequestServiceClient) ResolveComment(ctx context.Context, req *connect.Request[ermite.ResolveCommentRequest]) (*connect.Response[ermite.ResolveCommentResponse], error) {
267 return c.resolveComment.CallUnary(ctx, req)
268}
269
270// CloseMergeRequest calls ermite.MergeRequestService.CloseMergeRequest.
271func (c *mergeRequestServiceClient) CloseMergeRequest(ctx context.Context, req *connect.Request[ermite.CloseMergeRequestRequest]) (*connect.Response[ermite.CloseMergeRequestResponse], error) {
272 return c.closeMergeRequest.CallUnary(ctx, req)
273}
274
275// MergeMergeRequest calls ermite.MergeRequestService.MergeMergeRequest.
276func (c *mergeRequestServiceClient) MergeMergeRequest(ctx context.Context, req *connect.Request[ermite.MergeMergeRequestRequest]) (*connect.Response[ermite.MergeMergeRequestResponse], error) {
277 return c.mergeMergeRequest.CallUnary(ctx, req)
278}
279
280// MarkRead calls ermite.MergeRequestService.MarkRead.
281func (c *mergeRequestServiceClient) MarkRead(ctx context.Context, req *connect.Request[ermite.MarkReadRequest]) (*connect.Response[ermite.MarkReadResponse], error) {
282 return c.markRead.CallUnary(ctx, req)
283}
284
285// MergeRequestServiceHandler is an implementation of the ermite.MergeRequestService service.
286type MergeRequestServiceHandler interface {
287 // CreateMergeRequest opens a merge request. Needs the mr:write scope. Fails
288 // with invalid_argument if a text rule is broken, if a branch does not exist
289 // or if source and target are the same branch, and with already_exists if an
290 // open merge request already has the same source and target.
291 CreateMergeRequest(context.Context, *connect.Request[ermite.CreateMergeRequestRequest]) (*connect.Response[ermite.CreateMergeRequestResponse], error)
292 // ListMergeRequests lists the merge requests of a repository, highest
293 // number (newest) first, optionally restricted to one state. The listed
294 // merge requests carry no diff or comments; head_id is set. Fails with
295 // not_found if the repository does not exist or is not readable.
296 ListMergeRequests(context.Context, *connect.Request[ermite.ListMergeRequestsRequest]) (*connect.Response[ermite.ListMergeRequestsResponse], error)
297 // GetMergeRequest returns one merge request with its commits, its diff and
298 // its comments. The diff compares the target with the head (what the merge
299 // would bring: "target...head"), or, with since_last_read, the head the
300 // caller last marked read with the current head. Fails with not_found if
301 // the repository or the number is unknown.
302 GetMergeRequest(context.Context, *connect.Request[ermite.GetMergeRequestRequest]) (*connect.Response[ermite.GetMergeRequestResponse], error)
303 // AddComment adds a general comment, a comment on a line or a range of
304 // lines of the diff, or a reply to a root comment. Needs the mr:write
305 // scope; setting a verdict also needs the mr:review scope (permission_denied
306 // without it). Fails with invalid_argument if the text breaks a rule (it may
307 // be empty only with a verdict), if path, line, start_line and side do not
308 // designate lines of the current diff of the merge request, if reply_to is
309 // not the id of a root comment that is not deleted, if a reply sets path,
310 // line, start_line, side or verdict, or if a verdict is set on a reply; and
311 // with failed_precondition if the merge request is not open. A comment with
312 // VERDICT_APPROVE is created resolved.
313 AddComment(context.Context, *connect.Request[ermite.AddCommentRequest]) (*connect.Response[ermite.AddCommentResponse], error)
314 // EditComment replaces the text of a comment. Needs the mr:write scope, and
315 // only the author of the comment can edit it (permission_denied
316 // otherwise). Fails with invalid_argument if the text breaks a rule (it may
317 // be empty only for a comment with a verdict), with not_found if the comment
318 // is unknown, and with failed_precondition if the merge request is not open
319 // or the comment was deleted. Sending the current text succeeds and changes
320 // nothing.
321 EditComment(context.Context, *connect.Request[ermite.EditCommentRequest]) (*connect.Response[ermite.EditCommentResponse], error)
322 // DeleteComment deletes a comment: its text is emptied and deleted is set,
323 // while its id, anchor, replies and verdict remain. Needs the mr:write
324 // scope, and only the author of the comment can delete it
325 // (permission_denied otherwise). Fails with not_found if the comment is
326 // unknown and with failed_precondition if the merge request is not open.
327 // Deleting a comment already deleted succeeds and changes nothing.
328 DeleteComment(context.Context, *connect.Request[ermite.DeleteCommentRequest]) (*connect.Response[ermite.DeleteCommentResponse], error)
329 // ResolveComment marks a thread resolved or unresolved. Needs the mr:write
330 // scope. Resolution belongs to the root comment: on a reply it fails with
331 // invalid_argument. Fails with not_found if the comment is unknown and with
332 // failed_precondition if the merge request is not open. Setting the state
333 // the comment already has succeeds and changes nothing.
334 ResolveComment(context.Context, *connect.Request[ermite.ResolveCommentRequest]) (*connect.Response[ermite.ResolveCommentResponse], error)
335 // CloseMergeRequest closes an open merge request without merging it. Needs
336 // the mr:write scope. Fails with failed_precondition if the merge request
337 // is not open. A closed merge request cannot be reopened: open a new one.
338 CloseMergeRequest(context.Context, *connect.Request[ermite.CloseMergeRequestRequest]) (*connect.Response[ermite.CloseMergeRequestResponse], error)
339 // MergeMergeRequest merges an open merge request. Needs the mr:merge scope.
340 // The caller passes the head it reviewed: the server merges only if the
341 // source branch still points to it, so a push between review and merge is
342 // never merged unseen. Fails with invalid_argument if head_id is empty or
343 // not a commit id, and with failed_precondition if the merge request is not
344 // open, if the source branch no longer points to head_id ("branch moved,
345 // read again"), if the mode is fast-forward and the target is not an
346 // ancestor of the head (rebase and push again, or merge with squash or
347 // merge commit), if the mode is squash or merge commit and the head
348 // conflicts with the target or shares no history with it (rebase and push
349 // again), if the mode is not allowed by RepoSettings, or if a check fails
350 // and RepoSettings.failing_checks_block is set. Merges of one
351 // repository run one at a time. Repeating a call that succeeded fails with
352 // failed_precondition (not open). On success the server publishes
353 // MergeRequestMerged then Pushed for the target branch.
354 MergeMergeRequest(context.Context, *connect.Request[ermite.MergeMergeRequestRequest]) (*connect.Response[ermite.MergeMergeRequestResponse], error)
355 // MarkRead records the head the caller has reviewed, for the since_last_read
356 // option of GetMergeRequest. There is one read position per merge request,
357 // the reviewer's. Needs the mr:write scope. Marking a commit that does not
358 // exist in the repository is invalid_argument.
359 MarkRead(context.Context, *connect.Request[ermite.MarkReadRequest]) (*connect.Response[ermite.MarkReadResponse], error)
360}
361
362// NewMergeRequestServiceHandler builds an HTTP handler from the service implementation. It returns
363// the path on which to mount the handler and the handler itself.
364//
365// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
366// and JSON codecs. They also support gzip compression.
367func NewMergeRequestServiceHandler(svc MergeRequestServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
368 mergeRequestServiceMethods := ermite.File_ermite_merge_request_proto.Services().ByName("MergeRequestService").Methods()
369 mergeRequestServiceCreateMergeRequestHandler := connect.NewUnaryHandler(
370 MergeRequestServiceCreateMergeRequestProcedure,
371 svc.CreateMergeRequest,
372 connect.WithSchema(mergeRequestServiceMethods.ByName("CreateMergeRequest")),
373 connect.WithHandlerOptions(opts...),
374 )
375 mergeRequestServiceListMergeRequestsHandler := connect.NewUnaryHandler(
376 MergeRequestServiceListMergeRequestsProcedure,
377 svc.ListMergeRequests,
378 connect.WithSchema(mergeRequestServiceMethods.ByName("ListMergeRequests")),
379 connect.WithHandlerOptions(opts...),
380 )
381 mergeRequestServiceGetMergeRequestHandler := connect.NewUnaryHandler(
382 MergeRequestServiceGetMergeRequestProcedure,
383 svc.GetMergeRequest,
384 connect.WithSchema(mergeRequestServiceMethods.ByName("GetMergeRequest")),
385 connect.WithHandlerOptions(opts...),
386 )
387 mergeRequestServiceAddCommentHandler := connect.NewUnaryHandler(
388 MergeRequestServiceAddCommentProcedure,
389 svc.AddComment,
390 connect.WithSchema(mergeRequestServiceMethods.ByName("AddComment")),
391 connect.WithHandlerOptions(opts...),
392 )
393 mergeRequestServiceEditCommentHandler := connect.NewUnaryHandler(
394 MergeRequestServiceEditCommentProcedure,
395 svc.EditComment,
396 connect.WithSchema(mergeRequestServiceMethods.ByName("EditComment")),
397 connect.WithHandlerOptions(opts...),
398 )
399 mergeRequestServiceDeleteCommentHandler := connect.NewUnaryHandler(
400 MergeRequestServiceDeleteCommentProcedure,
401 svc.DeleteComment,
402 connect.WithSchema(mergeRequestServiceMethods.ByName("DeleteComment")),
403 connect.WithHandlerOptions(opts...),
404 )
405 mergeRequestServiceResolveCommentHandler := connect.NewUnaryHandler(
406 MergeRequestServiceResolveCommentProcedure,
407 svc.ResolveComment,
408 connect.WithSchema(mergeRequestServiceMethods.ByName("ResolveComment")),
409 connect.WithHandlerOptions(opts...),
410 )
411 mergeRequestServiceCloseMergeRequestHandler := connect.NewUnaryHandler(
412 MergeRequestServiceCloseMergeRequestProcedure,
413 svc.CloseMergeRequest,
414 connect.WithSchema(mergeRequestServiceMethods.ByName("CloseMergeRequest")),
415 connect.WithHandlerOptions(opts...),
416 )
417 mergeRequestServiceMergeMergeRequestHandler := connect.NewUnaryHandler(
418 MergeRequestServiceMergeMergeRequestProcedure,
419 svc.MergeMergeRequest,
420 connect.WithSchema(mergeRequestServiceMethods.ByName("MergeMergeRequest")),
421 connect.WithHandlerOptions(opts...),
422 )
423 mergeRequestServiceMarkReadHandler := connect.NewUnaryHandler(
424 MergeRequestServiceMarkReadProcedure,
425 svc.MarkRead,
426 connect.WithSchema(mergeRequestServiceMethods.ByName("MarkRead")),
427 connect.WithHandlerOptions(opts...),
428 )
429 return "/ermite.MergeRequestService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
430 switch r.URL.Path {
431 case MergeRequestServiceCreateMergeRequestProcedure:
432 mergeRequestServiceCreateMergeRequestHandler.ServeHTTP(w, r)
433 case MergeRequestServiceListMergeRequestsProcedure:
434 mergeRequestServiceListMergeRequestsHandler.ServeHTTP(w, r)
435 case MergeRequestServiceGetMergeRequestProcedure:
436 mergeRequestServiceGetMergeRequestHandler.ServeHTTP(w, r)
437 case MergeRequestServiceAddCommentProcedure:
438 mergeRequestServiceAddCommentHandler.ServeHTTP(w, r)
439 case MergeRequestServiceEditCommentProcedure:
440 mergeRequestServiceEditCommentHandler.ServeHTTP(w, r)
441 case MergeRequestServiceDeleteCommentProcedure:
442 mergeRequestServiceDeleteCommentHandler.ServeHTTP(w, r)
443 case MergeRequestServiceResolveCommentProcedure:
444 mergeRequestServiceResolveCommentHandler.ServeHTTP(w, r)
445 case MergeRequestServiceCloseMergeRequestProcedure:
446 mergeRequestServiceCloseMergeRequestHandler.ServeHTTP(w, r)
447 case MergeRequestServiceMergeMergeRequestProcedure:
448 mergeRequestServiceMergeMergeRequestHandler.ServeHTTP(w, r)
449 case MergeRequestServiceMarkReadProcedure:
450 mergeRequestServiceMarkReadHandler.ServeHTTP(w, r)
451 default:
452 http.NotFound(w, r)
453 }
454 })
455}
456
457// UnimplementedMergeRequestServiceHandler returns CodeUnimplemented from all methods.
458type UnimplementedMergeRequestServiceHandler struct{}
459
460func (UnimplementedMergeRequestServiceHandler) CreateMergeRequest(context.Context, *connect.Request[ermite.CreateMergeRequestRequest]) (*connect.Response[ermite.CreateMergeRequestResponse], error) {
461 return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.MergeRequestService.CreateMergeRequest is not implemented"))
462}
463
464func (UnimplementedMergeRequestServiceHandler) ListMergeRequests(context.Context, *connect.Request[ermite.ListMergeRequestsRequest]) (*connect.Response[ermite.ListMergeRequestsResponse], error) {
465 return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.MergeRequestService.ListMergeRequests is not implemented"))
466}
467
468func (UnimplementedMergeRequestServiceHandler) GetMergeRequest(context.Context, *connect.Request[ermite.GetMergeRequestRequest]) (*connect.Response[ermite.GetMergeRequestResponse], error) {
469 return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.MergeRequestService.GetMergeRequest is not implemented"))
470}
471
472func (UnimplementedMergeRequestServiceHandler) AddComment(context.Context, *connect.Request[ermite.AddCommentRequest]) (*connect.Response[ermite.AddCommentResponse], error) {
473 return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.MergeRequestService.AddComment is not implemented"))
474}
475
476func (UnimplementedMergeRequestServiceHandler) EditComment(context.Context, *connect.Request[ermite.EditCommentRequest]) (*connect.Response[ermite.EditCommentResponse], error) {
477 return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.MergeRequestService.EditComment is not implemented"))
478}
479
480func (UnimplementedMergeRequestServiceHandler) DeleteComment(context.Context, *connect.Request[ermite.DeleteCommentRequest]) (*connect.Response[ermite.DeleteCommentResponse], error) {
481 return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.MergeRequestService.DeleteComment is not implemented"))
482}
483
484func (UnimplementedMergeRequestServiceHandler) ResolveComment(context.Context, *connect.Request[ermite.ResolveCommentRequest]) (*connect.Response[ermite.ResolveCommentResponse], error) {
485 return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.MergeRequestService.ResolveComment is not implemented"))
486}
487
488func (UnimplementedMergeRequestServiceHandler) CloseMergeRequest(context.Context, *connect.Request[ermite.CloseMergeRequestRequest]) (*connect.Response[ermite.CloseMergeRequestResponse], error) {
489 return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.MergeRequestService.CloseMergeRequest is not implemented"))
490}
491
492func (UnimplementedMergeRequestServiceHandler) MergeMergeRequest(context.Context, *connect.Request[ermite.MergeMergeRequestRequest]) (*connect.Response[ermite.MergeMergeRequestResponse], error) {
493 return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.MergeRequestService.MergeMergeRequest is not implemented"))
494}
495
496func (UnimplementedMergeRequestServiceHandler) MarkRead(context.Context, *connect.Request[ermite.MarkReadRequest]) (*connect.Response[ermite.MarkReadResponse], error) {
497 return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.MergeRequestService.MarkRead is not implemented"))
498}