diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 01f5940b..08c18ce7 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-analytics-data.git", - "sha": "d8684ba07a2cb2a246f69a91a74d63994f1b3be9" + "sha": "dd37ff2c80f5d9df4a1ab06731a9b8c8fd308e65" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "67f09bf301083798e7220137723222eb00b8f88a" + "sha": "27b2d4f4674840628d0b75c5941e89c12af4764f" } } ] diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index 2b6cdbc9..7c8816a7 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -4,7 +4,7 @@ name: auto-release jobs: approve: runs-on: ubuntu-latest - if: contains(github.head_ref, 'release-v') + if: contains(github.head_ref, 'release-please') steps: - uses: actions/github-script@v3 with: @@ -16,8 +16,8 @@ jobs: return; } - // only approve PRs like "chore: release " - if ( !context.payload.pull_request.title.startsWith("chore: release") ) { + // only approve PRs like "chore(master): release " + if ( !context.payload.pull_request.title.startsWith("chore(master): release") ) { return; } diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 68302207..def8b3a2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -54,7 +54,11 @@ jobs: with: java-version: 8 - run: java -version - - run: .kokoro/linkage-monitor.sh + - name: Install artifacts to local Maven repository + run: .kokoro/build.sh + shell: bash + - name: Validate any conflicts with regard to com.google.cloud:libraries-bom (latest release) + uses: GoogleCloudPlatform/cloud-opensource-java/linkage-monitor@v1-linkagemonitor lint: runs-on: ubuntu-latest steps: diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 372118ee..9e35a95c 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -29,7 +29,7 @@ echo ${JOB_TYPE} # attempt to install 3 times with exponential backoff (starting with 10 seconds) retry_with_backoff 3 10 \ - mvn install -B -V \ + mvn install -B -V -ntp \ -DskipTests=true \ -Dclirr.skip=true \ -Denforcer.skip=true \ @@ -60,6 +60,7 @@ javadoc) ;; integration) mvn -B ${INTEGRATION_TEST_ARGS} \ + -ntp \ -Penable-integration-tests \ -DtrimStackTrace=false \ -Dclirr.skip=true \ @@ -81,6 +82,7 @@ samples) pushd ${SAMPLES_DIR} mvn -B \ -Penable-samples \ + -ntp \ -DtrimStackTrace=false \ -Dclirr.skip=true \ -Denforcer.skip=true \ @@ -110,8 +112,8 @@ bash .kokoro/coerce_logs.sh if [[ "${ENABLE_BUILD_COP}" == "true" ]] then - chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/buildcop - ${KOKORO_GFILE_DIR}/linux_amd64/buildcop -repo=googleapis/java-analytics-data + chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot + ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-analytics-data fi echo "exiting with ${RETURN_CODE}" diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh index c91e5a56..0fb8c843 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -31,7 +31,7 @@ export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" # this should run maven enforcer retry_with_backoff 3 10 \ - mvn install -B -V \ + mvn install -B -V -ntp \ -DskipTests=true \ -Dclirr.skip=true @@ -86,4 +86,4 @@ then else msg "Errors found. See log statements above." exit 1 -fi \ No newline at end of file +fi diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh deleted file mode 100755 index 759ab4e2..00000000 --- a/.kokoro/linkage-monitor.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# Copyright 2019 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 -# -# http://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. - -set -eo pipefail -# Display commands being run. -set -x - -## Get the directory of the build script -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -## cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -# include common functions -source ${scriptDir}/common.sh - -# Print out Java version -java -version -echo ${JOB_TYPE} - -# attempt to install 3 times with exponential backoff (starting with 10 seconds) -retry_with_backoff 3 10 \ - mvn install -B -V \ - -DskipTests=true \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dmaven.javadoc.skip=true \ - -Dgcloud.download.skip=true - -# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR -JAR=linkage-monitor-latest-all-deps.jar -curl -v -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/${JAR}" - -# Fails if there's new linkage errors compared with baseline -java -jar ${JAR} com.google.cloud:libraries-bom diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg index efb93f86..c6b1984e 100644 --- a/.kokoro/release/publish_javadoc.cfg +++ b/.kokoro/release/publish_javadoc.cfg @@ -7,10 +7,10 @@ env_vars: { value: "docs-staging" } +# cloud-rad staging env_vars: { key: "STAGING_BUCKET_V2" - value: "docs-staging-v2" - # Production will be at: docs-staging-v2 + value: "docs-staging-v2-staging" } env_vars: { @@ -26,4 +26,4 @@ before_action { keyname: "docuploader_service_account" } } -} +} \ No newline at end of file diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh index 848f0649..ac2c7c5a 100755 --- a/.kokoro/release/publish_javadoc.sh +++ b/.kokoro/release/publish_javadoc.sh @@ -71,7 +71,7 @@ python3 -m docuploader create-metadata \ --version ${VERSION} \ --language java -# upload docs +# upload docs to staging bucket python3 -m docuploader upload . \ --credentials ${CREDENTIALS} \ --staging-bucket ${STAGING_BUCKET_V2} diff --git a/.kokoro/release/publish_javadoc11.cfg b/.kokoro/release/publish_javadoc11.cfg new file mode 100644 index 00000000..5aba9b24 --- /dev/null +++ b/.kokoro/release/publish_javadoc11.cfg @@ -0,0 +1,30 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# cloud-rad production +env_vars: { + key: "STAGING_BUCKET_V2" + value: "docs-staging-v2" +} + +# Configure the docker image for kokoro-trampoline +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-analytics-data/.kokoro/release/publish_javadoc11.sh" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} + +# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/ +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx" diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh new file mode 100755 index 00000000..fa58249d --- /dev/null +++ b/.kokoro/release/publish_javadoc11.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# Copyright 2021 Google Inc. +# +# 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 +# +# http://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. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi + +if [[ -z "${STAGING_BUCKET_V2}" ]]; then + echo "Need to set STAGING_BUCKET_V2 environment variable" + exit 1 +fi + +# work from the git root directory +pushd $(dirname "$0")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -q -DskipTests=true + +export NAME=google-analytics-data +export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# V3 generates docfx yml from javadoc +# generate yml +mvn clean site -B -q -P docFX + +pushd target/docfx-yml + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload yml to production bucket +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET_V2} \ + --destination-prefix docfx- diff --git a/CHANGELOG.md b/CHANGELOG.md index 67d9cc8d..2e203e54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +### [0.5.5](https://www.github.com/googleapis/java-analytics-data/compare/v0.5.4...v0.5.5) (2021-02-22) + + +### Bug Fixes + +* don't log downloads ([#152](https://www.github.com/googleapis/java-analytics-data/issues/152)) ([e173782](https://www.github.com/googleapis/java-analytics-data/commit/e17378207bf50ccd1b5f931481cf1c894908fe25)) + + +### Documentation + +* generate sample code in the Java microgenerator ([#135](https://www.github.com/googleapis/java-analytics-data/issues/135)) ([0470fd1](https://www.github.com/googleapis/java-analytics-data/commit/0470fd12172a87ff90d279775b1931e48ece51d0)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.19.0 ([#153](https://www.github.com/googleapis/java-analytics-data/issues/153)) ([535c757](https://www.github.com/googleapis/java-analytics-data/commit/535c757a963f8e771f892244421dfb364a96256f)) + ### [0.5.4](https://www.github.com/googleapis/java-analytics-data/compare/v0.5.3...v0.5.4) (2021-01-14) diff --git a/LICENSE b/LICENSE index d6456956..261eeb9e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,3 @@ - Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ diff --git a/README.md b/README.md index 68983c7f..e00d0b54 100644 --- a/README.md +++ b/README.md @@ -20,18 +20,18 @@ If you are using Maven, add this to your pom.xml file: com.google.analytics google-analytics-data - 0.5.1 + 0.5.4 ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.analytics:google-analytics-data:0.5.1' +compile 'com.google.analytics:google-analytics-data:0.5.4' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.analytics" % "google-analytics-data" % "0.5.1" +libraryDependencies += "com.google.analytics" % "google-analytics-data" % "0.5.4" ``` ## Authentication diff --git a/google-analytics-data-bom/pom.xml b/google-analytics-data-bom/pom.xml index 240e46bb..50699722 100644 --- a/google-analytics-data-bom/pom.xml +++ b/google-analytics-data-bom/pom.xml @@ -3,12 +3,12 @@ 4.0.0 com.google.analytics google-analytics-data-bom - 0.5.4 + 0.5.5 pom com.google.cloud google-cloud-shared-config - 0.9.4 + 0.10.0 Google Analytics Data BOM @@ -68,17 +68,17 @@ com.google.analytics google-analytics-data - 0.5.4 + 0.5.5 com.google.api.grpc proto-google-analytics-data-v1alpha - 0.5.4 + 0.5.5 com.google.api.grpc grpc-google-analytics-data-v1alpha - 0.5.4 + 0.5.5 diff --git a/google-analytics-data/pom.xml b/google-analytics-data/pom.xml index f93d1d8d..47c40cf0 100644 --- a/google-analytics-data/pom.xml +++ b/google-analytics-data/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.analytics google-analytics-data - 0.5.4 + 0.5.5 jar Google Analytics Data https://github.com/googleapis/java-analytics-data @@ -11,7 +11,7 @@ com.google.analytics google-analytics-data-parent - 0.5.4 + 0.5.5 google-analytics-data @@ -68,7 +68,7 @@ junit junit test - 4.13.1 + 4.13.2 diff --git a/google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/AlphaAnalyticsDataClient.java b/google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/AlphaAnalyticsDataClient.java index 711b6993..74ab9383 100644 --- a/google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/AlphaAnalyticsDataClient.java +++ b/google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/AlphaAnalyticsDataClient.java @@ -32,6 +32,29 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *

