Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [analyticsdata] add the SheetExportAudienceList method to the Data API v1 alpha #10047

Merged
merged 2 commits into from Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions java-analytics-data/README.md
Expand Up @@ -23,7 +23,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.23.0</version>
<version>26.26.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -201,7 +201,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
[stability-image]: https://img.shields.io/badge/stability-preview-yellow
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.analytics/google-analytics-data.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.analytics/google-analytics-data/0.35.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.analytics/google-analytics-data/0.41.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down

Large diffs are not rendered by default.

Expand Up @@ -103,6 +103,12 @@ public UnaryCallSettings<CreateAudienceListRequest, Operation> createAudienceLis
return ((AlphaAnalyticsDataStubSettings) getStubSettings()).queryAudienceListSettings();
}

/** Returns the object with the settings used for calls to sheetExportAudienceList. */
public UnaryCallSettings<SheetExportAudienceListRequest, SheetExportAudienceListResponse>
sheetExportAudienceListSettings() {
return ((AlphaAnalyticsDataStubSettings) getStubSettings()).sheetExportAudienceListSettings();
}

/** Returns the object with the settings used for calls to getAudienceList. */
public UnaryCallSettings<GetAudienceListRequest, AudienceList> getAudienceListSettings() {
return ((AlphaAnalyticsDataStubSettings) getStubSettings()).getAudienceListSettings();
Expand Down Expand Up @@ -255,6 +261,13 @@ public Builder applyToAllUnaryMethods(
return getStubSettingsBuilder().queryAudienceListSettings();
}

/** Returns the builder for the settings used for calls to sheetExportAudienceList. */
public UnaryCallSettings.Builder<
SheetExportAudienceListRequest, SheetExportAudienceListResponse>
sheetExportAudienceListSettings() {
return getStubSettingsBuilder().sheetExportAudienceListSettings();
}

/** Returns the builder for the settings used for calls to getAudienceList. */
public UnaryCallSettings.Builder<GetAudienceListRequest, AudienceList>
getAudienceListSettings() {
Expand Down
Expand Up @@ -24,6 +24,9 @@
},
"RunFunnelReport": {
"methods": ["runFunnelReport", "runFunnelReportCallable"]
},
"SheetExportAudienceList": {
"methods": ["sheetExportAudienceList", "sheetExportAudienceList", "sheetExportAudienceList", "sheetExportAudienceListCallable"]
}
}
}
Expand Down
Expand Up @@ -28,6 +28,8 @@
import com.google.analytics.data.v1alpha.QueryAudienceListResponse;
import com.google.analytics.data.v1alpha.RunFunnelReportRequest;
import com.google.analytics.data.v1alpha.RunFunnelReportResponse;
import com.google.analytics.data.v1alpha.SheetExportAudienceListRequest;
import com.google.analytics.data.v1alpha.SheetExportAudienceListResponse;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.rpc.OperationCallable;
Expand Down Expand Up @@ -73,6 +75,11 @@ public UnaryCallable<CreateAudienceListRequest, Operation> createAudienceListCal
throw new UnsupportedOperationException("Not implemented: queryAudienceListCallable()");
}

public UnaryCallable<SheetExportAudienceListRequest, SheetExportAudienceListResponse>
sheetExportAudienceListCallable() {
throw new UnsupportedOperationException("Not implemented: sheetExportAudienceListCallable()");
}

public UnaryCallable<GetAudienceListRequest, AudienceList> getAudienceListCallable() {
throw new UnsupportedOperationException("Not implemented: getAudienceListCallable()");
}
Expand Down
Expand Up @@ -28,6 +28,8 @@
import com.google.analytics.data.v1alpha.QueryAudienceListResponse;
import com.google.analytics.data.v1alpha.RunFunnelReportRequest;
import com.google.analytics.data.v1alpha.RunFunnelReportResponse;
import com.google.analytics.data.v1alpha.SheetExportAudienceListRequest;
import com.google.analytics.data.v1alpha.SheetExportAudienceListResponse;
import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.BetaApi;
Expand Down Expand Up @@ -113,6 +115,9 @@ public class AlphaAnalyticsDataStubSettings extends StubSettings<AlphaAnalyticsD
ImmutableList.<String>builder()
.add("https://www.googleapis.com/auth/analytics")
.add("https://www.googleapis.com/auth/analytics.readonly")
.add("https://www.googleapis.com/auth/drive")
.add("https://www.googleapis.com/auth/drive.file")
.add("https://www.googleapis.com/auth/spreadsheets")
.build();

