Skip to content

Commit b68f00f

Browse files
fix!: rename the type FunnelFilter to FunnelFieldFilter (googleapis#505)
- [ ] Regenerate this pull request now. fix!: rename the `funnel_filter` field of the `FunnelFilterExpression` type to `funnel_field_filter` PiperOrigin-RevId: 455204231 Source-Link: googleapis/googleapis@4849480 Source-Link: https://github.com/googleapis/googleapis-gen/commit/589642d0a68a2c519273cf0f7d7947b19cd99eac Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTg5NjQyZDBhNjhhMmM1MTkyNzNjZjBmN2Q3OTQ3YjE5Y2Q5OWVhYyJ9 chore: update gapic-generator-java PiperOrigin-RevId: 454939894 Source-Link: googleapis/googleapis@519ca44 Source-Link: https://github.com/googleapis/googleapis-gen/commit/fc639d21a7cbc30aa0a9b862586942a0fb46c5c8 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZmM2MzlkMjFhN2NiYzMwYWEwYTliODYyNTg2OTQyYTBmYjQ2YzVjOCJ9 feat: Add Java REST transport to analytics, servicecontrol, servicemanagement, serviceusage and langauge APIs PiperOrigin-RevId: 454254635 Source-Link: googleapis/googleapis@84fb822 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4ffb61264d6fb634c430829dd2da75c5bed08304 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGZmYjYxMjY0ZDZmYjYzNGM0MzA4MjlkZDJkYTc1YzViZWQwODMwNCJ9
1 parent c08eabd commit b68f00f

24 files changed

+2219
-307
lines changed

java-analytics-data/google-analytics-data/pom.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@
6262
<groupId>com.google.api</groupId>
6363
<artifactId>gax-grpc</artifactId>
6464
</dependency>
65+
<dependency>
66+
<groupId>com.google.api</groupId>
67+
<artifactId>gax-httpjson</artifactId>
68+
</dependency>
6569
<dependency>
6670
<groupId>org.threeten</groupId>
6771
<artifactId>threetenbp</artifactId>
@@ -86,12 +90,24 @@
8690
<scope>test</scope>
8791
</dependency>
8892
<!-- Need testing utility classes for generated gRPC clients tests -->
93+
<dependency>
94+
<groupId>com.google.api</groupId>
95+
<artifactId>gax</artifactId>
96+
<classifier>testlib</classifier>
97+
<scope>test</scope>
98+
</dependency>
8999
<dependency>
90100
<groupId>com.google.api</groupId>
91101
<artifactId>gax-grpc</artifactId>
92102
<classifier>testlib</classifier>
93103
<scope>test</scope>
94104
</dependency>
105+
<dependency>
106+
<groupId>com.google.api</groupId>
107+
<artifactId>gax-httpjson</artifactId>
108+
<classifier>testlib</classifier>
109+
<scope>test</scope>
110+
</dependency>
95111
</dependencies>
96112

97113
<profiles>

java-analytics-data/google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/AlphaAnalyticsDataClient.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,21 @@
103103
* AlphaAnalyticsDataClient.create(alphaAnalyticsDataSettings);
104104
* }</pre>
105105
*
106+
* <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
107+
* the wire:
108+
*
109+
* <pre>{@code
110+
* // This snippet has been automatically generated for illustrative purposes only.
111+
* // It may require modifications to work in your environment.
112+
* AlphaAnalyticsDataSettings alphaAnalyticsDataSettings =
113+
* AlphaAnalyticsDataSettings.newBuilder()
114+
* .setTransportChannelProvider(
115+
* AlphaAnalyticsDataSettings.defaultHttpJsonTransportProviderBuilder().build())
116+
* .build();
117+
* AlphaAnalyticsDataClient alphaAnalyticsDataClient =
118+
* AlphaAnalyticsDataClient.create(alphaAnalyticsDataSettings);
119+
* }</pre>
120+
*
106121
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
107122
*/
108123
@BetaApi

java-analytics-data/google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/AlphaAnalyticsDataSettings.java

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.google.api.gax.core.GoogleCredentialsProvider;
2323
import com.google.api.gax.core.InstantiatingExecutorProvider;
2424
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
25+
import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
2526
import com.google.api.gax.rpc.ApiClientHeaderProvider;
2627
import com.google.api.gax.rpc.ClientContext;
2728
import com.google.api.gax.rpc.ClientSettings;
@@ -101,11 +102,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
101102
return AlphaAnalyticsDataStubSettings.defaultCredentialsProviderBuilder();
102103
}
103104

104-
/** Returns a builder for the default ChannelProvider for this service. */
105+
/** Returns a builder for the default gRPC ChannelProvider for this service. */
105106
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
106107
return AlphaAnalyticsDataStubSettings.defaultGrpcTransportProviderBuilder();
107108
}
108109

