Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.

Commit 8770abd

Browse files
Merge dc0abb7 into 0dbe987
2 parents 0dbe987 + dc0abb7 commit 8770abd

File tree

4 files changed

+100
-14
lines changed

4 files changed

+100
-14
lines changed

google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/GrpcCloudFunctionsServiceStub.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,68 +459,83 @@ public GrpcOperationsStub getOperationsStub() {
459459
return operationsStub;
460460
}
461461

462+
@Override
462463
public UnaryCallable<ListFunctionsRequest, ListFunctionsResponse> listFunctionsCallable() {
463464
return listFunctionsCallable;
464465
}
465466

467+
@Override
466468
public UnaryCallable<ListFunctionsRequest, ListFunctionsPagedResponse>
467469
listFunctionsPagedCallable() {
468470
return listFunctionsPagedCallable;
469471
}
470472

473+
@Override
471474
public UnaryCallable<GetFunctionRequest, CloudFunction> getFunctionCallable() {
472475
return getFunctionCallable;
473476
}
474477

478+
@Override
475479
public UnaryCallable<CreateFunctionRequest, Operation> createFunctionCallable() {
476480
return createFunctionCallable;
477481
}
478482

483+
@Override
479484
public OperationCallable<CreateFunctionRequest, CloudFunction, OperationMetadataV1>
480485
createFunctionOperationCallable() {
481486
return createFunctionOperationCallable;
482487
}
483488

489+
@Override
484490
public UnaryCallable<UpdateFunctionRequest, Operation> updateFunctionCallable() {
485491
return updateFunctionCallable;
486492
}
487493

494+
@Override
488495
public OperationCallable<UpdateFunctionRequest, CloudFunction, OperationMetadataV1>
489496
updateFunctionOperationCallable() {
490497
return updateFunctionOperationCallable;
491498
}
492499

500+
@Override
493501
public UnaryCallable<DeleteFunctionRequest, Operation> deleteFunctionCallable() {
494502
return deleteFunctionCallable;
495503
}
496504

505+
@Override
497506
public OperationCallable<DeleteFunctionRequest, Empty, OperationMetadataV1>
498507
deleteFunctionOperationCallable() {
499508
return deleteFunctionOperationCallable;
500509
}
501510

511+
@Override
502512
public UnaryCallable<CallFunctionRequest, CallFunctionResponse> callFunctionCallable() {
503513
return callFunctionCallable;
504514
}
505515

516+
@Override
506517
public UnaryCallable<GenerateUploadUrlRequest, GenerateUploadUrlResponse>
507518
generateUploadUrlCallable() {
508519
return generateUploadUrlCallable;
509520
}
510521

522+
@Override
511523
public UnaryCallable<GenerateDownloadUrlRequest, GenerateDownloadUrlResponse>
512524
generateDownloadUrlCallable() {
513525
return generateDownloadUrlCallable;
514526
}
515527

528+
@Override
516529
public UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() {
517530
return setIamPolicyCallable;
518531
}
519532

533+
@Override
520534
public UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
521535
return getIamPolicyCallable;
522536
}
523537

