Skip to content
This repository has been archived by the owner on Jan 22, 2024. It is now read-only.

Commit

Permalink
fix!: rename the 'page_size', 'page_token', 'total_size' fields to 'l…
Browse files Browse the repository at this point in the history
…imit', 'offset' and 'row_count' respectively

PiperOrigin-RevId: 361182102

Source-Link: googleapis/googleapis@d4cd8d9

Source-Author: Bazel Bot <bazel-bot-development[bot]@users.noreply.github.com>
Source-Date: Fri Mar 5 22:43:03 2021 +0000
Source-Repo: googleapis/googleapis-gen
Source-Sha: 18e181194cd6da98340da7096f2b8df0c2b6aa9b
Source-Link: googleapis/googleapis-gen@18e1811
  • Loading branch information
yoshi-automation committed Mar 5, 2021
1 parent b093093 commit ebc1a85
Show file tree
Hide file tree
Showing 19 changed files with 570 additions and 1,177 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,10 @@

import com.google.analytics.data.v1beta.stub.BetaAnalyticsDataStub;
import com.google.analytics.data.v1beta.stub.BetaAnalyticsDataStubSettings;
import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.paging.AbstractFixedSizeCollection;
import com.google.api.gax.paging.AbstractPage;
import com.google.api.gax.paging.AbstractPagedListResponse;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.common.util.concurrent.MoreExecutors;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;