110+
/** Returns a builder for the default REST ChannelProvider for this service. */
111+
@BetaApi
112+
public static InstantiatingHttpJsonChannelProvider.Builder
113+
defaultHttpJsonTransportProviderBuilder() {
114+
return AlphaAnalyticsDataStubSettings.defaultHttpJsonTransportProviderBuilder();
115+
}
116+
109117
public static TransportChannelProvider defaultTransportChannelProvider() {
110118
return AlphaAnalyticsDataStubSettings.defaultTransportChannelProvider();
111119
}
@@ -115,11 +123,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
115123
return AlphaAnalyticsDataStubSettings.defaultApiClientHeaderProviderBuilder();
116124
}
117125

118-
/** Returns a new builder for this class. */
126+
/** Returns a new gRPC builder for this class. */
119127
public static Builder newBuilder() {
120128
return Builder.createDefault();
121129
}
122130

131+
/** Returns a new REST builder for this class. */
132+
@BetaApi
133+
public static Builder newHttpJsonBuilder() {
134+
return Builder.createHttpJsonDefault();
135+
}
136+
123137
/** Returns a new builder for this class. */
124138
public static Builder newBuilder(ClientContext clientContext) {
125139
return new Builder(clientContext);
@@ -157,6 +171,11 @@ private static Builder createDefault() {
157171
return new Builder(AlphaAnalyticsDataStubSettings.newBuilder());
158172
}
159173

174+
@BetaApi
175+
private static Builder createHttpJsonDefault() {
176+
return new Builder(AlphaAnalyticsDataStubSettings.newHttpJsonBuilder());
177+
}
178+
160179
public AlphaAnalyticsDataStubSettings.Builder getStubSettingsBuilder() {
161180
return ((AlphaAnalyticsDataStubSettings.Builder) getStubSettings());
162181
}

java-analytics-data/google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/stub/AlphaAnalyticsDataStubSettings.java

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
import com.google.api.gax.grpc.GaxGrpcProperties;
2727
import com.google.api.gax.grpc.GrpcTransportChannel;
2828
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
29+
import com.google.api.gax.httpjson.GaxHttpJsonProperties;
30+
import com.google.api.gax.httpjson.HttpJsonTransportChannel;
31+
import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
2932
import com.google.api.gax.retrying.RetrySettings;
3033
import com.google.api.gax.rpc.ApiClientHeaderProvider;
3134
import com.google.api.gax.rpc.ClientContext;
@@ -102,6 +105,11 @@ public AlphaAnalyticsDataStub createStub() throws IOException {
102105
.equals(GrpcTransportChannel.getGrpcTransportName())) {
103106
return GrpcAlphaAnalyticsDataStub.create(this);
104107
}
108+
if (getTransportChannelProvider()
109+
.getTransportName()
110+
.equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
111+
return HttpJsonAlphaAnalyticsDataStub.create(this);
112+
}
105113
throw new UnsupportedOperationException(
106114
String.format(
107115
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
@@ -134,30 +142,56 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
134142
.setUseJwtAccessWithScope(true);
135143
}
136144

137-
/** Returns a builder for the default ChannelProvider for this service. */
145+
/** Returns a builder for the default gRPC ChannelProvider for this service. */
138146
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
139147
return InstantiatingGrpcChannelProvider.newBuilder()
140148
.setMaxInboundMessageSize(Integer.MAX_VALUE);
141149
}
142150

151+
/** Returns a builder for the default REST ChannelProvider for this service. */
152+
@BetaApi
153+
public static InstantiatingHttpJsonChannelProvider.Builder
154+
defaultHttpJsonTransportProviderBuilder() {
155+
return InstantiatingHttpJsonChannelProvider.newBuilder();
156+
}
157+
143158
public static TransportChannelProvider defaultTransportChannelProvider() {
144159
return defaultGrpcTransportProviderBuilder().build();
145160
}
146161

147162
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
148-
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
163+
public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() {
149164
return ApiClientHeaderProvider.newBuilder()
150165
.setGeneratedLibToken(
151166
"gapic", GaxProperties.getLibraryVersion(AlphaAnalyticsDataStubSettings.class))
152167
.setTransportToken(
153168
GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion());
154169
}
155170

156-
/** Returns a new builder for this class. */
171+
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
172+
public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() {
173+
return ApiClientHeaderProvider.newBuilder()
174+
.setGeneratedLibToken(
175+
"gapic", GaxProperties.getLibraryVersion(AlphaAnalyticsDataStubSettings.class))
176+
.setTransportToken(
177+
GaxHttpJsonProperties.getHttpJsonTokenName(),
178+
GaxHttpJsonProperties.getHttpJsonVersion());
179+
}
180+
181+
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
182+
return AlphaAnalyticsDataStubSettings.defaultGrpcApiClientHeaderProviderBuilder();
183+
}
184+
185+
/** Returns a new gRPC builder for this class. */
157186
public static Builder newBuilder() {
158187
return Builder.createDefault();
159188
}
160189