538+
@Override
524539
public UnaryCallable<TestIamPermissionsRequest, TestIamPermissionsResponse>
525540
testIamPermissionsCallable() {
526541
return testIamPermissionsCallable;

google-cloud-functions/src/test/java/com/google/cloud/functions/v1/CloudFunctionsServiceClientTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ public void getFunctionTest() throws Exception {
158158
CloudFunction.newBuilder()
159159
.setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
160160
.setDescription("description-1724546052")
161+
.setStatus(CloudFunctionStatus.forNumber(0))
161162
.setEntryPoint("entryPoint-1979329474")
162163
.setRuntime("runtime1550962648")
163164
.setTimeout(Duration.newBuilder().build())
@@ -210,6 +211,7 @@ public void getFunctionTest2() throws Exception {
210211
CloudFunction.newBuilder()
211212
.setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
212213
.setDescription("description-1724546052")
214+
.setStatus(CloudFunctionStatus.forNumber(0))
213215
.setEntryPoint("entryPoint-1979329474")
214216
.setRuntime("runtime1550962648")
215217
.setTimeout(Duration.newBuilder().build())
@@ -262,6 +264,7 @@ public void createFunctionTest() throws Exception {
262264
CloudFunction.newBuilder()
263265
.setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
264266
.setDescription("description-1724546052")
267+
.setStatus(CloudFunctionStatus.forNumber(0))
265268
.setEntryPoint("entryPoint-1979329474")
266269
.setRuntime("runtime1550962648")
267270
.setTimeout(Duration.newBuilder().build())
@@ -325,6 +328,7 @@ public void createFunctionTest2() throws Exception {
325328
CloudFunction.newBuilder()
326329
.setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
327330
.setDescription("description-1724546052")
331+
.setStatus(CloudFunctionStatus.forNumber(0))
328332
.setEntryPoint("entryPoint-1979329474")
329333
.setRuntime("runtime1550962648")
330334
.setTimeout(Duration.newBuilder().build())
@@ -388,6 +392,7 @@ public void updateFunctionTest() throws Exception {
388392
CloudFunction.newBuilder()
389393
.setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
390394
.setDescription("description-1724546052")
395+
.setStatus(CloudFunctionStatus.forNumber(0))
391396
.setEntryPoint("entryPoint-1979329474")
392397
.setRuntime("runtime1550962648")
393398
.setTimeout(Duration.newBuilder().build())

google-cloud-functions/src/test/java/com/google/cloud/functions/v1/MockCloudFunctionsServiceImpl.java

Lines changed: 77 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,13 @@ public void listFunctions(
7575
} else if (response instanceof Exception) {
7676
responseObserver.onError(((Exception) response));
7777
} else {
78-
responseObserver.onError(new IllegalArgumentException("Unrecognized response type"));
78+
responseObserver.onError(
79+
new IllegalArgumentException(
80+
String.format(
81+
"Unrecognized response type %s for method ListFunctions, expected %s or %s",
82+
response.getClass().getName(),
83+
ListFunctionsResponse.class.getName(),
84+
Exception.class.getName())));
7985
}
8086
}
8187

@@ -90,7 +96,13 @@ public void getFunction(
9096
} else if (response instanceof Exception) {
9197
responseObserver.onError(((Exception) response));
9298
} else {
93-
responseObserver.onError(new IllegalArgumentException("Unrecognized response type"));
99+
responseObserver.onError(
100+
new IllegalArgumentException(
101+
String.format(
102+
"Unrecognized response type %s for method GetFunction, expected %s or %s",
103+
response.getClass().getName(),
104+
CloudFunction.class.getName(),
105+
Exception.class.getName())));
94106
}
95107
}
96108

@@ -105,7 +117,13 @@ public void createFunction(
105117
} else if (response instanceof Exception) {
106118
responseObserver.onError(((Exception) response));
107119
} else {
108-
responseObserver.onError(new IllegalArgumentException("Unrecognized response type"));
120+
responseObserver.onError(
121+
new IllegalArgumentException(
122+
String.format(
123+
"Unrecognized response type %s for method CreateFunction, expected %s or %s",
124+
response.getClass().getName(),
125+
Operation.class.getName(),
126+
Exception.class.getName())));
109127
}
110128
}
111129

@@ -120,7 +138,13 @@ public void updateFunction(
120138
} else if (response instanceof Exception) {
121139
responseObserver.onError(((Exception) response));
122140
} else {
123-
responseObserver.onError(new IllegalArgumentException("Unrecognized response type"));
141+
responseObserver.onError(
142+
new IllegalArgumentException(
143+
String.format(
144+
"Unrecognized response type %s for method UpdateFunction, expected %s or %s",
145+
response.getClass().getName(),
146+
Operation.class.getName(),
147+
Exception.class.getName())));
124148
}
125149
}
126150

@@ -135,7 +159,13 @@ public void deleteFunction(
135159
} else if (response instanceof Exception) {
136160
responseObserver.onError(((Exception) response));
137161
} else {
138-
responseObserver.onError(new IllegalArgumentException("Unrecognized response type"));
162+
responseObserver.onError(
163+
new IllegalArgumentException(
164+
String.format(
165+
"Unrecognized response type %s for method DeleteFunction, expected %s or %s",
166+
response.getClass().getName(),
167+
Operation.class.getName(),
168+
Exception.class.getName())));
139169
}
140170
}
141171

@@ -150,7 +180,13 @@ public void callFunction(
150180
} else if (response instanceof Exception) {
151181
responseObserver.onError(((Exception) response));
152182
} else {
153-
responseObserver.onError(new IllegalArgumentException("Unrecognized response type"));
183+
responseObserver.onError(
184+
new IllegalArgumentException(
185+
String.format(
186+
"Unrecognized response type %s for method CallFunction, expected %s or %s",
187+
response.getClass().getName(),
188+
CallFunctionResponse.class.getName(),
189+
Exception.class.getName())));
154190
}
155191
}
156192

