| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 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 |
|
| 32 |
|
| 33 |
|
| 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 |
|
| 43 |
|
| 44 |
|
| 45 |
type SimulatorClient interface { |
| 46 |
|
| 47 |
|
| 48 |
GetReplay(ctx context.Context, in *GetReplayRequest, opts ...grpc.CallOption) (*Replay, error) |
| 49 |
|
| 50 |
|
| 51 |
CreateReplay(ctx context.Context, in *CreateReplayRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) |
| 52 |
|
| 53 |
|
| 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 |
|
| 93 |
|
| 94 |
|
| 95 |
type SimulatorServer interface { |
| 96 |
|
| 97 |
|
| 98 |
GetReplay(context.Context, *GetReplayRequest) (*Replay, error) |
| 99 |
|
| 100 |
|
| 101 |
CreateReplay(context.Context, *CreateReplayRequest) (*longrunningpb.Operation, error) |
| 102 |
|
| 103 |
|
| 104 |
ListReplayResults(context.Context, *ListReplayResultsRequest) (*ListReplayResultsResponse, error) |
| 105 |
} |
| 106 |
|
| 107 |
|
| 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 |
|
| 122 |
|
| 123 |
|
| 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 |
|
| 187 |
|
| 188 |
|
| 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 |
} |