Debian Codegraph @

dialogflow/cx/apiv3beta1/cxpb/webhook_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/dialogflow/cx/v3beta1/webhook.proto
20
21 package cxpb
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 Webhooks_ListWebhooks_FullMethodName = "/google.cloud.dialogflow.cx.v3beta1.Webhooks/ListWebhooks"
38 Webhooks_GetWebhook_FullMethodName = "/google.cloud.dialogflow.cx.v3beta1.Webhooks/GetWebhook"
39 Webhooks_CreateWebhook_FullMethodName = "/google.cloud.dialogflow.cx.v3beta1.Webhooks/CreateWebhook"
40 Webhooks_UpdateWebhook_FullMethodName = "/google.cloud.dialogflow.cx.v3beta1.Webhooks/UpdateWebhook"
41 Webhooks_DeleteWebhook_FullMethodName = "/google.cloud.dialogflow.cx.v3beta1.Webhooks/DeleteWebhook"
42 )
43
44 // WebhooksClient is the client API for Webhooks 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 WebhooksClient interface {
48 // Returns the list of all webhooks in the specified agent.
49 ListWebhooks(ctx context.Context, in *ListWebhooksRequest, opts ...grpc.CallOption) (*ListWebhooksResponse, error)
50 // Retrieves the specified webhook.
51 GetWebhook(ctx context.Context, in *GetWebhookRequest, opts ...grpc.CallOption) (*Webhook, error)
52 // Creates a webhook in the specified agent.
53 CreateWebhook(ctx context.Context, in *CreateWebhookRequest, opts ...grpc.CallOption) (*Webhook, error)
54 // Updates the specified webhook.
55 UpdateWebhook(ctx context.Context, in *UpdateWebhookRequest, opts ...grpc.CallOption) (*Webhook, error)
56 // Deletes the specified webhook.
57 DeleteWebhook(ctx context.Context, in *DeleteWebhookRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
58 }
59
60 type webhooksClient struct {
61 cc grpc.ClientConnInterface
62 }
63
64 func NewWebhooksClient(cc grpc.ClientConnInterface) WebhooksClient {
65 return &webhooksClient{cc}
66 }
67
68 func (c *webhooksClient) ListWebhooks(ctx context.Context, in *ListWebhooksRequest, opts ...grpc.CallOption) (*ListWebhooksResponse, error) {
69 out := new(ListWebhooksResponse)
70 err := c.cc.Invoke(ctx, Webhooks_ListWebhooks_FullMethodName, in, out, opts...)
71 if err != nil {
72 return nil, err
73 }
74 return out, nil
75 }
76
77 func (c *webhooksClient) GetWebhook(ctx context.Context, in *GetWebhookRequest, opts ...grpc.CallOption) (*Webhook, error) {
78 out := new(Webhook)
79 err := c.cc.Invoke(ctx, Webhooks_GetWebhook_FullMethodName, in, out, opts...)
80 if err != nil {
81 return nil, err
82 }
83 return out, nil
84 }
85
86 func (c *webhooksClient) CreateWebhook(ctx context.Context, in *CreateWebhookRequest, opts ...grpc.CallOption) (*Webhook, error) {
87 out := new(Webhook)
88 err := c.cc.Invoke(ctx, Webhooks_CreateWebhook_FullMethodName, in, out, opts...)
89 if err != nil {
90 return nil, err
91 }
92 return out, nil
93 }
94
95 func (c *webhooksClient) UpdateWebhook(ctx context.Context, in *UpdateWebhookRequest, opts ...grpc.CallOption) (*Webhook, error) {
96 out := new(Webhook)
97 err := c.cc.Invoke(ctx, Webhooks_UpdateWebhook_FullMethodName, in, out, opts...)
98 if err != nil {
99 return nil, err
100 }
101 return out, nil
102 }
103
104 func (c *webhooksClient) DeleteWebhook(ctx context.Context, in *DeleteWebhookRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
105 out := new(emptypb.Empty)
106 err := c.cc.Invoke(ctx, Webhooks_DeleteWebhook_FullMethodName, in, out, opts...)
107 if err != nil {
108 return nil, err
109 }
110 return out, nil
111 }
112
113 // WebhooksServer is the server API for Webhooks service.
114 // All implementations should embed UnimplementedWebhooksServer
115 // for forward compatibility
116 type WebhooksServer interface {
117 // Returns the list of all webhooks in the specified agent.
118 ListWebhooks(context.Context, *ListWebhooksRequest) (*ListWebhooksResponse, error)
119 // Retrieves the specified webhook.
120 GetWebhook(context.Context, *GetWebhookRequest) (*Webhook, error)
121 // Creates a webhook in the specified agent.
122 CreateWebhook(context.Context, *CreateWebhookRequest) (*Webhook, error)
123 // Updates the specified webhook.
124 UpdateWebhook(context.Context, *UpdateWebhookRequest) (*Webhook, error)
125 // Deletes the specified webhook.
126 DeleteWebhook(context.Context, *DeleteWebhookRequest) (*emptypb.Empty, error)
127 }
128
129 // UnimplementedWebhooksServer should be embedded to have forward compatible implementations.
130 type UnimplementedWebhooksServer struct {
131 }
132
133 func (UnimplementedWebhooksServer) ListWebhooks(context.Context, *ListWebhooksRequest) (*ListWebhooksResponse, error) {
134 return nil, status.Errorf(codes.Unimplemented, "method ListWebhooks not implemented")
135 }
136 func (UnimplementedWebhooksServer) GetWebhook(context.Context, *GetWebhookRequest) (*Webhook, error) {
137 return nil, status.Errorf(codes.Unimplemented, "method GetWebhook not implemented")
138 }
139 func (UnimplementedWebhooksServer) CreateWebhook(context.Context, *CreateWebhookRequest) (*Webhook, error) {
140 return nil, status.Errorf(codes.Unimplemented, "method CreateWebhook not implemented")
141 }
142 func (UnimplementedWebhooksServer) UpdateWebhook(context.Context, *UpdateWebhookRequest) (*Webhook, error) {
143 return nil, status.Errorf(codes.Unimplemented, "method UpdateWebhook not implemented")
144 }
145 func (UnimplementedWebhooksServer) DeleteWebhook(context.Context, *DeleteWebhookRequest) (*emptypb.Empty, error) {
146 return nil, status.Errorf(codes.Unimplemented, "method DeleteWebhook not implemented")
147 }
148
149 // UnsafeWebhooksServer may be embedded to opt out of forward compatibility for this service.
150 // Use of this interface is not recommended, as added methods to WebhooksServer will
151 // result in compilation errors.
152 type UnsafeWebhooksServer interface {
153 mustEmbedUnimplementedWebhooksServer()
154 }
155
156 func RegisterWebhooksServer(s grpc.ServiceRegistrar, srv WebhooksServer) {
157 s.RegisterService(&Webhooks_ServiceDesc, srv)
158 }
159
160 func _Webhooks_ListWebhooks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
161 in := new(ListWebhooksRequest)
162 if err := dec(in); err != nil {
163 return nil, err
164 }
165 if interceptor == nil {
166 return srv.(WebhooksServer).ListWebhooks(ctx, in)
167 }
168 info := &grpc.UnaryServerInfo{
169 Server: srv,
170 FullMethod: Webhooks_ListWebhooks_FullMethodName,
171 }
172 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
173 return srv.(WebhooksServer).ListWebhooks(ctx, req.(*ListWebhooksRequest))
174 }
175 return interceptor(ctx, in, info, handler)
176 }
177
178 func _Webhooks_GetWebhook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
179 in := new(GetWebhookRequest)
180 if err := dec(in); err != nil {
181 return nil, err
182 }
183 if interceptor == nil {
184 return srv.(WebhooksServer).GetWebhook(ctx, in)
185 }
186 info := &grpc.UnaryServerInfo{
187 Server: srv,
188 FullMethod: Webhooks_GetWebhook_FullMethodName,
189 }
190 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
191 return srv.(WebhooksServer).GetWebhook(ctx, req.(*GetWebhookRequest))
192 }
193 return interceptor(ctx, in, info, handler)
194 }
195
196 func _Webhooks_CreateWebhook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
197 in := new(CreateWebhookRequest)
198 if err := dec(in); err != nil {
199 return nil, err
200 }
201 if interceptor == nil {
202 return srv.(WebhooksServer).CreateWebhook(ctx, in)
203 }
204 info := &grpc.UnaryServerInfo{
205 Server: srv,
206 FullMethod: Webhooks_CreateWebhook_FullMethodName,
207 }
208 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
209 return srv.(WebhooksServer).CreateWebhook(ctx, req.(*CreateWebhookRequest))
210 }
211 return interceptor(ctx, in, info, handler)
212 }
213
214 func _Webhooks_UpdateWebhook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
215 in := new(UpdateWebhookRequest)
216 if err := dec(in); err != nil {
217 return nil, err
218 }
219 if interceptor == nil {
220 return srv.(WebhooksServer).UpdateWebhook(ctx, in)
221 }
222 info := &grpc.UnaryServerInfo{
223 Server: srv,
224 FullMethod: Webhooks_UpdateWebhook_FullMethodName,
225 }
226 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
227 return srv.(WebhooksServer).UpdateWebhook(ctx, req.(*UpdateWebhookRequest))
228 }
229 return interceptor(ctx, in, info, handler)
230 }
231
232 func _Webhooks_DeleteWebhook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
233 in := new(DeleteWebhookRequest)
234 if err := dec(in); err != nil {
235 return nil, err
236 }
237 if interceptor == nil {
238 return srv.(WebhooksServer).DeleteWebhook(ctx, in)
239 }
240 info := &grpc.UnaryServerInfo{
241 Server: srv,
242 FullMethod: Webhooks_DeleteWebhook_FullMethodName,
243 }
244 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
245 return srv.(WebhooksServer).DeleteWebhook(ctx, req.(*DeleteWebhookRequest))
246 }
247 return interceptor(ctx, in, info, handler)
248 }
249
250 // Webhooks_ServiceDesc is the grpc.ServiceDesc for Webhooks service.
251 // It's only intended for direct use with grpc.RegisterService,
252 // and not to be introspected or modified (even as a copy)
253 var Webhooks_ServiceDesc = grpc.ServiceDesc{
254 ServiceName: "google.cloud.dialogflow.cx.v3beta1.Webhooks",
255 HandlerType: (*WebhooksServer)(nil),
256 Methods: []grpc.MethodDesc{
257 {
258 MethodName: "ListWebhooks",
259 Handler: _Webhooks_ListWebhooks_Handler,
260 },
261 {
262 MethodName: "GetWebhook",
263 Handler: _Webhooks_GetWebhook_Handler,
264 },
265 {
266 MethodName: "CreateWebhook",
267 Handler: _Webhooks_CreateWebhook_Handler,
268 },
269 {
270 MethodName: "UpdateWebhook",
271 Handler: _Webhooks_UpdateWebhook_Handler,
272 },
273 {
274 MethodName: "DeleteWebhook",
275 Handler: _Webhooks_DeleteWebhook_Handler,
276 },
277 },
278 Streams: []grpc.StreamDesc{},
279 Metadata: "google/cloud/dialogflow/cx/v3beta1/webhook.proto",
280 }