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.cloud.billing.v1; 17 18 import static io.grpc.MethodDescriptor.generateFullMethodName; 19 20 /** 21 * 22 * 23 * <pre> 24 * A catalog of Google Cloud Platform services and SKUs. 25 * Provides pricing information and metadata on Google Cloud Platform services 26 * and SKUs. 27 * </pre> 28 */ 29 @javax.annotation.Generated( 30 value = "by gRPC proto compiler", 31 comments = "Source: google/cloud/billing/v1/cloud_catalog.proto") 32 @io.grpc.stub.annotations.GrpcGenerated 33 public final class CloudCatalogGrpc { 34 CloudCatalogGrpc()35 private CloudCatalogGrpc() {} 36 37 public static final String SERVICE_NAME = "google.cloud.billing.v1.CloudCatalog"; 38 39 // Static method descriptors that strictly reflect the proto. 40 private static volatile io.grpc.MethodDescriptor< 41 com.google.cloud.billing.v1.ListServicesRequest, 42 com.google.cloud.billing.v1.ListServicesResponse> 43 getListServicesMethod; 44 45 @io.grpc.stub.annotations.RpcMethod( 46 fullMethodName = SERVICE_NAME + '/' + "ListServices", 47 requestType = com.google.cloud.billing.v1.ListServicesRequest.class, 48 responseType = com.google.cloud.billing.v1.ListServicesResponse.class, 49 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 50 public static io.grpc.MethodDescriptor< 51 com.google.cloud.billing.v1.ListServicesRequest, 52 com.google.cloud.billing.v1.ListServicesResponse> getListServicesMethod()53 getListServicesMethod() { 54 io.grpc.MethodDescriptor< 55 com.google.cloud.billing.v1.ListServicesRequest, 56 com.google.cloud.billing.v1.ListServicesResponse> 57 getListServicesMethod; 58 if ((getListServicesMethod = CloudCatalogGrpc.getListServicesMethod) == null) { 59 synchronized (CloudCatalogGrpc.class) { 60 if ((getListServicesMethod = CloudCatalogGrpc.getListServicesMethod) == null) { 61 CloudCatalogGrpc.getListServicesMethod = 62 getListServicesMethod = 63 io.grpc.MethodDescriptor 64 .<com.google.cloud.billing.v1.ListServicesRequest, 65 com.google.cloud.billing.v1.ListServicesResponse> 66 newBuilder() 67 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 68 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListServices")) 69 .setSampledToLocalTracing(true) 70 .setRequestMarshaller( 71 io.grpc.protobuf.ProtoUtils.marshaller( 72 com.google.cloud.billing.v1.ListServicesRequest.getDefaultInstance())) 73 .setResponseMarshaller( 74 io.grpc.protobuf.ProtoUtils.marshaller( 75 com.google.cloud.billing.v1.ListServicesResponse 76 .getDefaultInstance())) 77 .setSchemaDescriptor(new CloudCatalogMethodDescriptorSupplier("ListServices")) 78 .build(); 79 } 80 } 81 } 82 return getListServicesMethod; 83 } 84 85 private static volatile io.grpc.MethodDescriptor< 86 com.google.cloud.billing.v1.ListSkusRequest, com.google.cloud.billing.v1.ListSkusResponse> 87 getListSkusMethod; 88 89 @io.grpc.stub.annotations.RpcMethod( 90 fullMethodName = SERVICE_NAME + '/' + "ListSkus", 91 requestType = com.google.cloud.billing.v1.ListSkusRequest.class, 92 responseType = com.google.cloud.billing.v1.ListSkusResponse.class, 93 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 94 public static io.grpc.MethodDescriptor< 95 com.google.cloud.billing.v1.ListSkusRequest, com.google.cloud.billing.v1.ListSkusResponse> getListSkusMethod()96 getListSkusMethod() { 97 io.grpc.MethodDescriptor< 98 com.google.cloud.billing.v1.ListSkusRequest, 99 com.google.cloud.billing.v1.ListSkusResponse> 100 getListSkusMethod; 101 if ((getListSkusMethod = CloudCatalogGrpc.getListSkusMethod) == null) { 102 synchronized (CloudCatalogGrpc.class) { 103 if ((getListSkusMethod = CloudCatalogGrpc.getListSkusMethod) == null) { 104 CloudCatalogGrpc.getListSkusMethod = 105 getListSkusMethod = 106 io.grpc.MethodDescriptor 107 .<com.google.cloud.billing.v1.ListSkusRequest, 108 com.google.cloud.billing.v1.ListSkusResponse> 109 newBuilder() 110 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 111 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSkus")) 112 .setSampledToLocalTracing(true) 113 .setRequestMarshaller( 114 io.grpc.protobuf.ProtoUtils.marshaller( 115 com.google.cloud.billing.v1.ListSkusRequest.getDefaultInstance())) 116 .setResponseMarshaller( 117 io.grpc.protobuf.ProtoUtils.marshaller( 118 com.google.cloud.billing.v1.ListSkusResponse.getDefaultInstance())) 119 .setSchemaDescriptor(new CloudCatalogMethodDescriptorSupplier("ListSkus")) 120 .build(); 121 } 122 } 123 } 124 return getListSkusMethod; 125 } 126 127 /** Creates a new async stub that supports all call types for the service */ newStub(io.grpc.Channel channel)128 public static CloudCatalogStub newStub(io.grpc.Channel channel) { 129 io.grpc.stub.AbstractStub.StubFactory<CloudCatalogStub> factory = 130 new io.grpc.stub.AbstractStub.StubFactory<CloudCatalogStub>() { 131 @java.lang.Override 132 public CloudCatalogStub newStub( 133 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 134 return new CloudCatalogStub(channel, callOptions); 135 } 136 }; 137 return CloudCatalogStub.newStub(factory, channel); 138 } 139 140 /** 141 * Creates a new blocking-style stub that supports unary and streaming output calls on the service 142 */ newBlockingStub(io.grpc.Channel channel)143 public static CloudCatalogBlockingStub newBlockingStub(io.grpc.Channel channel) { 144 io.grpc.stub.AbstractStub.StubFactory<CloudCatalogBlockingStub> factory = 145 new io.grpc.stub.AbstractStub.StubFactory<CloudCatalogBlockingStub>() { 146 @java.lang.Override 147 public CloudCatalogBlockingStub newStub( 148 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 149 return new CloudCatalogBlockingStub(channel, callOptions); 150 } 151 }; 152 return CloudCatalogBlockingStub.newStub(factory, channel); 153 } 154 155 /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ newFutureStub(io.grpc.Channel channel)156 public static CloudCatalogFutureStub newFutureStub(io.grpc.Channel channel) { 157 io.grpc.stub.AbstractStub.StubFactory<CloudCatalogFutureStub> factory = 158 new io.grpc.stub.AbstractStub.StubFactory<CloudCatalogFutureStub>() { 159 @java.lang.Override 160 public CloudCatalogFutureStub newStub( 161 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 162 return new CloudCatalogFutureStub(channel, callOptions); 163 } 164 }; 165 return CloudCatalogFutureStub.newStub(factory, channel); 166 } 167 168 /** 169 * 170 * 171 * <pre> 172 * A catalog of Google Cloud Platform services and SKUs. 173 * Provides pricing information and metadata on Google Cloud Platform services 174 * and SKUs. 175 * </pre> 176 */ 177 public interface AsyncService { 178 179 /** 180 * 181 * 182 * <pre> 183 * Lists all public cloud services. 184 * </pre> 185 */ listServices( com.google.cloud.billing.v1.ListServicesRequest request, io.grpc.stub.StreamObserver<com.google.cloud.billing.v1.ListServicesResponse> responseObserver)186 default void listServices( 187 com.google.cloud.billing.v1.ListServicesRequest request, 188 io.grpc.stub.StreamObserver<com.google.cloud.billing.v1.ListServicesResponse> 189 responseObserver) { 190 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 191 getListServicesMethod(), responseObserver); 192 } 193 194 /** 195 * 196 * 197 * <pre> 198 * Lists all publicly available SKUs for a given cloud service. 199 * </pre> 200 */ listSkus( com.google.cloud.billing.v1.ListSkusRequest request, io.grpc.stub.StreamObserver<com.google.cloud.billing.v1.ListSkusResponse> responseObserver)201 default void listSkus( 202 com.google.cloud.billing.v1.ListSkusRequest request, 203 io.grpc.stub.StreamObserver<com.google.cloud.billing.v1.ListSkusResponse> 204 responseObserver) { 205 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListSkusMethod(), responseObserver); 206 } 207 } 208 209 /** 210 * Base class for the server implementation of the service CloudCatalog. 211 * 212 * <pre> 213 * A catalog of Google Cloud Platform services and SKUs. 214 * Provides pricing information and metadata on Google Cloud Platform services 215 * and SKUs. 216 * </pre> 217 */ 218 public abstract static class CloudCatalogImplBase 219 implements io.grpc.BindableService, AsyncService { 220 221 @java.lang.Override bindService()222 public final io.grpc.ServerServiceDefinition bindService() { 223 return CloudCatalogGrpc.bindService(this); 224 } 225 } 226 227 /** 228 * A stub to allow clients to do asynchronous rpc calls to service CloudCatalog. 229 * 230 * <pre> 231 * A catalog of Google Cloud Platform services and SKUs. 232 * Provides pricing information and metadata on Google Cloud Platform services 233 * and SKUs. 234 * </pre> 235 */ 236 public static final class CloudCatalogStub 237 extends io.grpc.stub.AbstractAsyncStub<CloudCatalogStub> { CloudCatalogStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)238 private CloudCatalogStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 239 super(channel, callOptions); 240 } 241 242 @java.lang.Override build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)243 protected CloudCatalogStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 244 return new CloudCatalogStub(channel, callOptions); 245 } 246 247 /** 248 * 249 * 250 * <pre> 251 * Lists all public cloud services. 252 * </pre> 253 */ listServices( com.google.cloud.billing.v1.ListServicesRequest request, io.grpc.stub.StreamObserver<com.google.cloud.billing.v1.ListServicesResponse> responseObserver)254 public void listServices( 255 com.google.cloud.billing.v1.ListServicesRequest request, 256 io.grpc.stub.StreamObserver<com.google.cloud.billing.v1.ListServicesResponse> 257 responseObserver) { 258 io.grpc.stub.ClientCalls.asyncUnaryCall( 259 getChannel().newCall(getListServicesMethod(), getCallOptions()), 260 request, 261 responseObserver); 262 } 263 264 /** 265 * 266 * 267 * <pre> 268 * Lists all publicly available SKUs for a given cloud service. 269 * </pre> 270 */ listSkus( com.google.cloud.billing.v1.ListSkusRequest request, io.grpc.stub.StreamObserver<com.google.cloud.billing.v1.ListSkusResponse> responseObserver)271 public void listSkus( 272 com.google.cloud.billing.v1.ListSkusRequest request, 273 io.grpc.stub.StreamObserver<com.google.cloud.billing.v1.ListSkusResponse> 274 responseObserver) { 275 io.grpc.stub.ClientCalls.asyncUnaryCall( 276 getChannel().newCall(getListSkusMethod(), getCallOptions()), request, responseObserver); 277 } 278 } 279 280 /** 281 * A stub to allow clients to do synchronous rpc calls to service CloudCatalog. 282 * 283 * <pre> 284 * A catalog of Google Cloud Platform services and SKUs. 285 * Provides pricing information and metadata on Google Cloud Platform services 286 * and SKUs. 287 * </pre> 288 */ 289 public static final class CloudCatalogBlockingStub 290 extends io.grpc.stub.AbstractBlockingStub<CloudCatalogBlockingStub> { CloudCatalogBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)291 private CloudCatalogBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 292 super(channel, callOptions); 293 } 294 295 @java.lang.Override build( io.grpc.Channel channel, io.grpc.CallOptions callOptions)296 protected CloudCatalogBlockingStub build( 297 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 298 return new CloudCatalogBlockingStub(channel, callOptions); 299 } 300 301 /** 302 * 303 * 304 * <pre> 305 * Lists all public cloud services. 306 * </pre> 307 */ listServices( com.google.cloud.billing.v1.ListServicesRequest request)308 public com.google.cloud.billing.v1.ListServicesResponse listServices( 309 com.google.cloud.billing.v1.ListServicesRequest request) { 310 return io.grpc.stub.ClientCalls.blockingUnaryCall( 311 getChannel(), getListServicesMethod(), getCallOptions(), request); 312 } 313 314 /** 315 * 316 * 317 * <pre> 318 * Lists all publicly available SKUs for a given cloud service. 319 * </pre> 320 */ listSkus( com.google.cloud.billing.v1.ListSkusRequest request)321 public com.google.cloud.billing.v1.ListSkusResponse listSkus( 322 com.google.cloud.billing.v1.ListSkusRequest request) { 323 return io.grpc.stub.ClientCalls.blockingUnaryCall( 324 getChannel(), getListSkusMethod(), getCallOptions(), request); 325 } 326 } 327 328 /** 329 * A stub to allow clients to do ListenableFuture-style rpc calls to service CloudCatalog. 330 * 331 * <pre> 332 * A catalog of Google Cloud Platform services and SKUs. 333 * Provides pricing information and metadata on Google Cloud Platform services 334 * and SKUs. 335 * </pre> 336 */ 337 public static final class CloudCatalogFutureStub 338 extends io.grpc.stub.AbstractFutureStub<CloudCatalogFutureStub> { CloudCatalogFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)339 private CloudCatalogFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 340 super(channel, callOptions); 341 } 342 343 @java.lang.Override build( io.grpc.Channel channel, io.grpc.CallOptions callOptions)344 protected CloudCatalogFutureStub build( 345 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 346 return new CloudCatalogFutureStub(channel, callOptions); 347 } 348 349 /** 350 * 351 * 352 * <pre> 353 * Lists all public cloud services. 354 * </pre> 355 */ 356 public com.google.common.util.concurrent.ListenableFuture< 357 com.google.cloud.billing.v1.ListServicesResponse> listServices(com.google.cloud.billing.v1.ListServicesRequest request)358 listServices(com.google.cloud.billing.v1.ListServicesRequest request) { 359 return io.grpc.stub.ClientCalls.futureUnaryCall( 360 getChannel().newCall(getListServicesMethod(), getCallOptions()), request); 361 } 362 363 /** 364 * 365 * 366 * <pre> 367 * Lists all publicly available SKUs for a given cloud service. 368 * </pre> 369 */ 370 public com.google.common.util.concurrent.ListenableFuture< 371 com.google.cloud.billing.v1.ListSkusResponse> listSkus(com.google.cloud.billing.v1.ListSkusRequest request)372 listSkus(com.google.cloud.billing.v1.ListSkusRequest request) { 373 return io.grpc.stub.ClientCalls.futureUnaryCall( 374 getChannel().newCall(getListSkusMethod(), getCallOptions()), request); 375 } 376 } 377 378 private static final int METHODID_LIST_SERVICES = 0; 379 private static final int METHODID_LIST_SKUS = 1; 380 381 private static final class MethodHandlers<Req, Resp> 382 implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, 383 io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, 384 io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, 385 io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { 386 private final AsyncService serviceImpl; 387 private final int methodId; 388 MethodHandlers(AsyncService serviceImpl, int methodId)389 MethodHandlers(AsyncService serviceImpl, int methodId) { 390 this.serviceImpl = serviceImpl; 391 this.methodId = methodId; 392 } 393 394 @java.lang.Override 395 @java.lang.SuppressWarnings("unchecked") invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver)396 public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { 397 switch (methodId) { 398 case METHODID_LIST_SERVICES: 399 serviceImpl.listServices( 400 (com.google.cloud.billing.v1.ListServicesRequest) request, 401 (io.grpc.stub.StreamObserver<com.google.cloud.billing.v1.ListServicesResponse>) 402 responseObserver); 403 break; 404 case METHODID_LIST_SKUS: 405 serviceImpl.listSkus( 406 (com.google.cloud.billing.v1.ListSkusRequest) request, 407 (io.grpc.stub.StreamObserver<com.google.cloud.billing.v1.ListSkusResponse>) 408 responseObserver); 409 break; 410 default: 411 throw new AssertionError(); 412 } 413 } 414 415 @java.lang.Override 416 @java.lang.SuppressWarnings("unchecked") invoke( io.grpc.stub.StreamObserver<Resp> responseObserver)417 public io.grpc.stub.StreamObserver<Req> invoke( 418 io.grpc.stub.StreamObserver<Resp> responseObserver) { 419 switch (methodId) { 420 default: 421 throw new AssertionError(); 422 } 423 } 424 } 425 bindService(AsyncService service)426 public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { 427 return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) 428 .addMethod( 429 getListServicesMethod(), 430 io.grpc.stub.ServerCalls.asyncUnaryCall( 431 new MethodHandlers< 432 com.google.cloud.billing.v1.ListServicesRequest, 433 com.google.cloud.billing.v1.ListServicesResponse>( 434 service, METHODID_LIST_SERVICES))) 435 .addMethod( 436 getListSkusMethod(), 437 io.grpc.stub.ServerCalls.asyncUnaryCall( 438 new MethodHandlers< 439 com.google.cloud.billing.v1.ListSkusRequest, 440 com.google.cloud.billing.v1.ListSkusResponse>(service, METHODID_LIST_SKUS))) 441 .build(); 442 } 443 444 private abstract static class CloudCatalogBaseDescriptorSupplier 445 implements io.grpc.protobuf.ProtoFileDescriptorSupplier, 446 io.grpc.protobuf.ProtoServiceDescriptorSupplier { CloudCatalogBaseDescriptorSupplier()447 CloudCatalogBaseDescriptorSupplier() {} 448 449 @java.lang.Override getFileDescriptor()450 public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { 451 return com.google.cloud.billing.v1.CloudCatalogProto.getDescriptor(); 452 } 453 454 @java.lang.Override getServiceDescriptor()455 public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { 456 return getFileDescriptor().findServiceByName("CloudCatalog"); 457 } 458 } 459 460 private static final class CloudCatalogFileDescriptorSupplier 461 extends CloudCatalogBaseDescriptorSupplier { CloudCatalogFileDescriptorSupplier()462 CloudCatalogFileDescriptorSupplier() {} 463 } 464 465 private static final class CloudCatalogMethodDescriptorSupplier 466 extends CloudCatalogBaseDescriptorSupplier 467 implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { 468 private final String methodName; 469 CloudCatalogMethodDescriptorSupplier(String methodName)470 CloudCatalogMethodDescriptorSupplier(String methodName) { 471 this.methodName = methodName; 472 } 473 474 @java.lang.Override getMethodDescriptor()475 public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { 476 return getServiceDescriptor().findMethodByName(methodName); 477 } 478 } 479 480 private static volatile io.grpc.ServiceDescriptor serviceDescriptor; 481 getServiceDescriptor()482 public static io.grpc.ServiceDescriptor getServiceDescriptor() { 483 io.grpc.ServiceDescriptor result = serviceDescriptor; 484 if (result == null) { 485 synchronized (CloudCatalogGrpc.class) { 486 result = serviceDescriptor; 487 if (result == null) { 488 serviceDescriptor = 489 result = 490 io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) 491 .setSchemaDescriptor(new CloudCatalogFileDescriptorSupplier()) 492 .addMethod(getListServicesMethod()) 493 .addMethod(getListSkusMethod()) 494 .build(); 495 } 496 } 497 } 498 return result; 499 } 500 } 501