1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.google.webrisk.v1; 17 18 import static io.grpc.MethodDescriptor.generateFullMethodName; 19 20 /** 21 * 22 * 23 * <pre> 24 * Web Risk API defines an interface to detect malicious URLs on your 25 * website and in client applications. 26 * </pre> 27 */ 28 @javax.annotation.Generated( 29 value = "by gRPC proto compiler", 30 comments = "Source: google/cloud/webrisk/v1/webrisk.proto") 31 @io.grpc.stub.annotations.GrpcGenerated 32 public final class WebRiskServiceGrpc { 33 WebRiskServiceGrpc()34 private WebRiskServiceGrpc() {} 35 36 public static final String SERVICE_NAME = "google.cloud.webrisk.v1.WebRiskService"; 37 38 // Static method descriptors that strictly reflect the proto. 39 private static volatile io.grpc.MethodDescriptor< 40 com.google.webrisk.v1.ComputeThreatListDiffRequest, 41 com.google.webrisk.v1.ComputeThreatListDiffResponse> 42 getComputeThreatListDiffMethod; 43 44 @io.grpc.stub.annotations.RpcMethod( 45 fullMethodName = SERVICE_NAME + '/' + "ComputeThreatListDiff", 46 requestType = com.google.webrisk.v1.ComputeThreatListDiffRequest.class, 47 responseType = com.google.webrisk.v1.ComputeThreatListDiffResponse.class, 48 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 49 public static io.grpc.MethodDescriptor< 50 com.google.webrisk.v1.ComputeThreatListDiffRequest, 51 com.google.webrisk.v1.ComputeThreatListDiffResponse> getComputeThreatListDiffMethod()52 getComputeThreatListDiffMethod() { 53 io.grpc.MethodDescriptor< 54 com.google.webrisk.v1.ComputeThreatListDiffRequest, 55 com.google.webrisk.v1.ComputeThreatListDiffResponse> 56 getComputeThreatListDiffMethod; 57 if ((getComputeThreatListDiffMethod = WebRiskServiceGrpc.getComputeThreatListDiffMethod) 58 == null) { 59 synchronized (WebRiskServiceGrpc.class) { 60 if ((getComputeThreatListDiffMethod = WebRiskServiceGrpc.getComputeThreatListDiffMethod) 61 == null) { 62 WebRiskServiceGrpc.getComputeThreatListDiffMethod = 63 getComputeThreatListDiffMethod = 64 io.grpc.MethodDescriptor 65 .<com.google.webrisk.v1.ComputeThreatListDiffRequest, 66 com.google.webrisk.v1.ComputeThreatListDiffResponse> 67 newBuilder() 68 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 69 .setFullMethodName( 70 generateFullMethodName(SERVICE_NAME, "ComputeThreatListDiff")) 71 .setSampledToLocalTracing(true) 72 .setRequestMarshaller( 73 io.grpc.protobuf.ProtoUtils.marshaller( 74 com.google.webrisk.v1.ComputeThreatListDiffRequest 75 .getDefaultInstance())) 76 .setResponseMarshaller( 77 io.grpc.protobuf.ProtoUtils.marshaller( 78 com.google.webrisk.v1.ComputeThreatListDiffResponse 79 .getDefaultInstance())) 80 .setSchemaDescriptor( 81 new WebRiskServiceMethodDescriptorSupplier("ComputeThreatListDiff")) 82 .build(); 83 } 84 } 85 } 86 return getComputeThreatListDiffMethod; 87 } 88 89 private static volatile io.grpc.MethodDescriptor< 90 com.google.webrisk.v1.SearchUrisRequest, com.google.webrisk.v1.SearchUrisResponse> 91 getSearchUrisMethod; 92 93 @io.grpc.stub.annotations.RpcMethod( 94 fullMethodName = SERVICE_NAME + '/' + "SearchUris", 95 requestType = com.google.webrisk.v1.SearchUrisRequest.class, 96 responseType = com.google.webrisk.v1.SearchUrisResponse.class, 97 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 98 public static io.grpc.MethodDescriptor< 99 com.google.webrisk.v1.SearchUrisRequest, com.google.webrisk.v1.SearchUrisResponse> getSearchUrisMethod()100 getSearchUrisMethod() { 101 io.grpc.MethodDescriptor< 102 com.google.webrisk.v1.SearchUrisRequest, com.google.webrisk.v1.SearchUrisResponse> 103 getSearchUrisMethod; 104 if ((getSearchUrisMethod = WebRiskServiceGrpc.getSearchUrisMethod) == null) { 105 synchronized (WebRiskServiceGrpc.class) { 106 if ((getSearchUrisMethod = WebRiskServiceGrpc.getSearchUrisMethod) == null) { 107 WebRiskServiceGrpc.getSearchUrisMethod = 108 getSearchUrisMethod = 109 io.grpc.MethodDescriptor 110 .<com.google.webrisk.v1.SearchUrisRequest, 111 com.google.webrisk.v1.SearchUrisResponse> 112 newBuilder() 113 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 114 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SearchUris")) 115 .setSampledToLocalTracing(true) 116 .setRequestMarshaller( 117 io.grpc.protobuf.ProtoUtils.marshaller( 118 com.google.webrisk.v1.SearchUrisRequest.getDefaultInstance())) 119 .setResponseMarshaller( 120 io.grpc.protobuf.ProtoUtils.marshaller( 121 com.google.webrisk.v1.SearchUrisResponse.getDefaultInstance())) 122 .setSchemaDescriptor(new WebRiskServiceMethodDescriptorSupplier("SearchUris")) 123 .build(); 124 } 125 } 126 } 127 return getSearchUrisMethod; 128 } 129 130 private static volatile io.grpc.MethodDescriptor< 131 com.google.webrisk.v1.SearchHashesRequest, com.google.webrisk.v1.SearchHashesResponse> 132 getSearchHashesMethod; 133 134 @io.grpc.stub.annotations.RpcMethod( 135 fullMethodName = SERVICE_NAME + '/' + "SearchHashes", 136 requestType = com.google.webrisk.v1.SearchHashesRequest.class, 137 responseType = com.google.webrisk.v1.SearchHashesResponse.class, 138 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 139 public static io.grpc.MethodDescriptor< 140 com.google.webrisk.v1.SearchHashesRequest, com.google.webrisk.v1.SearchHashesResponse> getSearchHashesMethod()141 getSearchHashesMethod() { 142 io.grpc.MethodDescriptor< 143 com.google.webrisk.v1.SearchHashesRequest, com.google.webrisk.v1.SearchHashesResponse> 144 getSearchHashesMethod; 145 if ((getSearchHashesMethod = WebRiskServiceGrpc.getSearchHashesMethod) == null) { 146 synchronized (WebRiskServiceGrpc.class) { 147 if ((getSearchHashesMethod = WebRiskServiceGrpc.getSearchHashesMethod) == null) { 148 WebRiskServiceGrpc.getSearchHashesMethod = 149 getSearchHashesMethod = 150 io.grpc.MethodDescriptor 151 .<com.google.webrisk.v1.SearchHashesRequest, 152 com.google.webrisk.v1.SearchHashesResponse> 153 newBuilder() 154 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 155 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SearchHashes")) 156 .setSampledToLocalTracing(true) 157 .setRequestMarshaller( 158 io.grpc.protobuf.ProtoUtils.marshaller( 159 com.google.webrisk.v1.SearchHashesRequest.getDefaultInstance())) 160 .setResponseMarshaller( 161 io.grpc.protobuf.ProtoUtils.marshaller( 162 com.google.webrisk.v1.SearchHashesResponse.getDefaultInstance())) 163 .setSchemaDescriptor( 164 new WebRiskServiceMethodDescriptorSupplier("SearchHashes")) 165 .build(); 166 } 167 } 168 } 169 return getSearchHashesMethod; 170 } 171 172 private static volatile io.grpc.MethodDescriptor< 173 com.google.webrisk.v1.CreateSubmissionRequest, com.google.webrisk.v1.Submission> 174 getCreateSubmissionMethod; 175 176 @io.grpc.stub.annotations.RpcMethod( 177 fullMethodName = SERVICE_NAME + '/' + "CreateSubmission", 178 requestType = com.google.webrisk.v1.CreateSubmissionRequest.class, 179 responseType = com.google.webrisk.v1.Submission.class, 180 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 181 public static io.grpc.MethodDescriptor< 182 com.google.webrisk.v1.CreateSubmissionRequest, com.google.webrisk.v1.Submission> getCreateSubmissionMethod()183 getCreateSubmissionMethod() { 184 io.grpc.MethodDescriptor< 185 com.google.webrisk.v1.CreateSubmissionRequest, com.google.webrisk.v1.Submission> 186 getCreateSubmissionMethod; 187 if ((getCreateSubmissionMethod = WebRiskServiceGrpc.getCreateSubmissionMethod) == null) { 188 synchronized (WebRiskServiceGrpc.class) { 189 if ((getCreateSubmissionMethod = WebRiskServiceGrpc.getCreateSubmissionMethod) == null) { 190 WebRiskServiceGrpc.getCreateSubmissionMethod = 191 getCreateSubmissionMethod = 192 io.grpc.MethodDescriptor 193 .<com.google.webrisk.v1.CreateSubmissionRequest, 194 com.google.webrisk.v1.Submission> 195 newBuilder() 196 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 197 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSubmission")) 198 .setSampledToLocalTracing(true) 199 .setRequestMarshaller( 200 io.grpc.protobuf.ProtoUtils.marshaller( 201 com.google.webrisk.v1.CreateSubmissionRequest.getDefaultInstance())) 202 .setResponseMarshaller( 203 io.grpc.protobuf.ProtoUtils.marshaller( 204 com.google.webrisk.v1.Submission.getDefaultInstance())) 205 .setSchemaDescriptor( 206 new WebRiskServiceMethodDescriptorSupplier("CreateSubmission")) 207 .build(); 208 } 209 } 210 } 211 return getCreateSubmissionMethod; 212 } 213 214 /** Creates a new async stub that supports all call types for the service */ newStub(io.grpc.Channel channel)215 public static WebRiskServiceStub newStub(io.grpc.Channel channel) { 216 io.grpc.stub.AbstractStub.StubFactory<WebRiskServiceStub> factory = 217 new io.grpc.stub.AbstractStub.StubFactory<WebRiskServiceStub>() { 218 @java.lang.Override 219 public WebRiskServiceStub newStub( 220 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 221 return new WebRiskServiceStub(channel, callOptions); 222 } 223 }; 224 return WebRiskServiceStub.newStub(factory, channel); 225 } 226 227 /** 228 * Creates a new blocking-style stub that supports unary and streaming output calls on the service 229 */ newBlockingStub(io.grpc.Channel channel)230 public static WebRiskServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { 231 io.grpc.stub.AbstractStub.StubFactory<WebRiskServiceBlockingStub> factory = 232 new io.grpc.stub.AbstractStub.StubFactory<WebRiskServiceBlockingStub>() { 233 @java.lang.Override 234 public WebRiskServiceBlockingStub newStub( 235 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 236 return new WebRiskServiceBlockingStub(channel, callOptions); 237 } 238 }; 239 return WebRiskServiceBlockingStub.newStub(factory, channel); 240 } 241 242 /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ newFutureStub(io.grpc.Channel channel)243 public static WebRiskServiceFutureStub newFutureStub(io.grpc.Channel channel) { 244 io.grpc.stub.AbstractStub.StubFactory<WebRiskServiceFutureStub> factory = 245 new io.grpc.stub.AbstractStub.StubFactory<WebRiskServiceFutureStub>() { 246 @java.lang.Override 247 public WebRiskServiceFutureStub newStub( 248 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 249 return new WebRiskServiceFutureStub(channel, callOptions); 250 } 251 }; 252 return WebRiskServiceFutureStub.newStub(factory, channel); 253 } 254 255 /** 256 * 257 * 258 * <pre> 259 * Web Risk API defines an interface to detect malicious URLs on your 260 * website and in client applications. 261 * </pre> 262 */ 263 public interface AsyncService { 264 265 /** 266 * 267 * 268 * <pre> 269 * Gets the most recent threat list diffs. These diffs should be applied to 270 * a local database of hashes to keep it up-to-date. If the local database is 271 * empty or excessively out-of-date, a complete snapshot of the database will 272 * be returned. This Method only updates a single ThreatList at a time. To 273 * update multiple ThreatList databases, this method needs to be called once 274 * for each list. 275 * </pre> 276 */ computeThreatListDiff( com.google.webrisk.v1.ComputeThreatListDiffRequest request, io.grpc.stub.StreamObserver<com.google.webrisk.v1.ComputeThreatListDiffResponse> responseObserver)277 default void computeThreatListDiff( 278 com.google.webrisk.v1.ComputeThreatListDiffRequest request, 279 io.grpc.stub.StreamObserver<com.google.webrisk.v1.ComputeThreatListDiffResponse> 280 responseObserver) { 281 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 282 getComputeThreatListDiffMethod(), responseObserver); 283 } 284 285 /** 286 * 287 * 288 * <pre> 289 * This method is used to check whether a URI is on a given threatList. 290 * Multiple threatLists may be searched in a single query. 291 * The response will list all requested threatLists the URI was found to 292 * match. If the URI is not found on any of the requested ThreatList an 293 * empty response will be returned. 294 * </pre> 295 */ searchUris( com.google.webrisk.v1.SearchUrisRequest request, io.grpc.stub.StreamObserver<com.google.webrisk.v1.SearchUrisResponse> responseObserver)296 default void searchUris( 297 com.google.webrisk.v1.SearchUrisRequest request, 298 io.grpc.stub.StreamObserver<com.google.webrisk.v1.SearchUrisResponse> responseObserver) { 299 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSearchUrisMethod(), responseObserver); 300 } 301 302 /** 303 * 304 * 305 * <pre> 306 * Gets the full hashes that match the requested hash prefix. 307 * This is used after a hash prefix is looked up in a threatList 308 * and there is a match. The client side threatList only holds partial hashes 309 * so the client must query this method to determine if there is a full 310 * hash match of a threat. 311 * </pre> 312 */ searchHashes( com.google.webrisk.v1.SearchHashesRequest request, io.grpc.stub.StreamObserver<com.google.webrisk.v1.SearchHashesResponse> responseObserver)313 default void searchHashes( 314 com.google.webrisk.v1.SearchHashesRequest request, 315 io.grpc.stub.StreamObserver<com.google.webrisk.v1.SearchHashesResponse> responseObserver) { 316 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 317 getSearchHashesMethod(), responseObserver); 318 } 319 320 /** 321 * 322 * 323 * <pre> 324 * Creates a Submission of a URI suspected of containing phishing content to 325 * be reviewed. If the result verifies the existence of malicious phishing 326 * content, the site will be added to the [Google's Social Engineering 327 * lists](https://support.google.com/webmasters/answer/6350487/) in order to 328 * protect users that could get exposed to this threat in the future. Only 329 * allowlisted projects can use this method during Early Access. Please reach 330 * out to Sales or your customer engineer to obtain access. 331 * </pre> 332 */ createSubmission( com.google.webrisk.v1.CreateSubmissionRequest request, io.grpc.stub.StreamObserver<com.google.webrisk.v1.Submission> responseObserver)333 default void createSubmission( 334 com.google.webrisk.v1.CreateSubmissionRequest request, 335 io.grpc.stub.StreamObserver<com.google.webrisk.v1.Submission> responseObserver) { 336 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 337 getCreateSubmissionMethod(), responseObserver); 338 } 339 } 340 341 /** 342 * Base class for the server implementation of the service WebRiskService. 343 * 344 * <pre> 345 * Web Risk API defines an interface to detect malicious URLs on your 346 * website and in client applications. 347 * </pre> 348 */ 349 public abstract static class WebRiskServiceImplBase 350 implements io.grpc.BindableService, AsyncService { 351 352 @java.lang.Override bindService()353 public final io.grpc.ServerServiceDefinition bindService() { 354 return WebRiskServiceGrpc.bindService(this); 355 } 356 } 357 358 /** 359 * A stub to allow clients to do asynchronous rpc calls to service WebRiskService. 360 * 361 * <pre> 362 * Web Risk API defines an interface to detect malicious URLs on your 363 * website and in client applications. 364 * </pre> 365 */ 366 public static final class WebRiskServiceStub 367 extends io.grpc.stub.AbstractAsyncStub<WebRiskServiceStub> { WebRiskServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)368 private WebRiskServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 369 super(channel, callOptions); 370 } 371 372 @java.lang.Override build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)373 protected WebRiskServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 374 return new WebRiskServiceStub(channel, callOptions); 375 } 376 377 /** 378 * 379 * 380 * <pre> 381 * Gets the most recent threat list diffs. These diffs should be applied to 382 * a local database of hashes to keep it up-to-date. If the local database is 383 * empty or excessively out-of-date, a complete snapshot of the database will 384 * be returned. This Method only updates a single ThreatList at a time. To 385 * update multiple ThreatList databases, this method needs to be called once 386 * for each list. 387 * </pre> 388 */ computeThreatListDiff( com.google.webrisk.v1.ComputeThreatListDiffRequest request, io.grpc.stub.StreamObserver<com.google.webrisk.v1.ComputeThreatListDiffResponse> responseObserver)389 public void computeThreatListDiff( 390 com.google.webrisk.v1.ComputeThreatListDiffRequest request, 391 io.grpc.stub.StreamObserver<com.google.webrisk.v1.ComputeThreatListDiffResponse> 392 responseObserver) { 393 io.grpc.stub.ClientCalls.asyncUnaryCall( 394 getChannel().newCall(getComputeThreatListDiffMethod(), getCallOptions()), 395 request, 396 responseObserver); 397 } 398 399 /** 400 * 401 * 402 * <pre> 403 * This method is used to check whether a URI is on a given threatList. 404 * Multiple threatLists may be searched in a single query. 405 * The response will list all requested threatLists the URI was found to 406 * match. If the URI is not found on any of the requested ThreatList an 407 * empty response will be returned. 408 * </pre> 409 */ searchUris( com.google.webrisk.v1.SearchUrisRequest request, io.grpc.stub.StreamObserver<com.google.webrisk.v1.SearchUrisResponse> responseObserver)410 public void searchUris( 411 com.google.webrisk.v1.SearchUrisRequest request, 412 io.grpc.stub.StreamObserver<com.google.webrisk.v1.SearchUrisResponse> responseObserver) { 413 io.grpc.stub.ClientCalls.asyncUnaryCall( 414 getChannel().newCall(getSearchUrisMethod(), getCallOptions()), request, responseObserver); 415 } 416 417 /** 418 * 419 * 420 * <pre> 421 * Gets the full hashes that match the requested hash prefix. 422 * This is used after a hash prefix is looked up in a threatList 423 * and there is a match. The client side threatList only holds partial hashes 424 * so the client must query this method to determine if there is a full 425 * hash match of a threat. 426 * </pre> 427 */ searchHashes( com.google.webrisk.v1.SearchHashesRequest request, io.grpc.stub.StreamObserver<com.google.webrisk.v1.SearchHashesResponse> responseObserver)428 public void searchHashes( 429 com.google.webrisk.v1.SearchHashesRequest request, 430 io.grpc.stub.StreamObserver<com.google.webrisk.v1.SearchHashesResponse> responseObserver) { 431 io.grpc.stub.ClientCalls.asyncUnaryCall( 432 getChannel().newCall(getSearchHashesMethod(), getCallOptions()), 433 request, 434 responseObserver); 435 } 436 437 /** 438 * 439 * 440 * <pre> 441 * Creates a Submission of a URI suspected of containing phishing content to 442 * be reviewed. If the result verifies the existence of malicious phishing 443 * content, the site will be added to the [Google's Social Engineering 444 * lists](https://support.google.com/webmasters/answer/6350487/) in order to 445 * protect users that could get exposed to this threat in the future. Only 446 * allowlisted projects can use this method during Early Access. Please reach 447 * out to Sales or your customer engineer to obtain access. 448 * </pre> 449 */ createSubmission( com.google.webrisk.v1.CreateSubmissionRequest request, io.grpc.stub.StreamObserver<com.google.webrisk.v1.Submission> responseObserver)450 public void createSubmission( 451 com.google.webrisk.v1.CreateSubmissionRequest request, 452 io.grpc.stub.StreamObserver<com.google.webrisk.v1.Submission> responseObserver) { 453 io.grpc.stub.ClientCalls.asyncUnaryCall( 454 getChannel().newCall(getCreateSubmissionMethod(), getCallOptions()), 455 request, 456 responseObserver); 457 } 458 } 459 460 /** 461 * A stub to allow clients to do synchronous rpc calls to service WebRiskService. 462 * 463 * <pre> 464 * Web Risk API defines an interface to detect malicious URLs on your 465 * website and in client applications. 466 * </pre> 467 */ 468 public static final class WebRiskServiceBlockingStub 469 extends io.grpc.stub.AbstractBlockingStub<WebRiskServiceBlockingStub> { WebRiskServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)470 private WebRiskServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 471 super(channel, callOptions); 472 } 473 474 @java.lang.Override build( io.grpc.Channel channel, io.grpc.CallOptions callOptions)475 protected WebRiskServiceBlockingStub build( 476 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 477 return new WebRiskServiceBlockingStub(channel, callOptions); 478 } 479 480 /** 481 * 482 * 483 * <pre> 484 * Gets the most recent threat list diffs. These diffs should be applied to 485 * a local database of hashes to keep it up-to-date. If the local database is 486 * empty or excessively out-of-date, a complete snapshot of the database will 487 * be returned. This Method only updates a single ThreatList at a time. To 488 * update multiple ThreatList databases, this method needs to be called once 489 * for each list. 490 * </pre> 491 */ computeThreatListDiff( com.google.webrisk.v1.ComputeThreatListDiffRequest request)492 public com.google.webrisk.v1.ComputeThreatListDiffResponse computeThreatListDiff( 493 com.google.webrisk.v1.ComputeThreatListDiffRequest request) { 494 return io.grpc.stub.ClientCalls.blockingUnaryCall( 495 getChannel(), getComputeThreatListDiffMethod(), getCallOptions(), request); 496 } 497 498 /** 499 * 500 * 501 * <pre> 502 * This method is used to check whether a URI is on a given threatList. 503 * Multiple threatLists may be searched in a single query. 504 * The response will list all requested threatLists the URI was found to 505 * match. If the URI is not found on any of the requested ThreatList an 506 * empty response will be returned. 507 * </pre> 508 */ searchUris( com.google.webrisk.v1.SearchUrisRequest request)509 public com.google.webrisk.v1.SearchUrisResponse searchUris( 510 com.google.webrisk.v1.SearchUrisRequest request) { 511 return io.grpc.stub.ClientCalls.blockingUnaryCall( 512 getChannel(), getSearchUrisMethod(), getCallOptions(), request); 513 } 514 515 /** 516 * 517 * 518 * <pre> 519 * Gets the full hashes that match the requested hash prefix. 520 * This is used after a hash prefix is looked up in a threatList 521 * and there is a match. The client side threatList only holds partial hashes 522 * so the client must query this method to determine if there is a full 523 * hash match of a threat. 524 * </pre> 525 */ searchHashes( com.google.webrisk.v1.SearchHashesRequest request)526 public com.google.webrisk.v1.SearchHashesResponse searchHashes( 527 com.google.webrisk.v1.SearchHashesRequest request) { 528 return io.grpc.stub.ClientCalls.blockingUnaryCall( 529 getChannel(), getSearchHashesMethod(), getCallOptions(), request); 530 } 531 532 /** 533 * 534 * 535 * <pre> 536 * Creates a Submission of a URI suspected of containing phishing content to 537 * be reviewed. If the result verifies the existence of malicious phishing 538 * content, the site will be added to the [Google's Social Engineering 539 * lists](https://support.google.com/webmasters/answer/6350487/) in order to 540 * protect users that could get exposed to this threat in the future. Only 541 * allowlisted projects can use this method during Early Access. Please reach 542 * out to Sales or your customer engineer to obtain access. 543 * </pre> 544 */ createSubmission( com.google.webrisk.v1.CreateSubmissionRequest request)545 public com.google.webrisk.v1.Submission createSubmission( 546 com.google.webrisk.v1.CreateSubmissionRequest request) { 547 return io.grpc.stub.ClientCalls.blockingUnaryCall( 548 getChannel(), getCreateSubmissionMethod(), getCallOptions(), request); 549 } 550 } 551 552 /** 553 * A stub to allow clients to do ListenableFuture-style rpc calls to service WebRiskService. 554 * 555 * <pre> 556 * Web Risk API defines an interface to detect malicious URLs on your 557 * website and in client applications. 558 * </pre> 559 */ 560 public static final class WebRiskServiceFutureStub 561 extends io.grpc.stub.AbstractFutureStub<WebRiskServiceFutureStub> { WebRiskServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)562 private WebRiskServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 563 super(channel, callOptions); 564 } 565 566 @java.lang.Override build( io.grpc.Channel channel, io.grpc.CallOptions callOptions)567 protected WebRiskServiceFutureStub build( 568 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 569 return new WebRiskServiceFutureStub(channel, callOptions); 570 } 571 572 /** 573 * 574 * 575 * <pre> 576 * Gets the most recent threat list diffs. These diffs should be applied to 577 * a local database of hashes to keep it up-to-date. If the local database is 578 * empty or excessively out-of-date, a complete snapshot of the database will 579 * be returned. This Method only updates a single ThreatList at a time. To 580 * update multiple ThreatList databases, this method needs to be called once 581 * for each list. 582 * </pre> 583 */ 584 public com.google.common.util.concurrent.ListenableFuture< 585 com.google.webrisk.v1.ComputeThreatListDiffResponse> computeThreatListDiff(com.google.webrisk.v1.ComputeThreatListDiffRequest request)586 computeThreatListDiff(com.google.webrisk.v1.ComputeThreatListDiffRequest request) { 587 return io.grpc.stub.ClientCalls.futureUnaryCall( 588 getChannel().newCall(getComputeThreatListDiffMethod(), getCallOptions()), request); 589 } 590 591 /** 592 * 593 * 594 * <pre> 595 * This method is used to check whether a URI is on a given threatList. 596 * Multiple threatLists may be searched in a single query. 597 * The response will list all requested threatLists the URI was found to 598 * match. If the URI is not found on any of the requested ThreatList an 599 * empty response will be returned. 600 * </pre> 601 */ 602 public com.google.common.util.concurrent.ListenableFuture< 603 com.google.webrisk.v1.SearchUrisResponse> searchUris(com.google.webrisk.v1.SearchUrisRequest request)604 searchUris(com.google.webrisk.v1.SearchUrisRequest request) { 605 return io.grpc.stub.ClientCalls.futureUnaryCall( 606 getChannel().newCall(getSearchUrisMethod(), getCallOptions()), request); 607 } 608 609 /** 610 * 611 * 612 * <pre> 613 * Gets the full hashes that match the requested hash prefix. 614 * This is used after a hash prefix is looked up in a threatList 615 * and there is a match. The client side threatList only holds partial hashes 616 * so the client must query this method to determine if there is a full 617 * hash match of a threat. 618 * </pre> 619 */ 620 public com.google.common.util.concurrent.ListenableFuture< 621 com.google.webrisk.v1.SearchHashesResponse> searchHashes(com.google.webrisk.v1.SearchHashesRequest request)622 searchHashes(com.google.webrisk.v1.SearchHashesRequest request) { 623 return io.grpc.stub.ClientCalls.futureUnaryCall( 624 getChannel().newCall(getSearchHashesMethod(), getCallOptions()), request); 625 } 626 627 /** 628 * 629 * 630 * <pre> 631 * Creates a Submission of a URI suspected of containing phishing content to 632 * be reviewed. If the result verifies the existence of malicious phishing 633 * content, the site will be added to the [Google's Social Engineering 634 * lists](https://support.google.com/webmasters/answer/6350487/) in order to 635 * protect users that could get exposed to this threat in the future. Only 636 * allowlisted projects can use this method during Early Access. Please reach 637 * out to Sales or your customer engineer to obtain access. 638 * </pre> 639 */ 640 public com.google.common.util.concurrent.ListenableFuture<com.google.webrisk.v1.Submission> createSubmission(com.google.webrisk.v1.CreateSubmissionRequest request)641 createSubmission(com.google.webrisk.v1.CreateSubmissionRequest request) { 642 return io.grpc.stub.ClientCalls.futureUnaryCall( 643 getChannel().newCall(getCreateSubmissionMethod(), getCallOptions()), request); 644 } 645 } 646 647 private static final int METHODID_COMPUTE_THREAT_LIST_DIFF = 0; 648 private static final int METHODID_SEARCH_URIS = 1; 649 private static final int METHODID_SEARCH_HASHES = 2; 650 private static final int METHODID_CREATE_SUBMISSION = 3; 651 652 private static final class MethodHandlers<Req, Resp> 653 implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, 654 io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, 655 io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, 656 io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { 657 private final AsyncService serviceImpl; 658 private final int methodId; 659 MethodHandlers(AsyncService serviceImpl, int methodId)660 MethodHandlers(AsyncService serviceImpl, int methodId) { 661 this.serviceImpl = serviceImpl; 662 this.methodId = methodId; 663 } 664 665 @java.lang.Override 666 @java.lang.SuppressWarnings("unchecked") invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver)667 public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { 668 switch (methodId) { 669 case METHODID_COMPUTE_THREAT_LIST_DIFF: 670 serviceImpl.computeThreatListDiff( 671 (com.google.webrisk.v1.ComputeThreatListDiffRequest) request, 672 (io.grpc.stub.StreamObserver<com.google.webrisk.v1.ComputeThreatListDiffResponse>) 673 responseObserver); 674 break; 675 case METHODID_SEARCH_URIS: 676 serviceImpl.searchUris( 677 (com.google.webrisk.v1.SearchUrisRequest) request, 678 (io.grpc.stub.StreamObserver<com.google.webrisk.v1.SearchUrisResponse>) 679 responseObserver); 680 break; 681 case METHODID_SEARCH_HASHES: 682 serviceImpl.searchHashes( 683 (com.google.webrisk.v1.SearchHashesRequest) request, 684 (io.grpc.stub.StreamObserver<com.google.webrisk.v1.SearchHashesResponse>) 685 responseObserver); 686 break; 687 case METHODID_CREATE_SUBMISSION: 688 serviceImpl.createSubmission( 689 (com.google.webrisk.v1.CreateSubmissionRequest) request, 690 (io.grpc.stub.StreamObserver<com.google.webrisk.v1.Submission>) responseObserver); 691 break; 692 default: 693 throw new AssertionError(); 694 } 695 } 696 697 @java.lang.Override 698 @java.lang.SuppressWarnings("unchecked") invoke( io.grpc.stub.StreamObserver<Resp> responseObserver)699 public io.grpc.stub.StreamObserver<Req> invoke( 700 io.grpc.stub.StreamObserver<Resp> responseObserver) { 701 switch (methodId) { 702 default: 703 throw new AssertionError(); 704 } 705 } 706 } 707 bindService(AsyncService service)708 public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { 709 return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) 710 .addMethod( 711 getComputeThreatListDiffMethod(), 712 io.grpc.stub.ServerCalls.asyncUnaryCall( 713 new MethodHandlers< 714 com.google.webrisk.v1.ComputeThreatListDiffRequest, 715 com.google.webrisk.v1.ComputeThreatListDiffResponse>( 716 service, METHODID_COMPUTE_THREAT_LIST_DIFF))) 717 .addMethod( 718 getSearchUrisMethod(), 719 io.grpc.stub.ServerCalls.asyncUnaryCall( 720 new MethodHandlers< 721 com.google.webrisk.v1.SearchUrisRequest, 722 com.google.webrisk.v1.SearchUrisResponse>(service, METHODID_SEARCH_URIS))) 723 .addMethod( 724 getSearchHashesMethod(), 725 io.grpc.stub.ServerCalls.asyncUnaryCall( 726 new MethodHandlers< 727 com.google.webrisk.v1.SearchHashesRequest, 728 com.google.webrisk.v1.SearchHashesResponse>(service, METHODID_SEARCH_HASHES))) 729 .addMethod( 730 getCreateSubmissionMethod(), 731 io.grpc.stub.ServerCalls.asyncUnaryCall( 732 new MethodHandlers< 733 com.google.webrisk.v1.CreateSubmissionRequest, 734 com.google.webrisk.v1.Submission>(service, METHODID_CREATE_SUBMISSION))) 735 .build(); 736 } 737 738 private abstract static class WebRiskServiceBaseDescriptorSupplier 739 implements io.grpc.protobuf.ProtoFileDescriptorSupplier, 740 io.grpc.protobuf.ProtoServiceDescriptorSupplier { WebRiskServiceBaseDescriptorSupplier()741 WebRiskServiceBaseDescriptorSupplier() {} 742 743 @java.lang.Override getFileDescriptor()744 public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { 745 return com.google.webrisk.v1.WebRiskProto.getDescriptor(); 746 } 747 748 @java.lang.Override getServiceDescriptor()749 public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { 750 return getFileDescriptor().findServiceByName("WebRiskService"); 751 } 752 } 753 754 private static final class WebRiskServiceFileDescriptorSupplier 755 extends WebRiskServiceBaseDescriptorSupplier { WebRiskServiceFileDescriptorSupplier()756 WebRiskServiceFileDescriptorSupplier() {} 757 } 758 759 private static final class WebRiskServiceMethodDescriptorSupplier 760 extends WebRiskServiceBaseDescriptorSupplier 761 implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { 762 private final String methodName; 763 WebRiskServiceMethodDescriptorSupplier(String methodName)764 WebRiskServiceMethodDescriptorSupplier(String methodName) { 765 this.methodName = methodName; 766 } 767 768 @java.lang.Override getMethodDescriptor()769 public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { 770 return getServiceDescriptor().findMethodByName(methodName); 771 } 772 } 773 774 private static volatile io.grpc.ServiceDescriptor serviceDescriptor; 775 getServiceDescriptor()776 public static io.grpc.ServiceDescriptor getServiceDescriptor() { 777 io.grpc.ServiceDescriptor result = serviceDescriptor; 778 if (result == null) { 779 synchronized (WebRiskServiceGrpc.class) { 780 result = serviceDescriptor; 781 if (result == null) { 782 serviceDescriptor = 783 result = 784 io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) 785 .setSchemaDescriptor(new WebRiskServiceFileDescriptorSupplier()) 786 .addMethod(getComputeThreatListDiffMethod()) 787 .addMethod(getSearchUrisMethod()) 788 .addMethod(getSearchHashesMethod()) 789 .addMethod(getCreateSubmissionMethod()) 790 .build(); 791 } 792 } 793 } 794 return result; 795 } 796 } 797