private final UnaryCallSettings<RunFunnelReportRequest, RunFunnelReportResponse>
Expand All @@ -122,6 +127,8 @@ public class AlphaAnalyticsDataStubSettings extends StubSettings<AlphaAnalyticsD
createAudienceListOperationSettings;
private final UnaryCallSettings<QueryAudienceListRequest, QueryAudienceListResponse>
queryAudienceListSettings;
private final UnaryCallSettings<SheetExportAudienceListRequest, SheetExportAudienceListResponse>
sheetExportAudienceListSettings;
private final UnaryCallSettings<GetAudienceListRequest, AudienceList> getAudienceListSettings;
private final PagedCallSettings<
ListAudienceListsRequest, ListAudienceListsResponse, ListAudienceListsPagedResponse>
Expand Down Expand Up @@ -211,6 +218,12 @@ public UnaryCallSettings<CreateAudienceListRequest, Operation> createAudienceLis
return queryAudienceListSettings;
}

/** Returns the object with the settings used for calls to sheetExportAudienceList. */
public UnaryCallSettings<SheetExportAudienceListRequest, SheetExportAudienceListResponse>
sheetExportAudienceListSettings() {
return sheetExportAudienceListSettings;
}

/** Returns the object with the settings used for calls to getAudienceList. */
public UnaryCallSettings<GetAudienceListRequest, AudienceList> getAudienceListSettings() {
return getAudienceListSettings;
Expand Down Expand Up @@ -334,6 +347,7 @@ protected AlphaAnalyticsDataStubSettings(Builder settingsBuilder) throws IOExcep
createAudienceListOperationSettings =
settingsBuilder.createAudienceListOperationSettings().build();
queryAudienceListSettings = settingsBuilder.queryAudienceListSettings().build();
sheetExportAudienceListSettings = settingsBuilder.sheetExportAudienceListSettings().build();
getAudienceListSettings = settingsBuilder.getAudienceListSettings().build();
listAudienceListsSettings = settingsBuilder.listAudienceListsSettings().build();
}
Expand All @@ -351,6 +365,9 @@ public static class Builder
createAudienceListOperationSettings;
private final UnaryCallSettings.Builder<QueryAudienceListRequest, QueryAudienceListResponse>
queryAudienceListSettings;
private final UnaryCallSettings.Builder<
SheetExportAudienceListRequest, SheetExportAudienceListResponse>
sheetExportAudienceListSettings;
private final UnaryCallSettings.Builder<GetAudienceListRequest, AudienceList>
getAudienceListSettings;
private final PagedCallSettings.Builder<
Expand Down Expand Up @@ -408,6 +425,7 @@ protected Builder(ClientContext clientContext) {
createAudienceListSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
createAudienceListOperationSettings = OperationCallSettings.newBuilder();
queryAudienceListSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
sheetExportAudienceListSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
getAudienceListSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
listAudienceListsSettings = PagedCallSettings.newBuilder(LIST_AUDIENCE_LISTS_PAGE_STR_FACT);

Expand All @@ -416,6 +434,7 @@ protected Builder(ClientContext clientContext) {
runFunnelReportSettings,
createAudienceListSettings,
queryAudienceListSettings,
sheetExportAudienceListSettings,
getAudienceListSettings,
listAudienceListsSettings);
initDefaults(this);
Expand All @@ -429,6 +448,7 @@ protected Builder(AlphaAnalyticsDataStubSettings settings) {
createAudienceListOperationSettings =
settings.createAudienceListOperationSettings.toBuilder();
queryAudienceListSettings = settings.queryAudienceListSettings.toBuilder();
sheetExportAudienceListSettings = settings.sheetExportAudienceListSettings.toBuilder();
getAudienceListSettings = settings.getAudienceListSettings.toBuilder();
listAudienceListsSettings = settings.listAudienceListsSettings.toBuilder();

Expand All @@ -437,6 +457,7 @@ protected Builder(AlphaAnalyticsDataStubSettings settings) {
runFunnelReportSettings,
createAudienceListSettings,
queryAudienceListSettings,
sheetExportAudienceListSettings,
getAudienceListSettings,
listAudienceListsSettings);
}
Expand Down Expand Up @@ -483,6 +504,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
.sheetExportAudienceListSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));

builder
.getAudienceListSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
Expand Down Expand Up @@ -562,6 +588,13 @@ public Builder applyToAllUnaryMethods(
return queryAudienceListSettings;
}

