Debian Codegraph @

apihub/apiv1/apihubpb/linting_service_grpc.pb.go

raw
1 // Copyright 2025 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
16 // versions:
17 // - protoc-gen-go-grpc v1.3.0
18 // - protoc v4.25.7
19 // source: google/cloud/apihub/v1/linting_service.proto
20
21 package apihubpb
22
23 import (
24 context "context"
25 grpc "google.golang.org/grpc"
26 codes "google.golang.org/grpc/codes"
27 status "google.golang.org/grpc/status"
28 emptypb "google.golang.org/protobuf/types/known/emptypb"
29 )
30
31 // This is a compile-time assertion to ensure that this generated file
32 // is compatible with the grpc package it is being compiled against.
33 // Requires gRPC-Go v1.32.0 or later.
34 const _ = grpc.SupportPackageIsVersion7
35
36 const (
37 LintingService_GetStyleGuide_FullMethodName = "/google.cloud.apihub.v1.LintingService/GetStyleGuide"
38 LintingService_UpdateStyleGuide_FullMethodName = "/google.cloud.apihub.v1.LintingService/UpdateStyleGuide"
39 LintingService_GetStyleGuideContents_FullMethodName = "/google.cloud.apihub.v1.LintingService/GetStyleGuideContents"
40 LintingService_LintSpec_FullMethodName = "/google.cloud.apihub.v1.LintingService/LintSpec"
41 )
42
43 // LintingServiceClient is the client API for LintingService service.
44 //
45 // 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.
46 type LintingServiceClient interface {
47 // Get the style guide being used for linting.
48 GetStyleGuide(ctx context.Context, in *GetStyleGuideRequest, opts ...grpc.CallOption) (*StyleGuide, error)
49 // Update the styleGuide to be used for liniting in by API hub.
50 UpdateStyleGuide(ctx context.Context, in *UpdateStyleGuideRequest, opts ...grpc.CallOption) (*StyleGuide, error)
51 // Get the contents of the style guide.
52 GetStyleGuideContents(ctx context.Context, in *GetStyleGuideContentsRequest, opts ...grpc.CallOption) (*StyleGuideContents, error)
53 // Lints the requested spec and updates the corresponding API Spec with the
54 // lint response. This lint response will be available in all subsequent
55 // Get and List Spec calls to Core service.
56 LintSpec(ctx context.Context, in *LintSpecRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
57 }
58
59 type lintingServiceClient struct {
60 cc grpc.ClientConnInterface
61 }
62
63 func NewLintingServiceClient(cc grpc.ClientConnInterface) LintingServiceClient {
64 return &lintingServiceClient{cc}
65 }
66
67 func (c *lintingServiceClient) GetStyleGuide(ctx context.Context, in *GetStyleGuideRequest, opts ...grpc.CallOption) (*StyleGuide, error) {
68 out := new(StyleGuide)
69 err := c.cc.Invoke(ctx, LintingService_GetStyleGuide_FullMethodName, in, out, opts...)
70 if err != nil {
71 return nil, err
72 }
73 return out, nil
74 }
75
76 func (c *lintingServiceClient) UpdateStyleGuide(ctx context.Context, in *UpdateStyleGuideRequest, opts ...grpc.CallOption) (*StyleGuide, error) {
77 out := new(StyleGuide)
78 err := c.cc.Invoke(ctx, LintingService_UpdateStyleGuide_FullMethodName, in, out, opts...)
79 if err != nil {
80 return nil, err
81 }
82 return out, nil
83 }
84
85 func (c *lintingServiceClient) GetStyleGuideContents(ctx context.Context, in *GetStyleGuideContentsRequest, opts ...grpc.CallOption) (*StyleGuideContents, error) {
86 out := new(StyleGuideContents)
87 err := c.cc.Invoke(ctx, LintingService_GetStyleGuideContents_FullMethodName, in, out, opts...)
88 if err != nil {
89 return nil, err
90 }
91 return out, nil
92 }
93
94 func (c *lintingServiceClient) LintSpec(ctx context.Context, in *LintSpecRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
95 out := new(emptypb.Empty)
96 err := c.cc.Invoke(ctx, LintingService_LintSpec_FullMethodName, in, out, opts...)
97 if err != nil {
98 return nil, err
99 }
100 return out, nil
101 }
102
103 // LintingServiceServer is the server API for LintingService service.
104 // All implementations should embed UnimplementedLintingServiceServer
105 // for forward compatibility
106 type LintingServiceServer interface {
107 // Get the style guide being used for linting.
108 GetStyleGuide(context.Context, *GetStyleGuideRequest) (*StyleGuide, error)
109 // Update the styleGuide to be used for liniting in by API hub.
110 UpdateStyleGuide(context.Context, *UpdateStyleGuideRequest) (*StyleGuide, error)
111 // Get the contents of the style guide.
112 GetStyleGuideContents(context.Context, *GetStyleGuideContentsRequest) (*StyleGuideContents, error)
113 // Lints the requested spec and updates the corresponding API Spec with the
114 // lint response. This lint response will be available in all subsequent
115 // Get and List Spec calls to Core service.
116 LintSpec(context.Context, *LintSpecRequest) (*emptypb.Empty, error)
117 }
118
119 // UnimplementedLintingServiceServer should be embedded to have forward compatible implementations.
120 type UnimplementedLintingServiceServer struct {
121 }
122
123 func (UnimplementedLintingServiceServer) GetStyleGuide(context.Context, *GetStyleGuideRequest) (*StyleGuide, error) {
124 return nil, status.Errorf(codes.Unimplemented, "method GetStyleGuide not implemented")
125 }
126 func (UnimplementedLintingServiceServer) UpdateStyleGuide(context.Context, *UpdateStyleGuideRequest) (*StyleGuide, error) {
127 return nil, status.Errorf(codes.Unimplemented, "method UpdateStyleGuide not implemented")
128 }
129 func (UnimplementedLintingServiceServer) GetStyleGuideContents(context.Context, *GetStyleGuideContentsRequest) (*StyleGuideContents, error) {
130 return nil, status.Errorf(codes.Unimplemented, "method GetStyleGuideContents not implemented")
131 }
132 func (UnimplementedLintingServiceServer) LintSpec(context.Context, *LintSpecRequest) (*emptypb.Empty, error) {
133 return nil, status.Errorf(codes.Unimplemented, "method LintSpec not implemented")
134 }
135
136 // UnsafeLintingServiceServer may be embedded to opt out of forward compatibility for this service.
137 // Use of this interface is not recommended, as added methods to LintingServiceServer will
138 // result in compilation errors.
139 type UnsafeLintingServiceServer interface {
140 mustEmbedUnimplementedLintingServiceServer()
141 }
142
143 func RegisterLintingServiceServer(s grpc.ServiceRegistrar, srv LintingServiceServer) {
144 s.RegisterService(&LintingService_ServiceDesc, srv)
145 }
146
147 func _LintingService_GetStyleGuide_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
148 in := new(GetStyleGuideRequest)
149 if err := dec(in); err != nil {
150 return nil, err
151 }
152 if interceptor == nil {
153 return srv.(LintingServiceServer).GetStyleGuide(ctx, in)
154 }
155 info := &grpc.UnaryServerInfo{
156 Server: srv,
157 FullMethod: LintingService_GetStyleGuide_FullMethodName,
158 }
159 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
160 return srv.(LintingServiceServer).GetStyleGuide(ctx, req.(*GetStyleGuideRequest))
161 }
162 return interceptor(ctx, in, info, handler)
163 }
164
165 func _LintingService_UpdateStyleGuide_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
166 in := new(UpdateStyleGuideRequest)
167 if err := dec(in); err != nil {
168 return nil, err
169 }
170 if interceptor == nil {
171 return srv.(LintingServiceServer).UpdateStyleGuide(ctx, in)
172 }
173 info := &grpc.UnaryServerInfo{
174 Server: srv,
175 FullMethod: LintingService_UpdateStyleGuide_FullMethodName,
176 }
177 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
178 return srv.(LintingServiceServer).UpdateStyleGuide(ctx, req.(*UpdateStyleGuideRequest))
179 }
180 return interceptor(ctx, in, info, handler)
181 }
182
183 func _LintingService_GetStyleGuideContents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
184 in := new(GetStyleGuideContentsRequest)
185 if err := dec(in); err != nil {
186 return nil, err
187 }
188 if interceptor == nil {
189 return srv.(LintingServiceServer).GetStyleGuideContents(ctx, in)
190 }
191 info := &grpc.UnaryServerInfo{
192 Server: srv,
193 FullMethod: LintingService_GetStyleGuideContents_FullMethodName,
194 }
195 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
196 return srv.(LintingServiceServer).GetStyleGuideContents(ctx, req.(*GetStyleGuideContentsRequest))
197 }
198 return interceptor(ctx, in, info, handler)
199 }
200
201 func _LintingService_LintSpec_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
202 in := new(LintSpecRequest)
203 if err := dec(in); err != nil {
204 return nil, err
205 }
206 if interceptor == nil {
207 return srv.(LintingServiceServer).LintSpec(ctx, in)
208 }
209 info := &grpc.UnaryServerInfo{
210 Server: srv,
211 FullMethod: LintingService_LintSpec_FullMethodName,
212 }
213 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
214 return srv.(LintingServiceServer).LintSpec(ctx, req.(*LintSpecRequest))
215 }
216 return interceptor(ctx, in, info, handler)
217 }
218
219 // LintingService_ServiceDesc is the grpc.ServiceDesc for LintingService service.
220 // It's only intended for direct use with grpc.RegisterService,
221 // and not to be introspected or modified (even as a copy)
222 var LintingService_ServiceDesc = grpc.ServiceDesc{
223 ServiceName: "google.cloud.apihub.v1.LintingService",
224 HandlerType: (*LintingServiceServer)(nil),
225 Methods: []grpc.MethodDesc{
226 {
227 MethodName: "GetStyleGuide",
228 Handler: _LintingService_GetStyleGuide_Handler,
229 },
230 {
231 MethodName: "UpdateStyleGuide",
232 Handler: _LintingService_UpdateStyleGuide_Handler,
233 },
234 {
235 MethodName: "GetStyleGuideContents",
236 Handler: _LintingService_GetStyleGuideContents_Handler,
237 },
238 {
239 MethodName: "LintSpec",
240 Handler: _LintingService_LintSpec_Handler,
241 },
242 },
243 Streams: []grpc.StreamDesc{},
244 Metadata: "google/cloud/apihub/v1/linting_service.proto",
245 }