Debian Codegraph @

dialogflow/cx/apiv3beta1/cxpb/example_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/example.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 Examples_CreateExample_FullMethodName = "/google.cloud.dialogflow.cx.v3beta1.Examples/CreateExample"
38 Examples_DeleteExample_FullMethodName = "/google.cloud.dialogflow.cx.v3beta1.Examples/DeleteExample"
39 Examples_ListExamples_FullMethodName = "/google.cloud.dialogflow.cx.v3beta1.Examples/ListExamples"
40 Examples_GetExample_FullMethodName = "/google.cloud.dialogflow.cx.v3beta1.Examples/GetExample"
41 Examples_UpdateExample_FullMethodName = "/google.cloud.dialogflow.cx.v3beta1.Examples/UpdateExample"
42 )
43
44 // ExamplesClient is the client API for Examples 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 ExamplesClient interface {
48 // Creates an example in the specified playbook.
49 CreateExample(ctx context.Context, in *CreateExampleRequest, opts ...grpc.CallOption) (*Example, error)
50 // Deletes the specified example.
51 DeleteExample(ctx context.Context, in *DeleteExampleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
52 // Returns a list of examples in the specified playbook.
53 ListExamples(ctx context.Context, in *ListExamplesRequest, opts ...grpc.CallOption) (*ListExamplesResponse, error)
54 // Retrieves the specified example.
55 GetExample(ctx context.Context, in *GetExampleRequest, opts ...grpc.CallOption) (*Example, error)
56 // Update the specified example.
57 UpdateExample(ctx context.Context, in *UpdateExampleRequest, opts ...grpc.CallOption) (*Example, error)
58 }
59
60 type examplesClient struct {
61 cc grpc.ClientConnInterface
62 }
63
64 func NewExamplesClient(cc grpc.ClientConnInterface) ExamplesClient {
65 return &examplesClient{cc}
66 }
67
68 func (c *examplesClient) CreateExample(ctx context.Context, in *CreateExampleRequest, opts ...grpc.CallOption) (*Example, error) {
69 out := new(Example)
70 err := c.cc.Invoke(ctx, Examples_CreateExample_FullMethodName, in, out, opts...)
71 if err != nil {
72 return nil, err
73 }
74 return out, nil
75 }
76
77 func (c *examplesClient) DeleteExample(ctx context.Context, in *DeleteExampleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
78 out := new(emptypb.Empty)
79 err := c.cc.Invoke(ctx, Examples_DeleteExample_FullMethodName, in, out, opts...)
80 if err != nil {
81 return nil, err
82 }
83 return out, nil
84 }
85
86 func (c *examplesClient) ListExamples(ctx context.Context, in *ListExamplesRequest, opts ...grpc.CallOption) (*ListExamplesResponse, error) {
87 out := new(ListExamplesResponse)
88 err := c.cc.Invoke(ctx, Examples_ListExamples_FullMethodName, in, out, opts...)
89 if err != nil {
90 return nil, err
91 }
92 return out, nil
93 }
94
95 func (c *examplesClient) GetExample(ctx context.Context, in *GetExampleRequest, opts ...grpc.CallOption) (*Example, error) {
96 out := new(Example)
97 err := c.cc.Invoke(ctx, Examples_GetExample_FullMethodName, in, out, opts...)
98 if err != nil {
99 return nil, err
100 }
101 return out, nil
102 }
103
104 func (c *examplesClient) UpdateExample(ctx context.Context, in *UpdateExampleRequest, opts ...grpc.CallOption) (*Example, error) {
105 out := new(Example)
106 err := c.cc.Invoke(ctx, Examples_UpdateExample_FullMethodName, in, out, opts...)
107 if err != nil {
108 return nil, err
109 }
110 return out, nil
111 }
112
113 // ExamplesServer is the server API for Examples service.
114 // All implementations should embed UnimplementedExamplesServer
115 // for forward compatibility
116 type ExamplesServer interface {
117 // Creates an example in the specified playbook.
118 CreateExample(context.Context, *CreateExampleRequest) (*Example, error)
119 // Deletes the specified example.
120 DeleteExample(context.Context, *DeleteExampleRequest) (*emptypb.Empty, error)
121 // Returns a list of examples in the specified playbook.
122 ListExamples(context.Context, *ListExamplesRequest) (*ListExamplesResponse, error)
123 // Retrieves the specified example.
124 GetExample(context.Context, *GetExampleRequest) (*Example, error)
125 // Update the specified example.
126 UpdateExample(context.Context, *UpdateExampleRequest) (*Example, error)
127 }
128
129 // UnimplementedExamplesServer should be embedded to have forward compatible implementations.
130 type UnimplementedExamplesServer struct {
131 }
132
133 func (UnimplementedExamplesServer) CreateExample(context.Context, *CreateExampleRequest) (*Example, error) {
134 return nil, status.Errorf(codes.Unimplemented, "method CreateExample not implemented")
135 }
136 func (UnimplementedExamplesServer) DeleteExample(context.Context, *DeleteExampleRequest) (*emptypb.Empty, error) {
137 return nil, status.Errorf(codes.Unimplemented, "method DeleteExample not implemented")
138 }
139 func (UnimplementedExamplesServer) ListExamples(context.Context, *ListExamplesRequest) (*ListExamplesResponse, error) {
140 return nil, status.Errorf(codes.Unimplemented, "method ListExamples not implemented")
141 }
142 func (UnimplementedExamplesServer) GetExample(context.Context, *GetExampleRequest) (*Example, error) {
143 return nil, status.Errorf(codes.Unimplemented, "method GetExample not implemented")
144 }
145 func (UnimplementedExamplesServer) UpdateExample(context.Context, *UpdateExampleRequest) (*Example, error) {
146 return nil, status.Errorf(codes.Unimplemented, "method UpdateExample not implemented")
147 }
148
149 // UnsafeExamplesServer may be embedded to opt out of forward compatibility for this service.
150 // Use of this interface is not recommended, as added methods to ExamplesServer will
151 // result in compilation errors.
152 type UnsafeExamplesServer interface {
153 mustEmbedUnimplementedExamplesServer()
154 }
155
156 func RegisterExamplesServer(s grpc.ServiceRegistrar, srv ExamplesServer) {
157 s.RegisterService(&Examples_ServiceDesc, srv)
158 }
159
160 func _Examples_CreateExample_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
161 in := new(CreateExampleRequest)
162 if err := dec(in); err != nil {
163 return nil, err
164 }
165 if interceptor == nil {
166 return srv.(ExamplesServer).CreateExample(ctx, in)
167 }
168 info := &grpc.UnaryServerInfo{
169 Server: srv,
170 FullMethod: Examples_CreateExample_FullMethodName,
171 }
172 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
173 return srv.(ExamplesServer).CreateExample(ctx, req.(*CreateExampleRequest))
174 }
175 return interceptor(ctx, in, info, handler)
176 }
177
178 func _Examples_DeleteExample_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
179 in := new(DeleteExampleRequest)
180 if err := dec(in); err != nil {
181 return nil, err
182 }
183 if interceptor == nil {
184 return srv.(ExamplesServer).DeleteExample(ctx, in)
185 }
186 info := &grpc.UnaryServerInfo{
187 Server: srv,
188 FullMethod: Examples_DeleteExample_FullMethodName,
189 }
190 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
191 return srv.(ExamplesServer).DeleteExample(ctx, req.(*DeleteExampleRequest))
192 }
193 return interceptor(ctx, in, info, handler)
194 }
195
196 func _Examples_ListExamples_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
197 in := new(ListExamplesRequest)
198 if err := dec(in); err != nil {
199 return nil, err
200 }
201 if interceptor == nil {
202 return srv.(ExamplesServer).ListExamples(ctx, in)
203 }
204 info := &grpc.UnaryServerInfo{
205 Server: srv,
206 FullMethod: Examples_ListExamples_FullMethodName,
207 }
208 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
209 return srv.(ExamplesServer).ListExamples(ctx, req.(*ListExamplesRequest))
210 }
211 return interceptor(ctx, in, info, handler)
212 }
213
214 func _Examples_GetExample_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
215 in := new(GetExampleRequest)
216 if err := dec(in); err != nil {
217 return nil, err
218 }
219 if interceptor == nil {
220 return srv.(ExamplesServer).GetExample(ctx, in)
221 }
222 info := &grpc.UnaryServerInfo{
223 Server: srv,
224 FullMethod: Examples_GetExample_FullMethodName,
225 }
226 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
227 return srv.(ExamplesServer).GetExample(ctx, req.(*GetExampleRequest))
228 }
229 return interceptor(ctx, in, info, handler)
230 }
231
232 func _Examples_UpdateExample_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
233 in := new(UpdateExampleRequest)
234 if err := dec(in); err != nil {
235 return nil, err
236 }
237 if interceptor == nil {
238 return srv.(ExamplesServer).UpdateExample(ctx, in)
239 }
240 info := &grpc.UnaryServerInfo{
241 Server: srv,
242 FullMethod: Examples_UpdateExample_FullMethodName,
243 }
244 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
245 return srv.(ExamplesServer).UpdateExample(ctx, req.(*UpdateExampleRequest))
246 }
247 return interceptor(ctx, in, info, handler)
248 }
249
250 // Examples_ServiceDesc is the grpc.ServiceDesc for Examples 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 Examples_ServiceDesc = grpc.ServiceDesc{
254 ServiceName: "google.cloud.dialogflow.cx.v3beta1.Examples",
255 HandlerType: (*ExamplesServer)(nil),
256 Methods: []grpc.MethodDesc{
257 {
258 MethodName: "CreateExample",
259 Handler: _Examples_CreateExample_Handler,
260 },
261 {
262 MethodName: "DeleteExample",
263 Handler: _Examples_DeleteExample_Handler,
264 },
265 {
266 MethodName: "ListExamples",
267 Handler: _Examples_ListExamples_Handler,
268 },
269 {
270 MethodName: "GetExample",
271 Handler: _Examples_GetExample_Handler,
272 },
273 {
274 MethodName: "UpdateExample",
275 Handler: _Examples_UpdateExample_Handler,
276 },
277 },
278 Streams: []grpc.StreamDesc{},
279 Metadata: "google/cloud/dialogflow/cx/v3beta1/example.proto",
280 }