{@code
+ * try (AlphaAnalyticsDataClient alphaAnalyticsDataClient = AlphaAnalyticsDataClient.create()) {
+ *   RunReportRequest request =
+ *       RunReportRequest.newBuilder()
+ *           .setEntity(Entity.newBuilder().build())
+ *           .addAllDimensions(new ArrayList())
+ *           .addAllMetrics(new ArrayList())
+ *           .addAllDateRanges(new ArrayList())
+ *           .setOffset(-1019779949)
+ *           .setLimit(102976443)
+ *           .addAllMetricAggregations(new ArrayList())
+ *           .setDimensionFilter(FilterExpression.newBuilder().build())
+ *           .setMetricFilter(FilterExpression.newBuilder().build())
+ *           .addAllOrderBys(new ArrayList())
+ *           .setCurrencyCode("currencyCode1004773790")
+ *           .setCohortSpec(CohortSpec.newBuilder().build())
+ *           .setKeepEmptyRows(true)
+ *           .setReturnPropertyQuota(true)
+ *           .build();
+ *   RunReportResponse response = alphaAnalyticsDataClient.runReport(request);
+ * }
+ * }
+ * *

Note: close() needs to be called on the AlphaAnalyticsDataClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). @@ -143,6 +166,31 @@ public AlphaAnalyticsDataStub getStub() { * 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. * + *

Sample code: + * + *

{@code
+   * try (AlphaAnalyticsDataClient alphaAnalyticsDataClient = AlphaAnalyticsDataClient.create()) {
+   *   RunReportRequest request =
+   *       RunReportRequest.newBuilder()
+   *           .setEntity(Entity.newBuilder().build())
+   *           .addAllDimensions(new ArrayList())
+   *           .addAllMetrics(new ArrayList())
+   *           .addAllDateRanges(new ArrayList())
+   *           .setOffset(-1019779949)
+   *           .setLimit(102976443)
+   *           .addAllMetricAggregations(new ArrayList())
+   *           .setDimensionFilter(FilterExpression.newBuilder().build())
+   *           .setMetricFilter(FilterExpression.newBuilder().build())
+   *           .addAllOrderBys(new ArrayList())
+   *           .setCurrencyCode("currencyCode1004773790")
+   *           .setCohortSpec(CohortSpec.newBuilder().build())
+   *           .setKeepEmptyRows(true)
+   *           .setReturnPropertyQuota(true)
+   *           .build();
+   *   RunReportResponse response = alphaAnalyticsDataClient.runReport(request);
+   * }
+   * }
+ * * @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 */ @@ -159,6 +207,32 @@ public final RunReportResponse runReport(RunReportRequest request) { * break down metrics across some common criteria, such as country or event name. * *

Sample code: + * + *

{@code
+   * try (AlphaAnalyticsDataClient alphaAnalyticsDataClient = AlphaAnalyticsDataClient.create()) {
+   *   RunReportRequest request =
+   *       RunReportRequest.newBuilder()
+   *           .setEntity(Entity.newBuilder().build())
+   *           .addAllDimensions(new ArrayList())
+   *           .addAllMetrics(new ArrayList())
+   *           .addAllDateRanges(new ArrayList())
+   *           .setOffset(-1019779949)
+   *           .setLimit(102976443)
+   *           .addAllMetricAggregations(new ArrayList())
+   *           .setDimensionFilter(FilterExpression.newBuilder().build())
+   *           .setMetricFilter(FilterExpression.newBuilder().build())
+   *           .addAllOrderBys(new ArrayList())
+   *           .setCurrencyCode("currencyCode1004773790")
+   *           .setCohortSpec(CohortSpec.newBuilder().build())
+   *           .setKeepEmptyRows(true)
+   *           .setReturnPropertyQuota(true)
+   *           .build();
+   *   ApiFuture future =
+   *       alphaAnalyticsDataClient.runReportCallable().futureCall(request);
+   *   // Do something.
+   *   RunReportResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable runReportCallable() { return stub.runReportCallable(); @@ -171,6 +245,28 @@ public final UnaryCallable runReportCallabl * visible if they are included in a pivot. Multiple pivots can be specified to further dissect * your data. * + *

Sample code: + * + *

{@code
+   * try (AlphaAnalyticsDataClient alphaAnalyticsDataClient = AlphaAnalyticsDataClient.create()) {
+   *   RunPivotReportRequest request =
+   *       RunPivotReportRequest.newBuilder()
+   *           .setEntity(Entity.newBuilder().build())
+   *           .addAllDimensions(new ArrayList())
+   *           .addAllMetrics(new ArrayList())
+   *           .setDimensionFilter(FilterExpression.newBuilder().build())
+   *           .setMetricFilter(FilterExpression.newBuilder().build())
+   *           .addAllPivots(new ArrayList())
+   *           .addAllDateRanges(new ArrayList())
+   *           .setCurrencyCode("currencyCode1004773790")
+   *           .setCohortSpec(CohortSpec.newBuilder().build())
+   *           .setKeepEmptyRows(true)
+   *           .setReturnPropertyQuota(true)
+   *           .build();
+   *   RunPivotReportResponse response = alphaAnalyticsDataClient.runPivotReport(request);
+   * }
+   * }
+ * * @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 */ @@ -186,6 +282,29 @@ public final RunPivotReportResponse runPivotReport(RunPivotReportRequest request * your data. * *

Sample code: + * + *

{@code
+   * try (AlphaAnalyticsDataClient alphaAnalyticsDataClient = AlphaAnalyticsDataClient.create()) {
+   *   RunPivotReportRequest request =
+   *       RunPivotReportRequest.newBuilder()
+   *           .setEntity(Entity.newBuilder().build())
+   *           .addAllDimensions(new ArrayList())
+   *           .addAllMetrics(new ArrayList())
+   *           .setDimensionFilter(FilterExpression.newBuilder().build())
+   *           .setMetricFilter(FilterExpression.newBuilder().build())
+   *           .addAllPivots(new ArrayList())
+   *           .addAllDateRanges(new ArrayList())
+   *           .setCurrencyCode("currencyCode1004773790")
+   *           .setCohortSpec(CohortSpec.newBuilder().build())
+   *           .setKeepEmptyRows(true)
+   *           .setReturnPropertyQuota(true)
+   *           .build();
+   *   ApiFuture future =
+   *       alphaAnalyticsDataClient.runPivotReportCallable().futureCall(request);
+   *   // Do something.
+   *   RunPivotReportResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable runPivotReportCallable() { @@ -196,6 +315,19 @@ public final RunPivotReportResponse runPivotReport(RunPivotReportRequest request /** * Returns multiple reports in a batch. All reports must be for the same Entity. * + *

Sample code: + * + *

{@code
+   * try (AlphaAnalyticsDataClient alphaAnalyticsDataClient = AlphaAnalyticsDataClient.create()) {
+   *   BatchRunReportsRequest request =
+   *       BatchRunReportsRequest.newBuilder()
+   *           .setEntity(Entity.newBuilder().build())
+   *           .addAllRequests(new ArrayList())
+   *           .build();
+   *   BatchRunReportsResponse response = alphaAnalyticsDataClient.batchRunReports(request);
+   * }
+   * }
+ * * @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 */ @@ -208,6 +340,20 @@ public final BatchRunReportsResponse batchRunReports(BatchRunReportsRequest requ * Returns multiple reports in a batch. All reports must be for the same Entity. * *

Sample code: + * + *

{@code
+   * try (AlphaAnalyticsDataClient alphaAnalyticsDataClient = AlphaAnalyticsDataClient.create()) {
+   *   BatchRunReportsRequest request =
+   *       BatchRunReportsRequest.newBuilder()
+   *           .setEntity(Entity.newBuilder().build())
+   *           .addAllRequests(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       alphaAnalyticsDataClient.batchRunReportsCallable().futureCall(request);
+   *   // Do something.
+   *   BatchRunReportsResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable batchRunReportsCallable() { @@ -218,6 +364,20 @@ public final BatchRunReportsResponse batchRunReports(BatchRunReportsRequest requ /** * Returns multiple pivot reports in a batch. All reports must be for the same Entity. * + *

Sample code: + * + *

{@code
+   * try (AlphaAnalyticsDataClient alphaAnalyticsDataClient = AlphaAnalyticsDataClient.create()) {
+   *   BatchRunPivotReportsRequest request =
+   *       BatchRunPivotReportsRequest.newBuilder()
+   *           .setEntity(Entity.newBuilder().build())
+   *           .addAllRequests(new ArrayList())
+   *           .build();
+   *   BatchRunPivotReportsResponse response =
+   *       alphaAnalyticsDataClient.batchRunPivotReports(request);
+   * }
+   * }
+ * * @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 */ @@ -231,6 +391,20 @@ public final BatchRunPivotReportsResponse batchRunPivotReports( * Returns multiple pivot reports in a batch. All reports must be for the same Entity. * *

Sample code: + * + *

{@code
+   * try (AlphaAnalyticsDataClient alphaAnalyticsDataClient = AlphaAnalyticsDataClient.create()) {
+   *   BatchRunPivotReportsRequest request =
+   *       BatchRunPivotReportsRequest.newBuilder()
+   *           .setEntity(Entity.newBuilder().build())
+   *           .addAllRequests(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       alphaAnalyticsDataClient.batchRunPivotReportsCallable().futureCall(request);
+   *   // Do something.
+   *   BatchRunPivotReportsResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable batchRunPivotReportsCallable() { @@ -248,6 +422,15 @@ public final BatchRunPivotReportsResponse batchRunPivotReports( * property, the Metadata response will contain `customEvent:levels_unlocked`. Universal metadata * are dimensions and metrics applicable to any property such as `country` and `totalUsers`. * + *

Sample code: + * + *

{@code
+   * try (AlphaAnalyticsDataClient alphaAnalyticsDataClient = AlphaAnalyticsDataClient.create()) {
+   *   MetadataName name = MetadataName.of("[PROPERTY]");
+   *   Metadata response = alphaAnalyticsDataClient.getMetadata(name);
+   * }
+   * }
+ * * @param name Required. The resource name of the metadata to retrieve. This name field is * specified in the URL path and not URL parameters. Property is a numeric Google Analytics * GA4 Property identifier. To learn more, see [where to find your Property @@ -274,6 +457,15 @@ public final Metadata getMetadata(MetadataName name) { * property, the Metadata response will contain `customEvent:levels_unlocked`. Universal metadata * are dimensions and metrics applicable to any property such as `country` and `totalUsers`. * + *

Sample code: + * + *

{@code
+   * try (AlphaAnalyticsDataClient alphaAnalyticsDataClient = AlphaAnalyticsDataClient.create()) {
+   *   String name = MetadataName.of("[PROPERTY]").toString();
+   *   Metadata response = alphaAnalyticsDataClient.getMetadata(name);
+   * }
+   * }
+ * * @param name Required. The resource name of the metadata to retrieve. This name field is * specified in the URL path and not URL parameters. Property is a numeric Google Analytics * GA4 Property identifier. To learn more, see [where to find your Property @@ -299,6 +491,16 @@ public final Metadata getMetadata(String name) { * property, the Metadata response will contain `customEvent:levels_unlocked`. Universal metadata * are dimensions and metrics applicable to any property such as `country` and `totalUsers`. * + *

Sample code: + * + *

{@code
+   * try (AlphaAnalyticsDataClient alphaAnalyticsDataClient = AlphaAnalyticsDataClient.create()) {
+   *   GetMetadataRequest request =
+   *       GetMetadataRequest.newBuilder().setName(MetadataName.of("[PROPERTY]").toString()).build();
+   *   Metadata response = alphaAnalyticsDataClient.getMetadata(request);
+   * }
+   * }
+ * * @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 */ @@ -318,6 +520,17 @@ public final Metadata getMetadata(GetMetadataRequest request) { * are dimensions and metrics applicable to any property such as `country` and `totalUsers`. * *

Sample code: + * + *

{@code
+   * try (AlphaAnalyticsDataClient alphaAnalyticsDataClient = AlphaAnalyticsDataClient.create()) {
+   *   GetMetadataRequest request =
+   *       GetMetadataRequest.newBuilder().setName(MetadataName.of("[PROPERTY]").toString()).build();
+   *   ApiFuture future =
+   *       alphaAnalyticsDataClient.getMetadataCallable().futureCall(request);
+   *   // Do something.
+   *   Metadata response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getMetadataCallable() { return stub.getMetadataCallable(); @@ -328,6 +541,26 @@ public final UnaryCallable getMetadataCallable() { * The Google Analytics Realtime API returns a customized report of realtime event data for your * property. These reports show events and usage from the last 30 minutes. * + *

Sample code: + * + *

{@code
+   * try (AlphaAnalyticsDataClient alphaAnalyticsDataClient = AlphaAnalyticsDataClient.create()) {
+   *   RunRealtimeReportRequest request =
+   *       RunRealtimeReportRequest.newBuilder()
+   *           .setProperty("property-993141291")
+   *           .addAllDimensions(new ArrayList())
+   *           .addAllMetrics(new ArrayList())
+   *           .setLimit(102976443)
+   *           .setDimensionFilter(FilterExpression.newBuilder().build())
+   *           .setMetricFilter(FilterExpression.newBuilder().build())
+   *           .addAllMetricAggregations(new ArrayList())
+   *           .addAllOrderBys(new ArrayList())
+   *           .setReturnPropertyQuota(true)
+   *           .build();
+   *   RunRealtimeReportResponse response = alphaAnalyticsDataClient.runRealtimeReport(request);
+   * }
+   * }
+ * * @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 */ @@ -341,6 +574,27 @@ public final RunRealtimeReportResponse runRealtimeReport(RunRealtimeReportReques * property. These reports show events and usage from the last 30 minutes. * *

Sample code: + * + *

{@code
+   * try (AlphaAnalyticsDataClient alphaAnalyticsDataClient = AlphaAnalyticsDataClient.create()) {
+   *   RunRealtimeReportRequest request =
+   *       RunRealtimeReportRequest.newBuilder()
+   *           .setProperty("property-993141291")
+   *           .addAllDimensions(new ArrayList())
+   *           .addAllMetrics(new ArrayList())
+   *           .setLimit(102976443)
+   *           .setDimensionFilter(FilterExpression.newBuilder().build())
+   *           .setMetricFilter(FilterExpression.newBuilder().build())
+   *           .addAllMetricAggregations(new ArrayList())
+   *           .addAllOrderBys(new ArrayList())
+   *           .setReturnPropertyQuota(true)
+   *           .build();
+   *   ApiFuture future =
+   *       alphaAnalyticsDataClient.runRealtimeReportCallable().futureCall(request);
+   *   // Do something.
+   *   RunRealtimeReportResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable runRealtimeReportCallable() { diff --git a/google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/gapic_metadata.json b/google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/gapic_metadata.json new file mode 100644 index 00000000..39ab2589 --- /dev/null +++ b/google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/gapic_metadata.json @@ -0,0 +1,36 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.analytics.data.v1alpha", + "libraryPackage": "com.google.analytics.data.v1alpha", + "services": { + "AlphaAnalyticsData": { + "clients": { + "grpc": { + "libraryClient": "AlphaAnalyticsDataClient", + "rpcs": { + "BatchRunPivotReports": { + "methods": ["batchRunPivotReports", "batchRunPivotReportsCallable"] + }, + "BatchRunReports": { + "methods": ["batchRunReports", "batchRunReportsCallable"] + }, + "GetMetadata": { + "methods": ["getMetadata", "getMetadata", "getMetadata", "getMetadataCallable"] + }, + "RunPivotReport": { + "methods": ["runPivotReport", "runPivotReportCallable"] + }, + "RunRealtimeReport": { + "methods": ["runRealtimeReport", "runRealtimeReportCallable"] + }, + "RunReport": { + "methods": ["runReport", "runReportCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/package-info.java b/google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/package-info.java index e5ee347c..02c270f4 100644 --- a/google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/package-info.java +++ b/google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/package-info.java @@ -22,6 +22,29 @@ *

Service Description: Google Analytics reporting data service. * *

Sample for AlphaAnalyticsDataClient: + * + *

{@code
+ * try (AlphaAnalyticsDataClient alphaAnalyticsDataClient = AlphaAnalyticsDataClient.create()) {
+ *   RunReportRequest request =
+ *       RunReportRequest.newBuilder()
+ *           .setEntity(Entity.newBuilder().build())
+ *           .addAllDimensions(new ArrayList())
+ *           .addAllMetrics(new ArrayList())
+ *           .addAllDateRanges(new ArrayList())
+ *           .setOffset(-1019779949)
+ *           .setLimit(102976443)
+ *           .addAllMetricAggregations(new ArrayList())
+ *           .setDimensionFilter(FilterExpression.newBuilder().build())
+ *           .setMetricFilter(FilterExpression.newBuilder().build())
+ *           .addAllOrderBys(new ArrayList())
+ *           .setCurrencyCode("currencyCode1004773790")
+ *           .setCohortSpec(CohortSpec.newBuilder().build())
+ *           .setKeepEmptyRows(true)
+ *           .setReturnPropertyQuota(true)
+ *           .build();
+ *   RunReportResponse response = alphaAnalyticsDataClient.runReport(request);
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.analytics.data.v1alpha; diff --git a/google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/stub/GrpcAlphaAnalyticsDataStub.java b/google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/stub/GrpcAlphaAnalyticsDataStub.java index afac8d70..2dfee334 100644 --- a/google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/stub/GrpcAlphaAnalyticsDataStub.java +++ b/google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/stub/GrpcAlphaAnalyticsDataStub.java @@ -249,27 +249,33 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable runReportCallable() { return runReportCallable; } + @Override public UnaryCallable runPivotReportCallable() { return runPivotReportCallable; } + @Override public UnaryCallable batchRunReportsCallable() { return batchRunReportsCallable; } + @Override public UnaryCallable batchRunPivotReportsCallable() { return batchRunPivotReportsCallable; } + @Override public UnaryCallable getMetadataCallable() { return getMetadataCallable; } + @Override public UnaryCallable runRealtimeReportCallable() { return runRealtimeReportCallable; diff --git a/google-analytics-data/src/test/java/com/google/analytics/data/v1alpha/MockAlphaAnalyticsDataImpl.java b/google-analytics-data/src/test/java/com/google/analytics/data/v1alpha/MockAlphaAnalyticsDataImpl.java index 7f01e008..5e78c9a1 100644 --- a/google-analytics-data/src/test/java/com/google/analytics/data/v1alpha/MockAlphaAnalyticsDataImpl.java +++ b/google-analytics-data/src/test/java/com/google/analytics/data/v1alpha/MockAlphaAnalyticsDataImpl.java @@ -69,7 +69,13 @@ public void runReport( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RunReport, expected %s or %s", + response.getClass().getName(), + RunReportResponse.class.getName(), + Exception.class.getName()))); } } @@ -84,7 +90,13 @@ public void runPivotReport( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RunPivotReport, expected %s or %s", + response.getClass().getName(), + RunPivotReportResponse.class.getName(), + Exception.class.getName()))); } } @@ -99,7 +111,13 @@ public void batchRunReports( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method BatchRunReports, expected %s or %s", + response.getClass().getName(), + BatchRunReportsResponse.class.getName(), + Exception.class.getName()))); } } @@ -115,7 +133,13 @@ public void batchRunPivotReports( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method BatchRunPivotReports, expected %s or %s", + response.getClass().getName(), + BatchRunPivotReportsResponse.class.getName(), + Exception.class.getName()))); } } @@ -129,7 +153,13 @@ public void getMetadata(GetMetadataRequest request, StreamObserver res } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetMetadata, expected %s or %s", + response.getClass().getName(), + Metadata.class.getName(), + Exception.class.getName()))); } } @@ -145,7 +175,13 @@ public void runRealtimeReport( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RunRealtimeReport, expected %s or %s", + response.getClass().getName(), + RunRealtimeReportResponse.class.getName(), + Exception.class.getName()))); } } } diff --git a/grpc-google-analytics-data-v1alpha/pom.xml b/grpc-google-analytics-data-v1alpha/pom.xml index 7ce766b2..3eb4f606 100644 --- a/grpc-google-analytics-data-v1alpha/pom.xml +++ b/grpc-google-analytics-data-v1alpha/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-analytics-data-v1alpha - 0.5.4 + 0.5.5 grpc-google-analytics-data-v1alpha GRPC library for grpc-google-analytics-data-v1alpha com.google.analytics google-analytics-data-parent - 0.5.4 + 0.5.5 diff --git a/pom.xml b/pom.xml index e2e4a0e4..0d242cfe 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.analytics google-analytics-data-parent pom - 0.5.4 + 0.5.5 Google Analytics Data Parent https://github.com/googleapis/java-analytics-data @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 0.9.4 + 0.10.0 @@ -70,23 +70,23 @@ com.google.analytics google-analytics-data - 0.5.4 + 0.5.5 com.google.api.grpc proto-google-analytics-data-v1alpha - 0.5.4 + 0.5.5 com.google.api.grpc grpc-google-analytics-data-v1alpha - 0.5.4 + 0.5.5 com.google.cloud google-cloud-shared-dependencies - 0.18.0 + 0.19.0 pom import diff --git a/proto-google-analytics-data-v1alpha/pom.xml b/proto-google-analytics-data-v1alpha/pom.xml index ab01f582..21244b09 100644 --- a/proto-google-analytics-data-v1alpha/pom.xml +++ b/proto-google-analytics-data-v1alpha/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-analytics-data-v1alpha - 0.5.4 + 0.5.5 proto-google-analytics-data-v1alpha PROTO library for proto-google-analytics-data-v1alpha com.google.analytics google-analytics-data-parent - 0.5.4 + 0.5.5 diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index d3ab2f33..49a4f5cd 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,20 +29,20 @@ com.google.analytics google-analytics-data - 0.5.1 + 0.5.4 junit junit - 4.13.1 + 4.13.2 test com.google.truth truth - 1.1 + 1.1.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ba2e28c1..5560d16a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,20 +28,20 @@ com.google.analytics google-analytics-data - 0.5.4 + 0.5.5 junit junit - 4.13.1 + 4.13.2 test com.google.truth truth - 1.1 + 1.1.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 9528d1ba..97eb31ef 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -28,19 +28,19 @@ com.google.analytics google-analytics-data - 0.5.1 + 0.5.4 junit junit - 4.13.1 + 4.13.2 test com.google.truth truth - 1.1 + 1.1.2 test diff --git a/synth.metadata b/synth.metadata index f3ef7f39..8eefdb70 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,33 +4,22 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-analytics-data.git", - "sha": "0f2603f7375b7e13f33ff5c5da863b240eac192a" + "sha": "44a96d0276127da97c719c463eb4602ed9ffd483" } }, { "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "name": "googleapis-gen", + "remote": "https://github.com/googleapis/googleapis-gen.git", + "sha": "9d14cd16d94886f7f10a243e1b5a6876946f32bb", + "internalRef": "358516065" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "6133907dbb3ddab204a17a15d5c53ec0aae9b033" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "analytics-data", - "apiVersion": "v1alpha", - "language": "java", - "generator": "bazel" + "sha": "6946fd71ae9215b0e7ae188f5057df765ee6d7d2" } } ], @@ -59,7 +48,6 @@ ".kokoro/continuous/java8.cfg", ".kokoro/continuous/readme.cfg", ".kokoro/dependencies.sh", - ".kokoro/linkage-monitor.sh", ".kokoro/nightly/common.cfg", ".kokoro/nightly/integration.cfg", ".kokoro/nightly/java11.cfg", @@ -91,6 +79,8 @@ ".kokoro/release/promote.sh", ".kokoro/release/publish_javadoc.cfg", ".kokoro/release/publish_javadoc.sh", + ".kokoro/release/publish_javadoc11.cfg", + ".kokoro/release/publish_javadoc11.sh", ".kokoro/release/snapshot.cfg", ".kokoro/release/snapshot.sh", ".kokoro/release/stage.cfg", @@ -102,6 +92,7 @@ "codecov.yaml", "google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/AlphaAnalyticsDataClient.java", "google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/AlphaAnalyticsDataSettings.java", + "google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/gapic_metadata.json", "google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/package-info.java", "google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/stub/AlphaAnalyticsDataStub.java", "google-analytics-data/src/main/java/com/google/analytics/data/v1alpha/stub/AlphaAnalyticsDataStubSettings.java", diff --git a/synth.py b/synth.py index 5cdf5431..d7ed92da 100644 --- a/synth.py +++ b/synth.py @@ -14,20 +14,17 @@ """This script is used to synthesize generated parts of this library.""" -import synthtool as s -import synthtool.gcp as gcp import synthtool.languages.java as java service = 'analytics-data' versions = ['v1alpha'] for version in versions: - java.bazel_library( - service=service, - version=version, - proto_path=f'google/analytics/data/{version}', - bazel_target=f'//google/analytics/data/{version}:google-analytics-data-{version}-java', - cloud_api=False, + java.pregenerated_library( + service=service, + version=version, + path=f'google/analytics/data/{version}', + cloud_api=False, ) java.common_templates() \ No newline at end of file diff --git a/versions.txt b/versions.txt index 354eeea1..23d57054 100644 --- a/versions.txt +++ b/versions.txt @@ -1,6 +1,6 @@ # Format: # module:released-version:current-version -google-analytics-data:0.5.4:0.5.4 -proto-google-analytics-data-v1alpha:0.5.4:0.5.4 -grpc-google-analytics-data-v1alpha:0.5.4:0.5.4 \ No newline at end of file +google-analytics-data:0.5.5:0.5.5 +proto-google-analytics-data-v1alpha:0.5.5:0.5.5 +grpc-google-analytics-data-v1alpha:0.5.5:0.5.5 \ No newline at end of file