Debian Codegraph @

apihub/apiv1/apihubpb/curate_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/curate_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 ApiHubCurate_CreateCuration_FullMethodName = "/google.cloud.apihub.v1.ApiHubCurate/CreateCuration"
38 ApiHubCurate_GetCuration_FullMethodName = "/google.cloud.apihub.v1.ApiHubCurate/GetCuration"
39 ApiHubCurate_ListCurations_FullMethodName = "/google.cloud.apihub.v1.ApiHubCurate/ListCurations"
40 ApiHubCurate_UpdateCuration_FullMethodName = "/google.cloud.apihub.v1.ApiHubCurate/UpdateCuration"
41 ApiHubCurate_DeleteCuration_FullMethodName = "/google.cloud.apihub.v1.ApiHubCurate/DeleteCuration"
42 )
43
44 // ApiHubCurateClient is the client API for ApiHubCurate service.
45 //
46 // 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.
47 type ApiHubCurateClient interface {
48 // Create a curation resource in the API hub.
49 // Once a curation resource is created, plugin instances can start using it.
50 CreateCuration(ctx context.Context, in *CreateCurationRequest, opts ...grpc.CallOption) (*Curation, error)
51 // Get curation resource details.
52 GetCuration(ctx context.Context, in *GetCurationRequest, opts ...grpc.CallOption) (*Curation, error)
53 // List curation resources in the API hub.
54 ListCurations(ctx context.Context, in *ListCurationsRequest, opts ...grpc.CallOption) (*ListCurationsResponse, error)
55 // Update a curation resource in the API hub. The following fields in the
56 // [curation][google.cloud.apihub.v1.Curation] can be updated:
57 //
58 // * [display_name][google.cloud.apihub.v1.Curation.display_name]
59 // * [description][google.cloud.apihub.v1.Curation.description]
60 //
61 // The
62 // [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask]
63 // should be used to specify the fields being updated.
64 UpdateCuration(ctx context.Context, in *UpdateCurationRequest, opts ...grpc.CallOption) (*Curation, error)
65 // Delete a curation resource in the API hub. A curation can only be deleted
66 // if it's not being used by any plugin instance.
67 DeleteCuration(ctx context.Context, in *DeleteCurationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
68 }
69
70 type apiHubCurateClient struct {
71 cc grpc.ClientConnInterface
72 }
73
74 func NewApiHubCurateClient(cc grpc.ClientConnInterface) ApiHubCurateClient {
75 return &apiHubCurateClient{cc}
76 }
77
78 func (c *apiHubCurateClient) CreateCuration(ctx context.Context, in *CreateCurationRequest, opts ...grpc.CallOption) (*Curation, error) {
79 out := new(Curation)
80 err := c.cc.Invoke(ctx, ApiHubCurate_CreateCuration_FullMethodName, in, out, opts...)
81 if err != nil {
82 return nil, err
83 }
84 return out, nil
85 }
86
87 func (c *apiHubCurateClient) GetCuration(ctx context.Context, in *GetCurationRequest, opts ...grpc.CallOption) (*Curation, error) {
88 out := new(Curation)
89 err := c.cc.Invoke(ctx, ApiHubCurate_GetCuration_FullMethodName, in, out, opts...)
90 if err != nil {
91 return nil, err
92 }
93 return out, nil
94 }
95
96 func (c *apiHubCurateClient) ListCurations(ctx context.Context, in *ListCurationsRequest, opts ...grpc.CallOption) (*ListCurationsResponse, error) {
97 out := new(ListCurationsResponse)
98 err := c.cc.Invoke(ctx, ApiHubCurate_ListCurations_FullMethodName, in, out, opts...)
99 if err != nil {
100 return nil, err
101 }
102 return out, nil
103 }
104
105 func (c *apiHubCurateClient) UpdateCuration(ctx context.Context, in *UpdateCurationRequest, opts ...grpc.CallOption) (*Curation, error) {
106 out := new(Curation)
107 err := c.cc.Invoke(ctx, ApiHubCurate_UpdateCuration_FullMethodName, in, out, opts...)
108 if err != nil {
109 return nil, err
110 }
111 return out, nil
112 }
113
114 func (c *apiHubCurateClient) DeleteCuration(ctx context.Context, in *DeleteCurationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
115 out := new(emptypb.Empty)
116 err := c.cc.Invoke(ctx, ApiHubCurate_DeleteCuration_FullMethodName, in, out, opts...)
117 if err != nil {
118 return nil, err
119 }
120 return out, nil
121 }
122
123 // ApiHubCurateServer is the server API for ApiHubCurate service.
124 // All implementations should embed UnimplementedApiHubCurateServer
125 // for forward compatibility
126 type ApiHubCurateServer interface {
127 // Create a curation resource in the API hub.
128 // Once a curation resource is created, plugin instances can start using it.
129 CreateCuration(context.Context, *CreateCurationRequest) (*Curation, error)
130 // Get curation resource details.
131 GetCuration(context.Context, *GetCurationRequest) (*Curation, error)
132 // List curation resources in the API hub.
133 ListCurations(context.Context, *ListCurationsRequest) (*ListCurationsResponse, error)
134 // Update a curation resource in the API hub. The following fields in the
135 // [curation][google.cloud.apihub.v1.Curation] can be updated:
136 //
137 // * [display_name][google.cloud.apihub.v1.Curation.display_name]
138 // * [description][google.cloud.apihub.v1.Curation.description]
139 //
140 // The
141 // [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask]
142 // should be used to specify the fields being updated.
143 UpdateCuration(context.Context, *UpdateCurationRequest) (*Curation, error)
144 // Delete a curation resource in the API hub. A curation can only be deleted
145 // if it's not being used by any plugin instance.
146 DeleteCuration(context.Context, *DeleteCurationRequest) (*emptypb.Empty, error)
147 }
148
149 // UnimplementedApiHubCurateServer should be embedded to have forward compatible implementations.
150 type UnimplementedApiHubCurateServer struct {
151 }
152
153 func (UnimplementedApiHubCurateServer) CreateCuration(context.Context, *CreateCurationRequest) (*Curation, error) {
154 return nil, status.Errorf(codes.Unimplemented, "method CreateCuration not implemented")
155 }
156 func (UnimplementedApiHubCurateServer) GetCuration(context.Context, *GetCurationRequest) (*Curation, error) {
157 return nil, status.Errorf(codes.Unimplemented, "method GetCuration not implemented")
158 }
159 func (UnimplementedApiHubCurateServer) ListCurations(context.Context, *ListCurationsRequest) (*ListCurationsResponse, error) {
160 return nil, status.Errorf(codes.Unimplemented, "method ListCurations not implemented")
161 }
162 func (UnimplementedApiHubCurateServer) UpdateCuration(context.Context, *UpdateCurationRequest) (*Curation, error) {
163 return nil, status.Errorf(codes.Unimplemented, "method UpdateCuration not implemented")
164 }
165 func (UnimplementedApiHubCurateServer) DeleteCuration(context.Context, *DeleteCurationRequest) (*emptypb.Empty, error) {
166 return nil, status.Errorf(codes.Unimplemented, "method DeleteCuration not implemented")
167 }
168
169 // UnsafeApiHubCurateServer may be embedded to opt out of forward compatibility for this service.
170 // Use of this interface is not recommended, as added methods to ApiHubCurateServer will
171 // result in compilation errors.
172 type UnsafeApiHubCurateServer interface {
173 mustEmbedUnimplementedApiHubCurateServer()
174 }
175
176 func RegisterApiHubCurateServer(s grpc.ServiceRegistrar, srv ApiHubCurateServer) {
177 s.RegisterService(&ApiHubCurate_ServiceDesc, srv)
178 }
179
180 func _ApiHubCurate_CreateCuration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
181 in := new(CreateCurationRequest)
182 if err := dec(in); err != nil {
183 return nil, err
184 }
185 if interceptor == nil {
186 return srv.(ApiHubCurateServer).CreateCuration(ctx, in)
187 }
188 info := &grpc.UnaryServerInfo{
189 Server: srv,
190 FullMethod: ApiHubCurate_CreateCuration_FullMethodName,
191 }
192 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
193 return srv.(ApiHubCurateServer).CreateCuration(ctx, req.(*CreateCurationRequest))
194 }
195 return interceptor(ctx, in, info, handler)
196 }
197
198 func _ApiHubCurate_GetCuration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
199 in := new(GetCurationRequest)
200 if err := dec(in); err != nil {
201 return nil, err
202 }
203 if interceptor == nil {
204 return srv.(ApiHubCurateServer).GetCuration(ctx, in)
205 }
206 info := &grpc.UnaryServerInfo{
207 Server: srv,
208 FullMethod: ApiHubCurate_GetCuration_FullMethodName,
209 }
210 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
211 return srv.(ApiHubCurateServer).GetCuration(ctx, req.(*GetCurationRequest))
212 }
213 return interceptor(ctx, in, info, handler)
214 }
215
216 func _ApiHubCurate_ListCurations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
217 in := new(ListCurationsRequest)
218 if err := dec(in); err != nil {
219 return nil, err
220 }
221 if interceptor == nil {
222 return srv.(ApiHubCurateServer).ListCurations(ctx, in)
223 }
224 info := &grpc.UnaryServerInfo{
225 Server: srv,
226 FullMethod: ApiHubCurate_ListCurations_FullMethodName,
227 }
228 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
229 return srv.(ApiHubCurateServer).ListCurations(ctx, req.(*ListCurationsRequest))
230 }
231 return interceptor(ctx, in, info, handler)
232 }
233
234 func _ApiHubCurate_UpdateCuration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
235 in := new(UpdateCurationRequest)
236 if err := dec(in); err != nil {
237 return nil, err
238 }
239 if interceptor == nil {
240 return srv.(ApiHubCurateServer).UpdateCuration(ctx, in)
241 }
242 info := &grpc.UnaryServerInfo{
243 Server: srv,
244 FullMethod: ApiHubCurate_UpdateCuration_FullMethodName,
245 }
246 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
247 return srv.(ApiHubCurateServer).UpdateCuration(ctx, req.(*UpdateCurationRequest))
248 }
249 return interceptor(ctx, in, info, handler)
250 }
251
252 func _ApiHubCurate_DeleteCuration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
253 in := new(DeleteCurationRequest)
254 if err := dec(in); err != nil {
255 return nil, err
256 }
257 if interceptor == nil {
258 return srv.(ApiHubCurateServer).DeleteCuration(ctx, in)
259 }
260 info := &grpc.UnaryServerInfo{
261 Server: srv,
262 FullMethod: ApiHubCurate_DeleteCuration_FullMethodName,
263 }
264 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
265 return srv.(ApiHubCurateServer).DeleteCuration(ctx, req.(*DeleteCurationRequest))
266 }
267 return interceptor(ctx, in, info, handler)
268 }
269
270 // ApiHubCurate_ServiceDesc is the grpc.ServiceDesc for ApiHubCurate service.
271 // It's only intended for direct use with grpc.RegisterService,
272 // and not to be introspected or modified (even as a copy)
273 var ApiHubCurate_ServiceDesc = grpc.ServiceDesc{
274 ServiceName: "google.cloud.apihub.v1.ApiHubCurate",
275 HandlerType: (*ApiHubCurateServer)(nil),
276 Methods: []grpc.MethodDesc{
277 {
278 MethodName: "CreateCuration",
279 Handler: _ApiHubCurate_CreateCuration_Handler,
280 },
281 {
282 MethodName: "GetCuration",
283 Handler: _ApiHubCurate_GetCuration_Handler,
284 },
285 {
286 MethodName: "ListCurations",
287 Handler: _ApiHubCurate_ListCurations_Handler,
288 },
289 {
290 MethodName: "UpdateCuration",
291 Handler: _ApiHubCurate_UpdateCuration_Handler,
292 },
293 {
294 MethodName: "DeleteCuration",
295 Handler: _ApiHubCurate_DeleteCuration_Handler,
296 },
297 },
298 Streams: []grpc.StreamDesc{},
299 Metadata: "google/cloud/apihub/v1/curate_service.proto",
300 }