Expand All @@ -43,21 +34,24 @@
*
* <pre>{@code
* try (BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.create()) {
* RunPivotReportRequest request =
* RunPivotReportRequest.newBuilder()
* RunReportRequest request =
* RunReportRequest.newBuilder()
* .setProperty("property-993141291")
* .addAllDimensions(new ArrayList<Dimension>())
* .addAllMetrics(new ArrayList<Metric>())
* .addAllDateRanges(new ArrayList<DateRange>())
* .addAllPivots(new ArrayList<Pivot>())
* .setDimensionFilter(FilterExpression.newBuilder().build())
* .setMetricFilter(FilterExpression.newBuilder().build())
* .setOffset(-1019779949)
* .setLimit(102976443)
* .addAllMetricAggregations(new ArrayList<MetricAggregation>())
* .addAllOrderBys(new ArrayList<OrderBy>())
* .setCurrencyCode("currencyCode1004773790")
* .setCohortSpec(CohortSpec.newBuilder().build())
* .setKeepEmptyRows(true)
* .setReturnPropertyQuota(true)
* .build();
* RunPivotReportResponse response = betaAnalyticsDataClient.runPivotReport(request);
* RunReportResponse response = betaAnalyticsDataClient.runReport(request);
* }
* }</pre>
*
Expand Down Expand Up @@ -184,26 +178,24 @@ public BetaAnalyticsDataStub getStub() {
* .addAllDateRanges(new ArrayList<DateRange>())
* .setDimensionFilter(FilterExpression.newBuilder().build())
* .setMetricFilter(FilterExpression.newBuilder().build())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setOffset(-1019779949)
* .setLimit(102976443)
* .addAllMetricAggregations(new ArrayList<MetricAggregation>())
* .addAllOrderBys(new ArrayList<OrderBy>())
* .setCurrencyCode("currencyCode1004773790")
* .setCohortSpec(CohortSpec.newBuilder().build())
* .setKeepEmptyRows(true)
* .setReturnPropertyQuota(true)
* .build();
* for (DimensionHeader element : betaAnalyticsDataClient.runReport(request).iterateAll()) {
* // doThingsWith(element);
* }
* RunReportResponse response = betaAnalyticsDataClient.runReport(request);
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final RunReportPagedResponse runReport(RunReportRequest request) {
return runReportPagedCallable().call(request);
public final RunReportResponse runReport(RunReportRequest request) {
return runReportCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
Expand All @@ -226,52 +218,19 @@ public final RunReportPagedResponse runReport(RunReportRequest request) {
* .addAllDateRanges(new ArrayList<DateRange>())
* .setDimensionFilter(FilterExpression.newBuilder().build())
* .setMetricFilter(FilterExpression.newBuilder().build())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setOffset(-1019779949)
* .setLimit(102976443)
* .addAllMetricAggregations(new ArrayList<MetricAggregation>())
* .addAllOrderBys(new ArrayList<OrderBy>())
* .setCurrencyCode("currencyCode1004773790")
* .setCohortSpec(CohortSpec.newBuilder().build())
* .setKeepEmptyRows(true)
* .setReturnPropertyQuota(true)
* .build();
* ApiFuture<DimensionHeader> future =
* betaAnalyticsDataClient.runReportPagedCallable().futureCall(request);
* ApiFuture<RunReportResponse> future =
* betaAnalyticsDataClient.runReportCallable().futureCall(request);
* // Do something.
* for (DimensionHeader element : future.get().iterateAll()) {
* // doThingsWith(element);
* }
* }
* }</pre>
*/
public final UnaryCallable<RunReportRequest, RunReportPagedResponse> runReportPagedCallable() {
return stub.runReportPagedCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns a customized report of your Google Analytics event data. Reports contain statistics
* derived from data collected by the Google Analytics tracking code. The data returned from the
* API is as a table with columns for the requested dimensions and metrics. Metrics are individual
* measurements of user activity on your property, such as active users or event count. Dimensions
* break down metrics across some common criteria, such as country or event name.
*
* <p>Sample code:
*
* <pre>{@code
* try (BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.create()) {
* while (true) {
* RunReportResponse response = betaAnalyticsDataClient.runReportCallable().call(request);
* for (DimensionHeader element : response.getResponsesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
* if (!Strings.isNullOrEmpty(nextPageToken)) {
* request = request.toBuilder().setPageToken(nextPageToken).build();
* } else {
* break;
* }
* }
* RunReportResponse response = future.get();
* }
* }</pre>
*/
Expand Down Expand Up @@ -592,7 +551,7 @@ public final UnaryCallable<GetMetadataRequest, Metadata> getMetadataCallable() {
* .addAllMetrics(new ArrayList<Metric>())
* .setDimensionFilter(FilterExpression.newBuilder().build())
* .setMetricFilter(FilterExpression.newBuilder().build())
* .setPageSize(883849137)
* .setLimit(102976443)
* .addAllMetricAggregations(new ArrayList<MetricAggregation>())
* .addAllOrderBys(new ArrayList<OrderBy>())
* .setReturnPropertyQuota(true)
Expand Down Expand Up @@ -624,7 +583,7 @@ public final RunRealtimeReportResponse runRealtimeReport(RunRealtimeReportReques
* .addAllMetrics(new ArrayList<Metric>())
* .setDimensionFilter(FilterExpression.newBuilder().build())
* .setMetricFilter(FilterExpression.newBuilder().build())
* .setPageSize(883849137)
* .setLimit(102976443)
* .addAllMetricAggregations(new ArrayList<MetricAggregation>())
* .addAllOrderBys(new ArrayList<OrderBy>())
* .setReturnPropertyQuota(true)
Expand Down Expand Up @@ -670,84 +629,4 @@ public void shutdownNow() {
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
return stub.awaitTermination(duration, unit);
}

public static class RunReportPagedResponse
extends AbstractPagedListResponse<
RunReportRequest,
RunReportResponse,
DimensionHeader,
RunReportPage,
RunReportFixedSizeCollection> {

public static ApiFuture<RunReportPagedResponse> createAsync(
PageContext<RunReportRequest, RunReportResponse, DimensionHeader> context,
ApiFuture<RunReportResponse> futureResponse) {
ApiFuture<RunReportPage> futurePage =
RunReportPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<RunReportPage, RunReportPagedResponse>() {
@Override
public RunReportPagedResponse apply(RunReportPage input) {
return new RunReportPagedResponse(input);
}
},
MoreExecutors.directExecutor());
}

private RunReportPagedResponse(RunReportPage page) {
super(page, RunReportFixedSizeCollection.createEmptyCollection());
}
}

public static class RunReportPage
extends AbstractPage<RunReportRequest, RunReportResponse, DimensionHeader, RunReportPage> {

private RunReportPage(
PageContext<RunReportRequest, RunReportResponse, DimensionHeader> context,
RunReportResponse response) {
super(context, response);
}

private static RunReportPage createEmptyPage() {
return new RunReportPage(null, null);
}

@Override
protected RunReportPage createPage(
PageContext<RunReportRequest, RunReportResponse, DimensionHeader> context,
RunReportResponse response) {
return new RunReportPage(context, response);
}

@Override
public ApiFuture<RunReportPage> createPageAsync(
PageContext<RunReportRequest, RunReportResponse, DimensionHeader> context,
ApiFuture<RunReportResponse> futureResponse) {
return super.createPageAsync(context, futureResponse);
}
}

public static class RunReportFixedSizeCollection
extends AbstractFixedSizeCollection<
RunReportRequest,
RunReportResponse,
DimensionHeader,
RunReportPage,
RunReportFixedSizeCollection> {

private RunReportFixedSizeCollection(List<RunReportPage> pages, int collectionSize) {
super(pages, collectionSize);
}

private static RunReportFixedSizeCollection createEmptyCollection() {
return new RunReportFixedSizeCollection(null, 0);
}

@Override
protected RunReportFixedSizeCollection createCollection(
List<RunReportPage> pages, int collectionSize) {
return new RunReportFixedSizeCollection(pages, collectionSize);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package com.google.analytics.data.v1beta;

import static com.google.analytics.data.v1beta.BetaAnalyticsDataClient.RunReportPagedResponse;

import com.google.analytics.data.v1beta.stub.BetaAnalyticsDataStubSettings;
import com.google.api.core.ApiFunction;
import com.google.api.core.BetaApi;
Expand All @@ -27,7 +25,6 @@
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import java.io.IOException;
Expand All @@ -49,16 +46,16 @@
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
* <p>For example, to set the total timeout of runPivotReport to 30 seconds:
* <p>For example, to set the total timeout of runReport to 30 seconds:
*
* <pre>{@code
* BetaAnalyticsDataSettings.Builder betaAnalyticsDataSettingsBuilder =
* BetaAnalyticsDataSettings.newBuilder();
* betaAnalyticsDataSettingsBuilder
* .runPivotReportSettings()
* .runReportSettings()
* .setRetrySettings(
* betaAnalyticsDataSettingsBuilder
* .runPivotReportSettings()
* .runReportSettings()
* .getRetrySettings()
* .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
Expand All @@ -71,8 +68,7 @@
public class BetaAnalyticsDataSettings extends ClientSettings<BetaAnalyticsDataSettings> {

/** Returns the object with the settings used for calls to runReport. */
public PagedCallSettings<RunReportRequest, RunReportResponse, RunReportPagedResponse>
runReportSettings() {
public UnaryCallSettings<RunReportRequest, RunReportResponse> runReportSettings() {
return ((BetaAnalyticsDataStubSettings) getStubSettings()).runReportSettings();
}

Expand Down Expand Up @@ -203,8 +199,7 @@ public Builder applyToAllUnaryMethods(
}

/** Returns the builder for the settings used for calls to runReport. */
public PagedCallSettings.Builder<RunReportRequest, RunReportResponse, RunReportPagedResponse>
runReportSettings() {
public UnaryCallSettings.Builder<RunReportRequest, RunReportResponse> runReportSettings() {
return getStubSettingsBuilder().runReportSettings();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"methods": ["runRealtimeReport", "runRealtimeReportCallable"]
},
"RunReport": {
"methods": ["runReport", "runReportPagedCallable", "runReportCallable"]
"methods": ["runReport", "runReportCallable"]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,24 @@
*
* <pre>{@code
* try (BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.create()) {
* RunPivotReportRequest request =
* RunPivotReportRequest.newBuilder()
* RunReportRequest request =
* RunReportRequest.newBuilder()
* .setProperty("property-993141291")
* .addAllDimensions(new ArrayList<Dimension>())
* .addAllMetrics(new ArrayList<Metric>())
* .addAllDateRanges(new ArrayList<DateRange>())
* .addAllPivots(new ArrayList<Pivot>())
* .setDimensionFilter(FilterExpression.newBuilder().build())
* .setMetricFilter(FilterExpression.newBuilder().build())
* .setOffset(-1019779949)
* .setLimit(102976443)
* .addAllMetricAggregations(new ArrayList<MetricAggregation>())
* .addAllOrderBys(new ArrayList<OrderBy>())
* .setCurrencyCode("currencyCode1004773790")
* .setCohortSpec(CohortSpec.newBuilder().build())
* .setKeepEmptyRows(true)
* .setReturnPropertyQuota(true)
* .build();
* RunPivotReportResponse response = betaAnalyticsDataClient.runPivotReport(request);
* RunReportResponse response = betaAnalyticsDataClient.runReport(request);
* }
* }</pre>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package com.google.analytics.data.v1beta.stub;

import static com.google.analytics.data.v1beta.BetaAnalyticsDataClient.RunReportPagedResponse;

import com.google.analytics.data.v1beta.BatchRunPivotReportsRequest;
import com.google.analytics.data.v1beta.BatchRunPivotReportsResponse;
import com.google.analytics.data.v1beta.BatchRunReportsRequest;
Expand Down Expand Up @@ -45,10 +43,6 @@
@Generated("by gapic-generator-java")
public abstract class BetaAnalyticsDataStub implements BackgroundResource {

public UnaryCallable<RunReportRequest, RunReportPagedResponse> runReportPagedCallable() {
throw new UnsupportedOperationException("Not implemented: runReportPagedCallable()");
}

public UnaryCallable<RunReportRequest, RunReportResponse> runReportCallable() {
throw new UnsupportedOperationException("Not implemented: runReportCallable()");
}
Expand Down
Loading

0 comments on commit ebc1a85

Please sign in to comment.