Debian Codegraph @

policysimulator/apiv1/policysimulatorpb/simulator_grpc.pb.go

raw symbols SCIP
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/policysimulator/v1/simulator.proto
20
21 package policysimulatorpb
22
23 import (
24 longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
25 context "context"
26 grpc "google.golang.org/grpc"
27 codes "google.golang.org/grpc/codes"
28 status "google.golang.org/grpc/status"
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 Simulator_GetReplay_FullMethodName = "/google.cloud.policysimulator.v1.Simulator/GetReplay"
38 Simulator_CreateReplay_FullMethodName = "/google.cloud.policysimulator.v1.Simulator/CreateReplay"
39 Simulator_ListReplayResults_FullMethodName = "/google.cloud.policysimulator.v1.Simulator/ListReplayResults"
40 )
41
42 // SimulatorClient is the client API for Simulator service.
43 //
44 // 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.
45 type SimulatorClient interface {
46 // Gets the specified [Replay][google.cloud.policysimulator.v1.Replay]. Each
47 // `Replay` is available for at least 7 days.
48 GetReplay(ctx context.Context, in *GetReplayRequest, opts ...grpc.CallOption) (*Replay, error)
49 // Creates and starts a [Replay][google.cloud.policysimulator.v1.Replay] using
50 // the given [ReplayConfig][google.cloud.policysimulator.v1.ReplayConfig].
51 CreateReplay(ctx context.Context, in *CreateReplayRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error)
52 // Lists the results of running a
53 // [Replay][google.cloud.policysimulator.v1.Replay].
54 ListReplayResults(ctx context.Context, in *ListReplayResultsRequest, opts ...grpc.CallOption) (*ListReplayResultsResponse, error)
55 }
56
57 type simulatorClient struct {
58 cc grpc.ClientConnInterface
59 }
60
61 func NewSimulatorClient(cc grpc.ClientConnInterface) SimulatorClient {
62 return &simulatorClient{cc}
63 }
64
65 func (c *simulatorClient) GetReplay(ctx context.Context, in *GetReplayRequest, opts ...grpc.CallOption) (*Replay, error) {
66 out := new(Replay)
67 err := c.cc.Invoke(ctx, Simulator_GetReplay_FullMethodName, in, out, opts...)
68 if err != nil {
69 return nil, err
70 }
71 return out, nil
72 }
73
74 func (c *simulatorClient) CreateReplay(ctx context.Context, in *CreateReplayRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) {
75 out := new(longrunningpb.Operation)
76 err := c.cc.Invoke(ctx, Simulator_CreateReplay_FullMethodName, in, out, opts...)
77 if err != nil {
78 return nil, err
79 }
80 return out, nil
81 }
82
83 func (c *simulatorClient) ListReplayResults(ctx context.Context, in *ListReplayResultsRequest, opts ...grpc.CallOption) (*ListReplayResultsResponse, error) {
84 out := new(ListReplayResultsResponse)
85 err := c.cc.Invoke(ctx, Simulator_ListReplayResults_FullMethodName, in, out, opts...)
86 if err != nil {
87 return nil, err
88 }
89 return out, nil
90 }
91
92 // SimulatorServer is the server API for Simulator service.
93 // All implementations should embed UnimplementedSimulatorServer
94 // for forward compatibility
95 type SimulatorServer interface {
96 // Gets the specified [Replay][google.cloud.policysimulator.v1.Replay]. Each
97 // `Replay` is available for at least 7 days.
98 GetReplay(context.Context, *GetReplayRequest) (*Replay, error)
99 // Creates and starts a [Replay][google.cloud.policysimulator.v1.Replay] using
100 // the given [ReplayConfig][google.cloud.policysimulator.v1.ReplayConfig].
101 CreateReplay(context.Context, *CreateReplayRequest) (*longrunningpb.Operation, error)
102 // Lists the results of running a
103 // [Replay][google.cloud.policysimulator.v1.Replay].
104 ListReplayResults(context.Context, *ListReplayResultsRequest) (*ListReplayResultsResponse, error)
105 }
106
107 // UnimplementedSimulatorServer should be embedded to have forward compatible implementations.
108 type UnimplementedSimulatorServer struct {
109 }
110
111 func (UnimplementedSimulatorServer) GetReplay(context.Context, *GetReplayRequest) (*Replay, error) {
112 return nil, status.Errorf(codes.Unimplemented, "method GetReplay not implemented")
113 }
114 func (UnimplementedSimulatorServer) CreateReplay(context.Context, *CreateReplayRequest) (*longrunningpb.Operation, error) {
115 return nil, status.Errorf(codes.Unimplemented, "method CreateReplay not implemented")
116 }
117 func (UnimplementedSimulatorServer) ListReplayResults(context.Context, *ListReplayResultsRequest) (*ListReplayResultsResponse, error) {
118 return nil, status.Errorf(codes.Unimplemented, "method ListReplayResults not implemented")
119 }
120
121 // UnsafeSimulatorServer may be embedded to opt out of forward compatibility for this service.
122 // Use of this interface is not recommended, as added methods to SimulatorServer will
123 // result in compilation errors.
124 type UnsafeSimulatorServer interface {
125 mustEmbedUnimplementedSimulatorServer()
126 }
127
128 func RegisterSimulatorServer(s grpc.ServiceRegistrar, srv SimulatorServer) {
129 s.RegisterService(&Simulator_ServiceDesc, srv)
130 }
131
132 func _Simulator_GetReplay_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
133 in := new(GetReplayRequest)
134 if err := dec(in); err != nil {
135 return nil, err
136 }
137 if interceptor == nil {
138 return srv.(SimulatorServer).GetReplay(ctx, in)
139 }
140 info := &grpc.UnaryServerInfo{
141 Server: srv,
142 FullMethod: Simulator_GetReplay_FullMethodName,
143 }
144 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
145 return srv.(SimulatorServer).GetReplay(ctx, req.(*GetReplayRequest))
146 }
147 return interceptor(ctx, in, info, handler)
148 }
149
150 func _Simulator_CreateReplay_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
151 in := new(CreateReplayRequest)
152 if err := dec(in); err != nil {
153 return nil, err
154 }
155 if interceptor == nil {
156 return srv.(SimulatorServer).CreateReplay(ctx, in)
157 }
158 info := &grpc.UnaryServerInfo{
159 Server: srv,
160 FullMethod: Simulator_CreateReplay_FullMethodName,
161 }
162 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
163 return srv.(SimulatorServer).CreateReplay(ctx, req.(*CreateReplayRequest))
164 }
165 return interceptor(ctx, in, info, handler)
166 }
167
168 func _Simulator_ListReplayResults_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
169 in := new(ListReplayResultsRequest)
170 if err := dec(in); err != nil {
171 return nil, err
172 }
173 if interceptor == nil {
174 return srv.(SimulatorServer).ListReplayResults(ctx, in)
175 }
176 info := &grpc.UnaryServerInfo{
177 Server: srv,
178 FullMethod: Simulator_ListReplayResults_FullMethodName,
179 }
180 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
181 return srv.(SimulatorServer).ListReplayResults(ctx, req.(*ListReplayResultsRequest))
182 }
183 return interceptor(ctx, in, info, handler)
184 }
185
186 // Simulator_ServiceDesc is the grpc.ServiceDesc for Simulator service.
187 // It's only intended for direct use with grpc.RegisterService,
188 // and not to be introspected or modified (even as a copy)
189 var Simulator_ServiceDesc = grpc.ServiceDesc{
190 ServiceName: "google.cloud.policysimulator.v1.Simulator",
191 HandlerType: (*SimulatorServer)(nil),
192 Methods: []grpc.MethodDesc{
193 {
194 MethodName: "GetReplay",
195 Handler: _Simulator_GetReplay_Handler,
196 },
197 {
198 MethodName: "CreateReplay",
199 Handler: _Simulator_CreateReplay_Handler,
200 },
201 {
202 MethodName: "ListReplayResults",
203 Handler: _Simulator_ListReplayResults_Handler,
204 },
205 },
206 Streams: []grpc.StreamDesc{},
207 Metadata: "google/cloud/policysimulator/v1/simulator.proto",
208 }