190+
/** Returns a new REST builder for this class. */
191+
public static Builder newHttpJsonBuilder() {
192+
return Builder.createHttpJsonDefault();
193+
}
194+
161195
/** Returns a new builder for this class. */
162196
public static Builder newBuilder(ClientContext clientContext) {
163197
return new Builder(clientContext);
@@ -243,6 +277,19 @@ private static Builder createDefault() {
243277
return initDefaults(builder);
244278
}
245279

280+
private static Builder createHttpJsonDefault() {
281+
Builder builder = new Builder(((ClientContext) null));
282+
283+
builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build());
284+
builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
285+
builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build());
286+
builder.setEndpoint(getDefaultEndpoint());
287+
builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
288+
builder.setSwitchToMtlsEndpointAllowed(true);
289+
290+
return initDefaults(builder);
291+
}
292+
246293
private static Builder initDefaults(Builder builder) {
247294
builder
248295
.runFunnelReportSettings()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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.analytics.data.v1alpha.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.httpjson.longrunning.stub.OperationsStub;
25+
import com.google.api.gax.rpc.BatchingCallSettings;
26+
import com.google.api.gax.rpc.ClientContext;
27+
import com.google.api.gax.rpc.OperationCallSettings;
28+
import com.google.api.gax.rpc.OperationCallable;
29+
import com.google.api.gax.rpc.PagedCallSettings;
30+
import com.google.api.gax.rpc.ServerStreamingCallSettings;
31+
import com.google.api.gax.rpc.ServerStreamingCallable;
32+
import com.google.api.gax.rpc.UnaryCallSettings;
33+
import com.google.api.gax.rpc.UnaryCallable;
34+
import com.google.longrunning.Operation;
35+
import javax.annotation.Generated;
36+
37+
// AUTO-GENERATED DOCUMENTATION AND CLASS.
38+
/**
39+
* REST callable factory implementation for the AlphaAnalyticsData service API.
40+
*
41+
* <p>This class is for advanced usage.
42+
*/
43+
@BetaApi
44+
@Generated("by gapic-generator-java")
45+
public class HttpJsonAlphaAnalyticsDataCallableFactory
46+
implements HttpJsonStubCallableFactory<Operation, OperationsStub> {
47+
48+
@Override
49+
public <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createUnaryCallable(
50+
HttpJsonCallSettings<RequestT, ResponseT> httpJsonCallSettings,
51+
UnaryCallSettings<RequestT, ResponseT> callSettings,
52+
ClientContext clientContext) {
53+
return HttpJsonCallableFactory.createUnaryCallable(
54+
httpJsonCallSettings, callSettings, clientContext);
55+
}
56+
57+
@Override
58+
public <RequestT, ResponseT, PagedListResponseT>
59+
UnaryCallable<RequestT, PagedListResponseT> createPagedCallable(
60+
HttpJsonCallSettings<RequestT, ResponseT> httpJsonCallSettings,
61+
PagedCallSettings<RequestT, ResponseT, PagedListResponseT> callSettings,
62+
ClientContext clientContext) {
63+
return HttpJsonCallableFactory.createPagedCallable(
64+
httpJsonCallSettings, callSettings, clientContext);
65+
}
66+
67+
@Override
68+
public <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createBatchingCallable(
69+
HttpJsonCallSettings<RequestT, ResponseT> httpJsonCallSettings,
70+
BatchingCallSettings<RequestT, ResponseT> callSettings,
71+
ClientContext clientContext) {
72+
return HttpJsonCallableFactory.createBatchingCallable(
73+
httpJsonCallSettings, callSettings, clientContext);
74+
}
75+
76+
@BetaApi(
77+
"The surface for long-running operations is not stable yet and may change in the future.")
78+
@Override
79+
public <RequestT, ResponseT, MetadataT>
80+
OperationCallable<RequestT, ResponseT, MetadataT> createOperationCallable(
81+
HttpJsonCallSettings<RequestT, Operation> httpJsonCallSettings,
82+
OperationCallSettings<RequestT, ResponseT, MetadataT> callSettings,
83+
ClientContext clientContext,
84+
OperationsStub operationsStub) {
85+
UnaryCallable<RequestT, Operation> innerCallable =
86+
HttpJsonCallableFactory.createBaseUnaryCallable(
87+
httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext);
88+
HttpJsonOperationSnapshotCallable<RequestT, Operation> initialCallable =
89+
new HttpJsonOperationSnapshotCallable<RequestT, Operation>(
90+
innerCallable,
91+
httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory());
92+
return HttpJsonCallableFactory.createOperationCallable(
93+
callSettings, clientContext, operationsStub.longRunningClient(), initialCallable);
94+
}
95+
96+
@Override
97+
public <RequestT, ResponseT>
98+
ServerStreamingCallable<RequestT, ResponseT> createServerStreamingCallable(
99+
HttpJsonCallSettings<RequestT, ResponseT> httpJsonCallSettings,
100+
ServerStreamingCallSettings<RequestT, ResponseT> callSettings,
101+
ClientContext clientContext) {
102+
return HttpJsonCallableFactory.createServerStreamingCallable(
103+
httpJsonCallSettings, callSettings, clientContext);
104+
}
105+
}

0 commit comments

Comments
 (0)