Skip to content

Commit 40877ff

Browse files
committed
fix: Bring back auto generated files
1 parent 0fbc4ee commit 40877ff

File tree

6 files changed

+18762
-1
lines changed

6 files changed

+18762
-1
lines changed

.github/workflows/regen.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Generate Python Code from plugin-pb
2+
on:
3+
schedule:
4+
- cron: "0 8 * * *"
5+
workflow_dispatch:
6+
7+
jobs:
8+
regen:
9+
timeout-minutes: 30
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- uses: actions/setup-java@v3
15+
with:
16+
distribution: 'temurin'
17+
java-version: '18'
18+
cache: 'gradle'
19+
- name: Validate Gradle wrapper
20+
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
21+
- name: Generate code
22+
run: |
23+
make clone-proto
24+
make gen-proto
25+
- name: Create Pull Request
26+
uses: peter-evans/create-pull-request@v4
27+
with:
28+
# required so the PR triggers workflow runs
29+
token: ${{ secrets.GH_CQ_BOT }}
30+
branch: fix/gen_proto
31+
base: main
32+
title: "fix: Generate Python Code from `plugin-pb`"
33+
commit-message: "fix: Generate Python Code from `plugin-pb`"
34+
body: This PR was created by a scheduled workflow to regenerate the Python code from `plugin-pb`.
35+
author: cq-bot <[email protected]>
36+
labels: automerge

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ replay_pid*
2828
plugin-pb/
2929