/** Returns the builder for the settings used for calls to sheetExportAudienceList. */
public UnaryCallSettings.Builder<
SheetExportAudienceListRequest, SheetExportAudienceListResponse>
sheetExportAudienceListSettings() {
return sheetExportAudienceListSettings;
}

/** Returns the builder for the settings used for calls to getAudienceList. */
public UnaryCallSettings.Builder<GetAudienceListRequest, AudienceList>
getAudienceListSettings() {
Expand Down
Expand Up @@ -28,6 +28,8 @@
import com.google.analytics.data.v1alpha.QueryAudienceListResponse;
import com.google.analytics.data.v1alpha.RunFunnelReportRequest;
import com.google.analytics.data.v1alpha.RunFunnelReportResponse;
import com.google.analytics.data.v1alpha.SheetExportAudienceListRequest;
import com.google.analytics.data.v1alpha.SheetExportAudienceListResponse;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.core.BackgroundResourceAggregation;
Expand Down Expand Up @@ -88,6 +90,20 @@ public class GrpcAlphaAnalyticsDataStub extends AlphaAnalyticsDataStub {
ProtoUtils.marshaller(QueryAudienceListResponse.getDefaultInstance()))
.build();

private static final MethodDescriptor<
SheetExportAudienceListRequest, SheetExportAudienceListResponse>
sheetExportAudienceListMethodDescriptor =
MethodDescriptor
.<SheetExportAudienceListRequest, SheetExportAudienceListResponse>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.analytics.data.v1alpha.AlphaAnalyticsData/SheetExportAudienceList")
.setRequestMarshaller(
ProtoUtils.marshaller(SheetExportAudienceListRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(SheetExportAudienceListResponse.getDefaultInstance()))
.build();

private static final MethodDescriptor<GetAudienceListRequest, AudienceList>
getAudienceListMethodDescriptor =
MethodDescriptor.<GetAudienceListRequest, AudienceList>newBuilder()
Expand Down Expand Up @@ -117,6 +133,8 @@ public class GrpcAlphaAnalyticsDataStub extends AlphaAnalyticsDataStub {
createAudienceListOperationCallable;
private final UnaryCallable<QueryAudienceListRequest, QueryAudienceListResponse>
queryAudienceListCallable;
private final UnaryCallable<SheetExportAudienceListRequest, SheetExportAudienceListResponse>
sheetExportAudienceListCallable;
private final UnaryCallable<GetAudienceListRequest, AudienceList> getAudienceListCallable;
private final UnaryCallable<ListAudienceListsRequest, ListAudienceListsResponse>
listAudienceListsCallable;
Expand Down Expand Up @@ -199,6 +217,18 @@ protected GrpcAlphaAnalyticsDataStub(
return builder.build();
})
.build();
GrpcCallSettings<SheetExportAudienceListRequest, SheetExportAudienceListResponse>
sheetExportAudienceListTransportSettings =
GrpcCallSettings
.<SheetExportAudienceListRequest, SheetExportAudienceListResponse>newBuilder()
.setMethodDescriptor(sheetExportAudienceListMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings<GetAudienceListRequest, AudienceList> getAudienceListTransportSettings =
GrpcCallSettings.<GetAudienceListRequest, AudienceList>newBuilder()
.setMethodDescriptor(getAudienceListMethodDescriptor)
Expand Down Expand Up @@ -240,6 +270,11 @@ protected GrpcAlphaAnalyticsDataStub(
queryAudienceListTransportSettings,
settings.queryAudienceListSettings(),
clientContext);
this.sheetExportAudienceListCallable =
callableFactory.createUnaryCallable(
sheetExportAudienceListTransportSettings,
settings.sheetExportAudienceListSettings(),
clientContext);
this.getAudienceListCallable =
callableFactory.createUnaryCallable(
getAudienceListTransportSettings, settings.getAudienceListSettings(), clientContext);
Expand Down Expand Up @@ -284,6 +319,12 @@ public UnaryCallable<CreateAudienceListRequest, Operation> createAudienceListCal
return queryAudienceListCallable;
}

@Override
public UnaryCallable<SheetExportAudienceListRequest, SheetExportAudienceListResponse>
sheetExportAudienceListCallable() {
return sheetExportAudienceListCallable;
}

@Override
public UnaryCallable<GetAudienceListRequest, AudienceList> getAudienceListCallable() {
return getAudienceListCallable;
Expand Down