@@ -166,7 +202,13 @@ public void generateUploadUrl(
166202
} else if (response instanceof Exception) {
167203
responseObserver.onError(((Exception) response));
168204
} else {
169-
responseObserver.onError(new IllegalArgumentException("Unrecognized response type"));
205+
responseObserver.onError(
206+
new IllegalArgumentException(
207+
String.format(
208+
"Unrecognized response type %s for method GenerateUploadUrl, expected %s or %s",
209+
response.getClass().getName(),
210+
GenerateUploadUrlResponse.class.getName(),
211+
Exception.class.getName())));
170212
}
171213
}
172214

@@ -182,7 +224,13 @@ public void generateDownloadUrl(
182224
} else if (response instanceof Exception) {
183225
responseObserver.onError(((Exception) response));
184226
} else {
185-
responseObserver.onError(new IllegalArgumentException("Unrecognized response type"));
227+
responseObserver.onError(
228+
new IllegalArgumentException(
229+
String.format(
230+
"Unrecognized response type %s for method GenerateDownloadUrl, expected %s or %s",
231+
response.getClass().getName(),
232+
GenerateDownloadUrlResponse.class.getName(),
233+
Exception.class.getName())));
186234
}
187235
}
188236

@@ -196,7 +244,13 @@ public void setIamPolicy(SetIamPolicyRequest request, StreamObserver<Policy> res
196244
} else if (response instanceof Exception) {
197245
responseObserver.onError(((Exception) response));
198246
} else {
199-
responseObserver.onError(new IllegalArgumentException("Unrecognized response type"));
247+
responseObserver.onError(
248+
new IllegalArgumentException(
249+
String.format(
250+
"Unrecognized response type %s for method SetIamPolicy, expected %s or %s",
251+
response.getClass().getName(),
252+
Policy.class.getName(),
253+
Exception.class.getName())));
200254
}
201255
}
202256

@@ -210,7 +264,13 @@ public void getIamPolicy(GetIamPolicyRequest request, StreamObserver<Policy> res
210264
} else if (response instanceof Exception) {
211265
responseObserver.onError(((Exception) response));
212266
} else {
213-
responseObserver.onError(new IllegalArgumentException("Unrecognized response type"));
267+
responseObserver.onError(
268+
new IllegalArgumentException(
269+
String.format(
270+
"Unrecognized response type %s for method GetIamPolicy, expected %s or %s",
271+
response.getClass().getName(),
272+
Policy.class.getName(),
273+
Exception.class.getName())));
214274
}
215275
}
216276

@@ -226,7 +286,13 @@ public void testIamPermissions(
226286
} else if (response instanceof Exception) {
227287
responseObserver.onError(((Exception) response));
228288
} else {
229-
responseObserver.onError(new IllegalArgumentException("Unrecognized response type"));
289+
responseObserver.onError(
290+
new IllegalArgumentException(
291+
String.format(
292+
"Unrecognized response type %s for method TestIamPermissions, expected %s or %s",
293+
response.getClass().getName(),
294+
TestIamPermissionsResponse.class.getName(),
295+
Exception.class.getName())));
230296
}
231297
}
232298
}

synth.metadata

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
"git": {
55
"name": ".",
66
"remote": "https://github.com/googleapis/java-functions.git",
7-
"sha": "306fcec2af7e7d0b1f100998c745fd4e3d524452"
7+
"sha": "0dbe9872b0e4f34c5734a1ab646148d771fe6d68"
88
}
99
},
1010
{
1111
"git": {
1212
"name": "googleapis",
1313
"remote": "https://github.com/googleapis/googleapis.git",
14-
"sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb",
15-
"internalRef": "356341083"
14+
"sha": "e8bc4471a88ac5f60defe3ed436f517174e59ba0",
15+
"internalRef": "357800868"
1616
}
1717
},
1818
{

0 commit comments

Comments
 (0)