3030
# generated proto files
31-
build/
31+
build/*
32+
!build/generated/
3233

3334
.gradle
3435
.DS_Store
Lines changed: 305 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,305 @@
1+
package cloudquery.discovery.v1;
2+
3+
import static io.grpc.MethodDescriptor.generateFullMethodName;
4+
5+
/**
6+
*/
7+
@javax.annotation.Generated(
8+
value = "by gRPC proto compiler (version 1.57.0)",
9+
comments = "Source: cloudquery/discovery/v1/discovery.proto")
10+
@io.grpc.stub.annotations.GrpcGenerated
11+
public final class DiscoveryGrpc {
12+
13+
private DiscoveryGrpc() {}
14+
15+
public static final java.lang.String SERVICE_NAME = "cloudquery.discovery.v1.Discovery";
16+
17+
// Static method descriptors that strictly reflect the proto.
18+
private static volatile io.grpc.MethodDescriptor<cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Request,
19+
cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Response> getGetVersionsMethod;
20+
21+
@io.grpc.stub.annotations.RpcMethod(
22+
fullMethodName = SERVICE_NAME + '/' + "GetVersions",
23+
requestType = cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Request.class,
24+
responseType = cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Response.class,
25+
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
26+
public static io.grpc.MethodDescriptor<cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Request,
27+
cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Response> getGetVersionsMethod() {
28+
io.grpc.MethodDescriptor<cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Request, cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Response> getGetVersionsMethod;
29+
if ((getGetVersionsMethod = DiscoveryGrpc.getGetVersionsMethod) == null) {
30+
synchronized (DiscoveryGrpc.class) {
31+
if ((getGetVersionsMethod = DiscoveryGrpc.getGetVersionsMethod) == null) {
32+
DiscoveryGrpc.getGetVersionsMethod = getGetVersionsMethod =
33+
io.grpc.MethodDescriptor.<cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Request, cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Response>newBuilder()
34+
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
35+
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetVersions"))
36+
.setSampledToLocalTracing(true)
37+
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
38+
cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Request.getDefaultInstance()))
39+
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
40+
cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Response.getDefaultInstance()))
41+
.setSchemaDescriptor(new DiscoveryMethodDescriptorSupplier("GetVersions"))
42+
.build();
43+
}
44+
}
45+
}
46+
return getGetVersionsMethod;
47+
}
48+
49+
/**
50+
* Creates a new async stub that supports all call types for the service
51+
*/
52+
public static DiscoveryStub newStub(io.grpc.Channel channel) {
53+
io.grpc.stub.AbstractStub.StubFactory<DiscoveryStub> factory =
54+
new io.grpc.stub.AbstractStub.StubFactory<DiscoveryStub>() {
55+
@java.lang.Override
56+
public DiscoveryStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
57+
return new DiscoveryStub(channel, callOptions);
58+
}
59+
};
60+
return DiscoveryStub.newStub(factory, channel);
61+
}
62+
63+
/**
64+
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
65+
*/
66+
public static DiscoveryBlockingStub newBlockingStub(
67+
io.grpc.Channel channel) {
68+
io.grpc.stub.AbstractStub.StubFactory<DiscoveryBlockingStub> factory =
69+
new io.grpc.stub.AbstractStub.StubFactory<DiscoveryBlockingStub>() {
70+
@java.lang.Override
71+
public DiscoveryBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
72+
return new DiscoveryBlockingStub(channel, callOptions);
73+
}
74+
};
75+
return DiscoveryBlockingStub.newStub(factory, channel);
76+
}
77+
78+
/**
79+
* Creates a new ListenableFuture-style stub that supports unary calls on the service
80+
*/
81+
public static DiscoveryFutureStub newFutureStub(
82+
io.grpc.Channel channel) {
83+
io.grpc.stub.AbstractStub.StubFactory<DiscoveryFutureStub> factory =
84+
new io.grpc.stub.AbstractStub.StubFactory<DiscoveryFutureStub>() {
85+
@java.lang.Override
86+
public DiscoveryFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
87+
return new DiscoveryFutureStub(channel, callOptions);
88+
}
89+
};
90+
return DiscoveryFutureStub.newStub(factory, channel);
91+
}
92+
93+
/**
94+
*/
95+
public interface AsyncService {
96+
97+
/**
98+
* <pre>
99+
* Get the name of the plugin
100+
* </pre>
101+
*/
102+
default void getVersions(cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Request request,
103+
io.grpc.stub.StreamObserver<cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Response> responseObserver) {
104+
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetVersionsMethod(), responseObserver);
105+
}
106+
}
107+
108+
/**
109+
* Base class for the server implementation of the service Discovery.
110+
*/
111+
public static abstract class DiscoveryImplBase
112+
implements io.grpc.BindableService, AsyncService {
113+
114+
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
115+
return DiscoveryGrpc.bindService(this);
116+
}
117+
}
118+
119+
/**
120+
* A stub to allow clients to do asynchronous rpc calls to service Discovery.
121+
*/
122+
public static final class DiscoveryStub
123+
extends io.grpc.stub.AbstractAsyncStub<DiscoveryStub> {
124+
private DiscoveryStub(
125+
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
126+
super(channel, callOptions);
127+
}
128+
129+
@java.lang.Override
130+
protected DiscoveryStub build(
131+
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
132+
return new DiscoveryStub(channel, callOptions);
133+
}
134+
135+
/**
136+
* <pre>
137+
* Get the name of the plugin
138+
* </pre>
139+
*/
140+
public void getVersions(cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Request request,
141+
io.grpc.stub.StreamObserver<cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Response> responseObserver) {
142+
io.grpc.stub.ClientCalls.asyncUnaryCall(
143+
getChannel().newCall(getGetVersionsMethod(), getCallOptions()), request, responseObserver);
144+
}
145+
}
146+
147+
/**
148+
* A stub to allow clients to do synchronous rpc calls to service Discovery.
149+
*/
150+
public static final class DiscoveryBlockingStub
151+
extends io.grpc.stub.AbstractBlockingStub<DiscoveryBlockingStub> {
152+
private DiscoveryBlockingStub(
153+
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
154+
super(channel, callOptions);
155+
}
156+
157+
@java.lang.Override
158+
protected DiscoveryBlockingStub build(
159+
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
160+
return new DiscoveryBlockingStub(channel, callOptions);
161+
}
162+
163+
/**
164+
* <pre>
165+
* Get the name of the plugin
166+
* </pre>
167+
*/
168+
public cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Response getVersions(cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Request request) {
169+
return io.grpc.stub.ClientCalls.blockingUnaryCall(
170+
getChannel(), getGetVersionsMethod(), getCallOptions(), request);
171+
}
172+
}
173+
174+
/**
175+
* A stub to allow clients to do ListenableFuture-style rpc calls to service Discovery.
176+
*/
177+
public static final class DiscoveryFutureStub
178+
extends io.grpc.stub.AbstractFutureStub<DiscoveryFutureStub> {
179+
private DiscoveryFutureStub(
180+
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
181+
super(channel, callOptions);
182+
}
183+
184+
@java.lang.Override
185+
protected DiscoveryFutureStub build(
186+
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
187+
return new DiscoveryFutureStub(channel, callOptions);
188+
}
189+
190+
/**
191+
* <pre>
192+
* Get the name of the plugin
193+
* </pre>
194+
*/
195+
public com.google.common.util.concurrent.ListenableFuture<cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Response> getVersions(
196+
cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Request request) {
197+
return io.grpc.stub.ClientCalls.futureUnaryCall(
198+
getChannel().newCall(getGetVersionsMethod(), getCallOptions()), request);
199+
}
200+
}
201+
202+
private static final int METHODID_GET_VERSIONS = 0;
203+
204+
private static final class MethodHandlers<Req, Resp> implements
205+
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
206+
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
207+
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
208+
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
209+
private final AsyncService serviceImpl;
210+
private final int methodId;
211+
212+
MethodHandlers(AsyncService serviceImpl, int methodId) {
213+
this.serviceImpl = serviceImpl;
214+
this.methodId = methodId;
215+
}
216+
217+
@java.lang.Override
218+
@java.lang.SuppressWarnings("unchecked")
219+
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
220+
switch (methodId) {
221+
case METHODID_GET_VERSIONS:
222+
serviceImpl.getVersions((cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Request) request,
223+
(io.grpc.stub.StreamObserver<cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Response>) responseObserver);
224+
break;
225+
default:
226+
throw new AssertionError();
227+
}
228+
}
229+
230+
@java.lang.Override
231+
@java.lang.SuppressWarnings("unchecked")
232+
public io.grpc.stub.StreamObserver<Req> invoke(
233+
io.grpc.stub.StreamObserver<Resp> responseObserver) {
234+
switch (methodId) {
235+
default:
236+
throw new AssertionError();
237+
}
238+
}
239+
}
240+
241+
public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
242+
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
243+
.addMethod(
244+
getGetVersionsMethod(),
245+
io.grpc.stub.ServerCalls.asyncUnaryCall(
246+
new MethodHandlers<
247+
cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Request,
248+
cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Response>(
249+
service, METHODID_GET_VERSIONS)))
250+
.build();
251+
}
252+
253+
private static abstract class DiscoveryBaseDescriptorSupplier
254+
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
255+
DiscoveryBaseDescriptorSupplier() {}
256+
257+
@java.lang.Override
258+
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
259+
return cloudquery.discovery.v1.DiscoveryOuterClass.getDescriptor();
260+
}
261+
262+
@java.lang.Override
263+
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
264+
return getFileDescriptor().findServiceByName("Discovery");
265+
}
266+
}
267+
268+
private static final class DiscoveryFileDescriptorSupplier
269+
extends DiscoveryBaseDescriptorSupplier {
270+
DiscoveryFileDescriptorSupplier() {}
271+
}
272+
273+
private static final class DiscoveryMethodDescriptorSupplier
274+
extends DiscoveryBaseDescriptorSupplier
275+
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
276+
private final java.lang.String methodName;
277+
278+
DiscoveryMethodDescriptorSupplier(java.lang.String methodName) {
279+
this.methodName = methodName;
280+
}
281+
282+
@java.lang.Override
283+
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
284+
return getServiceDescriptor().findMethodByName(methodName);
285+
}
286+
}
287+
288+
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
289+
290+
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
291+
io.grpc.ServiceDescriptor result = serviceDescriptor;
292+
if (result == null) {
293+
synchronized (DiscoveryGrpc.class) {
294+
result = serviceDescriptor;
295+
if (result == null) {
296+
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
297+
.setSchemaDescriptor(new DiscoveryFileDescriptorSupplier())
298+
.addMethod(getGetVersionsMethod())
299+
.build();
300+
}
301+
}
302+
}
303+
return result;
304+
}
305+
}

0 commit comments

Comments
 (0)