diff --git a/java-analytics-admin/google-analytics-admin/src/main/java/com/google/analytics/admin/v1alpha/AnalyticsAdminServiceClient.java b/java-analytics-admin/google-analytics-admin/src/main/java/com/google/analytics/admin/v1alpha/AnalyticsAdminServiceClient.java
index 71bc4b552321..fe4023fbfb5f 100644
--- a/java-analytics-admin/google-analytics-admin/src/main/java/com/google/analytics/admin/v1alpha/AnalyticsAdminServiceClient.java
+++ b/java-analytics-admin/google-analytics-admin/src/main/java/com/google/analytics/admin/v1alpha/AnalyticsAdminServiceClient.java
@@ -103,6 +103,21 @@
* AnalyticsAdminServiceClient.create(analyticsAdminServiceSettings);
* }
*
+ * To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
+ * the wire:
+ *
+ *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * AnalyticsAdminServiceSettings analyticsAdminServiceSettings =
+ * AnalyticsAdminServiceSettings.newBuilder()
+ * .setTransportChannelProvider(
+ * AnalyticsAdminServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create(analyticsAdminServiceSettings);
+ * }
+ *
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@BetaApi
@@ -129,7 +144,6 @@ public static final AnalyticsAdminServiceClient create(AnalyticsAdminServiceSett
* Constructs an instance of AnalyticsAdminServiceClient, using the given stub for making calls.
* This is for advanced usage - prefer using create(AnalyticsAdminServiceSettings).
*/
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final AnalyticsAdminServiceClient create(AnalyticsAdminServiceStub stub) {
return new AnalyticsAdminServiceClient(stub);
}
@@ -144,7 +158,6 @@ protected AnalyticsAdminServiceClient(AnalyticsAdminServiceSettings settings) th
this.stub = ((AnalyticsAdminServiceStubSettings) settings.getStubSettings()).createStub();
}
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
protected AnalyticsAdminServiceClient(AnalyticsAdminServiceStub stub) {
this.settings = null;
this.stub = stub;
@@ -154,7 +167,6 @@ public final AnalyticsAdminServiceSettings getSettings() {
return settings;
}
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public AnalyticsAdminServiceStub getStub() {
return stub;
}
@@ -351,7 +363,7 @@ public final ListAccountsPagedResponse listAccounts(ListAccountsRequest request)
* while (true) {
* ListAccountsResponse response =
* analyticsAdminServiceClient.listAccountsCallable().call(request);
- * for (Account element : response.getResponsesList()) {
+ * for (Account element : response.getAccountsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -724,7 +736,7 @@ public final ListAccountSummariesPagedResponse listAccountSummaries(
* while (true) {
* ListAccountSummariesResponse response =
* analyticsAdminServiceClient.listAccountSummariesCallable().call(request);
- * for (AccountSummary element : response.getResponsesList()) {
+ * for (AccountSummary element : response.getAccountSummariesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -937,7 +949,7 @@ public final ListPropertiesPagedResponse listProperties(ListPropertiesRequest re
* while (true) {
* ListPropertiesResponse response =
* analyticsAdminServiceClient.listPropertiesCallable().call(request);
- * for (Property element : response.getResponsesList()) {
+ * for (Property element : response.getPropertiesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -1573,7 +1585,7 @@ public final ListUserLinksPagedResponse listUserLinks(ListUserLinksRequest reque
* while (true) {
* ListUserLinksResponse response =
* analyticsAdminServiceClient.listUserLinksCallable().call(request);
- * for (UserLink element : response.getResponsesList()) {
+ * for (UserLink element : response.getUserLinksList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -1690,7 +1702,7 @@ public final AuditUserLinksPagedResponse auditUserLinks(AuditUserLinksRequest re
* while (true) {
* AuditUserLinksResponse response =
* analyticsAdminServiceClient.auditUserLinksCallable().call(request);
- * for (AuditUserLink element : response.getResponsesList()) {
+ * for (AuditUserLink element : response.getUserLinksList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -2589,7 +2601,7 @@ public final ListFirebaseLinksPagedResponse listFirebaseLinks(ListFirebaseLinksR
* while (true) {
* ListFirebaseLinksResponse response =
* analyticsAdminServiceClient.listFirebaseLinksCallable().call(request);
- * for (FirebaseLink element : response.getResponsesList()) {
+ * for (FirebaseLink element : response.getFirebaseLinksList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -3165,7 +3177,7 @@ public final ListGoogleAdsLinksPagedResponse listGoogleAdsLinks(
* while (true) {
* ListGoogleAdsLinksResponse response =
* analyticsAdminServiceClient.listGoogleAdsLinksCallable().call(request);
- * for (GoogleAdsLink element : response.getResponsesList()) {
+ * for (GoogleAdsLink element : response.getGoogleAdsLinksList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -3561,7 +3573,7 @@ public final ListMeasurementProtocolSecretsPagedResponse listMeasurementProtocol
* while (true) {
* ListMeasurementProtocolSecretsResponse response =
* analyticsAdminServiceClient.listMeasurementProtocolSecretsCallable().call(request);
- * for (MeasurementProtocolSecret element : response.getResponsesList()) {
+ * for (MeasurementProtocolSecret element : response.getMeasurementProtocolSecretsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -4083,7 +4095,7 @@ public final SearchChangeHistoryEventsPagedResponse searchChangeHistoryEvents(
* while (true) {
* SearchChangeHistoryEventsResponse response =
* analyticsAdminServiceClient.searchChangeHistoryEventsCallable().call(request);
- * for (ChangeHistoryEvent element : response.getResponsesList()) {
+ * for (ChangeHistoryEvent element : response.getChangeHistoryEventsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -4792,7 +4804,7 @@ public final ListConversionEventsPagedResponse listConversionEvents(
* while (true) {
* ListConversionEventsResponse response =
* analyticsAdminServiceClient.listConversionEventsCallable().call(request);
- * for (ConversionEvent element : response.getResponsesList()) {
+ * for (ConversionEvent element : response.getConversionEventsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -5080,7 +5092,8 @@ public final ListDisplayVideo360AdvertiserLinksPagedResponse listDisplayVideo360
* while (true) {
* ListDisplayVideo360AdvertiserLinksResponse response =
* analyticsAdminServiceClient.listDisplayVideo360AdvertiserLinksCallable().call(request);
- * for (DisplayVideo360AdvertiserLink element : response.getResponsesList()) {
+ * for (DisplayVideo360AdvertiserLink element :
+ * response.getDisplayVideo360AdvertiserLinksList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -5737,7 +5750,8 @@ public final DisplayVideo360AdvertiserLinkProposal getDisplayVideo360AdvertiserL
* analyticsAdminServiceClient
* .listDisplayVideo360AdvertiserLinkProposalsCallable()
* .call(request);
- * for (DisplayVideo360AdvertiserLinkProposal element : response.getResponsesList()) {
+ * for (DisplayVideo360AdvertiserLinkProposal element :
+ * response.getDisplayVideo360AdvertiserLinkProposalsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -6501,7 +6515,7 @@ public final ListCustomDimensionsPagedResponse listCustomDimensions(
* while (true) {
* ListCustomDimensionsResponse response =
* analyticsAdminServiceClient.listCustomDimensionsCallable().call(request);
- * for (CustomDimension element : response.getResponsesList()) {
+ * for (CustomDimension element : response.getCustomDimensionsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -6530,7 +6544,7 @@ public final ListCustomDimensionsPagedResponse listCustomDimensions(
* // It may require modifications to work in your environment.
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
* AnalyticsAdminServiceClient.create()) {
- * CustomDimensionName name = CustomDimensionName.of("[PROPERTY]");
+ * CustomDimensionName name = CustomDimensionName.of("[PROPERTY]", "[CUSTOM_DIMENSION]");
* analyticsAdminServiceClient.archiveCustomDimension(name);
* }
* }
@@ -6558,7 +6572,7 @@ public final void archiveCustomDimension(CustomDimensionName name) {
* // It may require modifications to work in your environment.
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
* AnalyticsAdminServiceClient.create()) {
- * String name = CustomDimensionName.of("[PROPERTY]").toString();
+ * String name = CustomDimensionName.of("[PROPERTY]", "[CUSTOM_DIMENSION]").toString();
* analyticsAdminServiceClient.archiveCustomDimension(name);
* }
* }
@@ -6586,7 +6600,7 @@ public final void archiveCustomDimension(String name) {
* AnalyticsAdminServiceClient.create()) {
* ArchiveCustomDimensionRequest request =
* ArchiveCustomDimensionRequest.newBuilder()
- * .setName(CustomDimensionName.of("[PROPERTY]").toString())
+ * .setName(CustomDimensionName.of("[PROPERTY]", "[CUSTOM_DIMENSION]").toString())
* .build();
* analyticsAdminServiceClient.archiveCustomDimension(request);
* }
@@ -6612,7 +6626,7 @@ public final void archiveCustomDimension(ArchiveCustomDimensionRequest request)
* AnalyticsAdminServiceClient.create()) {
* ArchiveCustomDimensionRequest request =
* ArchiveCustomDimensionRequest.newBuilder()
- * .setName(CustomDimensionName.of("[PROPERTY]").toString())
+ * .setName(CustomDimensionName.of("[PROPERTY]", "[CUSTOM_DIMENSION]").toString())
* .build();
* ApiFuture future =
* analyticsAdminServiceClient.archiveCustomDimensionCallable().futureCall(request);
@@ -6637,7 +6651,7 @@ public final void archiveCustomDimension(ArchiveCustomDimensionRequest request)
* // It may require modifications to work in your environment.
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
* AnalyticsAdminServiceClient.create()) {
- * CustomDimensionName name = CustomDimensionName.of("[PROPERTY]");
+ * CustomDimensionName name = CustomDimensionName.of("[PROPERTY]", "[CUSTOM_DIMENSION]");
* CustomDimension response = analyticsAdminServiceClient.getCustomDimension(name);
* }
* }
@@ -6665,7 +6679,7 @@ public final CustomDimension getCustomDimension(CustomDimensionName name) {
* // It may require modifications to work in your environment.
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
* AnalyticsAdminServiceClient.create()) {
- * String name = CustomDimensionName.of("[PROPERTY]").toString();
+ * String name = CustomDimensionName.of("[PROPERTY]", "[CUSTOM_DIMENSION]").toString();
* CustomDimension response = analyticsAdminServiceClient.getCustomDimension(name);
* }
* }
@@ -6693,7 +6707,7 @@ public final CustomDimension getCustomDimension(String name) {
* AnalyticsAdminServiceClient.create()) {
* GetCustomDimensionRequest request =
* GetCustomDimensionRequest.newBuilder()
- * .setName(CustomDimensionName.of("[PROPERTY]").toString())
+ * .setName(CustomDimensionName.of("[PROPERTY]", "[CUSTOM_DIMENSION]").toString())
* .build();
* CustomDimension response = analyticsAdminServiceClient.getCustomDimension(request);
* }
@@ -6719,7 +6733,7 @@ public final CustomDimension getCustomDimension(GetCustomDimensionRequest reques
* AnalyticsAdminServiceClient.create()) {
* GetCustomDimensionRequest request =
* GetCustomDimensionRequest.newBuilder()
- * .setName(CustomDimensionName.of("[PROPERTY]").toString())
+ * .setName(CustomDimensionName.of("[PROPERTY]", "[CUSTOM_DIMENSION]").toString())
* .build();
* ApiFuture future =
* analyticsAdminServiceClient.getCustomDimensionCallable().futureCall(request);
@@ -7074,7 +7088,7 @@ public final ListCustomMetricsPagedResponse listCustomMetrics(ListCustomMetricsR
* while (true) {
* ListCustomMetricsResponse response =
* analyticsAdminServiceClient.listCustomMetricsCallable().call(request);
- * for (CustomMetric element : response.getResponsesList()) {
+ * for (CustomMetric element : response.getCustomMetricsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -7103,7 +7117,7 @@ public final ListCustomMetricsPagedResponse listCustomMetrics(ListCustomMetricsR
* // It may require modifications to work in your environment.
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
* AnalyticsAdminServiceClient.create()) {
- * CustomMetricName name = CustomMetricName.of("[PROPERTY]");
+ * CustomMetricName name = CustomMetricName.of("[PROPERTY]", "[CUSTOM_METRIC]");
* analyticsAdminServiceClient.archiveCustomMetric(name);
* }
* }
@@ -7131,7 +7145,7 @@ public final void archiveCustomMetric(CustomMetricName name) {
* // It may require modifications to work in your environment.
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
* AnalyticsAdminServiceClient.create()) {
- * String name = CustomMetricName.of("[PROPERTY]").toString();
+ * String name = CustomMetricName.of("[PROPERTY]", "[CUSTOM_METRIC]").toString();
* analyticsAdminServiceClient.archiveCustomMetric(name);
* }
* }
@@ -7159,7 +7173,7 @@ public final void archiveCustomMetric(String name) {
* AnalyticsAdminServiceClient.create()) {
* ArchiveCustomMetricRequest request =
* ArchiveCustomMetricRequest.newBuilder()
- * .setName(CustomMetricName.of("[PROPERTY]").toString())
+ * .setName(CustomMetricName.of("[PROPERTY]", "[CUSTOM_METRIC]").toString())
* .build();
* analyticsAdminServiceClient.archiveCustomMetric(request);
* }
@@ -7185,7 +7199,7 @@ public final void archiveCustomMetric(ArchiveCustomMetricRequest request) {
* AnalyticsAdminServiceClient.create()) {
* ArchiveCustomMetricRequest request =
* ArchiveCustomMetricRequest.newBuilder()
- * .setName(CustomMetricName.of("[PROPERTY]").toString())
+ * .setName(CustomMetricName.of("[PROPERTY]", "[CUSTOM_METRIC]").toString())
* .build();
* ApiFuture future =
* analyticsAdminServiceClient.archiveCustomMetricCallable().futureCall(request);
@@ -7209,7 +7223,7 @@ public final UnaryCallable archiveCustomMetri
* // It may require modifications to work in your environment.
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
* AnalyticsAdminServiceClient.create()) {
- * CustomMetricName name = CustomMetricName.of("[PROPERTY]");
+ * CustomMetricName name = CustomMetricName.of("[PROPERTY]", "[CUSTOM_METRIC]");
* CustomMetric response = analyticsAdminServiceClient.getCustomMetric(name);
* }
* }
@@ -7235,7 +7249,7 @@ public final CustomMetric getCustomMetric(CustomMetricName name) {
* // It may require modifications to work in your environment.
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
* AnalyticsAdminServiceClient.create()) {
- * String name = CustomMetricName.of("[PROPERTY]").toString();
+ * String name = CustomMetricName.of("[PROPERTY]", "[CUSTOM_METRIC]").toString();
* CustomMetric response = analyticsAdminServiceClient.getCustomMetric(name);
* }
* }
@@ -7262,7 +7276,7 @@ public final CustomMetric getCustomMetric(String name) {
* AnalyticsAdminServiceClient.create()) {
* GetCustomMetricRequest request =
* GetCustomMetricRequest.newBuilder()
- * .setName(CustomMetricName.of("[PROPERTY]").toString())
+ * .setName(CustomMetricName.of("[PROPERTY]", "[CUSTOM_METRIC]").toString())
* .build();
* CustomMetric response = analyticsAdminServiceClient.getCustomMetric(request);
* }
@@ -7288,7 +7302,7 @@ public final CustomMetric getCustomMetric(GetCustomMetricRequest request) {
* AnalyticsAdminServiceClient.create()) {
* GetCustomMetricRequest request =
* GetCustomMetricRequest.newBuilder()
- * .setName(CustomMetricName.of("[PROPERTY]").toString())
+ * .setName(CustomMetricName.of("[PROPERTY]", "[CUSTOM_METRIC]").toString())
* .build();
* ApiFuture future =
* analyticsAdminServiceClient.getCustomMetricCallable().futureCall(request);
@@ -7941,7 +7955,7 @@ public final ListDataStreamsPagedResponse listDataStreams(ListDataStreamsRequest
* while (true) {
* ListDataStreamsResponse response =
* analyticsAdminServiceClient.listDataStreamsCallable().call(request);
- * for (DataStream element : response.getResponsesList()) {
+ * for (DataStream element : response.getDataStreamsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
diff --git a/java-analytics-admin/google-analytics-admin/src/main/java/com/google/analytics/admin/v1alpha/AnalyticsAdminServiceSettings.java b/java-analytics-admin/google-analytics-admin/src/main/java/com/google/analytics/admin/v1alpha/AnalyticsAdminServiceSettings.java
index b8d36ed3a08a..e8fefe83f2ae 100644
--- a/java-analytics-admin/google-analytics-admin/src/main/java/com/google/analytics/admin/v1alpha/AnalyticsAdminServiceSettings.java
+++ b/java-analytics-admin/google-analytics-admin/src/main/java/com/google/analytics/admin/v1alpha/AnalyticsAdminServiceSettings.java
@@ -38,6 +38,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
@@ -589,11 +590,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return AnalyticsAdminServiceStubSettings.defaultCredentialsProviderBuilder();
}
- /** Returns a builder for the default ChannelProvider for this service. */
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return AnalyticsAdminServiceStubSettings.defaultGrpcTransportProviderBuilder();
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return AnalyticsAdminServiceStubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return AnalyticsAdminServiceStubSettings.defaultTransportChannelProvider();
}
@@ -603,11 +611,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return AnalyticsAdminServiceStubSettings.defaultApiClientHeaderProviderBuilder();
}
- /** Returns a new builder for this class. */
+ /** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}
+ /** Returns a new REST builder for this class. */
+ @BetaApi
+ public static Builder newHttpJsonBuilder() {
+ return Builder.createHttpJsonDefault();
+ }
+
/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
@@ -646,6 +660,11 @@ private static Builder createDefault() {
return new Builder(AnalyticsAdminServiceStubSettings.newBuilder());
}
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(AnalyticsAdminServiceStubSettings.newHttpJsonBuilder());
+ }
+
public AnalyticsAdminServiceStubSettings.Builder getStubSettingsBuilder() {
return ((AnalyticsAdminServiceStubSettings.Builder) getStubSettings());
}
diff --git a/java-analytics-admin/google-analytics-admin/src/main/java/com/google/analytics/admin/v1alpha/stub/AnalyticsAdminServiceStubSettings.java b/java-analytics-admin/google-analytics-admin/src/main/java/com/google/analytics/admin/v1alpha/stub/AnalyticsAdminServiceStubSettings.java
index 20e86b233a25..d2d87e5ff029 100644
--- a/java-analytics-admin/google-analytics-admin/src/main/java/com/google/analytics/admin/v1alpha/stub/AnalyticsAdminServiceStubSettings.java
+++ b/java-analytics-admin/google-analytics-admin/src/main/java/com/google/analytics/admin/v1alpha/stub/AnalyticsAdminServiceStubSettings.java
@@ -152,6 +152,9 @@
import com.google.api.gax.grpc.GaxGrpcProperties;
import com.google.api.gax.grpc.GrpcTransportChannel;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.httpjson.GaxHttpJsonProperties;
+import com.google.api.gax.httpjson.HttpJsonTransportChannel;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.rpc.ApiCallContext;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
@@ -1811,13 +1814,17 @@ public UnaryCallSettings getDataStreamSettings
return getDataStreamSettings;
}
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public AnalyticsAdminServiceStub createStub() throws IOException {
if (getTransportChannelProvider()
.getTransportName()
.equals(GrpcTransportChannel.getGrpcTransportName())) {
return GrpcAnalyticsAdminServiceStub.create(this);
}
+ if (getTransportChannelProvider()
+ .getTransportName()
+ .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
+ return HttpJsonAnalyticsAdminServiceStub.create(this);
+ }
throw new UnsupportedOperationException(
String.format(
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
@@ -1850,18 +1857,25 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
.setUseJwtAccessWithScope(true);
}
- /** Returns a builder for the default ChannelProvider for this service. */
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return InstantiatingGrpcChannelProvider.newBuilder()
.setMaxInboundMessageSize(Integer.MAX_VALUE);
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return InstantiatingHttpJsonChannelProvider.newBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return defaultGrpcTransportProviderBuilder().build();
}
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
- public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() {
return ApiClientHeaderProvider.newBuilder()
.setGeneratedLibToken(
"gapic", GaxProperties.getLibraryVersion(AnalyticsAdminServiceStubSettings.class))
@@ -1869,11 +1883,30 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion());
}
- /** Returns a new builder for this class. */
+ @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
+ public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() {
+ return ApiClientHeaderProvider.newBuilder()
+ .setGeneratedLibToken(
+ "gapic", GaxProperties.getLibraryVersion(AnalyticsAdminServiceStubSettings.class))
+ .setTransportToken(
+ GaxHttpJsonProperties.getHttpJsonTokenName(),
+ GaxHttpJsonProperties.getHttpJsonVersion());
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return AnalyticsAdminServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder();
+ }
+
+ /** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}
+ /** Returns a new REST builder for this class. */
+ public static Builder newHttpJsonBuilder() {
+ return Builder.createHttpJsonDefault();
+ }
+
/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
@@ -2546,6 +2579,19 @@ private static Builder createDefault() {
return initDefaults(builder);
}
+ private static Builder createHttpJsonDefault() {
+ Builder builder = new Builder(((ClientContext) null));
+
+ builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build());
+ builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
+ builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build());
+ builder.setEndpoint(getDefaultEndpoint());
+ builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
+ builder.setSwitchToMtlsEndpointAllowed(true);
+
+ return initDefaults(builder);
+ }
+
private static Builder initDefaults(Builder builder) {
builder
.getAccountSettings()
diff --git a/java-analytics-admin/google-analytics-admin/src/main/java/com/google/analytics/admin/v1alpha/stub/HttpJsonAnalyticsAdminServiceCallableFactory.java b/java-analytics-admin/google-analytics-admin/src/main/java/com/google/analytics/admin/v1alpha/stub/HttpJsonAnalyticsAdminServiceCallableFactory.java
new file mode 100644
index 000000000000..6a28742c90c0
--- /dev/null
+++ b/java-analytics-admin/google-analytics-admin/src/main/java/com/google/analytics/admin/v1alpha/stub/HttpJsonAnalyticsAdminServiceCallableFactory.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.analytics.admin.v1alpha.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonCallableFactory;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.longrunning.stub.OperationsStub;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST callable factory implementation for the AnalyticsAdminService service API.
+ *
+ * This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonAnalyticsAdminServiceCallableFactory
+ implements HttpJsonStubCallableFactory {
+
+ @Override
+ public UnaryCallable createUnaryCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ UnaryCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createUnaryCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ UnaryCallable createPagedCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ PagedCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createPagedCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public UnaryCallable createBatchingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ BatchingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createBatchingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ @Override
+ public
+ OperationCallable createOperationCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ OperationCallSettings callSettings,
+ ClientContext clientContext,
+ OperationsStub operationsStub) {
+ UnaryCallable innerCallable =
+ HttpJsonCallableFactory.createBaseUnaryCallable(
+ httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext);
+ HttpJsonOperationSnapshotCallable initialCallable =
+ new HttpJsonOperationSnapshotCallable(
+ innerCallable,
+ httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory());
+ return HttpJsonCallableFactory.createOperationCallable(
+ callSettings, clientContext, operationsStub.longRunningClient(), initialCallable);
+ }
+
+ @Override
+ public
+ ServerStreamingCallable createServerStreamingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ ServerStreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createServerStreamingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+}
diff --git a/java-analytics-admin/google-analytics-admin/src/main/java/com/google/analytics/admin/v1alpha/stub/HttpJsonAnalyticsAdminServiceStub.java b/java-analytics-admin/google-analytics-admin/src/main/java/com/google/analytics/admin/v1alpha/stub/HttpJsonAnalyticsAdminServiceStub.java
new file mode 100644
index 000000000000..06b153f7a698
--- /dev/null
+++ b/java-analytics-admin/google-analytics-admin/src/main/java/com/google/analytics/admin/v1alpha/stub/HttpJsonAnalyticsAdminServiceStub.java
@@ -0,0 +1,4505 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.analytics.admin.v1alpha.stub;
+
+import static com.google.analytics.admin.v1alpha.AnalyticsAdminServiceClient.AuditUserLinksPagedResponse;
+import static com.google.analytics.admin.v1alpha.AnalyticsAdminServiceClient.ListAccountSummariesPagedResponse;
+import static com.google.analytics.admin.v1alpha.AnalyticsAdminServiceClient.ListAccountsPagedResponse;
+import static com.google.analytics.admin.v1alpha.AnalyticsAdminServiceClient.ListConversionEventsPagedResponse;
+import static com.google.analytics.admin.v1alpha.AnalyticsAdminServiceClient.ListCustomDimensionsPagedResponse;
+import static com.google.analytics.admin.v1alpha.AnalyticsAdminServiceClient.ListCustomMetricsPagedResponse;
+import static com.google.analytics.admin.v1alpha.AnalyticsAdminServiceClient.ListDataStreamsPagedResponse;
+import static com.google.analytics.admin.v1alpha.AnalyticsAdminServiceClient.ListDisplayVideo360AdvertiserLinkProposalsPagedResponse;
+import static com.google.analytics.admin.v1alpha.AnalyticsAdminServiceClient.ListDisplayVideo360AdvertiserLinksPagedResponse;
+import static com.google.analytics.admin.v1alpha.AnalyticsAdminServiceClient.ListFirebaseLinksPagedResponse;
+import static com.google.analytics.admin.v1alpha.AnalyticsAdminServiceClient.ListGoogleAdsLinksPagedResponse;
+import static com.google.analytics.admin.v1alpha.AnalyticsAdminServiceClient.ListMeasurementProtocolSecretsPagedResponse;
+import static com.google.analytics.admin.v1alpha.AnalyticsAdminServiceClient.ListPropertiesPagedResponse;
+import static com.google.analytics.admin.v1alpha.AnalyticsAdminServiceClient.ListUserLinksPagedResponse;
+import static com.google.analytics.admin.v1alpha.AnalyticsAdminServiceClient.SearchChangeHistoryEventsPagedResponse;
+
+import com.google.analytics.admin.v1alpha.Account;
+import com.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionRequest;
+import com.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionResponse;
+import com.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalRequest;
+import com.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalResponse;
+import com.google.analytics.admin.v1alpha.ArchiveCustomDimensionRequest;
+import com.google.analytics.admin.v1alpha.ArchiveCustomMetricRequest;
+import com.google.analytics.admin.v1alpha.AuditUserLinksRequest;
+import com.google.analytics.admin.v1alpha.AuditUserLinksResponse;
+import com.google.analytics.admin.v1alpha.BatchCreateUserLinksRequest;
+import com.google.analytics.admin.v1alpha.BatchCreateUserLinksResponse;
+import com.google.analytics.admin.v1alpha.BatchDeleteUserLinksRequest;
+import com.google.analytics.admin.v1alpha.BatchGetUserLinksRequest;
+import com.google.analytics.admin.v1alpha.BatchGetUserLinksResponse;
+import com.google.analytics.admin.v1alpha.BatchUpdateUserLinksRequest;
+import com.google.analytics.admin.v1alpha.BatchUpdateUserLinksResponse;
+import com.google.analytics.admin.v1alpha.CancelDisplayVideo360AdvertiserLinkProposalRequest;
+import com.google.analytics.admin.v1alpha.ConversionEvent;
+import com.google.analytics.admin.v1alpha.CreateConversionEventRequest;
+import com.google.analytics.admin.v1alpha.CreateCustomDimensionRequest;
+import com.google.analytics.admin.v1alpha.CreateCustomMetricRequest;
+import com.google.analytics.admin.v1alpha.CreateDataStreamRequest;
+import com.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkProposalRequest;
+import com.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkRequest;
+import com.google.analytics.admin.v1alpha.CreateFirebaseLinkRequest;
+import com.google.analytics.admin.v1alpha.CreateGoogleAdsLinkRequest;
+import com.google.analytics.admin.v1alpha.CreateMeasurementProtocolSecretRequest;
+import com.google.analytics.admin.v1alpha.CreatePropertyRequest;
+import com.google.analytics.admin.v1alpha.CreateUserLinkRequest;
+import com.google.analytics.admin.v1alpha.CustomDimension;
+import com.google.analytics.admin.v1alpha.CustomMetric;
+import com.google.analytics.admin.v1alpha.DataRetentionSettings;
+import com.google.analytics.admin.v1alpha.DataSharingSettings;
+import com.google.analytics.admin.v1alpha.DataStream;
+import com.google.analytics.admin.v1alpha.DeleteAccountRequest;
+import com.google.analytics.admin.v1alpha.DeleteConversionEventRequest;
+import com.google.analytics.admin.v1alpha.DeleteDataStreamRequest;
+import com.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkProposalRequest;
+import com.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkRequest;
+import com.google.analytics.admin.v1alpha.DeleteFirebaseLinkRequest;
+import com.google.analytics.admin.v1alpha.DeleteGoogleAdsLinkRequest;
+import com.google.analytics.admin.v1alpha.DeleteMeasurementProtocolSecretRequest;
+import com.google.analytics.admin.v1alpha.DeletePropertyRequest;
+import com.google.analytics.admin.v1alpha.DeleteUserLinkRequest;
+import com.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink;
+import com.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal;
+import com.google.analytics.admin.v1alpha.FirebaseLink;
+import com.google.analytics.admin.v1alpha.GetAccountRequest;
+import com.google.analytics.admin.v1alpha.GetConversionEventRequest;
+import com.google.analytics.admin.v1alpha.GetCustomDimensionRequest;
+import com.google.analytics.admin.v1alpha.GetCustomMetricRequest;
+import com.google.analytics.admin.v1alpha.GetDataRetentionSettingsRequest;
+import com.google.analytics.admin.v1alpha.GetDataSharingSettingsRequest;
+import com.google.analytics.admin.v1alpha.GetDataStreamRequest;
+import com.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkProposalRequest;
+import com.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkRequest;
+import com.google.analytics.admin.v1alpha.GetGlobalSiteTagRequest;
+import com.google.analytics.admin.v1alpha.GetGoogleSignalsSettingsRequest;
+import com.google.analytics.admin.v1alpha.GetMeasurementProtocolSecretRequest;
+import com.google.analytics.admin.v1alpha.GetPropertyRequest;
+import com.google.analytics.admin.v1alpha.GetUserLinkRequest;
+import com.google.analytics.admin.v1alpha.GlobalSiteTag;
+import com.google.analytics.admin.v1alpha.GoogleAdsLink;
+import com.google.analytics.admin.v1alpha.GoogleSignalsSettings;
+import com.google.analytics.admin.v1alpha.ListAccountSummariesRequest;
+import com.google.analytics.admin.v1alpha.ListAccountSummariesResponse;
+import com.google.analytics.admin.v1alpha.ListAccountsRequest;
+import com.google.analytics.admin.v1alpha.ListAccountsResponse;
+import com.google.analytics.admin.v1alpha.ListConversionEventsRequest;
+import com.google.analytics.admin.v1alpha.ListConversionEventsResponse;
+import com.google.analytics.admin.v1alpha.ListCustomDimensionsRequest;
+import com.google.analytics.admin.v1alpha.ListCustomDimensionsResponse;
+import com.google.analytics.admin.v1alpha.ListCustomMetricsRequest;
+import com.google.analytics.admin.v1alpha.ListCustomMetricsResponse;
+import com.google.analytics.admin.v1alpha.ListDataStreamsRequest;
+import com.google.analytics.admin.v1alpha.ListDataStreamsResponse;
+import com.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest;
+import com.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsResponse;
+import com.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest;
+import com.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksResponse;
+import com.google.analytics.admin.v1alpha.ListFirebaseLinksRequest;
+import com.google.analytics.admin.v1alpha.ListFirebaseLinksResponse;
+import com.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest;
+import com.google.analytics.admin.v1alpha.ListGoogleAdsLinksResponse;
+import com.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest;
+import com.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsResponse;
+import com.google.analytics.admin.v1alpha.ListPropertiesRequest;
+import com.google.analytics.admin.v1alpha.ListPropertiesResponse;
+import com.google.analytics.admin.v1alpha.ListUserLinksRequest;
+import com.google.analytics.admin.v1alpha.ListUserLinksResponse;
+import com.google.analytics.admin.v1alpha.MeasurementProtocolSecret;
+import com.google.analytics.admin.v1alpha.Property;
+import com.google.analytics.admin.v1alpha.ProvisionAccountTicketRequest;
+import com.google.analytics.admin.v1alpha.ProvisionAccountTicketResponse;
+import com.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest;
+import com.google.analytics.admin.v1alpha.SearchChangeHistoryEventsResponse;
+import com.google.analytics.admin.v1alpha.UpdateAccountRequest;
+import com.google.analytics.admin.v1alpha.UpdateCustomDimensionRequest;
+import com.google.analytics.admin.v1alpha.UpdateCustomMetricRequest;
+import com.google.analytics.admin.v1alpha.UpdateDataRetentionSettingsRequest;
+import com.google.analytics.admin.v1alpha.UpdateDataStreamRequest;
+import com.google.analytics.admin.v1alpha.UpdateDisplayVideo360AdvertiserLinkRequest;
+import com.google.analytics.admin.v1alpha.UpdateGoogleAdsLinkRequest;
+import com.google.analytics.admin.v1alpha.UpdateGoogleSignalsSettingsRequest;
+import com.google.analytics.admin.v1alpha.UpdateMeasurementProtocolSecretRequest;
+import com.google.analytics.admin.v1alpha.UpdatePropertyRequest;
+import com.google.analytics.admin.v1alpha.UpdateUserLinkRequest;
+import com.google.analytics.admin.v1alpha.UserLink;
+import com.google.api.core.BetaApi;
+import com.google.api.core.InternalApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.core.BackgroundResourceAggregation;
+import com.google.api.gax.httpjson.ApiMethodDescriptor;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.ProtoMessageRequestFormatter;
+import com.google.api.gax.httpjson.ProtoMessageResponseParser;
+import com.google.api.gax.httpjson.ProtoRestSerializer;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.protobuf.Empty;
+import com.google.protobuf.TypeRegistry;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST stub implementation for the AnalyticsAdminService service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonAnalyticsAdminServiceStub extends AnalyticsAdminServiceStub {
+ private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build();
+
+ private static final ApiMethodDescriptor getAccountMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.analytics.admin.v1alpha.AnalyticsAdminService/GetAccount")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{name=accounts/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Account.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ listAccountsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/ListAccounts")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/accounts",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ serializer.putQueryParam(
+ fields, "showDeleted", request.getShowDeleted());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListAccountsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteAccountMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/DeleteAccount")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{name=accounts/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Empty.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateAccountMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/UpdateAccount")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{account.name=accounts/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "account.name", request.getAccount().getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create().toBody("account", request.getAccount()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Account.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor<
+ ProvisionAccountTicketRequest, ProvisionAccountTicketResponse>
+ provisionAccountTicketMethodDescriptor =
+ ApiMethodDescriptor
+ .newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/ProvisionAccountTicket")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/accounts:provisionAccountTicket",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create().toBody("*", request.toBuilder().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ProvisionAccountTicketResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor<
+ ListAccountSummariesRequest, ListAccountSummariesResponse>
+ listAccountSummariesMethodDescriptor =
+ ApiMethodDescriptor
+ .newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/ListAccountSummaries")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/accountSummaries",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListAccountSummariesResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getPropertyMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.analytics.admin.v1alpha.AnalyticsAdminService/GetProperty")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{name=properties/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Property.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ listPropertiesMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/ListProperties")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/properties",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "filter", request.getFilter());
+ serializer.putQueryParam(fields, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ serializer.putQueryParam(
+ fields, "showDeleted", request.getShowDeleted());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListPropertiesResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ createPropertyMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/CreateProperty")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/properties",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("property", request.getProperty()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Property.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ deletePropertyMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/DeleteProperty")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{name=properties/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Property.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ updatePropertyMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/UpdateProperty")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{property.name=properties/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "property.name", request.getProperty().getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("property", request.getProperty()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Property.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getUserLinkMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.analytics.admin.v1alpha.AnalyticsAdminService/GetUserLink")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{name=accounts/*/userLinks/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setAdditionalPaths("/v1alpha/{name=properties/*/userLinks/*}")
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(UserLink.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ batchGetUserLinksMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/BatchGetUserLinks")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{parent=accounts/*}/userLinks:batchGet",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setAdditionalPaths("/v1alpha/{parent=properties/*}/userLinks:batchGet")
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "names", request.getNamesList());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(BatchGetUserLinksResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ listUserLinksMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/ListUserLinks")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{parent=accounts/*}/userLinks",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setAdditionalPaths("/v1alpha/{parent=properties/*}/userLinks")
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListUserLinksResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ auditUserLinksMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/AuditUserLinks")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{parent=accounts/*}/userLinks:audit",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setAdditionalPaths("/v1alpha/{parent=properties/*}/userLinks:audit")
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearParent().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(AuditUserLinksResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ createUserLinkMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/CreateUserLink")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{parent=accounts/*}/userLinks",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setAdditionalPaths("/v1alpha/{parent=properties/*}/userLinks")
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(
+ fields, "notifyNewUser", request.getNotifyNewUser());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("userLink", request.getUserLink()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(UserLink.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor<
+ BatchCreateUserLinksRequest, BatchCreateUserLinksResponse>
+ batchCreateUserLinksMethodDescriptor =
+ ApiMethodDescriptor
+ .newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/BatchCreateUserLinks")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{parent=accounts/*}/userLinks:batchCreate",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setAdditionalPaths("/v1alpha/{parent=properties/*}/userLinks:batchCreate")
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearParent().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(BatchCreateUserLinksResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateUserLinkMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/UpdateUserLink")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{userLink.name=accounts/*/userLinks/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "userLink.name", request.getUserLink().getName());
+ return fields;
+ })
+ .setAdditionalPaths("/v1alpha/{userLink.name=properties/*/userLinks/*}")
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("userLink", request.getUserLink()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(UserLink.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor<
+ BatchUpdateUserLinksRequest, BatchUpdateUserLinksResponse>
+ batchUpdateUserLinksMethodDescriptor =
+ ApiMethodDescriptor
+ .newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/BatchUpdateUserLinks")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{parent=accounts/*}/userLinks:batchUpdate",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setAdditionalPaths("/v1alpha/{parent=properties/*}/userLinks:batchUpdate")
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearParent().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(BatchUpdateUserLinksResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteUserLinkMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/DeleteUserLink")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{name=accounts/*/userLinks/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setAdditionalPaths("/v1alpha/{name=properties/*/userLinks/*}")
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Empty.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ batchDeleteUserLinksMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/BatchDeleteUserLinks")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{parent=accounts/*}/userLinks:batchDelete",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setAdditionalPaths("/v1alpha/{parent=properties/*}/userLinks:batchDelete")
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearParent().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Empty.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ createFirebaseLinkMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/CreateFirebaseLink")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{parent=properties/*}/firebaseLinks",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("firebaseLink", request.getFirebaseLink()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(FirebaseLink.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteFirebaseLinkMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/DeleteFirebaseLink")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{name=properties/*/firebaseLinks/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Empty.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ listFirebaseLinksMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/ListFirebaseLinks")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{parent=properties/*}/firebaseLinks",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListFirebaseLinksResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getGlobalSiteTagMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/GetGlobalSiteTag")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{name=properties/*/dataStreams/*/globalSiteTag}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(GlobalSiteTag.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ createGoogleAdsLinkMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/CreateGoogleAdsLink")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{parent=properties/*}/googleAdsLinks",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("googleAdsLink", request.getGoogleAdsLink()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(GoogleAdsLink.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateGoogleAdsLinkMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/UpdateGoogleAdsLink")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{googleAdsLink.name=properties/*/googleAdsLinks/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "googleAdsLink.name", request.getGoogleAdsLink().getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("googleAdsLink", request.getGoogleAdsLink()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(GoogleAdsLink.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteGoogleAdsLinkMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.analytics.admin.v1alpha.AnalyticsAdminService/DeleteGoogleAdsLink")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1alpha/{name=properties/*/googleAdsLinks/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Empty.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor