Skip to content
This repository has been archived by the owner on Sep 9, 2023. It is now read-only.

Commit

Permalink
feat: add RunAccessReport method to the Admin API v1alpha (#442)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 465589484

Source-Link: googleapis/googleapis@80bf613

Source-Link: https://github.com/googleapis/googleapis-gen/commit/c015f3c725de4de9015dd83c55b2ec7eb05338dc
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzAxNWYzYzcyNWRlNGRlOTAxNWRkODNjNTViMmVjN2ViMDUzMzhkYyJ9
  • Loading branch information
gcf-owl-bot[bot] authored Aug 6, 2022
1 parent 4a762b4 commit 0d74509
Show file tree
Hide file tree
Showing 57 changed files with 32,594 additions and 894 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8777,6 +8777,99 @@ public final AttributionSettings updateAttributionSettings(
return stub.updateAttributionSettingsCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns a customized report of data access records. The report provides records of each time a
* user reads Google Analytics reporting data. Access records are retained for up to 2 years.
*
* <p>Data Access Reports can be requested for a property. The property must be in Google
* Analytics 360. This method is only available to Administrators.
*
* <p>These data access records include GA4 UI Reporting, GA4 UI Explorations, GA4 Data API, and
* other products like Firebase &amp; Admob that can retrieve data from Google Analytics through a
* linkage. These records don't include property configuration changes like adding a stream or
* changing a property's time zone. For configuration change history, see
* [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents).
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
* AnalyticsAdminServiceClient.create()) {
* RunAccessReportRequest request =
* RunAccessReportRequest.newBuilder()
* .setEntity("entity-1298275357")
* .addAllDimensions(new ArrayList<AccessDimension>())
* .addAllMetrics(new ArrayList<AccessMetric>())
* .addAllDateRanges(new ArrayList<AccessDateRange>())
* .setDimensionFilter(AccessFilterExpression.newBuilder().build())
* .setMetricFilter(AccessFilterExpression.newBuilder().build())
* .setOffset(-1019779949)
* .setLimit(102976443)
* .setTimeZone("timeZone-2077180903")
* .addAllOrderBys(new ArrayList<AccessOrderBy>())
* .setReturnEntityQuota(true)
* .build();
* RunAccessReportResponse response = analyticsAdminServiceClient.runAccessReport(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 RunAccessReportResponse runAccessReport(RunAccessReportRequest request) {
return runAccessReportCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns a customized report of data access records. The report provides records of each time a
* user reads Google Analytics reporting data. Access records are retained for up to 2 years.
*
* <p>Data Access Reports can be requested for a property. The property must be in Google
* Analytics 360. This method is only available to Administrators.
*
* <p>These data access records include GA4 UI Reporting, GA4 UI Explorations, GA4 Data API, and
* other products like Firebase &amp; Admob that can retrieve data from Google Analytics through a
* linkage. These records don't include property configuration changes like adding a stream or
* changing a property's time zone. For configuration change history, see
* [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents).
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
* AnalyticsAdminServiceClient.create()) {
* RunAccessReportRequest request =
* RunAccessReportRequest.newBuilder()
* .setEntity("entity-1298275357")
* .addAllDimensions(new ArrayList<AccessDimension>())
* .addAllMetrics(new ArrayList<AccessMetric>())
* .addAllDateRanges(new ArrayList<AccessDateRange>())
* .setDimensionFilter(AccessFilterExpression.newBuilder().build())
* .setMetricFilter(AccessFilterExpression.newBuilder().build())
* .setOffset(-1019779949)
* .setLimit(102976443)
* .setTimeZone("timeZone-2077180903")
* .addAllOrderBys(new ArrayList<AccessOrderBy>())
* .setReturnEntityQuota(true)
* .build();
* ApiFuture<RunAccessReportResponse> future =
* analyticsAdminServiceClient.runAccessReportCallable().futureCall(request);
* // Do something.
* RunAccessReportResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<RunAccessReportRequest, RunAccessReportResponse>
runAccessReportCallable() {
return stub.runAccessReportCallable();
}

@Override
public final void close() {
stub.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,12 @@ public UnaryCallSettings<ArchiveAudienceRequest, Empty> archiveAudienceSettings(
.updateAttributionSettingsSettings();
}

/** Returns the object with the settings used for calls to runAccessReport. */
public UnaryCallSettings<RunAccessReportRequest, RunAccessReportResponse>
runAccessReportSettings() {
return ((AnalyticsAdminServiceStubSettings) getStubSettings()).runAccessReportSettings();
}

public static final AnalyticsAdminServiceSettings create(AnalyticsAdminServiceStubSettings stub)
throws IOException {
return new AnalyticsAdminServiceSettings.Builder(stub.toBuilder()).build();
Expand Down Expand Up @@ -1241,6 +1247,12 @@ public UnaryCallSettings.Builder<ArchiveAudienceRequest, Empty> archiveAudienceS
return getStubSettingsBuilder().updateAttributionSettingsSettings();
}

/** Returns the builder for the settings used for calls to runAccessReport. */
public UnaryCallSettings.Builder<RunAccessReportRequest, RunAccessReportResponse>
runAccessReportSettings() {
return getStubSettingsBuilder().runAccessReportSettings();
}

@Override
public AnalyticsAdminServiceSettings build() throws IOException {
return new AnalyticsAdminServiceSettings(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@
"ProvisionAccountTicket": {
"methods": ["provisionAccountTicket", "provisionAccountTicketCallable"]
},
"RunAccessReport": {
"methods": ["runAccessReport", "runAccessReportCallable"]
},
"SearchChangeHistoryEvents": {
"methods": ["searchChangeHistoryEvents", "searchChangeHistoryEventsPagedCallable", "searchChangeHistoryEventsCallable"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@
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.RunAccessReportRequest;
import com.google.analytics.admin.v1alpha.RunAccessReportResponse;
import com.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest;
import com.google.analytics.admin.v1alpha.SearchChangeHistoryEventsResponse;
import com.google.analytics.admin.v1alpha.UpdateAccountRequest;
Expand Down Expand Up @@ -633,6 +635,10 @@ public UnaryCallable<ArchiveAudienceRequest, Empty> archiveAudienceCallable() {
throw new UnsupportedOperationException("Not implemented: updateAttributionSettingsCallable()");
}

public UnaryCallable<RunAccessReportRequest, RunAccessReportResponse> runAccessReportCallable() {
throw new UnsupportedOperationException("Not implemented: runAccessReportCallable()");
}

@Override
public abstract void close();
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@
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.RunAccessReportRequest;
import com.google.analytics.admin.v1alpha.RunAccessReportResponse;
import com.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest;
import com.google.analytics.admin.v1alpha.SearchChangeHistoryEventsResponse;
import com.google.analytics.admin.v1alpha.UpdateAccountRequest;
Expand Down Expand Up @@ -408,6 +410,8 @@ public class AnalyticsAdminServiceStubSettings
getAttributionSettingsSettings;
private final UnaryCallSettings<UpdateAttributionSettingsRequest, AttributionSettings>
updateAttributionSettingsSettings;
private final UnaryCallSettings<RunAccessReportRequest, RunAccessReportResponse>
runAccessReportSettings;

private static final PagedListDescriptor<ListAccountsRequest, ListAccountsResponse, Account>
LIST_ACCOUNTS_PAGE_STR_DESC =
Expand Down Expand Up @@ -1927,6 +1931,12 @@ public UnaryCallSettings<ArchiveAudienceRequest, Empty> archiveAudienceSettings(
return updateAttributionSettingsSettings;
}

/** Returns the object with the settings used for calls to runAccessReport. */
public UnaryCallSettings<RunAccessReportRequest, RunAccessReportResponse>
runAccessReportSettings() {
return runAccessReportSettings;
}

public AnalyticsAdminServiceStub createStub() throws IOException {
if (getTransportChannelProvider()
.getTransportName()
Expand Down Expand Up @@ -2130,6 +2140,7 @@ protected AnalyticsAdminServiceStubSettings(Builder settingsBuilder) throws IOEx
archiveAudienceSettings = settingsBuilder.archiveAudienceSettings().build();
getAttributionSettingsSettings = settingsBuilder.getAttributionSettingsSettings().build();
updateAttributionSettingsSettings = settingsBuilder.updateAttributionSettingsSettings().build();
runAccessReportSettings = settingsBuilder.runAccessReportSettings().build();
}

/** Builder for AnalyticsAdminServiceStubSettings. */
Expand Down Expand Up @@ -2326,6 +2337,8 @@ public static class Builder
getAttributionSettingsSettings;
private final UnaryCallSettings.Builder<UpdateAttributionSettingsRequest, AttributionSettings>
updateAttributionSettingsSettings;
private final UnaryCallSettings.Builder<RunAccessReportRequest, RunAccessReportResponse>
runAccessReportSettings;
private static final ImmutableMap<String, ImmutableSet<StatusCode.Code>>
RETRYABLE_CODE_DEFINITIONS;

Expand Down Expand Up @@ -2458,6 +2471,7 @@ protected Builder(ClientContext clientContext) {
archiveAudienceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
getAttributionSettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
updateAttributionSettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
runAccessReportSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();

unaryMethodSettingsBuilders =
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
Expand Down Expand Up @@ -2538,7 +2552,8 @@ protected Builder(ClientContext clientContext) {
updateAudienceSettings,
archiveAudienceSettings,
getAttributionSettingsSettings,
updateAttributionSettingsSettings);
updateAttributionSettingsSettings,
runAccessReportSettings);
initDefaults(this);
}

Expand Down Expand Up @@ -2642,6 +2657,7 @@ protected Builder(AnalyticsAdminServiceStubSettings settings) {
archiveAudienceSettings = settings.archiveAudienceSettings.toBuilder();
getAttributionSettingsSettings = settings.getAttributionSettingsSettings.toBuilder();
updateAttributionSettingsSettings = settings.updateAttributionSettingsSettings.toBuilder();
runAccessReportSettings = settings.runAccessReportSettings.toBuilder();

unaryMethodSettingsBuilders =
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
Expand Down Expand Up @@ -2722,7 +2738,8 @@ protected Builder(AnalyticsAdminServiceStubSettings settings) {
updateAudienceSettings,
archiveAudienceSettings,
getAttributionSettingsSettings,
updateAttributionSettingsSettings);
updateAttributionSettingsSettings,
runAccessReportSettings);
}

private static Builder createDefault() {
Expand Down Expand Up @@ -3142,6 +3159,11 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));

builder
.runAccessReportSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));

return builder;
}

Expand Down Expand Up @@ -3680,6 +3702,12 @@ public UnaryCallSettings.Builder<ArchiveAudienceRequest, Empty> archiveAudienceS
return updateAttributionSettingsSettings;
}

/** Returns the builder for the settings used for calls to runAccessReport. */
public UnaryCallSettings.Builder<RunAccessReportRequest, RunAccessReportResponse>
runAccessReportSettings() {
return runAccessReportSettings;
}

@Override
public AnalyticsAdminServiceStubSettings build() throws IOException {
return new AnalyticsAdminServiceStubSettings(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@
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.RunAccessReportRequest;
import com.google.analytics.admin.v1alpha.RunAccessReportResponse;
import com.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest;
import com.google.analytics.admin.v1alpha.SearchChangeHistoryEventsResponse;
import com.google.analytics.admin.v1alpha.UpdateAccountRequest;
Expand Down Expand Up @@ -1124,6 +1126,18 @@ public class GrpcAnalyticsAdminServiceStub extends AnalyticsAdminServiceStub {
ProtoUtils.marshaller(AttributionSettings.getDefaultInstance()))
.build();

private static final MethodDescriptor<RunAccessReportRequest, RunAccessReportResponse>
runAccessReportMethodDescriptor =
MethodDescriptor.<RunAccessReportRequest, RunAccessReportResponse>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.analytics.admin.v1alpha.AnalyticsAdminService/RunAccessReport")
.setRequestMarshaller(
ProtoUtils.marshaller(RunAccessReportRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(RunAccessReportResponse.getDefaultInstance()))
.build();

private final UnaryCallable<GetAccountRequest, Account> getAccountCallable;
private final UnaryCallable<ListAccountsRequest, ListAccountsResponse> listAccountsCallable;
private final UnaryCallable<ListAccountsRequest, ListAccountsPagedResponse>
Expand Down Expand Up @@ -1296,6 +1310,8 @@ public class GrpcAnalyticsAdminServiceStub extends AnalyticsAdminServiceStub {
getAttributionSettingsCallable;
private final UnaryCallable<UpdateAttributionSettingsRequest, AttributionSettings>
updateAttributionSettingsCallable;
private final UnaryCallable<RunAccessReportRequest, RunAccessReportResponse>
runAccessReportCallable;

private final BackgroundResource backgroundResources;
private final GrpcOperationsStub operationsStub;
Expand Down Expand Up @@ -2194,6 +2210,17 @@ protected GrpcAnalyticsAdminServiceStub(
return params.build();
})
.build();
GrpcCallSettings<RunAccessReportRequest, RunAccessReportResponse>
runAccessReportTransportSettings =
GrpcCallSettings.<RunAccessReportRequest, RunAccessReportResponse>newBuilder()
.setMethodDescriptor(runAccessReportMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("entity", String.valueOf(request.getEntity()));
return params.build();
})
.build();

this.getAccountCallable =
callableFactory.createUnaryCallable(
Expand Down Expand Up @@ -2599,6 +2626,9 @@ protected GrpcAnalyticsAdminServiceStub(
updateAttributionSettingsTransportSettings,
settings.updateAttributionSettingsSettings(),
clientContext);
this.runAccessReportCallable =
callableFactory.createUnaryCallable(
runAccessReportTransportSettings, settings.runAccessReportSettings(), clientContext);

this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
Expand Down Expand Up @@ -3145,6 +3175,11 @@ public UnaryCallable<ArchiveAudienceRequest, Empty> archiveAudienceCallable() {
return updateAttributionSettingsCallable;
}

@Override
public UnaryCallable<RunAccessReportRequest, RunAccessReportResponse> runAccessReportCallable() {
return runAccessReportCallable;
}

@Override
public final void close() {
try {
Expand Down
Loading

0 comments on commit 0d74509

Please sign in to comment.