• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2022 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 
17 package com.google.cloud.compute.v1.stub;
18 
19 import com.google.api.core.BetaApi;
20 import com.google.api.gax.httpjson.HttpJsonCallSettings;
21 import com.google.api.gax.httpjson.HttpJsonCallableFactory;
22 import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
23 import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
24 import com.google.api.gax.rpc.BatchingCallSettings;
25 import com.google.api.gax.rpc.ClientContext;
26 import com.google.api.gax.rpc.OperationCallSettings;
27 import com.google.api.gax.rpc.OperationCallable;
28 import com.google.api.gax.rpc.PagedCallSettings;
29 import com.google.api.gax.rpc.ServerStreamingCallSettings;
30 import com.google.api.gax.rpc.ServerStreamingCallable;
31 import com.google.api.gax.rpc.UnaryCallSettings;
32 import com.google.api.gax.rpc.UnaryCallable;
33 import com.google.cloud.compute.v1.Operation;
34 import javax.annotation.Generated;
35 
36 // AUTO-GENERATED DOCUMENTATION AND CLASS.
37 /**
38  * REST callable factory implementation for the UrlMaps service API.
39  *
40  * <p>This class is for advanced usage.
41  */
42 @Generated("by gapic-generator-java")
43 @BetaApi
44 public class HttpJsonUrlMapsCallableFactory
45     implements HttpJsonStubCallableFactory<Operation, GlobalOperationsStub> {
46 
47   @Override
createUnaryCallable( HttpJsonCallSettings<RequestT, ResponseT> httpJsonCallSettings, UnaryCallSettings<RequestT, ResponseT> callSettings, ClientContext clientContext)48   public <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createUnaryCallable(
49       HttpJsonCallSettings<RequestT, ResponseT> httpJsonCallSettings,
50       UnaryCallSettings<RequestT, ResponseT> callSettings,
51       ClientContext clientContext) {
52     return HttpJsonCallableFactory.createUnaryCallable(
53         httpJsonCallSettings, callSettings, clientContext);
54   }
55 
56   @Override
57   public <RequestT, ResponseT, PagedListResponseT>
createPagedCallable( HttpJsonCallSettings<RequestT, ResponseT> httpJsonCallSettings, PagedCallSettings<RequestT, ResponseT, PagedListResponseT> callSettings, ClientContext clientContext)58       UnaryCallable<RequestT, PagedListResponseT> createPagedCallable(
59           HttpJsonCallSettings<RequestT, ResponseT> httpJsonCallSettings,
60           PagedCallSettings<RequestT, ResponseT, PagedListResponseT> callSettings,
61           ClientContext clientContext) {
62     return HttpJsonCallableFactory.createPagedCallable(
63         httpJsonCallSettings, callSettings, clientContext);
64   }
65 
66   @Override
createBatchingCallable( HttpJsonCallSettings<RequestT, ResponseT> httpJsonCallSettings, BatchingCallSettings<RequestT, ResponseT> callSettings, ClientContext clientContext)67   public <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createBatchingCallable(
68       HttpJsonCallSettings<RequestT, ResponseT> httpJsonCallSettings,
69       BatchingCallSettings<RequestT, ResponseT> callSettings,
70       ClientContext clientContext) {
71     return HttpJsonCallableFactory.createBatchingCallable(
72         httpJsonCallSettings, callSettings, clientContext);
73   }
74 
75   @BetaApi(
76       "The surface for long-running operations is not stable yet and may change in the future.")
77   @Override
78   public <RequestT, ResponseT, MetadataT>
createOperationCallable( HttpJsonCallSettings<RequestT, Operation> httpJsonCallSettings, OperationCallSettings<RequestT, ResponseT, MetadataT> callSettings, ClientContext clientContext, GlobalOperationsStub operationsStub)79       OperationCallable<RequestT, ResponseT, MetadataT> createOperationCallable(
80           HttpJsonCallSettings<RequestT, Operation> httpJsonCallSettings,
81           OperationCallSettings<RequestT, ResponseT, MetadataT> callSettings,
82           ClientContext clientContext,
83           GlobalOperationsStub operationsStub) {
84     UnaryCallable<RequestT, Operation> innerCallable =
85         HttpJsonCallableFactory.createBaseUnaryCallable(
86             httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext);
87     HttpJsonOperationSnapshotCallable<RequestT, Operation> initialCallable =
88         new HttpJsonOperationSnapshotCallable<RequestT, Operation>(
89             innerCallable,
90             httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory());
91     return HttpJsonCallableFactory.createOperationCallable(
92         callSettings, clientContext, operationsStub.longRunningClient(), initialCallable);
93   }
94 
95   @Override
96   public <RequestT, ResponseT>
createServerStreamingCallable( HttpJsonCallSettings<RequestT, ResponseT> httpJsonCallSettings, ServerStreamingCallSettings<RequestT, ResponseT> callSettings, ClientContext clientContext)97       ServerStreamingCallable<RequestT, ResponseT> createServerStreamingCallable(
98           HttpJsonCallSettings<RequestT, ResponseT> httpJsonCallSettings,
99           ServerStreamingCallSettings<RequestT, ResponseT> callSettings,
100           ClientContext clientContext) {
101     return HttpJsonCallableFactory.createServerStreamingCallable(
102         httpJsonCallSettings, callSettings, clientContext);
103   }
104 }
105