From 6471323f7aad7da67f9bb37a655802e36e6794e6 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 15 Jun 2022 21:47:44 +0000 Subject: [PATCH 1/2] fix!: rename the type `FunnelFilter` to `FunnelFieldFilter` fix!: rename the `funnel_filter` field of the `FunnelFilterExpression` type to `funnel_field_filter` PiperOrigin-RevId: 455204231 Source-Link: https://github.com/googleapis/googleapis/commit/48494807478bb592357bd4d115c13a0224020450 Source-Link: https://github.com/googleapis/googleapis-gen/commit/589642d0a68a2c519273cf0f7d7947b19cd99eac Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTg5NjQyZDBhNjhhMmM1MTkyNzNjZjBmN2Q3OTQ3YjE5Y2Q5OWVhYyJ9 --- owl-bot-staging/v1alpha/.eslintignore | 7 + owl-bot-staging/v1alpha/.eslintrc.json | 3 + owl-bot-staging/v1alpha/.gitignore | 14 + owl-bot-staging/v1alpha/.jsdoc.js | 55 + owl-bot-staging/v1alpha/.mocharc.js | 33 + owl-bot-staging/v1alpha/.prettierrc.js | 22 + owl-bot-staging/v1alpha/README.md | 1 + .../v1alpha/linkinator.config.json | 16 + owl-bot-staging/v1alpha/package.json | 64 + .../data/v1alpha/analytics_data_api.proto | 169 +++ .../google/analytics/data/v1alpha/data.proto | 1233 +++++++++++++++++ .../alpha_analytics_data.run_funnel_report.js | 128 ++ ...etadata.google.analytics.data.v1alpha.json | 91 ++ owl-bot-staging/v1alpha/src/index.ts | 25 + .../v1alpha/alpha_analytics_data_client.ts | 432 ++++++ .../alpha_analytics_data_client_config.json | 31 + .../alpha_analytics_data_proto_list.json | 4 + .../v1alpha/src/v1alpha/gapic_metadata.json | 33 + owl-bot-staging/v1alpha/src/v1alpha/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../v1alpha/system-test/install.ts | 49 + .../gapic_alpha_analytics_data_v1alpha.ts | 232 ++++ owl-bot-staging/v1alpha/tsconfig.json | 19 + owl-bot-staging/v1alpha/webpack.config.js | 64 + owl-bot-staging/v1beta/.eslintignore | 7 + owl-bot-staging/v1beta/.eslintrc.json | 3 + owl-bot-staging/v1beta/.gitignore | 14 + owl-bot-staging/v1beta/.jsdoc.js | 55 + owl-bot-staging/v1beta/.mocharc.js | 33 + owl-bot-staging/v1beta/.prettierrc.js | 22 + owl-bot-staging/v1beta/README.md | 1 + owl-bot-staging/v1beta/linkinator.config.json | 16 + owl-bot-staging/v1beta/package.json | 64 + .../data/v1beta/analytics_data_api.proto | 620 +++++++++ .../google/analytics/data/v1beta/data.proto | 959 +++++++++++++ ..._analytics_data.batch_run_pivot_reports.js | 69 + .../beta_analytics_data.batch_run_reports.js | 69 + ...beta_analytics_data.check_compatibility.js | 90 ++ .../beta_analytics_data.get_metadata.js | 66 + .../beta_analytics_data.run_pivot_report.js | 121 ++ ...beta_analytics_data.run_realtime_report.js | 113 ++ .../v1beta/beta_analytics_data.run_report.js | 144 ++ ...metadata.google.analytics.data.v1beta.json | 451 ++++++ owl-bot-staging/v1beta/src/index.ts | 25 + .../src/v1beta/beta_analytics_data_client.ts | 1067 ++++++++++++++ .../beta_analytics_data_client_config.json | 73 + .../beta_analytics_data_proto_list.json | 4 + .../v1beta/src/v1beta/gapic_metadata.json | 93 ++ owl-bot-staging/v1beta/src/v1beta/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + owl-bot-staging/v1beta/system-test/install.ts | 49 + .../test/gapic_beta_analytics_data_v1beta.ts | 847 +++++++++++ owl-bot-staging/v1beta/tsconfig.json | 19 + owl-bot-staging/v1beta/webpack.config.js | 64 + 56 files changed, 8039 insertions(+) create mode 100644 owl-bot-staging/v1alpha/.eslintignore create mode 100644 owl-bot-staging/v1alpha/.eslintrc.json create mode 100644 owl-bot-staging/v1alpha/.gitignore create mode 100644 owl-bot-staging/v1alpha/.jsdoc.js create mode 100644 owl-bot-staging/v1alpha/.mocharc.js create mode 100644 owl-bot-staging/v1alpha/.prettierrc.js create mode 100644 owl-bot-staging/v1alpha/README.md create mode 100644 owl-bot-staging/v1alpha/linkinator.config.json create mode 100644 owl-bot-staging/v1alpha/package.json create mode 100644 owl-bot-staging/v1alpha/protos/google/analytics/data/v1alpha/analytics_data_api.proto create mode 100644 owl-bot-staging/v1alpha/protos/google/analytics/data/v1alpha/data.proto create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.data.v1alpha.json create mode 100644 owl-bot-staging/v1alpha/src/index.ts create mode 100644 owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_client.ts create mode 100644 owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_client_config.json create mode 100644 owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_proto_list.json create mode 100644 owl-bot-staging/v1alpha/src/v1alpha/gapic_metadata.json create mode 100644 owl-bot-staging/v1alpha/src/v1alpha/index.ts create mode 100644 owl-bot-staging/v1alpha/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/v1alpha/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/v1alpha/system-test/install.ts create mode 100644 owl-bot-staging/v1alpha/test/gapic_alpha_analytics_data_v1alpha.ts create mode 100644 owl-bot-staging/v1alpha/tsconfig.json create mode 100644 owl-bot-staging/v1alpha/webpack.config.js create mode 100644 owl-bot-staging/v1beta/.eslintignore create mode 100644 owl-bot-staging/v1beta/.eslintrc.json create mode 100644 owl-bot-staging/v1beta/.gitignore create mode 100644 owl-bot-staging/v1beta/.jsdoc.js create mode 100644 owl-bot-staging/v1beta/.mocharc.js create mode 100644 owl-bot-staging/v1beta/.prettierrc.js create mode 100644 owl-bot-staging/v1beta/README.md create mode 100644 owl-bot-staging/v1beta/linkinator.config.json create mode 100644 owl-bot-staging/v1beta/package.json create mode 100644 owl-bot-staging/v1beta/protos/google/analytics/data/v1beta/analytics_data_api.proto create mode 100644 owl-bot-staging/v1beta/protos/google/analytics/data/v1beta/data.proto create mode 100644 owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js create mode 100644 owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.batch_run_reports.js create mode 100644 owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.check_compatibility.js create mode 100644 owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.get_metadata.js create mode 100644 owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_pivot_report.js create mode 100644 owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_realtime_report.js create mode 100644 owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_report.js create mode 100644 owl-bot-staging/v1beta/samples/generated/v1beta/snippet_metadata.google.analytics.data.v1beta.json create mode 100644 owl-bot-staging/v1beta/src/index.ts create mode 100644 owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_client.ts create mode 100644 owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_client_config.json create mode 100644 owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_proto_list.json create mode 100644 owl-bot-staging/v1beta/src/v1beta/gapic_metadata.json create mode 100644 owl-bot-staging/v1beta/src/v1beta/index.ts create mode 100644 owl-bot-staging/v1beta/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/v1beta/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/v1beta/system-test/install.ts create mode 100644 owl-bot-staging/v1beta/test/gapic_beta_analytics_data_v1beta.ts create mode 100644 owl-bot-staging/v1beta/tsconfig.json create mode 100644 owl-bot-staging/v1beta/webpack.config.js diff --git a/owl-bot-staging/v1alpha/.eslintignore b/owl-bot-staging/v1alpha/.eslintignore new file mode 100644 index 000000000..cfc348ec4 --- /dev/null +++ b/owl-bot-staging/v1alpha/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/v1alpha/.eslintrc.json b/owl-bot-staging/v1alpha/.eslintrc.json new file mode 100644 index 000000000..782153495 --- /dev/null +++ b/owl-bot-staging/v1alpha/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/v1alpha/.gitignore b/owl-bot-staging/v1alpha/.gitignore new file mode 100644 index 000000000..5d32b2378 --- /dev/null +++ b/owl-bot-staging/v1alpha/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +.coverage +coverage +.nyc_output +docs/ +out/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/v1alpha/.jsdoc.js b/owl-bot-staging/v1alpha/.jsdoc.js new file mode 100644 index 000000000..51555adbf --- /dev/null +++ b/owl-bot-staging/v1alpha/.jsdoc.js @@ -0,0 +1,55 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/data', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/v1alpha/.mocharc.js b/owl-bot-staging/v1alpha/.mocharc.js new file mode 100644 index 000000000..481c522b0 --- /dev/null +++ b/owl-bot-staging/v1alpha/.mocharc.js @@ -0,0 +1,33 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/v1alpha/.prettierrc.js b/owl-bot-staging/v1alpha/.prettierrc.js new file mode 100644 index 000000000..494e14786 --- /dev/null +++ b/owl-bot-staging/v1alpha/.prettierrc.js @@ -0,0 +1,22 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/v1alpha/README.md b/owl-bot-staging/v1alpha/README.md new file mode 100644 index 000000000..61b6042f8 --- /dev/null +++ b/owl-bot-staging/v1alpha/README.md @@ -0,0 +1 @@ +Data: Nodejs Client diff --git a/owl-bot-staging/v1alpha/linkinator.config.json b/owl-bot-staging/v1alpha/linkinator.config.json new file mode 100644 index 000000000..befd23c86 --- /dev/null +++ b/owl-bot-staging/v1alpha/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/owl-bot-staging/v1alpha/package.json b/owl-bot-staging/v1alpha/package.json new file mode 100644 index 000000000..61845d2ce --- /dev/null +++ b/owl-bot-staging/v1alpha/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/data", + "version": "0.1.0", + "description": "Data client for Node.js", + "repository": "googleapis/nodejs-data", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google data", + "data", + "alpha analytics data" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^2.29.4" + }, + "devDependencies": { + "@types/mocha": "^9.1.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.8", + "c8": "^7.11.0", + "gts": "^3.1.0", + "jsdoc": "^3.6.7", + "jsdoc-fresh": "^1.1.1", + "jsdoc-region-tag": "^1.3.1", + "linkinator": "^3.0.0", + "mocha": "^9.1.4", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^13.0.0", + "ts-loader": "^9.2.6", + "typescript": "^4.5.5", + "webpack": "^5.67.0", + "webpack-cli": "^4.9.1" + }, + "engines": { + "node": ">=v10.24.0" + } +} diff --git a/owl-bot-staging/v1alpha/protos/google/analytics/data/v1alpha/analytics_data_api.proto b/owl-bot-staging/v1alpha/protos/google/analytics/data/v1alpha/analytics_data_api.proto new file mode 100644 index 000000000..f86cf8dbd --- /dev/null +++ b/owl-bot-staging/v1alpha/protos/google/analytics/data/v1alpha/analytics_data_api.proto @@ -0,0 +1,169 @@ +// 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 +// +// 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. + +syntax = "proto3"; + +package google.analytics.data.v1alpha; + +import "google/analytics/data/v1alpha/data.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; + +option go_package = "google.golang.org/genproto/googleapis/analytics/data/v1alpha;data"; +option java_multiple_files = true; +option java_outer_classname = "AnalyticsDataApiProto"; +option java_package = "com.google.analytics.data.v1alpha"; + +// Google Analytics reporting data service. +service AlphaAnalyticsData { + option (google.api.default_host) = "analyticsdata.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/analytics," + "https://www.googleapis.com/auth/analytics.readonly"; + + // Returns a customized funnel report of your Google Analytics event data. The + // data returned from the API is as a table with columns for the requested + // dimensions and metrics. + // + // Funnel exploration lets you visualize the steps your users take to complete + // a task and quickly see how well they are succeeding or failing at each + // step. For example, how do prospects become shoppers and then become buyers? + // How do one time buyers become repeat buyers? With this information, you can + // improve inefficient or abandoned customer journeys. To learn more, see [GA4 + // Funnel Explorations](https://support.google.com/analytics/answer/9327974). + rpc RunFunnelReport(RunFunnelReportRequest) returns (RunFunnelReportResponse) { + option (google.api.http) = { + post: "/v1alpha/{property=properties/*}:runFunnelReport" + body: "*" + }; + } +} + +// The request for a funnel report. +message RunFunnelReportRequest { + // Controls the dimensions present in the funnel visualization sub report + // response. + enum FunnelVisualizationType { + // Unspecified type. + FUNNEL_VISUALIZATION_TYPE_UNSPECIFIED = 0; + + // A standard (stepped) funnel. The funnel visualization sub report in the + // response will not contain date. + STANDARD_FUNNEL = 1; + + // A trended (line chart) funnel. The funnel visualization sub report in the + // response will contain the date dimension. + TRENDED_FUNNEL = 2; + } + + // A Google Analytics GA4 property identifier whose events are tracked. + // Specified in the URL path and not the body. To learn more, see [where to + // find your Property + // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + // Within a batch request, this property should either be unspecified or + // consistent with the batch-level property. + // + // Example: properties/1234 + string property = 1; + + // Date ranges of data to read. If multiple date ranges are requested, each + // response row will contain a zero based date range index. If two date + // ranges overlap, the event data for the overlapping days is included in the + // response rows for both date ranges. + repeated DateRange date_ranges = 2; + + // The configuration of this request's funnel. This funnel configuration is + // required. + Funnel funnel = 3; + + // If specified, this breakdown adds a dimension to the funnel table sub + // report response. This breakdown dimension expands each funnel step to the + // unique values of the breakdown dimension. For example, a breakdown by the + // `deviceCategory` dimension will create rows for `mobile`, `tablet`, + // `desktop`, and the total. + FunnelBreakdown funnel_breakdown = 4; + + // If specified, next action adds a dimension to the funnel visualization sub + // report response. This next action dimension expands each funnel step to the + // unique values of the next action. For example a next action of the + // `eventName` dimension will create rows for several events (i.e. + // `session_start` & `click`) and the total. + // + // Next action only supports `eventName` and most Page / Screen dimensions + // like `pageTitle` and `pagePath`. + FunnelNextAction funnel_next_action = 5; + + // The funnel visualization type controls the dimensions present in the funnel + // visualization sub report response. If not specified, `STANDARD_FUNNEL` is + // used. + FunnelVisualizationType funnel_visualization_type = 6; + + // The configurations of segments. Segments are subsets of a property's data. + // In a funnel report with segments, the funnel is evaluated in each segment. + // + // Each segment specified in this request + // produces a separate row in the response; in the response, each segment + // identified by its name. + // + // The segments parameter is optional. Requests are limited to 4 segments. + repeated Segment segments = 7; + + // The number of rows to return. If unspecified, 10,000 rows are returned. The + // API returns a maximum of 100,000 rows per request, no matter how many you + // ask for. `limit` must be positive. + // + // The API can also return fewer rows than the requested `limit`, if there + // aren't as many dimension values as the `limit`. + int64 limit = 9; + + // Dimension filters allow you to ask for only specific dimension values in + // the report. To learn more, see [Creating a Report: Dimension + // Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + // for examples. Metrics cannot be used in this filter. + FilterExpression dimension_filter = 10; + + // Toggles whether to return the current state of this Analytics Property's + // quota. Quota is returned in [PropertyQuota](#PropertyQuota). + bool return_property_quota = 12; +} + +// The funnel report response contains two sub reports. The two sub reports are +// different combinations of dimensions and metrics. +message RunFunnelReportResponse { + // The funnel table is a report with the funnel step, segment, breakdown + // dimension, active users, completion rate, abandonments, and abandonments + // rate. + // + // The segment dimension is only present in this response if a segment was + // requested. The breakdown dimension is only present in this response if it + // was requested. + FunnelSubReport funnel_table = 1; + + // The funnel visualization is a report with the funnel step, segment, date, + // next action dimension, and active users. + // + // The segment dimension is only present in this response if a segment was + // requested. The date dimension is only present in this response if it was + // requested via the `TRENDED_FUNNEL` funnel type. The next action dimension + // is only present in the response if it was requested. + FunnelSubReport funnel_visualization = 2; + + // This Analytics Property's quota state including this request. + PropertyQuota property_quota = 3; + + // Identifies what kind of resource this message is. This `kind` is always the + // fixed string "analyticsData#runFunnelReport". Useful to distinguish between + // response types in JSON. + string kind = 4; +} diff --git a/owl-bot-staging/v1alpha/protos/google/analytics/data/v1alpha/data.proto b/owl-bot-staging/v1alpha/protos/google/analytics/data/v1alpha/data.proto new file mode 100644 index 000000000..9ef9f6143 --- /dev/null +++ b/owl-bot-staging/v1alpha/protos/google/analytics/data/v1alpha/data.proto @@ -0,0 +1,1233 @@ +// 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 +// +// 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. + +syntax = "proto3"; + +package google.analytics.data.v1alpha; + +import "google/protobuf/duration.proto"; + +option go_package = "google.golang.org/genproto/googleapis/analytics/data/v1alpha;data"; +option java_multiple_files = true; +option java_outer_classname = "ReportingApiProto"; +option java_package = "com.google.analytics.data.v1alpha"; + +// A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests +// are allowed up to 4 date ranges. +message DateRange { + // The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot + // be after `end_date`. The format `NdaysAgo`, `yesterday`, or `today` is also + // accepted, and in that case, the date is inferred based on the property's + // reporting time zone. + string start_date = 1; + + // The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot + // be before `start_date`. The format `NdaysAgo`, `yesterday`, or `today` is + // also accepted, and in that case, the date is inferred based on the + // property's reporting time zone. + string end_date = 2; + + // Assigns a name to this date range. The dimension `dateRange` is valued to + // this name in a report response. If set, cannot begin with `date_range_` or + // `RESERVED_`. If not set, date ranges are named by their zero based index in + // the request: `date_range_0`, `date_range_1`, etc. + string name = 3; +} + +// Dimensions are attributes of your data. For example, the dimension city +// indicates the city from which an event originates. Dimension values in report +// responses are strings; for example, the city could be "Paris" or "New York". +message Dimension { + // The name of the dimension. See the [API + // Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) + // for the list of dimension names. + // + // If `dimensionExpression` is specified, `name` can be any string that you + // would like within the allowed character set. For example if a + // `dimensionExpression` concatenates `country` and `city`, you could call + // that dimension `countryAndCity`. Dimension names that you choose must match + // the regular expression `^[a-zA-Z0-9_]$`. + // + // Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`, + // `dimensionExpression`, and `pivots`. + string name = 1; + + // One dimension can be the result of an expression of multiple dimensions. + // For example, dimension "country, city": concatenate(country, ", ", city). + DimensionExpression dimension_expression = 2; +} + +// Used to express a dimension which is the result of a formula of multiple +// dimensions. Example usages: +// 1) lower_case(dimension) +// 2) concatenate(dimension1, symbol, dimension2). +message DimensionExpression { + // Used to convert a dimension value to a single case. + message CaseExpression { + // Name of a dimension. The name must refer back to a name in dimensions + // field of the request. + string dimension_name = 1; + } + + // Used to combine dimension values to a single dimension. + message ConcatenateExpression { + // Names of dimensions. The names must refer back to names in the dimensions + // field of the request. + repeated string dimension_names = 1; + + // The delimiter placed between dimension names. + // + // Delimiters are often single characters such as "|" or "," but can be + // longer strings. If a dimension value contains the delimiter, both will be + // present in response with no distinction. For example if dimension 1 value + // = "US,FR", dimension 2 value = "JP", and delimiter = ",", then the + // response will contain "US,FR,JP". + string delimiter = 2; + } + + // Specify one type of dimension expression for `DimensionExpression`. + oneof one_expression { + // Used to convert a dimension value to lower case. + CaseExpression lower_case = 4; + + // Used to convert a dimension value to upper case. + CaseExpression upper_case = 5; + + // Used to combine dimension values to a single dimension. + // For example, dimension "country, city": concatenate(country, ", ", city). + ConcatenateExpression concatenate = 6; + } +} + +// To express dimension or metric filters. The fields in the same +// FilterExpression need to be either all dimensions or all metrics. +message FilterExpression { + // Specify one type of filter expression for `FilterExpression`. + oneof expr { + // The FilterExpressions in and_group have an AND relationship. + FilterExpressionList and_group = 1; + + // The FilterExpressions in or_group have an OR relationship. + FilterExpressionList or_group = 2; + + // The FilterExpression is NOT of not_expression. + FilterExpression not_expression = 3; + + // A primitive filter. In the same FilterExpression, all of the filter's + // field names need to be either all dimensions or all metrics. + Filter filter = 4; + } +} + +// A list of filter expressions. +message FilterExpressionList { + // A list of filter expressions. + repeated FilterExpression expressions = 1; +} + +// An expression to filter dimension or metric values. +message Filter { + // The dimension name or metric name. Must be a name defined in dimensions + // or metrics. + string field_name = 1; + + // Specify one type of filter for `Filter`. + oneof one_filter { + // Strings related filter. + StringFilter string_filter = 2; + + // A filter for in list values. + InListFilter in_list_filter = 3; + + // A filter for numeric or date values. + NumericFilter numeric_filter = 4; + + // A filter for between two values. + BetweenFilter between_filter = 5; + } +} + +// The filter for string +message StringFilter { + // The match type of a string filter + enum MatchType { + // Unspecified + MATCH_TYPE_UNSPECIFIED = 0; + + // Exact match of the string value. + EXACT = 1; + + // Begins with the string value. + BEGINS_WITH = 2; + + // Ends with the string value. + ENDS_WITH = 3; + + // Contains the string value. + CONTAINS = 4; + + // Full match for the regular expression with the string value. + FULL_REGEXP = 5; + + // Partial match for the regular expression with the string value. + PARTIAL_REGEXP = 6; + } + + // The match type for this filter. + MatchType match_type = 1; + + // The string value used for the matching. + string value = 2; + + // If true, the string value is case sensitive. + bool case_sensitive = 3; +} + +// The result needs to be in a list of string values. +message InListFilter { + // The list of string values. + // Must be non-empty. + repeated string values = 1; + + // If true, the string value is case sensitive. + bool case_sensitive = 2; +} + +// Filters for numeric or date values. +message NumericFilter { + // The operation applied to a numeric filter + enum Operation { + // Unspecified. + OPERATION_UNSPECIFIED = 0; + + // Equal + EQUAL = 1; + + // Less than + LESS_THAN = 2; + + // Less than or equal + LESS_THAN_OR_EQUAL = 3; + + // Greater than + GREATER_THAN = 4; + + // Greater than or equal + GREATER_THAN_OR_EQUAL = 5; + } + + // The operation type for this filter. + Operation operation = 1; + + // A numeric value or a date value. + NumericValue value = 2; +} + +// To express that the result needs to be between two numbers (inclusive). +message BetweenFilter { + // Begins with this number. + NumericValue from_value = 1; + + // Ends with this number. + NumericValue to_value = 2; +} + +// To represent a number. +message NumericValue { + // One of a numeric value + oneof one_value { + // Integer value + int64 int64_value = 1; + + // Double value + double double_value = 2; + } +} + +// Describes a dimension column in the report. Dimensions requested in a report +// produce column entries within rows and DimensionHeaders. However, dimensions +// used exclusively within filters or expressions do not produce columns in a +// report; correspondingly, those dimensions do not produce headers. +message DimensionHeader { + // The dimension's name. + string name = 1; +} + +// Describes a metric column in the report. Visible metrics requested in a +// report produce column entries within rows and MetricHeaders. However, +// metrics used exclusively within filters or expressions do not produce columns +// in a report; correspondingly, those metrics do not produce headers. +message MetricHeader { + // The metric's name. + string name = 1; + + // The metric's data type. + MetricType type = 2; +} + +// Report data for each row. +// For example if RunReportRequest contains: +// +// ```none +// "dimensions": [ +// { +// "name": "eventName" +// }, +// { +// "name": "countryId" +// } +// ], +// "metrics": [ +// { +// "name": "eventCount" +// } +// ] +// ``` +// +// One row with 'in_app_purchase' as the eventName, 'JP' as the countryId, and +// 15 as the eventCount, would be: +// +// ```none +// "dimensionValues": [ +// { +// "value": "in_app_purchase" +// }, +// { +// "value": "JP" +// } +// ], +// "metricValues": [ +// { +// "value": "15" +// } +// ] +// ``` +message Row { + // List of requested dimension values. In a PivotReport, dimension_values + // are only listed for dimensions included in a pivot. + repeated DimensionValue dimension_values = 1; + + // List of requested visible metric values. + repeated MetricValue metric_values = 2; +} + +// The value of a dimension. +message DimensionValue { + // One kind of dimension value + oneof one_value { + // Value as a string if the dimension type is a string. + string value = 1; + } +} + +// The value of a metric. +message MetricValue { + // One of metric value + oneof one_value { + // Measurement value. See MetricHeader for type. + string value = 4; + } +} + +// Current state of all quotas for this Analytics Property. If any quota for a +// property is exhausted, all requests to that property will return Resource +// Exhausted errors. +message PropertyQuota { + // Standard Analytics Properties can use up to 25,000 tokens per day; + // Analytics 360 Properties can use 250,000 tokens per day. Most requests + // consume fewer than 10 tokens. + QuotaStatus tokens_per_day = 1; + + // Standard Analytics Properties can use up to 5,000 tokens per hour; + // Analytics 360 Properties can use 50,000 tokens per hour. An API request + // consumes a single number of tokens, and that number is deducted from both + // the hourly and daily quotas. + QuotaStatus tokens_per_hour = 2; + + // Standard Analytics Properties can send up to 10 concurrent requests; + // Analytics 360 Properties can use up to 50 concurrent requests. + QuotaStatus concurrent_requests = 3; + + // Standard Analytics Properties and cloud project pairs can have up to 10 + // server errors per hour; Analytics 360 Properties and cloud project pairs + // can have up to 50 server errors per hour. + QuotaStatus server_errors_per_project_per_hour = 4; + + // Analytics Properties can send up to 120 requests with potentially + // thresholded dimensions per hour. In a batch request, each report request + // is individually counted for this quota if the request contains potentially + // thresholded dimensions. + QuotaStatus potentially_thresholded_requests_per_hour = 5; +} + +// Current state for a particular quota group. +message QuotaStatus { + // Quota consumed by this request. + int32 consumed = 1; + + // Quota remaining after this request. + int32 remaining = 2; +} + +// Breakdowns add a dimension to the funnel table sub report response. +message FunnelBreakdown { + // The dimension column added to the funnel table sub report response. The + // breakdown dimension breaks down each funnel step. A valid + // `breakdownDimension` is required if `funnelBreakdown` is specified. + Dimension breakdown_dimension = 1; + + // The maximum number of distinct values of the breakdown dimension to return + // in the response. A `limit` of `5` is used if limit is not specified. Limit + // must exceed zero and cannot exceed 15. + optional int64 limit = 2; +} + +// Next actions state the value for a dimension after the user has achieved +// a step but before the same user has achieved the next step. For example if +// the `nextActionDimension` is `eventName`, then `nextActionDimension` in the +// `i`th funnel step row will return first event after the event that qualified +// the user into the `i`th funnel step but before the user achieved the `i+1`th +// funnel step. +message FunnelNextAction { + // The dimension column added to the funnel visualization sub report response. + // The next action dimension returns the next dimension value of this + // dimension after the user has attained the `i`th funnel step. + // + // `nextActionDimension` currently only supports `eventName` and most Page / + // Screen dimensions like `pageTitle` and `pagePath`. `nextActionDimension` + // cannot be a dimension expression. + Dimension next_action_dimension = 1; + + // The maximum number of distinct values of the breakdown dimension to return + // in the response. A `limit` of `5` is used if limit is not specified. Limit + // must exceed zero and cannot exceed 5. + optional int64 limit = 2; +} + +// Configures the funnel in a funnel report request. A funnel reports on users +// as they pass through a sequence of steps. +// +// Funnel exploration lets you visualize the steps your users take to complete a +// task and quickly see how well they are succeeding or failing at each step. +// For example, how do prospects become shoppers and then become buyers? How do +// one time buyers become repeat buyers? With this information, you can improve +// inefficient or abandoned customer journeys. +message Funnel { + // In an open funnel, users can enter the funnel in any step, and in a closed + // funnel, users must enter the funnel in the first step. Optional. If + // unspecified, a closed funnel is used. + bool is_open_funnel = 1; + + // The sequential steps of this funnel. + repeated FunnelStep steps = 2; +} + +// Steps define the user journey you want to measure. Steps contain one or +// more conditions that your users must meet to be included in that step of +// the funnel journey. +message FunnelStep { + // The distinctive name for this step. If unspecified, steps will be named + // by a 1 based indexed name (i.e. "0. ", "1. ", etc.). This name defines + // string value returned by the `funnelStepName` dimension. For example, + // specifying `name = Purchase` in the request's third funnel step will + // produce `3. Purchase` in the funnel report response. + string name = 1; + + // If true, this step must directly follow the previous step. If false, + // there can be events between the previous step and this step. If + // unspecified, `isDirectlyFollowedBy` is treated as false. + bool is_directly_followed_by = 2; + + // If specified, this step must complete within this duration of the + // completion of the prior step. `withinDurationFromPriorStep` is inclusive + // of the endpoint at the microsecond granularity. For example a duration of + // 5 seconds can be completed at 4.9 or 5.0 seconds, but not 5 seconds and 1 + // microsecond. + // + // `withinDurationFromPriorStep` is optional, and if unspecified, steps may + // be separated by any time duration. + optional google.protobuf.Duration within_duration_from_prior_step = 3; + + // The condition that your users must meet to be included in this step of + // the funnel journey. + FunnelFilterExpression filter_expression = 4; +} + +// Funnel sub reports contain the dimension and metric data values. For example, +// 12 users reached the second step of the funnel. +message FunnelSubReport { + // Describes dimension columns. Funnel reports always include the funnel step + // dimension in sub report responses. Additional dimensions like breakdowns, + // dates, and next actions may be present in the response if requested. + repeated DimensionHeader dimension_headers = 1; + + // Describes metric columns. Funnel reports always include active users in sub + // report responses. The funnel table includes additional metrics like + // completion rate, abandonments, and abandonments rate. + repeated MetricHeader metric_headers = 2; + + // Rows of dimension value combinations and metric values in the report. + repeated Row rows = 3; + + // Metadata for the funnel report. + FunnelResponseMetadata metadata = 4; +} + +// User segments are subsets of users who engaged with your site or app. For +// example, users who have previously purchased; users who added items to their +// shopping carts, but didn’t complete a purchase. +message UserSegment { + // Defines which users are included in this segment. Optional. + UserSegmentCriteria user_inclusion_criteria = 1; + + // Defines which users are excluded in this segment. Optional. + UserSegmentExclusion exclusion = 2; +} + +// A user matches a criteria if the user's events meet the conditions in the +// criteria. +message UserSegmentCriteria { + // A user matches this criteria if the user matches each of these + // `andConditionGroups` and each of the `andSequenceGroups`. + // `andConditionGroups` may be empty if `andSequenceGroups` are specified. + repeated UserSegmentConditionGroup and_condition_groups = 1; + + // A user matches this criteria if the user matches each of these + // `andSequenceGroups` and each of the `andConditionGroups`. + // `andSequenceGroups` may be empty if `andConditionGroups` are specified. + repeated UserSegmentSequenceGroup and_sequence_groups = 2; +} + +// Scoping specifies which events are considered when evaluating if a user +// meets a criteria. +enum UserCriteriaScoping { + // Unspecified criteria scoping. Do not specify. + USER_CRITERIA_SCOPING_UNSPECIFIED = 0; + + // If the criteria is satisfied within one event, the user matches the + // criteria. + USER_CRITERIA_WITHIN_SAME_EVENT = 1; + + // If the criteria is satisfied within one session, the user matches the + // criteria. + USER_CRITERIA_WITHIN_SAME_SESSION = 2; + + // If the criteria is satisfied by any events for the user, the user + // matches the criteria. + USER_CRITERIA_ACROSS_ALL_SESSIONS = 3; +} + +// Conditions tell Analytics what data to include in or exclude from the +// segment. +message UserSegmentConditionGroup { + // Data is included or excluded from the segment based on if it matches + // the condition group. This scoping defines how many events the + // `segmentFilterExpression` is evaluated on before the condition group + // is determined to be matched or not. For example if `conditionScoping = + // USER_CRITERIA_WITHIN_SAME_SESSION`, the expression is evaluated on all + // events in a session, and then, the condition group is determined to be + // matched or not for this user. For example if `conditionScoping = + // USER_CRITERIA_WITHIN_SAME_EVENT`, the expression is evaluated on a single + // event, and then, the condition group is determined to be matched or not for + // this user. + // + // Optional. If unspecified, `conditionScoping = ACROSS_ALL_SESSIONS` is + // used. + UserCriteriaScoping condition_scoping = 1; + + // Data is included or excluded from the segment based on if it matches + // this expression. Expressions express criteria on dimension, metrics, + // and/or parameters. + SegmentFilterExpression segment_filter_expression = 2; +} + +// Define conditions that must occur in a specific order for the user to be +// a member of the segment. +message UserSegmentSequenceGroup { + // All sequence steps must be satisfied in the scoping for the user to + // match the sequence. For example if `sequenceScoping = + // USER_CRITERIA_WITHIN_SAME_SESSION`, all sequence steps must complete within + // one session for the user to match the sequence. `sequenceScoping = + // USER_CRITERIA_WITHIN_SAME_EVENT` is not supported. + // + // Optional. If unspecified, `conditionScoping = ACROSS_ALL_SESSIONS` is + // used. + UserCriteriaScoping sequence_scoping = 1; + + // Defines the time period in which the whole sequence must occur; for + // example, 30 Minutes. `sequenceMaximumDuration` is inclusive + // of the endpoint at the microsecond granularity. For example a sequence + // with a maximum duration of 5 seconds can be completed at 4.9 or 5.0 + // seconds, but not 5 seconds and 1 microsecond. + // + // `sequenceMaximumDuration` is optional, and if unspecified, sequences can + // be completed in any time duration. + google.protobuf.Duration sequence_maximum_duration = 2; + + // An ordered sequence of condition steps. A user's events must complete + // each step in order for the user to match the + // `UserSegmentSequenceGroup`. + repeated UserSequenceStep user_sequence_steps = 3; +} + +// A condition that must occur in the specified step order for this user +// to match the sequence. +message UserSequenceStep { + // If true, the event satisfying this step must be the very next event + // after the event satifying the last step. If false, this step indirectly + // follows the prior step; for example, there may be events between the + // prior step and this step. `isDirectlyFollowedBy` must be false for + // the first step. + bool is_directly_followed_by = 1; + + // This sequence step must be satisfied in the scoping for the user to + // match the sequence. For example if `sequenceScoping = + // WITHIN_SAME_SESSION`, this sequence steps must complete within one + // session for the user to match the sequence. `stepScoping = + // ACROSS_ALL_SESSIONS` is only allowed if the `sequenceScoping = + // ACROSS_ALL_SESSIONS`. + // + // Optional. If unspecified, `stepScoping` uses the same + // `UserCriteriaScoping` as the `sequenceScoping`. + UserCriteriaScoping step_scoping = 2; + + // A user matches this sequence step if their events match this + // expression. Expressions express criteria on dimension, metrics, + // and/or parameters. + SegmentFilterExpression segment_filter_expression = 3; +} + +// Specifies which users are excluded in this segment. +message UserSegmentExclusion { + // Specifies how long an exclusion will last if a user matches the + // `userExclusionCriteria`. + // + // Optional. If unspecified, `userExclusionDuration` of + // `USER_EXCLUSION_TEMPORARY` is used. + UserExclusionDuration user_exclusion_duration = 1; + + // If a user meets this condition, the user is excluded from membership in + // the segment for the `userExclusionDuration`. + UserSegmentCriteria user_exclusion_criteria = 2; +} + +// Enumerates options for how long an exclusion will last if a user matches +// the `userExclusionCriteria`. +enum UserExclusionDuration { + // Unspecified exclusion duration. Do not specify. + USER_EXCLUSION_DURATION_UNSPECIFIED = 0; + + // Temporarily exclude users from the segment during periods when the + // user meets the `userExclusionCriteria` condition. + USER_EXCLUSION_TEMPORARY = 1; + + // Permanently exclude users from the segment if the user ever meets the + // `userExclusionCriteria` condition. + USER_EXCLUSION_PERMANENT = 2; +} + +// Session segments are subsets of the sessions that occurred on your site or +// app: for example, all the sessions that originated from a particular +// advertising campaign. +message SessionSegment { + // Defines which sessions are included in this segment. Optional. + SessionSegmentCriteria session_inclusion_criteria = 1; + + // Defines which sessions are excluded in this segment. Optional. + SessionSegmentExclusion exclusion = 2; +} + +// A session matches a criteria if the session's events meet the conditions in +// the criteria. +message SessionSegmentCriteria { + // A session matches this criteria if the session matches each of these + // `andConditionGroups`. + repeated SessionSegmentConditionGroup and_condition_groups = 1; +} + +// Scoping specifies which events are considered when evaluating if a +// session meets a criteria. +enum SessionCriteriaScoping { + // Unspecified criteria scoping. Do not specify. + SESSION_CRITERIA_SCOPING_UNSPECIFIED = 0; + + // If the criteria is satisfied within one event, the session matches the + // criteria. + SESSION_CRITERIA_WITHIN_SAME_EVENT = 1; + + // If the criteria is satisfied within one session, the session matches + // the criteria. + SESSION_CRITERIA_WITHIN_SAME_SESSION = 2; +} + +// Conditions tell Analytics what data to include in or exclude from the +// segment. +message SessionSegmentConditionGroup { + // Data is included or excluded from the segment based on if it matches + // the condition group. This scoping defines how many events the + // `segmentFilterExpression` is evaluated on before the condition group + // is determined to be matched or not. For example if `conditionScoping = + // SESSION_CRITERIA_WITHIN_SAME_SESSION`, the expression is evaluated on all + // events in a session, and then, the condition group is determined to be + // matched or not for this session. For example if `conditionScoping = + // SESSION_CRITERIA_WITHIN_SAME_EVENT`, the expression is evaluated on a + // single event, and then, the condition group is determined to be matched or + // not for this session. + // + // Optional. If unspecified, a `conditionScoping` of `WITHIN_SAME_SESSION` + // is used. + SessionCriteriaScoping condition_scoping = 1; + + // Data is included or excluded from the segment based on if it matches + // this expression. Expressions express criteria on dimension, metrics, + // and/or parameters. + SegmentFilterExpression segment_filter_expression = 2; +} + +// Specifies which sessions are excluded in this segment. +message SessionSegmentExclusion { + // Specifies how long an exclusion will last if a session matches the + // `sessionExclusionCriteria`. + // + // Optional. If unspecified, a `sessionExclusionDuration` of + // `SESSION_EXCLUSION_TEMPORARY` is used. + SessionExclusionDuration session_exclusion_duration = 1; + + // If a session meets this condition, the session is excluded from + // membership in the segment for the `sessionExclusionDuration`. + SessionSegmentCriteria session_exclusion_criteria = 2; +} + +// Enumerates options for how long an exclusion will last if a session +// matches the `sessionExclusionCriteria`. +enum SessionExclusionDuration { + // Unspecified exclusion duration. Do not specify. + SESSION_EXCLUSION_DURATION_UNSPECIFIED = 0; + + // Temporarily exclude sessions from the segment during periods when the + // session meets the `sessionExclusionCriteria` condition. + SESSION_EXCLUSION_TEMPORARY = 1; + + // Permanently exclude sessions from the segment if the session ever meets + // the `sessionExclusionCriteria` condition. + SESSION_EXCLUSION_PERMANENT = 2; +} + +// Event segments are subsets of events that were triggered on your site or app. +// for example, all purchase events made in a particular location; app_exception +// events that occurred on a specific operating system. +message EventSegment { + // Defines which events are included in this segment. Optional. + EventSegmentCriteria event_inclusion_criteria = 1; + + // Defines which events are excluded in this segment. Optional. + EventSegmentExclusion exclusion = 2; +} + +// An event matches a criteria if the event meet the conditions in the +// criteria. +message EventSegmentCriteria { + // An event matches this criteria if the event matches each of these + // `andConditionGroups`. + repeated EventSegmentConditionGroup and_condition_groups = 1; +} + +// Scoping specifies which events are considered when evaluating if an event +// meets a criteria. +enum EventCriteriaScoping { + // Unspecified criteria scoping. Do not specify. + EVENT_CRITERIA_SCOPING_UNSPECIFIED = 0; + + // If the criteria is satisfied within one event, the event matches the + // criteria. + EVENT_CRITERIA_WITHIN_SAME_EVENT = 1; +} + +// Conditions tell Analytics what data to include in or exclude from the +// segment. +message EventSegmentConditionGroup { + // `conditionScoping` should always be `EVENT_CRITERIA_WITHIN_SAME_EVENT`. + // + // Optional. If unspecified, a `conditionScoping` of + // `EVENT_CRITERIA_WITHIN_SAME_EVENT` is used. + EventCriteriaScoping condition_scoping = 1; + + // Data is included or excluded from the segment based on if it matches + // this expression. Expressions express criteria on dimension, metrics, + // and/or parameters. + SegmentFilterExpression segment_filter_expression = 2; +} + +// Specifies which events are excluded in this segment. +message EventSegmentExclusion { + // `eventExclusionDuration` should always be `PERMANENTLY_EXCLUDE`. + // + // Optional. If unspecified, an `eventExclusionDuration` of + // `EVENT_EXCLUSION_PERMANENT` is used. + EventExclusionDuration event_exclusion_duration = 1; + + // If an event meets this condition, the event is excluded from membership + // in the segment for the `eventExclusionDuration`. + EventSegmentCriteria event_exclusion_criteria = 2; +} + +// Enumerates options for how long an exclusion will last if an event +// matches the `eventExclusionCriteria`. +enum EventExclusionDuration { + // Unspecified exclusion duration. Do not specify. + EVENT_EXCLUSION_DURATION_UNSPECIFIED = 0; + + // Permanently exclude events from the segment if the event ever meets + // the `eventExclusionCriteria` condition. + EVENT_EXCLUSION_PERMANENT = 1; +} + +// A segment is a subset of your Analytics data. For example, of your entire set +// of users, one segment might be users from a particular country or city. +// Another segment might be users who purchase a particular line of products or +// who visit a specific part of your site or trigger certain events in your app. +// +// To learn more, see [GA4 Segment +// Builder](https://support.google.com/analytics/answer/9304353). +message Segment { + // The name for this segment. If unspecified, segments are named "Segment". + // This name defines string value returned by the `segment` dimension. The + // `segment` dimension prefixes segment names by the 1-based index number of + // the segment in the request (i.e. "1. Segment", "2. Segment", etc.). + string name = 1; + + // A segment is specified in one scope. + oneof one_segment_scope { + // User segments are subsets of users who engaged with your site or app. + UserSegment user_segment = 2; + + // Session segments are subsets of the sessions that occurred on your site + // or app. + SessionSegment session_segment = 3; + + // Event segments are subsets of events that were triggered on your site or + // app. + EventSegment event_segment = 4; + } +} + +// Expresses combinations of segment filters. +message SegmentFilterExpression { + // Specify one type of filter for `SegmentFilterExpression`. + oneof expr { + // The SegmentFilterExpression in `andGroup` have an AND relationship. + SegmentFilterExpressionList and_group = 1; + + // The SegmentFilterExpression in `orGroup` have an OR relationship. + SegmentFilterExpressionList or_group = 2; + + // The SegmentFilterExpression is NOT of `notExpression`. + SegmentFilterExpression not_expression = 3; + + // A primitive segment filter. + SegmentFilter segment_filter = 4; + + // Creates a filter that matches events of a single event name. If a + // parameter filter expression is specified, only the subset of events that + // match both the single event name and the parameter filter expressions + // match this event filter. + SegmentEventFilter segment_event_filter = 5; + } +} + +// A list of segment filter expressions. +message SegmentFilterExpressionList { + // The list of segment filter expressions + repeated SegmentFilterExpression expressions = 1; +} + +// An expression to filter dimension or metric values. +message SegmentFilter { + // The dimension name or metric name. + string field_name = 1; + + // Specify one type of filter for `Filter`. + oneof one_filter { + // Strings related filter. + StringFilter string_filter = 4; + + // A filter for in list values. + InListFilter in_list_filter = 5; + + // A filter for numeric or date values. + NumericFilter numeric_filter = 6; + + // A filter for between two values. + BetweenFilter between_filter = 7; + } + + // Specifies the scope for the filter. + SegmentFilterScoping filter_scoping = 8; +} + +// Scopings specify how the dimensions & metrics of multiple events +// should be considered when evaluating a segment filter. +message SegmentFilterScoping { + // If `atAnyPointInTime` is true, this filter evaluates to true for all + // events if it evaluates to true for any event in the date range of the + // request. + // + // This `atAnyPointInTime` parameter does not extend the date range of + // events in the report. If `atAnyPointInTime` is true, only events within + // the report's date range are considered when evaluating this filter. + // + // This `atAnyPointInTime` is only able to be specified if the criteria + // scoping is `ACROSS_ALL_SESSIONS` and is not able to be specified in + // sequences. + // + // If the criteria scoping is `ACROSS_ALL_SESSIONS`, `atAnyPointInTime` = + // false is used if unspecified. + optional bool at_any_point_in_time = 1; +} + +// Creates a filter that matches events of a single event name. If a parameter +// filter expression is specified, only the subset of events that match both the +// single event name and the parameter filter expressions match this event +// filter. +message SegmentEventFilter { + // This filter matches events of this single event name. Event name is + // required. + optional string event_name = 1; + + // If specified, this filter matches events that match both the single event + // name and the parameter filter expressions. + // + // Inside the parameter filter expression, only parameter filters are + // available. + optional SegmentParameterFilterExpression segment_parameter_filter_expression = 2; +} + +// Expresses combinations of segment filter on parameters. +message SegmentParameterFilterExpression { + // Specify one type of filter for `SegmentParameterFilterExpression`. + oneof expr { + // The SegmentParameterFilterExpression in `andGroup` have an AND + // relationship. + SegmentParameterFilterExpressionList and_group = 1; + + // The SegmentParameterFilterExpression in `orGroup` have an OR + // relationship. + SegmentParameterFilterExpressionList or_group = 2; + + // The SegmentParameterFilterExpression is NOT of `notExpression`. + SegmentParameterFilterExpression not_expression = 3; + + // A primitive segment parameter filter. + SegmentParameterFilter segment_parameter_filter = 4; + } +} + +// A list of segment parameter filter expressions. +message SegmentParameterFilterExpressionList { + // The list of segment parameter filter expressions. + repeated SegmentParameterFilterExpression expressions = 1; +} + +// An expression to filter parameter values in a segment. +message SegmentParameterFilter { + // The field that is being filtered. + oneof one_parameter { + // This filter will be evaluated on the specified event parameter. Event + // parameters are logged as parameters of the event. Event parameters + // include fields like "firebase_screen" & "currency". + // + // Event parameters can only be used in segments & funnels and can only be + // used in a descendent filter from an EventFilter. In a descendent filter + // from an EventFilter either event or item parameters should be used. + string event_parameter_name = 1; + + // This filter will be evaluated on the specified item parameter. Item + // parameters are logged as parameters in the item array. Item parameters + // include fields like "item_name" & "item_category". + // + // Item parameters can only be used in segments & funnels and can only be + // used in a descendent filter from an EventFilter. In a descendent filter + // from an EventFilter either event or item parameters should be used. + // + // Item parameters are only available in ecommerce events. To learn more + // about ecommerce events, see the [Measure ecommerce] + // (https://developers.google.com/analytics/devguides/collection/ga4/ecommerce) + // guide. + string item_parameter_name = 2; + } + + // Specify one type of filter. + oneof one_filter { + // Strings related filter. + StringFilter string_filter = 4; + + // A filter for in list values. + InListFilter in_list_filter = 5; + + // A filter for numeric or date values. + NumericFilter numeric_filter = 6; + + // A filter for between two values. + BetweenFilter between_filter = 7; + } + + // Specifies the scope for the filter. + SegmentParameterFilterScoping filter_scoping = 8; +} + +// Scopings specify how multiple events should be considered when evaluating a +// segment parameter filter. +message SegmentParameterFilterScoping { + // Accumulates the parameter over the specified period of days before + // applying the filter. Only supported if criteria scoping is + // `ACROSS_ALL_SESSIONS` or `WITHIN_SAME_SESSION`. Only supported if the + // parameter is `event_count`. + // + // For example if `inAnyNDayPeriod` is 3, the event_name is "purchase", + // the event parameter is "event_count", and the Filter's criteria is + // greater than 5, this filter will accumulate the event count of purchase + // events over every 3 consecutive day period in the report's date range; a + // user will pass this Filter's criteria to be included in this segment if + // their count of purchase events exceeds 5 in any 3 consecutive day period. + // For example, the periods 2021-11-01 to 2021-11-03, 2021-11-02 to + // 2021-11-04, 2021-11-03 to 2021-11-05, and etc. will be considered. + // + // The date range is not extended for the purpose of having a full N day + // window near the start of the date range. For example if a report is for + // 2021-11-01 to 2021-11-10 and `inAnyNDayPeriod` = 3, the first two day + // period will be effectively shortened because no event data outside the + // report's date range will be read. For example, the first four periods + // will effectively be: 2021-11-01 to 2021-11-01, 2021-11-01 to 2021-11-02, + // 2021-11-01 to 2021-11-03, and 2021-11-02 to 2021-11-04. + // + // `inAnyNDayPeriod` is optional. If not specified, the + // `segmentParameterFilter` is applied to each event individually. + optional int64 in_any_n_day_period = 1; +} + +// Expresses combinations of funnel filters. +message FunnelFilterExpression { + // Specify one type of filter for `FunnelFilterExpression`. + oneof expr { + // The FunnelFilterExpression in `andGroup` have an AND relationship. + FunnelFilterExpressionList and_group = 1; + + // The FunnelFilterExpression in `orGroup` have an OR relationship. + FunnelFilterExpressionList or_group = 2; + + // The FunnelFilterExpression is NOT of `notExpression`. + FunnelFilterExpression not_expression = 3; + + // A funnel filter for a dimension or metric. + FunnelFieldFilter funnel_field_filter = 4; + + // Creates a filter that matches events of a single event name. If a + // parameter filter expression is specified, only the subset of events that + // match both the single event name and the parameter filter expressions + // match this event filter. + FunnelEventFilter funnel_event_filter = 5; + } +} + +// A list of funnel filter expressions. +message FunnelFilterExpressionList { + // The list of funnel filter expressions. + repeated FunnelFilterExpression expressions = 1; +} + +// An expression to filter dimension or metric values. +message FunnelFieldFilter { + // The dimension name or metric name. + string field_name = 1; + + // Specify one type of filter. + oneof one_filter { + // Strings related filter. + StringFilter string_filter = 4; + + // A filter for in list values. + InListFilter in_list_filter = 5; + + // A filter for numeric or date values. + NumericFilter numeric_filter = 6; + + // A filter for between two values. + BetweenFilter between_filter = 7; + } +} + +// Creates a filter that matches events of a single event name. If a parameter +// filter expression is specified, only the subset of events that match both the +// single event name and the parameter filter expressions match this event +// filter. +message FunnelEventFilter { + // This filter matches events of this single event name. Event name is + // required. + optional string event_name = 1; + + // If specified, this filter matches events that match both the single event + // name and the parameter filter expressions. + // + // Inside the parameter filter expression, only parameter filters are + // available. + optional FunnelParameterFilterExpression funnel_parameter_filter_expression = 2; +} + +// Expresses combinations of funnel filters on parameters. +message FunnelParameterFilterExpression { + // Specify one type of filter for `FunnelParameterFilterExpression`. + oneof expr { + // The FunnelParameterFilterExpression in `andGroup` have an AND + // relationship. + FunnelParameterFilterExpressionList and_group = 1; + + // The FunnelParameterFilterExpression in `orGroup` have an OR + // relationship. + FunnelParameterFilterExpressionList or_group = 2; + + // The FunnelParameterFilterExpression is NOT of `notExpression`. + FunnelParameterFilterExpression not_expression = 3; + + // A primitive funnel parameter filter. + FunnelParameterFilter funnel_parameter_filter = 4; + } +} + +// A list of funnel parameter filter expressions. +message FunnelParameterFilterExpressionList { + // The list of funnel parameter filter expressions. + repeated FunnelParameterFilterExpression expressions = 1; +} + +// An expression to filter parameter values in a funnel. +message FunnelParameterFilter { + // The field that is being filtered. + oneof one_parameter { + // This filter will be evaluated on the specified event parameter. Event + // parameters are logged as parameters of the event. Event parameters + // include fields like "firebase_screen" & "currency". + // + // Event parameters can only be used in segments & funnels and can only be + // used in a descendent filter from an EventFilter. In a descendent filter + // from an EventFilter either event or item parameters should be used. + string event_parameter_name = 1; + + // This filter will be evaluated on the specified item parameter. Item + // parameters are logged as parameters in the item array. Item parameters + // include fields like "item_name" & "item_category". + // + // Item parameters can only be used in segments & funnels and can only be + // used in a descendent filter from an EventFilter. In a descendent filter + // from an EventFilter either event or item parameters should be used. + // + // Item parameters are only available in ecommerce events. To learn more + // about ecommerce events, see the [Measure ecommerce] + // (https://developers.google.com/analytics/devguides/collection/ga4/ecommerce) + // guide. + string item_parameter_name = 2; + } + + // Specify one type of filter. + oneof one_filter { + // Strings related filter. + StringFilter string_filter = 4; + + // A filter for in list values. + InListFilter in_list_filter = 5; + + // A filter for numeric or date values. + NumericFilter numeric_filter = 6; + + // A filter for between two values. + BetweenFilter between_filter = 7; + } +} + +// The funnel report's response metadata carries additional information about +// the funnel report. +message FunnelResponseMetadata { + // If funnel report results are + // [sampled](https://support.google.com/analytics/answer/2637192), this + // describes what percentage of events were used in this funnel report. One + // `samplingMetadatas` is populated for each date range. Each + // `samplingMetadatas` corresponds to a date range in order that date ranges + // were specified in the request. + // + // However if the results are not sampled, this field will not be defined. + repeated SamplingMetadata sampling_metadatas = 1; +} + +// If funnel report results are +// [sampled](https://support.google.com/analytics/answer/2637192), this +// metadata describes what percentage of events were used in this funnel +// report for a date range. Sampling is the practice of analyzing a subset of +// all data in order to uncover the meaningful information in the larger data +// set. +message SamplingMetadata { + // The total number of events read in this sampled report for a date range. + // This is the size of the subset this property's data that was analyzed in + // this funnel report. + int64 samples_read_count = 1; + + // The total number of events present in this property's data that could + // have been analyzed in this funnel report for a date range. Sampling + // uncovers the meaningful information about the larger data set, and this + // is the size of the larger data set. + // + // To calculate the percentage of available data that was used in this + // funnel report, compute `samplesReadCount/samplingSpaceSize`. + int64 sampling_space_size = 2; +} + +// A metric's value type. +enum MetricType { + // Unspecified type. + METRIC_TYPE_UNSPECIFIED = 0; + + // Integer type. + TYPE_INTEGER = 1; + + // Floating point type. + TYPE_FLOAT = 2; + + // A duration of seconds; a special floating point type. + TYPE_SECONDS = 4; + + // A duration in milliseconds; a special floating point type. + TYPE_MILLISECONDS = 5; + + // A duration in minutes; a special floating point type. + TYPE_MINUTES = 6; + + // A duration in hours; a special floating point type. + TYPE_HOURS = 7; + + // A custom metric of standard type; a special floating point type. + TYPE_STANDARD = 8; + + // An amount of money; a special floating point type. + TYPE_CURRENCY = 9; + + // A length in feet; a special floating point type. + TYPE_FEET = 10; + + // A length in miles; a special floating point type. + TYPE_MILES = 11; + + // A length in meters; a special floating point type. + TYPE_METERS = 12; + + // A length in kilometers; a special floating point type. + TYPE_KILOMETERS = 13; +} diff --git a/owl-bot-staging/v1alpha/samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js new file mode 100644 index 000000000..6fe1b50b1 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js @@ -0,0 +1,128 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START analyticsdata_v1alpha_generated_AlphaAnalyticsData_RunFunnelReport_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see where to + * find your Property + * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * Within a batch request, this property should either be unspecified or + * consistent with the batch-level property. + * Example: properties/1234 + */ + // const property = 'abc123' + /** + * Date ranges of data to read. If multiple date ranges are requested, each + * response row will contain a zero based date range index. If two date + * ranges overlap, the event data for the overlapping days is included in the + * response rows for both date ranges. + */ + // const dateRanges = 1234 + /** + * The configuration of this request's funnel. This funnel configuration is + * required. + */ + // const funnel = {} + /** + * If specified, this breakdown adds a dimension to the funnel table sub + * report response. This breakdown dimension expands each funnel step to the + * unique values of the breakdown dimension. For example, a breakdown by the + * `deviceCategory` dimension will create rows for `mobile`, `tablet`, + * `desktop`, and the total. + */ + // const funnelBreakdown = {} + /** + * If specified, next action adds a dimension to the funnel visualization sub + * report response. This next action dimension expands each funnel step to the + * unique values of the next action. For example a next action of the + * `eventName` dimension will create rows for several events (i.e. + * `session_start` & `click`) and the total. + * Next action only supports `eventName` and most Page / Screen dimensions + * like `pageTitle` and `pagePath`. + */ + // const funnelNextAction = {} + /** + * The funnel visualization type controls the dimensions present in the funnel + * visualization sub report response. If not specified, `STANDARD_FUNNEL` is + * used. + */ + // const funnelVisualizationType = {} + /** + * The configurations of segments. Segments are subsets of a property's data. + * In a funnel report with segments, the funnel is evaluated in each segment. + * Each segment specified in this request + * produces a separate row in the response; in the response, each segment + * identified by its name. + * The segments parameter is optional. Requests are limited to 4 segments. + */ + // const segments = 1234 + /** + * The number of rows to return. If unspecified, 10,000 rows are returned. The + * API returns a maximum of 100,000 rows per request, no matter how many you + * ask for. `limit` must be positive. + * The API can also return fewer rows than the requested `limit`, if there + * aren't as many dimension values as the `limit`. + */ + // const limit = 1234 + /** + * Dimension filters allow you to ask for only specific dimension values in + * the report. To learn more, see Creating a Report: Dimension + * Filters (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + * for examples. Metrics cannot be used in this filter. + */ + // const dimensionFilter = {} + /** + * Toggles whether to return the current state of this Analytics Property's + * quota. Quota is returned in PropertyQuota (#PropertyQuota). + */ + // const returnPropertyQuota = true + + // Imports the Data library + const {AlphaAnalyticsDataClient} = require('@google-cloud/data').v1alpha; + + // Instantiates a client + const dataClient = new AlphaAnalyticsDataClient(); + + async function callRunFunnelReport() { + // Construct request + const request = { + }; + + // Run request + const response = await dataClient.runFunnelReport(request); + console.log(response); + } + + callRunFunnelReport(); + // [END analyticsdata_v1alpha_generated_AlphaAnalyticsData_RunFunnelReport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.data.v1alpha.json b/owl-bot-staging/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.data.v1alpha.json new file mode 100644 index 000000000..a6468db65 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.data.v1alpha.json @@ -0,0 +1,91 @@ +{ + "clientLibrary": { + "name": "nodejs-data", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.analytics.data.v1alpha", + "version": "v1alpha" + } + ] + }, + "snippets": [ + { + "regionTag": "analyticsdata_v1alpha_generated_AlphaAnalyticsData_RunFunnelReport_async", + "title": "AlphaAnalyticsData runFunnelReport Sample", + "origin": "API_DEFINITION", + "description": " Returns a customized funnel report of your Google Analytics event data. The data returned from the API is as a table with columns for the requested dimensions and metrics. Funnel exploration lets you visualize the steps your users take to complete a task and quickly see how well they are succeeding or failing at each step. For example, how do prospects become shoppers and then become buyers? How do one time buyers become repeat buyers? With this information, you can improve inefficient or abandoned customer journeys. To learn more, see [GA4 Funnel Explorations](https://support.google.com/analytics/answer/9327974).", + "canonical": true, + "file": "alpha_analytics_data.run_funnel_report.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 120, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunFunnelReport", + "fullName": "google.analytics.data.v1alpha.AlphaAnalyticsData.RunFunnelReport", + "async": true, + "parameters": [ + { + "name": "property", + "type": "TYPE_STRING" + }, + { + "name": "date_ranges", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "funnel", + "type": ".google.analytics.data.v1alpha.Funnel" + }, + { + "name": "funnel_breakdown", + "type": ".google.analytics.data.v1alpha.FunnelBreakdown" + }, + { + "name": "funnel_next_action", + "type": ".google.analytics.data.v1alpha.FunnelNextAction" + }, + { + "name": "funnel_visualization_type", + "type": ".google.analytics.data.v1alpha.RunFunnelReportRequest.FunnelVisualizationType" + }, + { + "name": "segments", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "limit", + "type": "TYPE_INT64" + }, + { + "name": "dimension_filter", + "type": ".google.analytics.data.v1alpha.FilterExpression" + }, + { + "name": "return_property_quota", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.analytics.data.v1alpha.RunFunnelReportResponse", + "client": { + "shortName": "AlphaAnalyticsDataClient", + "fullName": "google.analytics.data.v1alpha.AlphaAnalyticsDataClient" + }, + "method": { + "shortName": "RunFunnelReport", + "fullName": "google.analytics.data.v1alpha.AlphaAnalyticsData.RunFunnelReport", + "service": { + "shortName": "AlphaAnalyticsData", + "fullName": "google.analytics.data.v1alpha.AlphaAnalyticsData" + } + } + } + } + ] +} diff --git a/owl-bot-staging/v1alpha/src/index.ts b/owl-bot-staging/v1alpha/src/index.ts new file mode 100644 index 000000000..926ad988e --- /dev/null +++ b/owl-bot-staging/v1alpha/src/index.ts @@ -0,0 +1,25 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1alpha from './v1alpha'; +const AlphaAnalyticsDataClient = v1alpha.AlphaAnalyticsDataClient; +type AlphaAnalyticsDataClient = v1alpha.AlphaAnalyticsDataClient; +export {v1alpha, AlphaAnalyticsDataClient}; +export default {v1alpha, AlphaAnalyticsDataClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_client.ts b/owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_client.ts new file mode 100644 index 000000000..f1002543e --- /dev/null +++ b/owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_client.ts @@ -0,0 +1,432 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1alpha/alpha_analytics_data_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './alpha_analytics_data_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Google Analytics reporting data service. + * @class + * @memberof v1alpha + */ +export class AlphaAnalyticsDataClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + alphaAnalyticsDataStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AlphaAnalyticsDataClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AlphaAnalyticsDataClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.analytics.data.v1alpha.AlphaAnalyticsData', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.alphaAnalyticsDataStub) { + return this.alphaAnalyticsDataStub; + } + + // Put together the "service stub" for + // google.analytics.data.v1alpha.AlphaAnalyticsData. + this.alphaAnalyticsDataStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.analytics.data.v1alpha.AlphaAnalyticsData') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.analytics.data.v1alpha.AlphaAnalyticsData, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const alphaAnalyticsDataStubMethods = + ['runFunnelReport']; + for (const methodName of alphaAnalyticsDataStubMethods) { + const callPromise = this.alphaAnalyticsDataStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.alphaAnalyticsDataStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'analyticsdata.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'analyticsdata.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/analytics', + 'https://www.googleapis.com/auth/analytics.readonly' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Returns a customized funnel report of your Google Analytics event data. The + * data returned from the API is as a table with columns for the requested + * dimensions and metrics. + * + * Funnel exploration lets you visualize the steps your users take to complete + * a task and quickly see how well they are succeeding or failing at each + * step. For example, how do prospects become shoppers and then become buyers? + * How do one time buyers become repeat buyers? With this information, you can + * improve inefficient or abandoned customer journeys. To learn more, see [GA4 + * Funnel Explorations](https://support.google.com/analytics/answer/9327974). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.property + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see [where to + * find your Property + * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * Within a batch request, this property should either be unspecified or + * consistent with the batch-level property. + * + * Example: properties/1234 + * @param {number[]} request.dateRanges + * Date ranges of data to read. If multiple date ranges are requested, each + * response row will contain a zero based date range index. If two date + * ranges overlap, the event data for the overlapping days is included in the + * response rows for both date ranges. + * @param {google.analytics.data.v1alpha.Funnel} request.funnel + * The configuration of this request's funnel. This funnel configuration is + * required. + * @param {google.analytics.data.v1alpha.FunnelBreakdown} request.funnelBreakdown + * If specified, this breakdown adds a dimension to the funnel table sub + * report response. This breakdown dimension expands each funnel step to the + * unique values of the breakdown dimension. For example, a breakdown by the + * `deviceCategory` dimension will create rows for `mobile`, `tablet`, + * `desktop`, and the total. + * @param {google.analytics.data.v1alpha.FunnelNextAction} request.funnelNextAction + * If specified, next action adds a dimension to the funnel visualization sub + * report response. This next action dimension expands each funnel step to the + * unique values of the next action. For example a next action of the + * `eventName` dimension will create rows for several events (i.e. + * `session_start` & `click`) and the total. + * + * Next action only supports `eventName` and most Page / Screen dimensions + * like `pageTitle` and `pagePath`. + * @param {google.analytics.data.v1alpha.RunFunnelReportRequest.FunnelVisualizationType} request.funnelVisualizationType + * The funnel visualization type controls the dimensions present in the funnel + * visualization sub report response. If not specified, `STANDARD_FUNNEL` is + * used. + * @param {number[]} request.segments + * The configurations of segments. Segments are subsets of a property's data. + * In a funnel report with segments, the funnel is evaluated in each segment. + * + * Each segment specified in this request + * produces a separate row in the response; in the response, each segment + * identified by its name. + * + * The segments parameter is optional. Requests are limited to 4 segments. + * @param {number} request.limit + * The number of rows to return. If unspecified, 10,000 rows are returned. The + * API returns a maximum of 100,000 rows per request, no matter how many you + * ask for. `limit` must be positive. + * + * The API can also return fewer rows than the requested `limit`, if there + * aren't as many dimension values as the `limit`. + * @param {google.analytics.data.v1alpha.FilterExpression} request.dimensionFilter + * Dimension filters allow you to ask for only specific dimension values in + * the report. To learn more, see [Creating a Report: Dimension + * Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + * for examples. Metrics cannot be used in this filter. + * @param {boolean} request.returnPropertyQuota + * Toggles whether to return the current state of this Analytics Property's + * quota. Quota is returned in [PropertyQuota](#PropertyQuota). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [RunFunnelReportResponse]{@link google.analytics.data.v1alpha.RunFunnelReportResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js + * region_tag:analyticsdata_v1alpha_generated_AlphaAnalyticsData_RunFunnelReport_async + */ + runFunnelReport( + request?: protos.google.analytics.data.v1alpha.IRunFunnelReportRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, + protos.google.analytics.data.v1alpha.IRunFunnelReportRequest|undefined, {}|undefined + ]>; + runFunnelReport( + request: protos.google.analytics.data.v1alpha.IRunFunnelReportRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, + protos.google.analytics.data.v1alpha.IRunFunnelReportRequest|null|undefined, + {}|null|undefined>): void; + runFunnelReport( + request: protos.google.analytics.data.v1alpha.IRunFunnelReportRequest, + callback: Callback< + protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, + protos.google.analytics.data.v1alpha.IRunFunnelReportRequest|null|undefined, + {}|null|undefined>): void; + runFunnelReport( + request?: protos.google.analytics.data.v1alpha.IRunFunnelReportRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, + protos.google.analytics.data.v1alpha.IRunFunnelReportRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, + protos.google.analytics.data.v1alpha.IRunFunnelReportRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, + protos.google.analytics.data.v1alpha.IRunFunnelReportRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'property': request.property || '', + }); + this.initialize(); + return this.innerApiCalls.runFunnelReport(request, options, callback); + } + + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.alphaAnalyticsDataStub && !this._terminated) { + return this.alphaAnalyticsDataStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_client_config.json b/owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_client_config.json new file mode 100644 index 000000000..89acd1c25 --- /dev/null +++ b/owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_client_config.json @@ -0,0 +1,31 @@ +{ + "interfaces": { + "google.analytics.data.v1alpha.AlphaAnalyticsData": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "RunFunnelReport": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_proto_list.json b/owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_proto_list.json new file mode 100644 index 000000000..5047e31ed --- /dev/null +++ b/owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/analytics/data/v1alpha/analytics_data_api.proto", + "../../protos/google/analytics/data/v1alpha/data.proto" +] diff --git a/owl-bot-staging/v1alpha/src/v1alpha/gapic_metadata.json b/owl-bot-staging/v1alpha/src/v1alpha/gapic_metadata.json new file mode 100644 index 000000000..d96e93cb5 --- /dev/null +++ b/owl-bot-staging/v1alpha/src/v1alpha/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.analytics.data.v1alpha", + "libraryPackage": "@google-cloud/data", + "services": { + "AlphaAnalyticsData": { + "clients": { + "grpc": { + "libraryClient": "AlphaAnalyticsDataClient", + "rpcs": { + "RunFunnelReport": { + "methods": [ + "runFunnelReport" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AlphaAnalyticsDataClient", + "rpcs": { + "RunFunnelReport": { + "methods": [ + "runFunnelReport" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/v1alpha/src/v1alpha/index.ts b/owl-bot-staging/v1alpha/src/v1alpha/index.ts new file mode 100644 index 000000000..9adb2d521 --- /dev/null +++ b/owl-bot-staging/v1alpha/src/v1alpha/index.ts @@ -0,0 +1,19 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {AlphaAnalyticsDataClient} from './alpha_analytics_data_client'; diff --git a/owl-bot-staging/v1alpha/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v1alpha/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000..947d5b1cc --- /dev/null +++ b/owl-bot-staging/v1alpha/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const data = require('@google-cloud/data'); + +function main() { + const alphaAnalyticsDataClient = new data.AlphaAnalyticsDataClient(); +} + +main(); diff --git a/owl-bot-staging/v1alpha/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v1alpha/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000..93674d4db --- /dev/null +++ b/owl-bot-staging/v1alpha/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {AlphaAnalyticsDataClient} from '@google-cloud/data'; + +// check that the client class type name can be used +function doStuffWithAlphaAnalyticsDataClient(client: AlphaAnalyticsDataClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const alphaAnalyticsDataClient = new AlphaAnalyticsDataClient(); + doStuffWithAlphaAnalyticsDataClient(alphaAnalyticsDataClient); +} + +main(); diff --git a/owl-bot-staging/v1alpha/system-test/install.ts b/owl-bot-staging/v1alpha/system-test/install.ts new file mode 100644 index 000000000..8ec452229 --- /dev/null +++ b/owl-bot-staging/v1alpha/system-test/install.ts @@ -0,0 +1,49 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import { packNTest } from 'pack-n-play'; +import { readFileSync } from 'fs'; +import { describe, it } from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/v1alpha/test/gapic_alpha_analytics_data_v1alpha.ts b/owl-bot-staging/v1alpha/test/gapic_alpha_analytics_data_v1alpha.ts new file mode 100644 index 000000000..654a76199 --- /dev/null +++ b/owl-bot-staging/v1alpha/test/gapic_alpha_analytics_data_v1alpha.ts @@ -0,0 +1,232 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as alphaanalyticsdataModule from '../src'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +describe('v1alpha.AlphaAnalyticsDataClient', () => { + it('has servicePath', () => { + const servicePath = alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.alphaAnalyticsDataStub, undefined); + await client.initialize(); + assert(client.alphaAnalyticsDataStub); + }); + + it('has close method for the initialized client', done => { + const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.alphaAnalyticsDataStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.alphaAnalyticsDataStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('runFunnelReport', () => { + it('invokes runFunnelReport without error', async () => { + const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1alpha.RunFunnelReportRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1alpha.RunFunnelReportResponse()); + client.innerApiCalls.runFunnelReport = stubSimpleCall(expectedResponse); + const [response] = await client.runFunnelReport(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.runFunnelReport as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes runFunnelReport without error using callback', async () => { + const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1alpha.RunFunnelReportRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1alpha.RunFunnelReportResponse()); + client.innerApiCalls.runFunnelReport = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runFunnelReport( + request, + (err?: Error|null, result?: protos.google.analytics.data.v1alpha.IRunFunnelReportResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.runFunnelReport as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes runFunnelReport with error', async () => { + const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1alpha.RunFunnelReportRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runFunnelReport = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.runFunnelReport(request), expectedError); + assert((client.innerApiCalls.runFunnelReport as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes runFunnelReport with closed client', async () => { + const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1alpha.RunFunnelReportRequest()); + request.property = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.runFunnelReport(request), expectedError); + }); + }); +}); diff --git a/owl-bot-staging/v1alpha/tsconfig.json b/owl-bot-staging/v1alpha/tsconfig.json new file mode 100644 index 000000000..c78f1c884 --- /dev/null +++ b/owl-bot-staging/v1alpha/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/v1alpha/webpack.config.js b/owl-bot-staging/v1alpha/webpack.config.js new file mode 100644 index 000000000..f5f52a892 --- /dev/null +++ b/owl-bot-staging/v1alpha/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 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. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'AlphaAnalyticsData', + filename: './alpha-analytics-data.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; diff --git a/owl-bot-staging/v1beta/.eslintignore b/owl-bot-staging/v1beta/.eslintignore new file mode 100644 index 000000000..cfc348ec4 --- /dev/null +++ b/owl-bot-staging/v1beta/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/v1beta/.eslintrc.json b/owl-bot-staging/v1beta/.eslintrc.json new file mode 100644 index 000000000..782153495 --- /dev/null +++ b/owl-bot-staging/v1beta/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/v1beta/.gitignore b/owl-bot-staging/v1beta/.gitignore new file mode 100644 index 000000000..5d32b2378 --- /dev/null +++ b/owl-bot-staging/v1beta/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +.coverage +coverage +.nyc_output +docs/ +out/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/v1beta/.jsdoc.js b/owl-bot-staging/v1beta/.jsdoc.js new file mode 100644 index 000000000..a28a7a092 --- /dev/null +++ b/owl-bot-staging/v1beta/.jsdoc.js @@ -0,0 +1,55 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-analytics/data', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/v1beta/.mocharc.js b/owl-bot-staging/v1beta/.mocharc.js new file mode 100644 index 000000000..481c522b0 --- /dev/null +++ b/owl-bot-staging/v1beta/.mocharc.js @@ -0,0 +1,33 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/v1beta/.prettierrc.js b/owl-bot-staging/v1beta/.prettierrc.js new file mode 100644 index 000000000..494e14786 --- /dev/null +++ b/owl-bot-staging/v1beta/.prettierrc.js @@ -0,0 +1,22 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/v1beta/README.md b/owl-bot-staging/v1beta/README.md new file mode 100644 index 000000000..61b6042f8 --- /dev/null +++ b/owl-bot-staging/v1beta/README.md @@ -0,0 +1 @@ +Data: Nodejs Client diff --git a/owl-bot-staging/v1beta/linkinator.config.json b/owl-bot-staging/v1beta/linkinator.config.json new file mode 100644 index 000000000..befd23c86 --- /dev/null +++ b/owl-bot-staging/v1beta/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/owl-bot-staging/v1beta/package.json b/owl-bot-staging/v1beta/package.json new file mode 100644 index 000000000..8b5966b2d --- /dev/null +++ b/owl-bot-staging/v1beta/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-analytics/data", + "version": "0.1.0", + "description": "Data client for Node.js", + "repository": "googleapis/nodejs-data", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google data", + "data", + "beta analytics data" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^2.29.4" + }, + "devDependencies": { + "@types/mocha": "^9.1.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.8", + "c8": "^7.11.0", + "gts": "^3.1.0", + "jsdoc": "^3.6.7", + "jsdoc-fresh": "^1.1.1", + "jsdoc-region-tag": "^1.3.1", + "linkinator": "^3.0.0", + "mocha": "^9.1.4", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^13.0.0", + "ts-loader": "^9.2.6", + "typescript": "^4.5.5", + "webpack": "^5.67.0", + "webpack-cli": "^4.9.1" + }, + "engines": { + "node": ">=v10.24.0" + } +} diff --git a/owl-bot-staging/v1beta/protos/google/analytics/data/v1beta/analytics_data_api.proto b/owl-bot-staging/v1beta/protos/google/analytics/data/v1beta/analytics_data_api.proto new file mode 100644 index 000000000..b32577e76 --- /dev/null +++ b/owl-bot-staging/v1beta/protos/google/analytics/data/v1beta/analytics_data_api.proto @@ -0,0 +1,620 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.analytics.data.v1beta; + +import "google/analytics/data/v1beta/data.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "google.golang.org/genproto/googleapis/analytics/data/v1beta;data"; +option java_multiple_files = true; +option java_outer_classname = "AnalyticsDataApiProto"; +option java_package = "com.google.analytics.data.v1beta"; + +// Google Analytics reporting data service. +service BetaAnalyticsData { + option (google.api.default_host) = "analyticsdata.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/analytics," + "https://www.googleapis.com/auth/analytics.readonly"; + + // 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. + rpc RunReport(RunReportRequest) returns (RunReportResponse) { + option (google.api.http) = { + post: "/v1beta/{property=properties/*}:runReport" + body: "*" + }; + } + + // Returns a customized pivot report of your Google Analytics event data. + // Pivot reports are more advanced and expressive formats than regular + // reports. In a pivot report, dimensions are only visible if they are + // included in a pivot. Multiple pivots can be specified to further dissect + // your data. + rpc RunPivotReport(RunPivotReportRequest) returns (RunPivotReportResponse) { + option (google.api.http) = { + post: "/v1beta/{property=properties/*}:runPivotReport" + body: "*" + }; + } + + // Returns multiple reports in a batch. All reports must be for the same + // GA4 Property. + rpc BatchRunReports(BatchRunReportsRequest) returns (BatchRunReportsResponse) { + option (google.api.http) = { + post: "/v1beta/{property=properties/*}:batchRunReports" + body: "*" + }; + } + + // Returns multiple pivot reports in a batch. All reports must be for the same + // GA4 Property. + rpc BatchRunPivotReports(BatchRunPivotReportsRequest) returns (BatchRunPivotReportsResponse) { + option (google.api.http) = { + post: "/v1beta/{property=properties/*}:batchRunPivotReports" + body: "*" + }; + } + + // Returns metadata for dimensions and metrics available in reporting methods. + // Used to explore the dimensions and metrics. In this method, a Google + // Analytics GA4 Property Identifier is specified in the request, and + // the metadata response includes Custom dimensions and metrics as well as + // Universal metadata. + // + // For example if a custom metric with parameter name `levels_unlocked` is + // registered to a property, the Metadata response will contain + // `customEvent:levels_unlocked`. Universal metadata are dimensions and + // metrics applicable to any property such as `country` and `totalUsers`. + rpc GetMetadata(GetMetadataRequest) returns (Metadata) { + option (google.api.http) = { + get: "/v1beta/{name=properties/*/metadata}" + }; + option (google.api.method_signature) = "name"; + } + + // 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. + rpc RunRealtimeReport(RunRealtimeReportRequest) returns (RunRealtimeReportResponse) { + option (google.api.http) = { + post: "/v1beta/{property=properties/*}:runRealtimeReport" + body: "*" + }; + } + + // This compatibility method lists dimensions and metrics that can be added to + // a report request and maintain compatibility. This method fails if the + // request's dimensions and metrics are incompatible. + // + // In Google Analytics, reports fail if they request incompatible dimensions + // and/or metrics; in that case, you will need to remove dimensions and/or + // metrics from the incompatible report until the report is compatible. + // + // The Realtime and Core reports have different compatibility rules. This + // method checks compatibility for Core reports. + rpc CheckCompatibility(CheckCompatibilityRequest) returns (CheckCompatibilityResponse) { + option (google.api.http) = { + post: "/v1beta/{property=properties/*}:checkCompatibility" + body: "*" + }; + } +} + +// The request for compatibility information for a report's dimensions and +// metrics. Check compatibility provides a preview of the compatibility of a +// report; fields shared with the `runReport` request should be the same values +// as in your `runReport` request. +message CheckCompatibilityRequest { + // A Google Analytics GA4 property identifier whose events are tracked. To + // learn more, see [where to find your Property + // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + // `property` should be the same value as in your `runReport` request. + // + // Example: properties/1234 + // + // Set the Property ID to 0 for compatibility checking on dimensions and + // metrics common to all properties. In this special mode, this method will + // not return custom dimensions and metrics. + string property = 1; + + // The dimensions in this report. `dimensions` should be the same value as in + // your `runReport` request. + repeated Dimension dimensions = 2; + + // The metrics in this report. `metrics` should be the same value as in your + // `runReport` request. + repeated Metric metrics = 3; + + // The filter clause of dimensions. `dimensionFilter` should be the same value + // as in your `runReport` request. + FilterExpression dimension_filter = 4; + + // The filter clause of metrics. `metricFilter` should be the same value as in + // your `runReport` request + FilterExpression metric_filter = 5; + + // Filters the dimensions and metrics in the response to just this + // compatibility. Commonly used as `”compatibilityFilter”: “COMPATIBLE”` + // to only return compatible dimensions & metrics. + Compatibility compatibility_filter = 6; +} + +// The compatibility response with the compatibility of each dimension & metric. +message CheckCompatibilityResponse { + // The compatibility of each dimension. + repeated DimensionCompatibility dimension_compatibilities = 1; + + // The compatibility of each metric. + repeated MetricCompatibility metric_compatibilities = 2; +} + +// The dimensions and metrics currently accepted in reporting methods. +message Metadata { + option (google.api.resource) = { + type: "analyticsdata.googleapis.com/Metadata" + pattern: "properties/{property}/metadata" + }; + + // Resource name of this metadata. + string name = 3; + + // The dimension descriptions. + repeated DimensionMetadata dimensions = 1; + + // The metric descriptions. + repeated MetricMetadata metrics = 2; +} + +// The request to generate a report. +message RunReportRequest { + // A Google Analytics GA4 property identifier whose events are tracked. + // Specified in the URL path and not the body. To learn more, see [where to + // find your Property + // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + // Within a batch request, this property should either be unspecified or + // consistent with the batch-level property. + // + // Example: properties/1234 + string property = 1; + + // The dimensions requested and displayed. + repeated Dimension dimensions = 2; + + // The metrics requested and displayed. + repeated Metric metrics = 3; + + // Date ranges of data to read. If multiple date ranges are requested, each + // response row will contain a zero based date range index. If two date + // ranges overlap, the event data for the overlapping days is included in the + // response rows for both date ranges. In a cohort request, this `dateRanges` + // must be unspecified. + repeated DateRange date_ranges = 4; + + // Dimension filters allow you to ask for only specific dimension values in + // the report. To learn more, see [Fundamentals of Dimension + // Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + // for examples. Metrics cannot be used in this filter. + FilterExpression dimension_filter = 5; + + // The filter clause of metrics. Applied at post aggregation phase, similar to + // SQL having-clause. Dimensions cannot be used in this filter. + FilterExpression metric_filter = 6; + + // The row count of the start row. The first row is counted as row 0. + // + // When paging, the first request does not specify offset; or equivalently, + // sets offset to 0; the first request returns the first `limit` of rows. The + // second request sets offset to the `limit` of the first request; the second + // request returns the second `limit` of rows. + // + // To learn more about this pagination parameter, see + // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + int64 offset = 7; + + // The number of rows to return. If unspecified, 10,000 rows are returned. The + // API returns a maximum of 100,000 rows per request, no matter how many you + // ask for. `limit` must be positive. + // + // The API can also return fewer rows than the requested `limit`, if there + // aren't as many dimension values as the `limit`. For instance, there are + // fewer than 300 possible values for the dimension `country`, so when + // reporting on only `country`, you can't get more than 300 rows, even if you + // set `limit` to a higher value. + // + // To learn more about this pagination parameter, see + // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + int64 limit = 8; + + // Aggregation of metrics. Aggregated metric values will be shown in rows + // where the dimension_values are set to "RESERVED_(MetricAggregation)". + repeated MetricAggregation metric_aggregations = 9; + + // Specifies how rows are ordered in the response. + repeated OrderBy order_bys = 10; + + // A currency code in ISO4217 format, such as "AED", "USD", "JPY". + // If the field is empty, the report uses the property's default currency. + string currency_code = 11; + + // Cohort group associated with this request. If there is a cohort group + // in the request the 'cohort' dimension must be present. + CohortSpec cohort_spec = 12; + + // If false or unspecified, each row with all metrics equal to 0 will not be + // returned. If true, these rows will be returned if they are not separately + // removed by a filter. + bool keep_empty_rows = 13; + + // Toggles whether to return the current state of this Analytics Property's + // quota. Quota is returned in [PropertyQuota](#PropertyQuota). + bool return_property_quota = 14; +} + +// The response report table corresponding to a request. +message RunReportResponse { + // Describes dimension columns. The number of DimensionHeaders and ordering of + // DimensionHeaders matches the dimensions present in rows. + repeated DimensionHeader dimension_headers = 1; + + // Describes metric columns. The number of MetricHeaders and ordering of + // MetricHeaders matches the metrics present in rows. + repeated MetricHeader metric_headers = 2; + + // Rows of dimension value combinations and metric values in the report. + repeated Row rows = 3; + + // If requested, the totaled values of metrics. + repeated Row totals = 4; + + // If requested, the maximum values of metrics. + repeated Row maximums = 5; + + // If requested, the minimum values of metrics. + repeated Row minimums = 6; + + // The total number of rows in the query result. `rowCount` is independent of + // the number of rows returned in the response, the `limit` request + // parameter, and the `offset` request parameter. For example if a query + // returns 175 rows and includes `limit` of 50 in the API request, the + // response will contain `rowCount` of 175 but only 50 rows. + // + // To learn more about this pagination parameter, see + // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + int32 row_count = 7; + + // Metadata for the report. + ResponseMetaData metadata = 8; + + // This Analytics Property's quota state including this request. + PropertyQuota property_quota = 9; + + // Identifies what kind of resource this message is. This `kind` is always the + // fixed string "analyticsData#runReport". Useful to distinguish between + // response types in JSON. + string kind = 10; +} + +// The request to generate a pivot report. +message RunPivotReportRequest { + // A Google Analytics GA4 property identifier whose events are tracked. + // Specified in the URL path and not the body. To learn more, see [where to + // find your Property + // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + // Within a batch request, this property should either be unspecified or + // consistent with the batch-level property. + // + // Example: properties/1234 + string property = 1; + + // The dimensions requested. All defined dimensions must be used by one of the + // following: dimension_expression, dimension_filter, pivots, order_bys. + repeated Dimension dimensions = 2; + + // The metrics requested, at least one metric needs to be specified. All + // defined metrics must be used by one of the following: metric_expression, + // metric_filter, order_bys. + repeated Metric metrics = 3; + + // The date range to retrieve event data for the report. If multiple date + // ranges are specified, event data from each date range is used in the + // report. A special dimension with field name "dateRange" can be included in + // a Pivot's field names; if included, the report compares between date + // ranges. In a cohort request, this `dateRanges` must be unspecified. + repeated DateRange date_ranges = 4; + + // Describes the visual format of the report's dimensions in columns or rows. + // The union of the fieldNames (dimension names) in all pivots must be a + // subset of dimension names defined in Dimensions. No two pivots can share a + // dimension. A dimension is only visible if it appears in a pivot. + repeated Pivot pivots = 5; + + // The filter clause of dimensions. Dimensions must be requested to be used in + // this filter. Metrics cannot be used in this filter. + FilterExpression dimension_filter = 6; + + // The filter clause of metrics. Applied at post aggregation phase, similar to + // SQL having-clause. Metrics must be requested to be used in this filter. + // Dimensions cannot be used in this filter. + FilterExpression metric_filter = 7; + + // A currency code in ISO4217 format, such as "AED", "USD", "JPY". + // If the field is empty, the report uses the property's default currency. + string currency_code = 8; + + // Cohort group associated with this request. If there is a cohort group + // in the request the 'cohort' dimension must be present. + CohortSpec cohort_spec = 9; + + // If false or unspecified, each row with all metrics equal to 0 will not be + // returned. If true, these rows will be returned if they are not separately + // removed by a filter. + bool keep_empty_rows = 10; + + // Toggles whether to return the current state of this Analytics Property's + // quota. Quota is returned in [PropertyQuota](#PropertyQuota). + bool return_property_quota = 11; +} + +// The response pivot report table corresponding to a pivot request. +message RunPivotReportResponse { + // Summarizes the columns and rows created by a pivot. Each pivot in the + // request produces one header in the response. If we have a request like + // this: + // + // "pivots": [{ + // "fieldNames": ["country", + // "city"] + // }, + // { + // "fieldNames": "eventName" + // }] + // + // We will have the following `pivotHeaders` in the response: + // + // "pivotHeaders" : [{ + // "dimensionHeaders": [{ + // "dimensionValues": [ + // { "value": "United Kingdom" }, + // { "value": "London" } + // ] + // }, + // { + // "dimensionValues": [ + // { "value": "Japan" }, + // { "value": "Osaka" } + // ] + // }] + // }, + // { + // "dimensionHeaders": [{ + // "dimensionValues": [{ "value": "session_start" }] + // }, + // { + // "dimensionValues": [{ "value": "scroll" }] + // }] + // }] + repeated PivotHeader pivot_headers = 1; + + // Describes dimension columns. The number of DimensionHeaders and ordering of + // DimensionHeaders matches the dimensions present in rows. + repeated DimensionHeader dimension_headers = 2; + + // Describes metric columns. The number of MetricHeaders and ordering of + // MetricHeaders matches the metrics present in rows. + repeated MetricHeader metric_headers = 3; + + // Rows of dimension value combinations and metric values in the report. + repeated Row rows = 4; + + // Aggregation of metric values. Can be totals, minimums, or maximums. The + // returned aggregations are controlled by the metric_aggregations in the + // pivot. The type of aggregation returned in each row is shown by the + // dimension_values which are set to "RESERVED_". + repeated Row aggregates = 5; + + // Metadata for the report. + ResponseMetaData metadata = 6; + + // This Analytics Property's quota state including this request. + PropertyQuota property_quota = 7; + + // Identifies what kind of resource this message is. This `kind` is always the + // fixed string "analyticsData#runPivotReport". Useful to distinguish between + // response types in JSON. + string kind = 8; +} + +// The batch request containing multiple report requests. +message BatchRunReportsRequest { + // A Google Analytics GA4 property identifier whose events are tracked. + // Specified in the URL path and not the body. To learn more, see [where to + // find your Property + // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + // This property must be specified for the batch. The property within + // RunReportRequest may either be unspecified or consistent with this + // property. + // + // Example: properties/1234 + string property = 1; + + // Individual requests. Each request has a separate report response. Each + // batch request is allowed up to 5 requests. + repeated RunReportRequest requests = 2; +} + +// The batch response containing multiple reports. +message BatchRunReportsResponse { + // Individual responses. Each response has a separate report request. + repeated RunReportResponse reports = 1; + + // Identifies what kind of resource this message is. This `kind` is always the + // fixed string "analyticsData#batchRunReports". Useful to distinguish between + // response types in JSON. + string kind = 2; +} + +// The batch request containing multiple pivot report requests. +message BatchRunPivotReportsRequest { + // A Google Analytics GA4 property identifier whose events are tracked. + // Specified in the URL path and not the body. To learn more, see [where to + // find your Property + // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + // This property must be specified for the batch. The property within + // RunPivotReportRequest may either be unspecified or consistent with this + // property. + // + // Example: properties/1234 + string property = 1; + + // Individual requests. Each request has a separate pivot report response. + // Each batch request is allowed up to 5 requests. + repeated RunPivotReportRequest requests = 2; +} + +// The batch response containing multiple pivot reports. +message BatchRunPivotReportsResponse { + // Individual responses. Each response has a separate pivot report request. + repeated RunPivotReportResponse pivot_reports = 1; + + // Identifies what kind of resource this message is. This `kind` is always the + // fixed string "analyticsData#batchRunPivotReports". Useful to distinguish + // between response types in JSON. + string kind = 2; +} + +// Request for a property's dimension and metric metadata. +message GetMetadataRequest { + // 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 + // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + // + // Example: properties/1234/metadata + // + // Set the Property ID to 0 for dimensions and metrics common to all + // properties. In this special mode, this method will not return custom + // dimensions and metrics. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsdata.googleapis.com/Metadata" + } + ]; +} + +// The request to generate a realtime report. +message RunRealtimeReportRequest { + // A Google Analytics GA4 property identifier whose events are tracked. + // Specified in the URL path and not the body. To learn more, see [where to + // find your Property + // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + // + // Example: properties/1234 + string property = 1; + + // The dimensions requested and displayed. + repeated Dimension dimensions = 2; + + // The metrics requested and displayed. + repeated Metric metrics = 3; + + // The filter clause of dimensions. Dimensions must be requested to be used in + // this filter. Metrics cannot be used in this filter. + FilterExpression dimension_filter = 4; + + // The filter clause of metrics. Applied at post aggregation phase, similar to + // SQL having-clause. Metrics must be requested to be used in this filter. + // Dimensions cannot be used in this filter. + FilterExpression metric_filter = 5; + + // The number of rows to return. If unspecified, 10,000 rows are returned. The + // API returns a maximum of 100,000 rows per request, no matter how many you + // ask for. `limit` must be positive. + // + // The API can also return fewer rows than the requested `limit`, if there + // aren't as many dimension values as the `limit`. For instance, there are + // fewer than 300 possible values for the dimension `country`, so when + // reporting on only `country`, you can't get more than 300 rows, even if you + // set `limit` to a higher value. + int64 limit = 6; + + // Aggregation of metrics. Aggregated metric values will be shown in rows + // where the dimension_values are set to "RESERVED_(MetricAggregation)". + repeated MetricAggregation metric_aggregations = 7; + + // Specifies how rows are ordered in the response. + repeated OrderBy order_bys = 8; + + // Toggles whether to return the current state of this Analytics Property's + // Realtime quota. Quota is returned in [PropertyQuota](#PropertyQuota). + bool return_property_quota = 9; + + // The minute ranges of event data to read. If unspecified, one minute range + // for the last 30 minutes will be used. If multiple minute ranges are + // requested, each response row will contain a zero based minute range index. + // If two minute ranges overlap, the event data for the overlapping minutes is + // included in the response rows for both minute ranges. + repeated MinuteRange minute_ranges = 10; +} + +// The response realtime report table corresponding to a request. +message RunRealtimeReportResponse { + // Describes dimension columns. The number of DimensionHeaders and ordering of + // DimensionHeaders matches the dimensions present in rows. + repeated DimensionHeader dimension_headers = 1; + + // Describes metric columns. The number of MetricHeaders and ordering of + // MetricHeaders matches the metrics present in rows. + repeated MetricHeader metric_headers = 2; + + // Rows of dimension value combinations and metric values in the report. + repeated Row rows = 3; + + // If requested, the totaled values of metrics. + repeated Row totals = 4; + + // If requested, the maximum values of metrics. + repeated Row maximums = 5; + + // If requested, the minimum values of metrics. + repeated Row minimums = 6; + + // The total number of rows in the query result. `rowCount` is independent of + // the number of rows returned in the response and the `limit` request + // parameter. For example if a query returns 175 rows and includes `limit` + // of 50 in the API request, the response will contain `rowCount` of 175 but + // only 50 rows. + int32 row_count = 7; + + // This Analytics Property's Realtime quota state including this request. + PropertyQuota property_quota = 8; + + // Identifies what kind of resource this message is. This `kind` is always the + // fixed string "analyticsData#runRealtimeReport". Useful to distinguish + // between response types in JSON. + string kind = 9; +} diff --git a/owl-bot-staging/v1beta/protos/google/analytics/data/v1beta/data.proto b/owl-bot-staging/v1beta/protos/google/analytics/data/v1beta/data.proto new file mode 100644 index 000000000..a33d45538 --- /dev/null +++ b/owl-bot-staging/v1beta/protos/google/analytics/data/v1beta/data.proto @@ -0,0 +1,959 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.analytics.data.v1beta; + +option go_package = "google.golang.org/genproto/googleapis/analytics/data/v1beta;data"; +option java_multiple_files = true; +option java_outer_classname = "ReportingApiProto"; +option java_package = "com.google.analytics.data.v1beta"; + +// A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests +// are allowed up to 4 date ranges. +message DateRange { + // The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot + // be after `end_date`. The format `NdaysAgo`, `yesterday`, or `today` is also + // accepted, and in that case, the date is inferred based on the property's + // reporting time zone. + string start_date = 1; + + // The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot + // be before `start_date`. The format `NdaysAgo`, `yesterday`, or `today` is + // also accepted, and in that case, the date is inferred based on the + // property's reporting time zone. + string end_date = 2; + + // Assigns a name to this date range. The dimension `dateRange` is valued to + // this name in a report response. If set, cannot begin with `date_range_` or + // `RESERVED_`. If not set, date ranges are named by their zero based index in + // the request: `date_range_0`, `date_range_1`, etc. + string name = 3; +} + +// A contiguous set of minutes: startMinutesAgo, startMinutesAgo + 1, ..., +// endMinutesAgo. Requests are allowed up to 2 minute ranges. +message MinuteRange { + // The inclusive start minute for the query as a number of minutes before now. + // For example, `"startMinutesAgo": 29` specifies the report should include + // event data from 29 minutes ago and after. Cannot be after `endMinutesAgo`. + // + // If unspecified, `startMinutesAgo` is defaulted to 29. Standard Analytics + // properties can request up to the last 30 minutes of event data + // (`startMinutesAgo <= 29`), and Google Analytics 360 properties can request + // up to the last 60 minutes of event data (`startMinutesAgo <= 59`). + optional int32 start_minutes_ago = 1; + + // The inclusive end minute for the query as a number of minutes before now. + // Cannot be before `startMinutesAgo`. For example, `"endMinutesAgo": 15` + // specifies the report should include event data from prior to 15 minutes + // ago. + // + // If unspecified, `endMinutesAgo` is defaulted to 0. Standard Analytics + // properties can request any minute in the last 30 minutes of event data + // (`endMinutesAgo <= 29`), and Google Analytics 360 properties can request + // any minute in the last 60 minutes of event data (`endMinutesAgo <= 59`). + optional int32 end_minutes_ago = 2; + + // Assigns a name to this minute range. The dimension `dateRange` is valued to + // this name in a report response. If set, cannot begin with `date_range_` or + // `RESERVED_`. If not set, minute ranges are named by their zero based index + // in the request: `date_range_0`, `date_range_1`, etc. + string name = 3; +} + +// Dimensions are attributes of your data. For example, the dimension city +// indicates the city from which an event originates. Dimension values in report +// responses are strings; for example, city could be "Paris" or "New York". +// Requests are allowed up to 9 dimensions. +message Dimension { + // The name of the dimension. See the [API + // Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) + // for the list of dimension names. + // + // If `dimensionExpression` is specified, `name` can be any string that you + // would like within the allowed character set. For example if a + // `dimensionExpression` concatenates `country` and `city`, you could call + // that dimension `countryAndCity`. Dimension names that you choose must match + // the regular expression `^[a-zA-Z0-9_]$`. + // + // Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`, + // `dimensionExpression`, and `pivots`. + string name = 1; + + // One dimension can be the result of an expression of multiple dimensions. + // For example, dimension "country, city": concatenate(country, ", ", city). + DimensionExpression dimension_expression = 2; +} + +// Used to express a dimension which is the result of a formula of multiple +// dimensions. Example usages: +// 1) lower_case(dimension) +// 2) concatenate(dimension1, symbol, dimension2). +message DimensionExpression { + // Used to convert a dimension value to a single case. + message CaseExpression { + // Name of a dimension. The name must refer back to a name in dimensions + // field of the request. + string dimension_name = 1; + } + + // Used to combine dimension values to a single dimension. + message ConcatenateExpression { + // Names of dimensions. The names must refer back to names in the dimensions + // field of the request. + repeated string dimension_names = 1; + + // The delimiter placed between dimension names. + // + // Delimiters are often single characters such as "|" or "," but can be + // longer strings. If a dimension value contains the delimiter, both will be + // present in response with no distinction. For example if dimension 1 value + // = "US,FR", dimension 2 value = "JP", and delimiter = ",", then the + // response will contain "US,FR,JP". + string delimiter = 2; + } + + // Specify one type of dimension expression for `DimensionExpression`. + oneof one_expression { + // Used to convert a dimension value to lower case. + CaseExpression lower_case = 4; + + // Used to convert a dimension value to upper case. + CaseExpression upper_case = 5; + + // Used to combine dimension values to a single dimension. + // For example, dimension "country, city": concatenate(country, ", ", city). + ConcatenateExpression concatenate = 6; + } +} + +// The quantitative measurements of a report. For example, the metric +// `eventCount` is the total number of events. Requests are allowed up to 10 +// metrics. +message Metric { + // The name of the metric. See the [API + // Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics) + // for the list of metric names. + // + // If `expression` is specified, `name` can be any string that you would like + // within the allowed character set. For example if `expression` is + // `screenPageViews/sessions`, you could call that metric's name = + // `viewsPerSession`. Metric names that you choose must match the regular + // expression `^[a-zA-Z0-9_]$`. + // + // Metrics are referenced by `name` in `metricFilter`, `orderBys`, and metric + // `expression`. + string name = 1; + + // A mathematical expression for derived metrics. For example, the metric + // Event count per user is `eventCount/totalUsers`. + string expression = 2; + + // Indicates if a metric is invisible in the report response. If a metric is + // invisible, the metric will not produce a column in the response, but can be + // used in `metricFilter`, `orderBys`, or a metric `expression`. + bool invisible = 3; +} + +// To express dimension or metric filters. +// The fields in the same FilterExpression need to be either all dimensions or +// all metrics. +message FilterExpression { + // Specify one type of filter expression for `FilterExpression`. + oneof expr { + // The FilterExpressions in and_group have an AND relationship. + FilterExpressionList and_group = 1; + + // The FilterExpressions in or_group have an OR relationship. + FilterExpressionList or_group = 2; + + // The FilterExpression is NOT of not_expression. + FilterExpression not_expression = 3; + + // A primitive filter. + // All fields in filter in same FilterExpression needs to be either all + // dimensions or metrics. + Filter filter = 4; + } +} + +// A list of filter expressions. +message FilterExpressionList { + // A list of filter expressions. + repeated FilterExpression expressions = 1; +} + +// An expression to filter dimension or metric values. +message Filter { + // The filter for string + message StringFilter { + // The match type of a string filter + enum MatchType { + // Unspecified + MATCH_TYPE_UNSPECIFIED = 0; + + // Exact match of the string value. + EXACT = 1; + + // Begins with the string value. + BEGINS_WITH = 2; + + // Ends with the string value. + ENDS_WITH = 3; + + // Contains the string value. + CONTAINS = 4; + + // Full regular expression match with the string value. + FULL_REGEXP = 5; + + // Partial regular expression match with the string value. + PARTIAL_REGEXP = 6; + } + + // The match type for this filter. + MatchType match_type = 1; + + // The string value used for the matching. + string value = 2; + + // If true, the string value is case sensitive. + bool case_sensitive = 3; + } + + // The result needs to be in a list of string values. + message InListFilter { + // The list of string values. + // Must be non-empty. + repeated string values = 1; + + // If true, the string value is case sensitive. + bool case_sensitive = 2; + } + + // Filters for numeric or date values. + message NumericFilter { + // The operation applied to a numeric filter + enum Operation { + // Unspecified. + OPERATION_UNSPECIFIED = 0; + + // Equal + EQUAL = 1; + + // Less than + LESS_THAN = 2; + + // Less than or equal + LESS_THAN_OR_EQUAL = 3; + + // Greater than + GREATER_THAN = 4; + + // Greater than or equal + GREATER_THAN_OR_EQUAL = 5; + } + + // The operation type for this filter. + Operation operation = 1; + + // A numeric value or a date value. + NumericValue value = 2; + } + + // To express that the result needs to be between two numbers (inclusive). + message BetweenFilter { + // Begins with this number. + NumericValue from_value = 1; + + // Ends with this number. + NumericValue to_value = 2; + } + + // The dimension name or metric name. Must be a name defined in dimensions + // or metrics. + string field_name = 1; + + // Specify one type of filter for `Filter`. + oneof one_filter { + // Strings related filter. + StringFilter string_filter = 3; + + // A filter for in list values. + InListFilter in_list_filter = 4; + + // A filter for numeric or date values. + NumericFilter numeric_filter = 5; + + // A filter for two values. + BetweenFilter between_filter = 6; + } +} + +// The sort options. +message OrderBy { + // Sorts by metric values. + message MetricOrderBy { + // A metric name in the request to order by. + string metric_name = 1; + } + + // Sorts by dimension values. + message DimensionOrderBy { + // Rule to order the string dimension values by. + enum OrderType { + // Unspecified. + ORDER_TYPE_UNSPECIFIED = 0; + + // Alphanumeric sort by Unicode code point. For example, "2" < "A" < "X" < + // "b" < "z". + ALPHANUMERIC = 1; + + // Case insensitive alphanumeric sort by lower case Unicode code point. + // For example, "2" < "A" < "b" < "X" < "z". + CASE_INSENSITIVE_ALPHANUMERIC = 2; + + // Dimension values are converted to numbers before sorting. For example + // in NUMERIC sort, "25" < "100", and in `ALPHANUMERIC` sort, "100" < + // "25". Non-numeric dimension values all have equal ordering value below + // all numeric values. + NUMERIC = 3; + } + + // A dimension name in the request to order by. + string dimension_name = 1; + + // Controls the rule for dimension value ordering. + OrderType order_type = 2; + } + + // Sorts by a pivot column group. + message PivotOrderBy { + // A pair of dimension names and values. Rows with this dimension pivot pair + // are ordered by the metric's value. + // + // For example if pivots = {{"browser", "Chrome"}} and + // metric_name = "Sessions", + // then the rows will be sorted based on Sessions in Chrome. + // + // ---------|----------|----------------|----------|---------------- + // | Chrome | Chrome | Safari | Safari + // ---------|----------|----------------|----------|---------------- + // Country | Sessions | Pages/Sessions | Sessions | Pages/Sessions + // ---------|----------|----------------|----------|---------------- + // US | 2 | 2 | 3 | 1 + // ---------|----------|----------------|----------|---------------- + // Canada | 3 | 1 | 4 | 1 + // ---------|----------|----------------|----------|---------------- + message PivotSelection { + // Must be a dimension name from the request. + string dimension_name = 1; + + // Order by only when the named dimension is this value. + string dimension_value = 2; + } + + // In the response to order by, order rows by this column. Must be a metric + // name from the request. + string metric_name = 1; + + // Used to select a dimension name and value pivot. If multiple pivot + // selections are given, the sort occurs on rows where all pivot selection + // dimension name and value pairs match the row's dimension name and value + // pair. + repeated PivotSelection pivot_selections = 2; + } + + // Specify one type of order by for `OrderBy`. + oneof one_order_by { + // Sorts results by a metric's values. + MetricOrderBy metric = 1; + + // Sorts results by a dimension's values. + DimensionOrderBy dimension = 2; + + // Sorts results by a metric's values within a pivot column group. + PivotOrderBy pivot = 3; + } + + // If true, sorts by descending order. + bool desc = 4; +} + +// Describes the visible dimension columns and rows in the report response. +message Pivot { + // Dimension names for visible columns in the report response. Including + // "dateRange" produces a date range column; for each row in the response, + // dimension values in the date range column will indicate the corresponding + // date range from the request. + repeated string field_names = 1; + + // Specifies how dimensions are ordered in the pivot. In the first Pivot, the + // OrderBys determine Row and PivotDimensionHeader ordering; in subsequent + // Pivots, the OrderBys determine only PivotDimensionHeader ordering. + // Dimensions specified in these OrderBys must be a subset of + // Pivot.field_names. + repeated OrderBy order_bys = 2; + + // The row count of the start row. The first row is counted as row 0. + int64 offset = 3; + + // The number of unique combinations of dimension values to return in this + // pivot. The `limit` parameter is required. A `limit` of 10,000 is common for + // single pivot requests. + // + // The product of the `limit` for each `pivot` in a `RunPivotReportRequest` + // must not exceed 100,000. For example, a two pivot request with `limit: + // 1000` in each pivot will fail because the product is `1,000,000`. + int64 limit = 4; + + // Aggregate the metrics by dimensions in this pivot using the specified + // metric_aggregations. + repeated MetricAggregation metric_aggregations = 5; +} + +// The specification of cohorts for a cohort report. +// +// Cohort reports create a time series of user retention for the cohort. For +// example, you could select the cohort of users that were acquired in the first +// week of September and follow that cohort for the next six weeks. Selecting +// the users acquired in the first week of September cohort is specified in the +// `cohort` object. Following that cohort for the next six weeks is specified in +// the `cohortsRange` object. +// +// For examples, see [Cohort Report +// Examples](https://developers.google.com/analytics/devguides/reporting/data/v1/advanced#cohort_report_examples). +// +// The report response could show a weekly time series where say your app has +// retained 60% of this cohort after three weeks and 25% of this cohort after +// six weeks. These two percentages can be calculated by the metric +// `cohortActiveUsers/cohortTotalUsers` and will be separate rows in the report. +message CohortSpec { + // Defines the selection criteria to group users into cohorts. + // + // Most cohort reports define only a single cohort. If multiple cohorts are + // specified, each cohort can be recognized in the report by their name. + repeated Cohort cohorts = 1; + + // Cohort reports follow cohorts over an extended reporting date range. This + // range specifies an offset duration to follow the cohorts over. + CohortsRange cohorts_range = 2; + + // Optional settings for a cohort report. + CohortReportSettings cohort_report_settings = 3; +} + +// Defines a cohort selection criteria. A cohort is a group of users who share +// a common characteristic. For example, users with the same `firstSessionDate` +// belong to the same cohort. +message Cohort { + // Assigns a name to this cohort. The dimension `cohort` is valued to this + // name in a report response. If set, cannot begin with `cohort_` or + // `RESERVED_`. If not set, cohorts are named by their zero based index + // `cohort_0`, `cohort_1`, etc. + string name = 1; + + // Dimension used by the cohort. Required and only supports + // `firstSessionDate`. + string dimension = 2; + + // The cohort selects users whose first touch date is between start date and + // end date defined in the `dateRange`. This `dateRange` does not specify the + // full date range of event data that is present in a cohort report. In a + // cohort report, this `dateRange` is extended by the granularity and offset + // present in the `cohortsRange`; event data for the extended reporting date + // range is present in a cohort report. + // + // In a cohort request, this `dateRange` is required and the `dateRanges` in + // the `RunReportRequest` or `RunPivotReportRequest` must be unspecified. + // + // This `dateRange` should generally be aligned with the cohort's granularity. + // If `CohortsRange` uses daily granularity, this `dateRange` can be a single + // day. If `CohortsRange` uses weekly granularity, this `dateRange` can be + // aligned to a week boundary, starting at Sunday and ending Saturday. If + // `CohortsRange` uses monthly granularity, this `dateRange` can be aligned to + // a month, starting at the first and ending on the last day of the month. + DateRange date_range = 3; +} + +// Configures the extended reporting date range for a cohort report. Specifies +// an offset duration to follow the cohorts over. +message CohortsRange { + // The granularity used to interpret the `startOffset` and `endOffset` for the + // extended reporting date range for a cohort report. + enum Granularity { + // Should never be specified. + GRANULARITY_UNSPECIFIED = 0; + + // Daily granularity. Commonly used if the cohort's `dateRange` is a single + // day and the request contains `cohortNthDay`. + DAILY = 1; + + // Weekly granularity. Commonly used if the cohort's `dateRange` is a week + // in duration (starting on Sunday and ending on Saturday) and the request + // contains `cohortNthWeek`. + WEEKLY = 2; + + // Monthly granularity. Commonly used if the cohort's `dateRange` is a month + // in duration and the request contains `cohortNthMonth`. + MONTHLY = 3; + } + + // Required. The granularity used to interpret the `startOffset` and + // `endOffset` for the extended reporting date range for a cohort report. + Granularity granularity = 1; + + // `startOffset` specifies the start date of the extended reporting date range + // for a cohort report. `startOffset` is commonly set to 0 so that reports + // contain data from the acquisition of the cohort forward. + // + // If `granularity` is `DAILY`, the `startDate` of the extended reporting date + // range is `startDate` of the cohort plus `startOffset` days. + // + // If `granularity` is `WEEKLY`, the `startDate` of the extended reporting + // date range is `startDate` of the cohort plus `startOffset * 7` days. + // + // If `granularity` is `MONTHLY`, the `startDate` of the extended reporting + // date range is `startDate` of the cohort plus `startOffset * 30` days. + int32 start_offset = 2; + + // Required. `endOffset` specifies the end date of the extended reporting date + // range for a cohort report. `endOffset` can be any positive integer but is + // commonly set to 5 to 10 so that reports contain data on the cohort for the + // next several granularity time periods. + // + // If `granularity` is `DAILY`, the `endDate` of the extended reporting date + // range is `endDate` of the cohort plus `endOffset` days. + // + // If `granularity` is `WEEKLY`, the `endDate` of the extended reporting date + // range is `endDate` of the cohort plus `endOffset * 7` days. + // + // If `granularity` is `MONTHLY`, the `endDate` of the extended reporting date + // range is `endDate` of the cohort plus `endOffset * 30` days. + int32 end_offset = 3; +} + +// Optional settings of a cohort report. +message CohortReportSettings { + // If true, accumulates the result from first touch day to the end day. Not + // supported in `RunReportRequest`. + bool accumulate = 1; +} + +// Response's metadata carrying additional information about the report content. +message ResponseMetaData { + // The schema restrictions actively enforced in creating this report. To learn + // more, see [Access and data-restriction + // management](https://support.google.com/analytics/answer/10851388). + message SchemaRestrictionResponse { + // A metric actively restricted in creating the report. + message ActiveMetricRestriction { + // The name of the restricted metric. + optional string metric_name = 1; + + // The reason for this metric's restriction. + repeated RestrictedMetricType restricted_metric_types = 2; + } + + // All restrictions actively enforced in creating the report. For example, + // `purchaseRevenue` always has the restriction type `REVENUE_DATA`. + // However, this active response restriction is only populated if the user's + // custom role disallows access to `REVENUE_DATA`. + repeated ActiveMetricRestriction active_metric_restrictions = 1; + } + + // If true, indicates some buckets of dimension combinations are rolled into + // "(other)" row. This can happen for high cardinality reports. + bool data_loss_from_other_row = 3; + + // Describes the schema restrictions actively enforced in creating this + // report. To learn more, see [Access and data-restriction + // management](https://support.google.com/analytics/answer/10851388). + optional SchemaRestrictionResponse schema_restriction_response = 4; + + // The currency code used in this report. Intended to be used in formatting + // currency metrics like `purchaseRevenue` for visualization. If currency_code + // was specified in the request, this response parameter will echo the request + // parameter; otherwise, this response parameter is the property's current + // currency_code. + // + // Currency codes are string encodings of currency types from the ISO 4217 + // standard (https://en.wikipedia.org/wiki/ISO_4217); for example "USD", + // "EUR", "JPY". To learn more, see + // https://support.google.com/analytics/answer/9796179. + optional string currency_code = 5; + + // The property's current timezone. Intended to be used to interpret + // time-based dimensions like `hour` and `minute`. Formatted as strings from + // the IANA Time Zone database (https://www.iana.org/time-zones); for example + // "America/New_York" or "Asia/Tokyo". + optional string time_zone = 6; + + // If empty reason is specified, the report is empty for this reason. + optional string empty_reason = 7; +} + +// Describes a dimension column in the report. Dimensions requested in a report +// produce column entries within rows and DimensionHeaders. However, dimensions +// used exclusively within filters or expressions do not produce columns in a +// report; correspondingly, those dimensions do not produce headers. +message DimensionHeader { + // The dimension's name. + string name = 1; +} + +// Describes a metric column in the report. Visible metrics requested in a +// report produce column entries within rows and MetricHeaders. However, +// metrics used exclusively within filters or expressions do not produce columns +// in a report; correspondingly, those metrics do not produce headers. +message MetricHeader { + // The metric's name. + string name = 1; + + // The metric's data type. + MetricType type = 2; +} + +// Dimensions' values in a single pivot. +message PivotHeader { + // The size is the same as the cardinality of the corresponding dimension + // combinations. + repeated PivotDimensionHeader pivot_dimension_headers = 1; + + // The cardinality of the pivot. The total number of rows for this pivot's + // fields regardless of how the parameters `offset` and `limit` are specified + // in the request. + int32 row_count = 2; +} + +// Summarizes dimension values from a row for this pivot. +message PivotDimensionHeader { + // Values of multiple dimensions in a pivot. + repeated DimensionValue dimension_values = 1; +} + +// Report data for each row. +// For example if RunReportRequest contains: +// +// ```none +// "dimensions": [ +// { +// "name": "eventName" +// }, +// { +// "name": "countryId" +// } +// ], +// "metrics": [ +// { +// "name": "eventCount" +// } +// ] +// ``` +// +// One row with 'in_app_purchase' as the eventName, 'JP' as the countryId, and +// 15 as the eventCount, would be: +// +// ```none +// "dimensionValues": [ +// { +// "value": "in_app_purchase" +// }, +// { +// "value": "JP" +// } +// ], +// "metricValues": [ +// { +// "value": "15" +// } +// ] +// ``` +message Row { + // List of requested dimension values. In a PivotReport, dimension_values + // are only listed for dimensions included in a pivot. + repeated DimensionValue dimension_values = 1; + + // List of requested visible metric values. + repeated MetricValue metric_values = 2; +} + +// The value of a dimension. +message DimensionValue { + // One kind of dimension value + oneof one_value { + // Value as a string if the dimension type is a string. + string value = 1; + } +} + +// The value of a metric. +message MetricValue { + // One of metric value + oneof one_value { + // Measurement value. See MetricHeader for type. + string value = 4; + } +} + +// To represent a number. +message NumericValue { + // One of a numeric value + oneof one_value { + // Integer value + int64 int64_value = 1; + + // Double value + double double_value = 2; + } +} + +// Current state of all quotas for this Analytics Property. If any quota for a +// property is exhausted, all requests to that property will return Resource +// Exhausted errors. +message PropertyQuota { + // Standard Analytics Properties can use up to 25,000 tokens per day; + // Analytics 360 Properties can use 250,000 tokens per day. Most requests + // consume fewer than 10 tokens. + QuotaStatus tokens_per_day = 1; + + // Standard Analytics Properties can use up to 5,000 tokens per hour; + // Analytics 360 Properties can use 50,000 tokens per hour. An API request + // consumes a single number of tokens, and that number is deducted from both + // the hourly and daily quotas. + QuotaStatus tokens_per_hour = 2; + + // Standard Analytics Properties can send up to 10 concurrent requests; + // Analytics 360 Properties can use up to 50 concurrent requests. + QuotaStatus concurrent_requests = 3; + + // Standard Analytics Properties and cloud project pairs can have up to 10 + // server errors per hour; Analytics 360 Properties and cloud project pairs + // can have up to 50 server errors per hour. + QuotaStatus server_errors_per_project_per_hour = 4; + + // Analytics Properties can send up to 120 requests with potentially + // thresholded dimensions per hour. In a batch request, each report request + // is individually counted for this quota if the request contains potentially + // thresholded dimensions. + QuotaStatus potentially_thresholded_requests_per_hour = 5; +} + +// Current state for a particular quota group. +message QuotaStatus { + // Quota consumed by this request. + int32 consumed = 1; + + // Quota remaining after this request. + int32 remaining = 2; +} + +// Explains a dimension. +message DimensionMetadata { + // This dimension's name. Useable in [Dimension](#Dimension)'s `name`. For + // example, `eventName`. + string api_name = 1; + + // This dimension's name within the Google Analytics user interface. For + // example, `Event name`. + string ui_name = 2; + + // Description of how this dimension is used and calculated. + string description = 3; + + // Still usable but deprecated names for this dimension. If populated, this + // dimension is available by either `apiName` or one of `deprecatedApiNames` + // for a period of time. After the deprecation period, the dimension will be + // available only by `apiName`. + repeated string deprecated_api_names = 4; + + // True if the dimension is a custom dimension for this property. + bool custom_definition = 5; + + // The display name of the category that this dimension belongs to. Similar + // dimensions and metrics are categorized together. + string category = 7; +} + +// Explains a metric. +message MetricMetadata { + // Justifications for why this metric is blocked. + enum BlockedReason { + // Will never be specified in API response. + BLOCKED_REASON_UNSPECIFIED = 0; + + // If present, your access is blocked to revenue related metrics for this + // property, and this metric is revenue related. + NO_REVENUE_METRICS = 1; + + // If present, your access is blocked to cost related metrics for this + // property, and this metric is cost related. + NO_COST_METRICS = 2; + } + + // A metric name. Useable in [Metric](#Metric)'s `name`. For example, + // `eventCount`. + string api_name = 1; + + // This metric's name within the Google Analytics user interface. For example, + // `Event count`. + string ui_name = 2; + + // Description of how this metric is used and calculated. + string description = 3; + + // Still usable but deprecated names for this metric. If populated, this + // metric is available by either `apiName` or one of `deprecatedApiNames` + // for a period of time. After the deprecation period, the metric will be + // available only by `apiName`. + repeated string deprecated_api_names = 4; + + // The type of this metric. + MetricType type = 5; + + // The mathematical expression for this derived metric. Can be used in + // [Metric](#Metric)'s `expression` field for equivalent reports. Most metrics + // are not expressions, and for non-expressions, this field is empty. + string expression = 6; + + // True if the metric is a custom metric for this property. + bool custom_definition = 7; + + // If reasons are specified, your access is blocked to this metric for this + // property. API requests from you to this property for this metric will + // succeed; however, the report will contain only zeros for this metric. API + // requests with metric filters on blocked metrics will fail. If reasons are + // empty, you have access to this metric. + // + // To learn more, see [Access and data-restriction + // management](https://support.google.com/analytics/answer/10851388). + repeated BlockedReason blocked_reasons = 8; + + // The display name of the category that this metrics belongs to. Similar + // dimensions and metrics are categorized together. + string category = 10; +} + +// The compatibility for a single dimension. +message DimensionCompatibility { + // The dimension metadata contains the API name for this compatibility + // information. The dimension metadata also contains other helpful information + // like the UI name and description. + optional DimensionMetadata dimension_metadata = 1; + + // The compatibility of this dimension. If the compatibility is COMPATIBLE, + // this dimension can be successfully added to the report. + optional Compatibility compatibility = 2; +} + +// The compatibility for a single metric. +message MetricCompatibility { + // The metric metadata contains the API name for this compatibility + // information. The metric metadata also contains other helpful information + // like the UI name and description. + optional MetricMetadata metric_metadata = 1; + + // The compatibility of this metric. If the compatibility is COMPATIBLE, + // this metric can be successfully added to the report. + optional Compatibility compatibility = 2; +} + +// Represents aggregation of metrics. +enum MetricAggregation { + // Unspecified operator. + METRIC_AGGREGATION_UNSPECIFIED = 0; + + // SUM operator. + TOTAL = 1; + + // Minimum operator. + MINIMUM = 5; + + // Maximum operator. + MAXIMUM = 6; + + // Count operator. + COUNT = 4; +} + +// A metric's value type. +enum MetricType { + // Unspecified type. + METRIC_TYPE_UNSPECIFIED = 0; + + // Integer type. + TYPE_INTEGER = 1; + + // Floating point type. + TYPE_FLOAT = 2; + + // A duration of seconds; a special floating point type. + TYPE_SECONDS = 4; + + // A duration in milliseconds; a special floating point type. + TYPE_MILLISECONDS = 5; + + // A duration in minutes; a special floating point type. + TYPE_MINUTES = 6; + + // A duration in hours; a special floating point type. + TYPE_HOURS = 7; + + // A custom metric of standard type; a special floating point type. + TYPE_STANDARD = 8; + + // An amount of money; a special floating point type. + TYPE_CURRENCY = 9; + + // A length in feet; a special floating point type. + TYPE_FEET = 10; + + // A length in miles; a special floating point type. + TYPE_MILES = 11; + + // A length in meters; a special floating point type. + TYPE_METERS = 12; + + // A length in kilometers; a special floating point type. + TYPE_KILOMETERS = 13; +} + +// Categories of data that you may be restricted from viewing on certain GA4 +// properties. +enum RestrictedMetricType { + // Unspecified type. + RESTRICTED_METRIC_TYPE_UNSPECIFIED = 0; + + // Cost metrics such as `adCost`. + COST_DATA = 1; + + // Revenue metrics such as `purchaseRevenue`. + REVENUE_DATA = 2; +} + +// The compatibility types for a single dimension or metric. +enum Compatibility { + // Unspecified compatibility. + COMPATIBILITY_UNSPECIFIED = 0; + + // The dimension or metric is compatible. This dimension or metric can be + // successfully added to a report. + COMPATIBLE = 1; + + // The dimension or metric is incompatible. This dimension or metric cannot be + // successfully added to a report. + INCOMPATIBLE = 2; +} diff --git a/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js b/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js new file mode 100644 index 000000000..be57e2ecb --- /dev/null +++ b/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js @@ -0,0 +1,69 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunPivotReports_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see where to + * find your Property + * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * This property must be specified for the batch. The property within + * RunPivotReportRequest may either be unspecified or consistent with this + * property. + * Example: properties/1234 + */ + // const property = 'abc123' + /** + * Individual requests. Each request has a separate pivot report response. + * Each batch request is allowed up to 5 requests. + */ + // const requests = 1234 + + // Imports the Data library + const {BetaAnalyticsDataClient} = require('@google-analytics/data').v1beta; + + // Instantiates a client + const dataClient = new BetaAnalyticsDataClient(); + + async function callBatchRunPivotReports() { + // Construct request + const request = { + }; + + // Run request + const response = await dataClient.batchRunPivotReports(request); + console.log(response); + } + + callBatchRunPivotReports(); + // [END analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunPivotReports_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.batch_run_reports.js b/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.batch_run_reports.js new file mode 100644 index 000000000..4677d77f1 --- /dev/null +++ b/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.batch_run_reports.js @@ -0,0 +1,69 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunReports_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see where to + * find your Property + * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * This property must be specified for the batch. The property within + * RunReportRequest may either be unspecified or consistent with this + * property. + * Example: properties/1234 + */ + // const property = 'abc123' + /** + * Individual requests. Each request has a separate report response. Each + * batch request is allowed up to 5 requests. + */ + // const requests = 1234 + + // Imports the Data library + const {BetaAnalyticsDataClient} = require('@google-analytics/data').v1beta; + + // Instantiates a client + const dataClient = new BetaAnalyticsDataClient(); + + async function callBatchRunReports() { + // Construct request + const request = { + }; + + // Run request + const response = await dataClient.batchRunReports(request); + console.log(response); + } + + callBatchRunReports(); + // [END analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunReports_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.check_compatibility.js b/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.check_compatibility.js new file mode 100644 index 000000000..e5ef6a610 --- /dev/null +++ b/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.check_compatibility.js @@ -0,0 +1,90 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START analyticsdata_v1beta_generated_BetaAnalyticsData_CheckCompatibility_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * A Google Analytics GA4 property identifier whose events are tracked. To + * learn more, see where to find your Property + * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * `property` should be the same value as in your `runReport` request. + * Example: properties/1234 + * Set the Property ID to 0 for compatibility checking on dimensions and + * metrics common to all properties. In this special mode, this method will + * not return custom dimensions and metrics. + */ + // const property = 'abc123' + /** + * The dimensions in this report. `dimensions` should be the same value as in + * your `runReport` request. + */ + // const dimensions = 1234 + /** + * The metrics in this report. `metrics` should be the same value as in your + * `runReport` request. + */ + // const metrics = 1234 + /** + * The filter clause of dimensions. `dimensionFilter` should be the same value + * as in your `runReport` request. + */ + // const dimensionFilter = {} + /** + * The filter clause of metrics. `metricFilter` should be the same value as in + * your `runReport` request + */ + // const metricFilter = {} + /** + * Filters the dimensions and metrics in the response to just this + * compatibility. Commonly used as `”compatibilityFilter”: “COMPATIBLE”` + * to only return compatible dimensions & metrics. + */ + // const compatibilityFilter = {} + + // Imports the Data library + const {BetaAnalyticsDataClient} = require('@google-analytics/data').v1beta; + + // Instantiates a client + const dataClient = new BetaAnalyticsDataClient(); + + async function callCheckCompatibility() { + // Construct request + const request = { + }; + + // Run request + const response = await dataClient.checkCompatibility(request); + console.log(response); + } + + callCheckCompatibility(); + // [END analyticsdata_v1beta_generated_BetaAnalyticsData_CheckCompatibility_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.get_metadata.js b/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.get_metadata.js new file mode 100644 index 000000000..e489bbda5 --- /dev/null +++ b/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.get_metadata.js @@ -0,0 +1,66 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START analyticsdata_v1beta_generated_BetaAnalyticsData_GetMetadata_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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 + * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * Example: properties/1234/metadata + * Set the Property ID to 0 for dimensions and metrics common to all + * properties. In this special mode, this method will not return custom + * dimensions and metrics. + */ + // const name = 'abc123' + + // Imports the Data library + const {BetaAnalyticsDataClient} = require('@google-analytics/data').v1beta; + + // Instantiates a client + const dataClient = new BetaAnalyticsDataClient(); + + async function callGetMetadata() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataClient.getMetadata(request); + console.log(response); + } + + callGetMetadata(); + // [END analyticsdata_v1beta_generated_BetaAnalyticsData_GetMetadata_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_pivot_report.js b/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_pivot_report.js new file mode 100644 index 000000000..4bb4c0483 --- /dev/null +++ b/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_pivot_report.js @@ -0,0 +1,121 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START analyticsdata_v1beta_generated_BetaAnalyticsData_RunPivotReport_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see where to + * find your Property + * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * Within a batch request, this property should either be unspecified or + * consistent with the batch-level property. + * Example: properties/1234 + */ + // const property = 'abc123' + /** + * The dimensions requested. All defined dimensions must be used by one of the + * following: dimension_expression, dimension_filter, pivots, order_bys. + */ + // const dimensions = 1234 + /** + * The metrics requested, at least one metric needs to be specified. All + * defined metrics must be used by one of the following: metric_expression, + * metric_filter, order_bys. + */ + // const metrics = 1234 + /** + * The date range to retrieve event data for the report. If multiple date + * ranges are specified, event data from each date range is used in the + * report. A special dimension with field name "dateRange" can be included in + * a Pivot's field names; if included, the report compares between date + * ranges. In a cohort request, this `dateRanges` must be unspecified. + */ + // const dateRanges = 1234 + /** + * Describes the visual format of the report's dimensions in columns or rows. + * The union of the fieldNames (dimension names) in all pivots must be a + * subset of dimension names defined in Dimensions. No two pivots can share a + * dimension. A dimension is only visible if it appears in a pivot. + */ + // const pivots = 1234 + /** + * The filter clause of dimensions. Dimensions must be requested to be used in + * this filter. Metrics cannot be used in this filter. + */ + // const dimensionFilter = {} + /** + * The filter clause of metrics. Applied at post aggregation phase, similar to + * SQL having-clause. Metrics must be requested to be used in this filter. + * Dimensions cannot be used in this filter. + */ + // const metricFilter = {} + /** + * A currency code in ISO4217 format, such as "AED", "USD", "JPY". + * If the field is empty, the report uses the property's default currency. + */ + // const currencyCode = 'abc123' + /** + * Cohort group associated with this request. If there is a cohort group + * in the request the 'cohort' dimension must be present. + */ + // const cohortSpec = {} + /** + * If false or unspecified, each row with all metrics equal to 0 will not be + * returned. If true, these rows will be returned if they are not separately + * removed by a filter. + */ + // const keepEmptyRows = true + /** + * Toggles whether to return the current state of this Analytics Property's + * quota. Quota is returned in PropertyQuota (#PropertyQuota). + */ + // const returnPropertyQuota = true + + // Imports the Data library + const {BetaAnalyticsDataClient} = require('@google-analytics/data').v1beta; + + // Instantiates a client + const dataClient = new BetaAnalyticsDataClient(); + + async function callRunPivotReport() { + // Construct request + const request = { + }; + + // Run request + const response = await dataClient.runPivotReport(request); + console.log(response); + } + + callRunPivotReport(); + // [END analyticsdata_v1beta_generated_BetaAnalyticsData_RunPivotReport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_realtime_report.js b/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_realtime_report.js new file mode 100644 index 000000000..12618945c --- /dev/null +++ b/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_realtime_report.js @@ -0,0 +1,113 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START analyticsdata_v1beta_generated_BetaAnalyticsData_RunRealtimeReport_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see where to + * find your Property + * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * Example: properties/1234 + */ + // const property = 'abc123' + /** + * The dimensions requested and displayed. + */ + // const dimensions = 1234 + /** + * The metrics requested and displayed. + */ + // const metrics = 1234 + /** + * The filter clause of dimensions. Dimensions must be requested to be used in + * this filter. Metrics cannot be used in this filter. + */ + // const dimensionFilter = {} + /** + * The filter clause of metrics. Applied at post aggregation phase, similar to + * SQL having-clause. Metrics must be requested to be used in this filter. + * Dimensions cannot be used in this filter. + */ + // const metricFilter = {} + /** + * The number of rows to return. If unspecified, 10,000 rows are returned. The + * API returns a maximum of 100,000 rows per request, no matter how many you + * ask for. `limit` must be positive. + * The API can also return fewer rows than the requested `limit`, if there + * aren't as many dimension values as the `limit`. For instance, there are + * fewer than 300 possible values for the dimension `country`, so when + * reporting on only `country`, you can't get more than 300 rows, even if you + * set `limit` to a higher value. + */ + // const limit = 1234 + /** + * Aggregation of metrics. Aggregated metric values will be shown in rows + * where the dimension_values are set to "RESERVED_(MetricAggregation)". + */ + // const metricAggregations = 1234 + /** + * Specifies how rows are ordered in the response. + */ + // const orderBys = 1234 + /** + * Toggles whether to return the current state of this Analytics Property's + * Realtime quota. Quota is returned in PropertyQuota (#PropertyQuota). + */ + // const returnPropertyQuota = true + /** + * The minute ranges of event data to read. If unspecified, one minute range + * for the last 30 minutes will be used. If multiple minute ranges are + * requested, each response row will contain a zero based minute range index. + * If two minute ranges overlap, the event data for the overlapping minutes is + * included in the response rows for both minute ranges. + */ + // const minuteRanges = 1234 + + // Imports the Data library + const {BetaAnalyticsDataClient} = require('@google-analytics/data').v1beta; + + // Instantiates a client + const dataClient = new BetaAnalyticsDataClient(); + + async function callRunRealtimeReport() { + // Construct request + const request = { + }; + + // Run request + const response = await dataClient.runRealtimeReport(request); + console.log(response); + } + + callRunRealtimeReport(); + // [END analyticsdata_v1beta_generated_BetaAnalyticsData_RunRealtimeReport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_report.js b/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_report.js new file mode 100644 index 000000000..1da71d36b --- /dev/null +++ b/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_report.js @@ -0,0 +1,144 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START analyticsdata_v1beta_generated_BetaAnalyticsData_RunReport_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see where to + * find your Property + * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * Within a batch request, this property should either be unspecified or + * consistent with the batch-level property. + * Example: properties/1234 + */ + // const property = 'abc123' + /** + * The dimensions requested and displayed. + */ + // const dimensions = 1234 + /** + * The metrics requested and displayed. + */ + // const metrics = 1234 + /** + * Date ranges of data to read. If multiple date ranges are requested, each + * response row will contain a zero based date range index. If two date + * ranges overlap, the event data for the overlapping days is included in the + * response rows for both date ranges. In a cohort request, this `dateRanges` + * must be unspecified. + */ + // const dateRanges = 1234 + /** + * Dimension filters allow you to ask for only specific dimension values in + * the report. To learn more, see Fundamentals of Dimension + * Filters (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + * for examples. Metrics cannot be used in this filter. + */ + // const dimensionFilter = {} + /** + * The filter clause of metrics. Applied at post aggregation phase, similar to + * SQL having-clause. Dimensions cannot be used in this filter. + */ + // const metricFilter = {} + /** + * The row count of the start row. The first row is counted as row 0. + * When paging, the first request does not specify offset; or equivalently, + * sets offset to 0; the first request returns the first `limit` of rows. The + * second request sets offset to the `limit` of the first request; the second + * request returns the second `limit` of rows. + * To learn more about this pagination parameter, see + * Pagination (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + */ + // const offset = 1234 + /** + * The number of rows to return. If unspecified, 10,000 rows are returned. The + * API returns a maximum of 100,000 rows per request, no matter how many you + * ask for. `limit` must be positive. + * The API can also return fewer rows than the requested `limit`, if there + * aren't as many dimension values as the `limit`. For instance, there are + * fewer than 300 possible values for the dimension `country`, so when + * reporting on only `country`, you can't get more than 300 rows, even if you + * set `limit` to a higher value. + * To learn more about this pagination parameter, see + * Pagination (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + */ + // const limit = 1234 + /** + * Aggregation of metrics. Aggregated metric values will be shown in rows + * where the dimension_values are set to "RESERVED_(MetricAggregation)". + */ + // const metricAggregations = 1234 + /** + * Specifies how rows are ordered in the response. + */ + // const orderBys = 1234 + /** + * A currency code in ISO4217 format, such as "AED", "USD", "JPY". + * If the field is empty, the report uses the property's default currency. + */ + // const currencyCode = 'abc123' + /** + * Cohort group associated with this request. If there is a cohort group + * in the request the 'cohort' dimension must be present. + */ + // const cohortSpec = {} + /** + * If false or unspecified, each row with all metrics equal to 0 will not be + * returned. If true, these rows will be returned if they are not separately + * removed by a filter. + */ + // const keepEmptyRows = true + /** + * Toggles whether to return the current state of this Analytics Property's + * quota. Quota is returned in PropertyQuota (#PropertyQuota). + */ + // const returnPropertyQuota = true + + // Imports the Data library + const {BetaAnalyticsDataClient} = require('@google-analytics/data').v1beta; + + // Instantiates a client + const dataClient = new BetaAnalyticsDataClient(); + + async function callRunReport() { + // Construct request + const request = { + }; + + // Run request + const response = await dataClient.runReport(request); + console.log(response); + } + + callRunReport(); + // [END analyticsdata_v1beta_generated_BetaAnalyticsData_RunReport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta/samples/generated/v1beta/snippet_metadata.google.analytics.data.v1beta.json b/owl-bot-staging/v1beta/samples/generated/v1beta/snippet_metadata.google.analytics.data.v1beta.json new file mode 100644 index 000000000..37e2aa574 --- /dev/null +++ b/owl-bot-staging/v1beta/samples/generated/v1beta/snippet_metadata.google.analytics.data.v1beta.json @@ -0,0 +1,451 @@ +{ + "clientLibrary": { + "name": "nodejs-data", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.analytics.data.v1beta", + "version": "v1beta" + } + ] + }, + "snippets": [ + { + "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_RunReport_async", + "title": "BetaAnalyticsData runReport Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "beta_analytics_data.run_report.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 136, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunReport", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.RunReport", + "async": true, + "parameters": [ + { + "name": "property", + "type": "TYPE_STRING" + }, + { + "name": "dimensions", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "metrics", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "date_ranges", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "dimension_filter", + "type": ".google.analytics.data.v1beta.FilterExpression" + }, + { + "name": "metric_filter", + "type": ".google.analytics.data.v1beta.FilterExpression" + }, + { + "name": "offset", + "type": "TYPE_INT64" + }, + { + "name": "limit", + "type": "TYPE_INT64" + }, + { + "name": "metric_aggregations", + "type": "TYPE_ENUM[]" + }, + { + "name": "order_bys", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "currency_code", + "type": "TYPE_STRING" + }, + { + "name": "cohort_spec", + "type": ".google.analytics.data.v1beta.CohortSpec" + }, + { + "name": "keep_empty_rows", + "type": "TYPE_BOOL" + }, + { + "name": "return_property_quota", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.analytics.data.v1beta.RunReportResponse", + "client": { + "shortName": "BetaAnalyticsDataClient", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsDataClient" + }, + "method": { + "shortName": "RunReport", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.RunReport", + "service": { + "shortName": "BetaAnalyticsData", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData" + } + } + } + }, + { + "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_RunPivotReport_async", + "title": "BetaAnalyticsData runPivotReport Sample", + "origin": "API_DEFINITION", + "description": " Returns a customized pivot report of your Google Analytics event data. Pivot reports are more advanced and expressive formats than regular reports. In a pivot report, dimensions are only visible if they are included in a pivot. Multiple pivots can be specified to further dissect your data.", + "canonical": true, + "file": "beta_analytics_data.run_pivot_report.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 113, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunPivotReport", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.RunPivotReport", + "async": true, + "parameters": [ + { + "name": "property", + "type": "TYPE_STRING" + }, + { + "name": "dimensions", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "metrics", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "date_ranges", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "pivots", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "dimension_filter", + "type": ".google.analytics.data.v1beta.FilterExpression" + }, + { + "name": "metric_filter", + "type": ".google.analytics.data.v1beta.FilterExpression" + }, + { + "name": "currency_code", + "type": "TYPE_STRING" + }, + { + "name": "cohort_spec", + "type": ".google.analytics.data.v1beta.CohortSpec" + }, + { + "name": "keep_empty_rows", + "type": "TYPE_BOOL" + }, + { + "name": "return_property_quota", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.analytics.data.v1beta.RunPivotReportResponse", + "client": { + "shortName": "BetaAnalyticsDataClient", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsDataClient" + }, + "method": { + "shortName": "RunPivotReport", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.RunPivotReport", + "service": { + "shortName": "BetaAnalyticsData", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData" + } + } + } + }, + { + "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunReports_async", + "title": "BetaAnalyticsData batchRunReports Sample", + "origin": "API_DEFINITION", + "description": " Returns multiple reports in a batch. All reports must be for the same GA4 Property.", + "canonical": true, + "file": "beta_analytics_data.batch_run_reports.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchRunReports", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.BatchRunReports", + "async": true, + "parameters": [ + { + "name": "property", + "type": "TYPE_STRING" + }, + { + "name": "requests", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.analytics.data.v1beta.BatchRunReportsResponse", + "client": { + "shortName": "BetaAnalyticsDataClient", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsDataClient" + }, + "method": { + "shortName": "BatchRunReports", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.BatchRunReports", + "service": { + "shortName": "BetaAnalyticsData", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData" + } + } + } + }, + { + "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunPivotReports_async", + "title": "BetaAnalyticsData batchRunPivotReports Sample", + "origin": "API_DEFINITION", + "description": " Returns multiple pivot reports in a batch. All reports must be for the same GA4 Property.", + "canonical": true, + "file": "beta_analytics_data.batch_run_pivot_reports.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchRunPivotReports", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.BatchRunPivotReports", + "async": true, + "parameters": [ + { + "name": "property", + "type": "TYPE_STRING" + }, + { + "name": "requests", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.analytics.data.v1beta.BatchRunPivotReportsResponse", + "client": { + "shortName": "BetaAnalyticsDataClient", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsDataClient" + }, + "method": { + "shortName": "BatchRunPivotReports", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.BatchRunPivotReports", + "service": { + "shortName": "BetaAnalyticsData", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData" + } + } + } + }, + { + "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_GetMetadata_async", + "title": "BetaAnalyticsData getMetadata Sample", + "origin": "API_DEFINITION", + "description": " Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics GA4 Property Identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata. For example if a custom metric with parameter name `levels_unlocked` is registered to a property, the Metadata response will contain `customEvent:levels_unlocked`. Universal metadata are dimensions and metrics applicable to any property such as `country` and `totalUsers`.", + "canonical": true, + "file": "beta_analytics_data.get_metadata.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMetadata", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.GetMetadata", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.data.v1beta.Metadata", + "client": { + "shortName": "BetaAnalyticsDataClient", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsDataClient" + }, + "method": { + "shortName": "GetMetadata", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.GetMetadata", + "service": { + "shortName": "BetaAnalyticsData", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData" + } + } + } + }, + { + "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_RunRealtimeReport_async", + "title": "BetaAnalyticsData runRealtimeReport Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "beta_analytics_data.run_realtime_report.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 105, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunRealtimeReport", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.RunRealtimeReport", + "async": true, + "parameters": [ + { + "name": "property", + "type": "TYPE_STRING" + }, + { + "name": "dimensions", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "metrics", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "dimension_filter", + "type": ".google.analytics.data.v1beta.FilterExpression" + }, + { + "name": "metric_filter", + "type": ".google.analytics.data.v1beta.FilterExpression" + }, + { + "name": "limit", + "type": "TYPE_INT64" + }, + { + "name": "metric_aggregations", + "type": "TYPE_ENUM[]" + }, + { + "name": "order_bys", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "return_property_quota", + "type": "TYPE_BOOL" + }, + { + "name": "minute_ranges", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.analytics.data.v1beta.RunRealtimeReportResponse", + "client": { + "shortName": "BetaAnalyticsDataClient", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsDataClient" + }, + "method": { + "shortName": "RunRealtimeReport", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.RunRealtimeReport", + "service": { + "shortName": "BetaAnalyticsData", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData" + } + } + } + }, + { + "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_CheckCompatibility_async", + "title": "BetaAnalyticsData checkCompatibility Sample", + "origin": "API_DEFINITION", + "description": " This compatibility method lists dimensions and metrics that can be added to a report request and maintain compatibility. This method fails if the request's dimensions and metrics are incompatible. In Google Analytics, reports fail if they request incompatible dimensions and/or metrics; in that case, you will need to remove dimensions and/or metrics from the incompatible report until the report is compatible. The Realtime and Core reports have different compatibility rules. This method checks compatibility for Core reports.", + "canonical": true, + "file": "beta_analytics_data.check_compatibility.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CheckCompatibility", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.CheckCompatibility", + "async": true, + "parameters": [ + { + "name": "property", + "type": "TYPE_STRING" + }, + { + "name": "dimensions", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "metrics", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "dimension_filter", + "type": ".google.analytics.data.v1beta.FilterExpression" + }, + { + "name": "metric_filter", + "type": ".google.analytics.data.v1beta.FilterExpression" + }, + { + "name": "compatibility_filter", + "type": ".google.analytics.data.v1beta.Compatibility" + } + ], + "resultType": ".google.analytics.data.v1beta.CheckCompatibilityResponse", + "client": { + "shortName": "BetaAnalyticsDataClient", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsDataClient" + }, + "method": { + "shortName": "CheckCompatibility", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.CheckCompatibility", + "service": { + "shortName": "BetaAnalyticsData", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData" + } + } + } + } + ] +} diff --git a/owl-bot-staging/v1beta/src/index.ts b/owl-bot-staging/v1beta/src/index.ts new file mode 100644 index 000000000..03c54ab9b --- /dev/null +++ b/owl-bot-staging/v1beta/src/index.ts @@ -0,0 +1,25 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1beta from './v1beta'; +const BetaAnalyticsDataClient = v1beta.BetaAnalyticsDataClient; +type BetaAnalyticsDataClient = v1beta.BetaAnalyticsDataClient; +export {v1beta, BetaAnalyticsDataClient}; +export default {v1beta, BetaAnalyticsDataClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_client.ts b/owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_client.ts new file mode 100644 index 000000000..c05aac27b --- /dev/null +++ b/owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_client.ts @@ -0,0 +1,1067 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta/beta_analytics_data_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './beta_analytics_data_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Google Analytics reporting data service. + * @class + * @memberof v1beta + */ +export class BetaAnalyticsDataClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + betaAnalyticsDataStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BetaAnalyticsDataClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof BetaAnalyticsDataClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + metadataPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/metadata' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.analytics.data.v1beta.BetaAnalyticsData', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.betaAnalyticsDataStub) { + return this.betaAnalyticsDataStub; + } + + // Put together the "service stub" for + // google.analytics.data.v1beta.BetaAnalyticsData. + this.betaAnalyticsDataStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.analytics.data.v1beta.BetaAnalyticsData') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.analytics.data.v1beta.BetaAnalyticsData, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const betaAnalyticsDataStubMethods = + ['runReport', 'runPivotReport', 'batchRunReports', 'batchRunPivotReports', 'getMetadata', 'runRealtimeReport', 'checkCompatibility']; + for (const methodName of betaAnalyticsDataStubMethods) { + const callPromise = this.betaAnalyticsDataStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.betaAnalyticsDataStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'analyticsdata.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'analyticsdata.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/analytics', + 'https://www.googleapis.com/auth/analytics.readonly' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.property + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see [where to + * find your Property + * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * Within a batch request, this property should either be unspecified or + * consistent with the batch-level property. + * + * Example: properties/1234 + * @param {number[]} request.dimensions + * The dimensions requested and displayed. + * @param {number[]} request.metrics + * The metrics requested and displayed. + * @param {number[]} request.dateRanges + * Date ranges of data to read. If multiple date ranges are requested, each + * response row will contain a zero based date range index. If two date + * ranges overlap, the event data for the overlapping days is included in the + * response rows for both date ranges. In a cohort request, this `dateRanges` + * must be unspecified. + * @param {google.analytics.data.v1beta.FilterExpression} request.dimensionFilter + * Dimension filters allow you to ask for only specific dimension values in + * the report. To learn more, see [Fundamentals of Dimension + * Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + * for examples. Metrics cannot be used in this filter. + * @param {google.analytics.data.v1beta.FilterExpression} request.metricFilter + * The filter clause of metrics. Applied at post aggregation phase, similar to + * SQL having-clause. Dimensions cannot be used in this filter. + * @param {number} request.offset + * The row count of the start row. The first row is counted as row 0. + * + * When paging, the first request does not specify offset; or equivalently, + * sets offset to 0; the first request returns the first `limit` of rows. The + * second request sets offset to the `limit` of the first request; the second + * request returns the second `limit` of rows. + * + * To learn more about this pagination parameter, see + * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + * @param {number} request.limit + * The number of rows to return. If unspecified, 10,000 rows are returned. The + * API returns a maximum of 100,000 rows per request, no matter how many you + * ask for. `limit` must be positive. + * + * The API can also return fewer rows than the requested `limit`, if there + * aren't as many dimension values as the `limit`. For instance, there are + * fewer than 300 possible values for the dimension `country`, so when + * reporting on only `country`, you can't get more than 300 rows, even if you + * set `limit` to a higher value. + * + * To learn more about this pagination parameter, see + * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + * @param {number[]} request.metricAggregations + * Aggregation of metrics. Aggregated metric values will be shown in rows + * where the dimension_values are set to "RESERVED_(MetricAggregation)". + * @param {number[]} request.orderBys + * Specifies how rows are ordered in the response. + * @param {string} request.currencyCode + * A currency code in ISO4217 format, such as "AED", "USD", "JPY". + * If the field is empty, the report uses the property's default currency. + * @param {google.analytics.data.v1beta.CohortSpec} request.cohortSpec + * Cohort group associated with this request. If there is a cohort group + * in the request the 'cohort' dimension must be present. + * @param {boolean} request.keepEmptyRows + * If false or unspecified, each row with all metrics equal to 0 will not be + * returned. If true, these rows will be returned if they are not separately + * removed by a filter. + * @param {boolean} request.returnPropertyQuota + * Toggles whether to return the current state of this Analytics Property's + * quota. Quota is returned in [PropertyQuota](#PropertyQuota). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [RunReportResponse]{@link google.analytics.data.v1beta.RunReportResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/beta_analytics_data.run_report.js + * region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_RunReport_async + */ + runReport( + request?: protos.google.analytics.data.v1beta.IRunReportRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.data.v1beta.IRunReportResponse, + protos.google.analytics.data.v1beta.IRunReportRequest|undefined, {}|undefined + ]>; + runReport( + request: protos.google.analytics.data.v1beta.IRunReportRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.data.v1beta.IRunReportResponse, + protos.google.analytics.data.v1beta.IRunReportRequest|null|undefined, + {}|null|undefined>): void; + runReport( + request: protos.google.analytics.data.v1beta.IRunReportRequest, + callback: Callback< + protos.google.analytics.data.v1beta.IRunReportResponse, + protos.google.analytics.data.v1beta.IRunReportRequest|null|undefined, + {}|null|undefined>): void; + runReport( + request?: protos.google.analytics.data.v1beta.IRunReportRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.data.v1beta.IRunReportResponse, + protos.google.analytics.data.v1beta.IRunReportRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.data.v1beta.IRunReportResponse, + protos.google.analytics.data.v1beta.IRunReportRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.data.v1beta.IRunReportResponse, + protos.google.analytics.data.v1beta.IRunReportRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'property': request.property || '', + }); + this.initialize(); + return this.innerApiCalls.runReport(request, options, callback); + } +/** + * Returns a customized pivot report of your Google Analytics event data. + * Pivot reports are more advanced and expressive formats than regular + * reports. In a pivot report, dimensions are only visible if they are + * included in a pivot. Multiple pivots can be specified to further dissect + * your data. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.property + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see [where to + * find your Property + * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * Within a batch request, this property should either be unspecified or + * consistent with the batch-level property. + * + * Example: properties/1234 + * @param {number[]} request.dimensions + * The dimensions requested. All defined dimensions must be used by one of the + * following: dimension_expression, dimension_filter, pivots, order_bys. + * @param {number[]} request.metrics + * The metrics requested, at least one metric needs to be specified. All + * defined metrics must be used by one of the following: metric_expression, + * metric_filter, order_bys. + * @param {number[]} request.dateRanges + * The date range to retrieve event data for the report. If multiple date + * ranges are specified, event data from each date range is used in the + * report. A special dimension with field name "dateRange" can be included in + * a Pivot's field names; if included, the report compares between date + * ranges. In a cohort request, this `dateRanges` must be unspecified. + * @param {number[]} request.pivots + * Describes the visual format of the report's dimensions in columns or rows. + * The union of the fieldNames (dimension names) in all pivots must be a + * subset of dimension names defined in Dimensions. No two pivots can share a + * dimension. A dimension is only visible if it appears in a pivot. + * @param {google.analytics.data.v1beta.FilterExpression} request.dimensionFilter + * The filter clause of dimensions. Dimensions must be requested to be used in + * this filter. Metrics cannot be used in this filter. + * @param {google.analytics.data.v1beta.FilterExpression} request.metricFilter + * The filter clause of metrics. Applied at post aggregation phase, similar to + * SQL having-clause. Metrics must be requested to be used in this filter. + * Dimensions cannot be used in this filter. + * @param {string} request.currencyCode + * A currency code in ISO4217 format, such as "AED", "USD", "JPY". + * If the field is empty, the report uses the property's default currency. + * @param {google.analytics.data.v1beta.CohortSpec} request.cohortSpec + * Cohort group associated with this request. If there is a cohort group + * in the request the 'cohort' dimension must be present. + * @param {boolean} request.keepEmptyRows + * If false or unspecified, each row with all metrics equal to 0 will not be + * returned. If true, these rows will be returned if they are not separately + * removed by a filter. + * @param {boolean} request.returnPropertyQuota + * Toggles whether to return the current state of this Analytics Property's + * quota. Quota is returned in [PropertyQuota](#PropertyQuota). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [RunPivotReportResponse]{@link google.analytics.data.v1beta.RunPivotReportResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/beta_analytics_data.run_pivot_report.js + * region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_RunPivotReport_async + */ + runPivotReport( + request?: protos.google.analytics.data.v1beta.IRunPivotReportRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.data.v1beta.IRunPivotReportResponse, + protos.google.analytics.data.v1beta.IRunPivotReportRequest|undefined, {}|undefined + ]>; + runPivotReport( + request: protos.google.analytics.data.v1beta.IRunPivotReportRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.data.v1beta.IRunPivotReportResponse, + protos.google.analytics.data.v1beta.IRunPivotReportRequest|null|undefined, + {}|null|undefined>): void; + runPivotReport( + request: protos.google.analytics.data.v1beta.IRunPivotReportRequest, + callback: Callback< + protos.google.analytics.data.v1beta.IRunPivotReportResponse, + protos.google.analytics.data.v1beta.IRunPivotReportRequest|null|undefined, + {}|null|undefined>): void; + runPivotReport( + request?: protos.google.analytics.data.v1beta.IRunPivotReportRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.data.v1beta.IRunPivotReportResponse, + protos.google.analytics.data.v1beta.IRunPivotReportRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.data.v1beta.IRunPivotReportResponse, + protos.google.analytics.data.v1beta.IRunPivotReportRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.data.v1beta.IRunPivotReportResponse, + protos.google.analytics.data.v1beta.IRunPivotReportRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'property': request.property || '', + }); + this.initialize(); + return this.innerApiCalls.runPivotReport(request, options, callback); + } +/** + * Returns multiple reports in a batch. All reports must be for the same + * GA4 Property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.property + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see [where to + * find your Property + * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * This property must be specified for the batch. The property within + * RunReportRequest may either be unspecified or consistent with this + * property. + * + * Example: properties/1234 + * @param {number[]} request.requests + * Individual requests. Each request has a separate report response. Each + * batch request is allowed up to 5 requests. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchRunReportsResponse]{@link google.analytics.data.v1beta.BatchRunReportsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/beta_analytics_data.batch_run_reports.js + * region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunReports_async + */ + batchRunReports( + request?: protos.google.analytics.data.v1beta.IBatchRunReportsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.data.v1beta.IBatchRunReportsResponse, + protos.google.analytics.data.v1beta.IBatchRunReportsRequest|undefined, {}|undefined + ]>; + batchRunReports( + request: protos.google.analytics.data.v1beta.IBatchRunReportsRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.data.v1beta.IBatchRunReportsResponse, + protos.google.analytics.data.v1beta.IBatchRunReportsRequest|null|undefined, + {}|null|undefined>): void; + batchRunReports( + request: protos.google.analytics.data.v1beta.IBatchRunReportsRequest, + callback: Callback< + protos.google.analytics.data.v1beta.IBatchRunReportsResponse, + protos.google.analytics.data.v1beta.IBatchRunReportsRequest|null|undefined, + {}|null|undefined>): void; + batchRunReports( + request?: protos.google.analytics.data.v1beta.IBatchRunReportsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.data.v1beta.IBatchRunReportsResponse, + protos.google.analytics.data.v1beta.IBatchRunReportsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.data.v1beta.IBatchRunReportsResponse, + protos.google.analytics.data.v1beta.IBatchRunReportsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.data.v1beta.IBatchRunReportsResponse, + protos.google.analytics.data.v1beta.IBatchRunReportsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'property': request.property || '', + }); + this.initialize(); + return this.innerApiCalls.batchRunReports(request, options, callback); + } +/** + * Returns multiple pivot reports in a batch. All reports must be for the same + * GA4 Property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.property + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see [where to + * find your Property + * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * This property must be specified for the batch. The property within + * RunPivotReportRequest may either be unspecified or consistent with this + * property. + * + * Example: properties/1234 + * @param {number[]} request.requests + * Individual requests. Each request has a separate pivot report response. + * Each batch request is allowed up to 5 requests. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchRunPivotReportsResponse]{@link google.analytics.data.v1beta.BatchRunPivotReportsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js + * region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunPivotReports_async + */ + batchRunPivotReports( + request?: protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse, + protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest|undefined, {}|undefined + ]>; + batchRunPivotReports( + request: protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse, + protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest|null|undefined, + {}|null|undefined>): void; + batchRunPivotReports( + request: protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest, + callback: Callback< + protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse, + protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest|null|undefined, + {}|null|undefined>): void; + batchRunPivotReports( + request?: protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse, + protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse, + protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse, + protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'property': request.property || '', + }); + this.initialize(); + return this.innerApiCalls.batchRunPivotReports(request, options, callback); + } +/** + * Returns metadata for dimensions and metrics available in reporting methods. + * Used to explore the dimensions and metrics. In this method, a Google + * Analytics GA4 Property Identifier is specified in the request, and + * the metadata response includes Custom dimensions and metrics as well as + * Universal metadata. + * + * For example if a custom metric with parameter name `levels_unlocked` is + * registered to a property, the Metadata response will contain + * `customEvent:levels_unlocked`. Universal metadata are dimensions and + * metrics applicable to any property such as `country` and `totalUsers`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.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 + * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * + * Example: properties/1234/metadata + * + * Set the Property ID to 0 for dimensions and metrics common to all + * properties. In this special mode, this method will not return custom + * dimensions and metrics. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Metadata]{@link google.analytics.data.v1beta.Metadata}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/beta_analytics_data.get_metadata.js + * region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_GetMetadata_async + */ + getMetadata( + request?: protos.google.analytics.data.v1beta.IGetMetadataRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.data.v1beta.IMetadata, + protos.google.analytics.data.v1beta.IGetMetadataRequest|undefined, {}|undefined + ]>; + getMetadata( + request: protos.google.analytics.data.v1beta.IGetMetadataRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.data.v1beta.IMetadata, + protos.google.analytics.data.v1beta.IGetMetadataRequest|null|undefined, + {}|null|undefined>): void; + getMetadata( + request: protos.google.analytics.data.v1beta.IGetMetadataRequest, + callback: Callback< + protos.google.analytics.data.v1beta.IMetadata, + protos.google.analytics.data.v1beta.IGetMetadataRequest|null|undefined, + {}|null|undefined>): void; + getMetadata( + request?: protos.google.analytics.data.v1beta.IGetMetadataRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.data.v1beta.IMetadata, + protos.google.analytics.data.v1beta.IGetMetadataRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.data.v1beta.IMetadata, + protos.google.analytics.data.v1beta.IGetMetadataRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.data.v1beta.IMetadata, + protos.google.analytics.data.v1beta.IGetMetadataRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getMetadata(request, options, callback); + } +/** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.property + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see [where to + * find your Property + * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * + * Example: properties/1234 + * @param {number[]} request.dimensions + * The dimensions requested and displayed. + * @param {number[]} request.metrics + * The metrics requested and displayed. + * @param {google.analytics.data.v1beta.FilterExpression} request.dimensionFilter + * The filter clause of dimensions. Dimensions must be requested to be used in + * this filter. Metrics cannot be used in this filter. + * @param {google.analytics.data.v1beta.FilterExpression} request.metricFilter + * The filter clause of metrics. Applied at post aggregation phase, similar to + * SQL having-clause. Metrics must be requested to be used in this filter. + * Dimensions cannot be used in this filter. + * @param {number} request.limit + * The number of rows to return. If unspecified, 10,000 rows are returned. The + * API returns a maximum of 100,000 rows per request, no matter how many you + * ask for. `limit` must be positive. + * + * The API can also return fewer rows than the requested `limit`, if there + * aren't as many dimension values as the `limit`. For instance, there are + * fewer than 300 possible values for the dimension `country`, so when + * reporting on only `country`, you can't get more than 300 rows, even if you + * set `limit` to a higher value. + * @param {number[]} request.metricAggregations + * Aggregation of metrics. Aggregated metric values will be shown in rows + * where the dimension_values are set to "RESERVED_(MetricAggregation)". + * @param {number[]} request.orderBys + * Specifies how rows are ordered in the response. + * @param {boolean} request.returnPropertyQuota + * Toggles whether to return the current state of this Analytics Property's + * Realtime quota. Quota is returned in [PropertyQuota](#PropertyQuota). + * @param {number[]} request.minuteRanges + * The minute ranges of event data to read. If unspecified, one minute range + * for the last 30 minutes will be used. If multiple minute ranges are + * requested, each response row will contain a zero based minute range index. + * If two minute ranges overlap, the event data for the overlapping minutes is + * included in the response rows for both minute ranges. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [RunRealtimeReportResponse]{@link google.analytics.data.v1beta.RunRealtimeReportResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/beta_analytics_data.run_realtime_report.js + * region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_RunRealtimeReport_async + */ + runRealtimeReport( + request?: protos.google.analytics.data.v1beta.IRunRealtimeReportRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.data.v1beta.IRunRealtimeReportResponse, + protos.google.analytics.data.v1beta.IRunRealtimeReportRequest|undefined, {}|undefined + ]>; + runRealtimeReport( + request: protos.google.analytics.data.v1beta.IRunRealtimeReportRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.data.v1beta.IRunRealtimeReportResponse, + protos.google.analytics.data.v1beta.IRunRealtimeReportRequest|null|undefined, + {}|null|undefined>): void; + runRealtimeReport( + request: protos.google.analytics.data.v1beta.IRunRealtimeReportRequest, + callback: Callback< + protos.google.analytics.data.v1beta.IRunRealtimeReportResponse, + protos.google.analytics.data.v1beta.IRunRealtimeReportRequest|null|undefined, + {}|null|undefined>): void; + runRealtimeReport( + request?: protos.google.analytics.data.v1beta.IRunRealtimeReportRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.data.v1beta.IRunRealtimeReportResponse, + protos.google.analytics.data.v1beta.IRunRealtimeReportRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.data.v1beta.IRunRealtimeReportResponse, + protos.google.analytics.data.v1beta.IRunRealtimeReportRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.data.v1beta.IRunRealtimeReportResponse, + protos.google.analytics.data.v1beta.IRunRealtimeReportRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'property': request.property || '', + }); + this.initialize(); + return this.innerApiCalls.runRealtimeReport(request, options, callback); + } +/** + * This compatibility method lists dimensions and metrics that can be added to + * a report request and maintain compatibility. This method fails if the + * request's dimensions and metrics are incompatible. + * + * In Google Analytics, reports fail if they request incompatible dimensions + * and/or metrics; in that case, you will need to remove dimensions and/or + * metrics from the incompatible report until the report is compatible. + * + * The Realtime and Core reports have different compatibility rules. This + * method checks compatibility for Core reports. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.property + * A Google Analytics GA4 property identifier whose events are tracked. To + * learn more, see [where to find your Property + * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * `property` should be the same value as in your `runReport` request. + * + * Example: properties/1234 + * + * Set the Property ID to 0 for compatibility checking on dimensions and + * metrics common to all properties. In this special mode, this method will + * not return custom dimensions and metrics. + * @param {number[]} request.dimensions + * The dimensions in this report. `dimensions` should be the same value as in + * your `runReport` request. + * @param {number[]} request.metrics + * The metrics in this report. `metrics` should be the same value as in your + * `runReport` request. + * @param {google.analytics.data.v1beta.FilterExpression} request.dimensionFilter + * The filter clause of dimensions. `dimensionFilter` should be the same value + * as in your `runReport` request. + * @param {google.analytics.data.v1beta.FilterExpression} request.metricFilter + * The filter clause of metrics. `metricFilter` should be the same value as in + * your `runReport` request + * @param {google.analytics.data.v1beta.Compatibility} request.compatibilityFilter + * Filters the dimensions and metrics in the response to just this + * compatibility. Commonly used as `”compatibilityFilter”: “COMPATIBLE”` + * to only return compatible dimensions & metrics. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CheckCompatibilityResponse]{@link google.analytics.data.v1beta.CheckCompatibilityResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/beta_analytics_data.check_compatibility.js + * region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_CheckCompatibility_async + */ + checkCompatibility( + request?: protos.google.analytics.data.v1beta.ICheckCompatibilityRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.data.v1beta.ICheckCompatibilityResponse, + protos.google.analytics.data.v1beta.ICheckCompatibilityRequest|undefined, {}|undefined + ]>; + checkCompatibility( + request: protos.google.analytics.data.v1beta.ICheckCompatibilityRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.data.v1beta.ICheckCompatibilityResponse, + protos.google.analytics.data.v1beta.ICheckCompatibilityRequest|null|undefined, + {}|null|undefined>): void; + checkCompatibility( + request: protos.google.analytics.data.v1beta.ICheckCompatibilityRequest, + callback: Callback< + protos.google.analytics.data.v1beta.ICheckCompatibilityResponse, + protos.google.analytics.data.v1beta.ICheckCompatibilityRequest|null|undefined, + {}|null|undefined>): void; + checkCompatibility( + request?: protos.google.analytics.data.v1beta.ICheckCompatibilityRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.data.v1beta.ICheckCompatibilityResponse, + protos.google.analytics.data.v1beta.ICheckCompatibilityRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.data.v1beta.ICheckCompatibilityResponse, + protos.google.analytics.data.v1beta.ICheckCompatibilityRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.data.v1beta.ICheckCompatibilityResponse, + protos.google.analytics.data.v1beta.ICheckCompatibilityRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'property': request.property || '', + }); + this.initialize(); + return this.innerApiCalls.checkCompatibility(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified metadata resource name string. + * + * @param {string} property + * @returns {string} Resource name string. + */ + metadataPath(property:string) { + return this.pathTemplates.metadataPathTemplate.render({ + property: property, + }); + } + + /** + * Parse the property from Metadata resource. + * + * @param {string} metadataName + * A fully-qualified path representing Metadata resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromMetadataName(metadataName: string) { + return this.pathTemplates.metadataPathTemplate.match(metadataName).property; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.betaAnalyticsDataStub && !this._terminated) { + return this.betaAnalyticsDataStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_client_config.json b/owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_client_config.json new file mode 100644 index 000000000..6cea5f968 --- /dev/null +++ b/owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_client_config.json @@ -0,0 +1,73 @@ +{ + "interfaces": { + "google.analytics.data.v1beta.BetaAnalyticsData": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unknown": [ + "UNKNOWN" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "RunReport": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RunPivotReport": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchRunReports": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchRunPivotReports": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetMetadata": { + "timeout_millis": 60000, + "retry_codes_name": "unknown", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "RunRealtimeReport": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CheckCompatibility": { + "timeout_millis": 60000, + "retry_codes_name": "unknown", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + } + } + } + } +} diff --git a/owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_proto_list.json b/owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_proto_list.json new file mode 100644 index 000000000..89471a423 --- /dev/null +++ b/owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/analytics/data/v1beta/analytics_data_api.proto", + "../../protos/google/analytics/data/v1beta/data.proto" +] diff --git a/owl-bot-staging/v1beta/src/v1beta/gapic_metadata.json b/owl-bot-staging/v1beta/src/v1beta/gapic_metadata.json new file mode 100644 index 000000000..3ec307b6a --- /dev/null +++ b/owl-bot-staging/v1beta/src/v1beta/gapic_metadata.json @@ -0,0 +1,93 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.analytics.data.v1beta", + "libraryPackage": "@google-analytics/data", + "services": { + "BetaAnalyticsData": { + "clients": { + "grpc": { + "libraryClient": "BetaAnalyticsDataClient", + "rpcs": { + "RunReport": { + "methods": [ + "runReport" + ] + }, + "RunPivotReport": { + "methods": [ + "runPivotReport" + ] + }, + "BatchRunReports": { + "methods": [ + "batchRunReports" + ] + }, + "BatchRunPivotReports": { + "methods": [ + "batchRunPivotReports" + ] + }, + "GetMetadata": { + "methods": [ + "getMetadata" + ] + }, + "RunRealtimeReport": { + "methods": [ + "runRealtimeReport" + ] + }, + "CheckCompatibility": { + "methods": [ + "checkCompatibility" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BetaAnalyticsDataClient", + "rpcs": { + "RunReport": { + "methods": [ + "runReport" + ] + }, + "RunPivotReport": { + "methods": [ + "runPivotReport" + ] + }, + "BatchRunReports": { + "methods": [ + "batchRunReports" + ] + }, + "BatchRunPivotReports": { + "methods": [ + "batchRunPivotReports" + ] + }, + "GetMetadata": { + "methods": [ + "getMetadata" + ] + }, + "RunRealtimeReport": { + "methods": [ + "runRealtimeReport" + ] + }, + "CheckCompatibility": { + "methods": [ + "checkCompatibility" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/v1beta/src/v1beta/index.ts b/owl-bot-staging/v1beta/src/v1beta/index.ts new file mode 100644 index 000000000..36af99e4a --- /dev/null +++ b/owl-bot-staging/v1beta/src/v1beta/index.ts @@ -0,0 +1,19 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {BetaAnalyticsDataClient} from './beta_analytics_data_client'; diff --git a/owl-bot-staging/v1beta/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v1beta/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000..75c874a34 --- /dev/null +++ b/owl-bot-staging/v1beta/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const data = require('@google-analytics/data'); + +function main() { + const betaAnalyticsDataClient = new data.BetaAnalyticsDataClient(); +} + +main(); diff --git a/owl-bot-staging/v1beta/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v1beta/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000..f052efcd6 --- /dev/null +++ b/owl-bot-staging/v1beta/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {BetaAnalyticsDataClient} from '@google-analytics/data'; + +// check that the client class type name can be used +function doStuffWithBetaAnalyticsDataClient(client: BetaAnalyticsDataClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const betaAnalyticsDataClient = new BetaAnalyticsDataClient(); + doStuffWithBetaAnalyticsDataClient(betaAnalyticsDataClient); +} + +main(); diff --git a/owl-bot-staging/v1beta/system-test/install.ts b/owl-bot-staging/v1beta/system-test/install.ts new file mode 100644 index 000000000..8ec452229 --- /dev/null +++ b/owl-bot-staging/v1beta/system-test/install.ts @@ -0,0 +1,49 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import { packNTest } from 'pack-n-play'; +import { readFileSync } from 'fs'; +import { describe, it } from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/v1beta/test/gapic_beta_analytics_data_v1beta.ts b/owl-bot-staging/v1beta/test/gapic_beta_analytics_data_v1beta.ts new file mode 100644 index 000000000..002375486 --- /dev/null +++ b/owl-bot-staging/v1beta/test/gapic_beta_analytics_data_v1beta.ts @@ -0,0 +1,847 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as betaanalyticsdataModule from '../src'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +describe('v1beta.BetaAnalyticsDataClient', () => { + it('has servicePath', () => { + const servicePath = betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.betaAnalyticsDataStub, undefined); + await client.initialize(); + assert(client.betaAnalyticsDataStub); + }); + + it('has close method for the initialized client', done => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.betaAnalyticsDataStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.betaAnalyticsDataStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('runReport', () => { + it('invokes runReport without error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunReportRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.RunReportResponse()); + client.innerApiCalls.runReport = stubSimpleCall(expectedResponse); + const [response] = await client.runReport(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.runReport as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes runReport without error using callback', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunReportRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.RunReportResponse()); + client.innerApiCalls.runReport = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runReport( + request, + (err?: Error|null, result?: protos.google.analytics.data.v1beta.IRunReportResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.runReport as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes runReport with error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunReportRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runReport = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.runReport(request), expectedError); + assert((client.innerApiCalls.runReport as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes runReport with closed client', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunReportRequest()); + request.property = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.runReport(request), expectedError); + }); + }); + + describe('runPivotReport', () => { + it('invokes runPivotReport without error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunPivotReportRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.RunPivotReportResponse()); + client.innerApiCalls.runPivotReport = stubSimpleCall(expectedResponse); + const [response] = await client.runPivotReport(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.runPivotReport as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes runPivotReport without error using callback', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunPivotReportRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.RunPivotReportResponse()); + client.innerApiCalls.runPivotReport = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runPivotReport( + request, + (err?: Error|null, result?: protos.google.analytics.data.v1beta.IRunPivotReportResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.runPivotReport as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes runPivotReport with error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunPivotReportRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runPivotReport = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.runPivotReport(request), expectedError); + assert((client.innerApiCalls.runPivotReport as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes runPivotReport with closed client', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunPivotReportRequest()); + request.property = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.runPivotReport(request), expectedError); + }); + }); + + describe('batchRunReports', () => { + it('invokes batchRunReports without error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunReportsRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunReportsResponse()); + client.innerApiCalls.batchRunReports = stubSimpleCall(expectedResponse); + const [response] = await client.batchRunReports(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchRunReports as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchRunReports without error using callback', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunReportsRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunReportsResponse()); + client.innerApiCalls.batchRunReports = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchRunReports( + request, + (err?: Error|null, result?: protos.google.analytics.data.v1beta.IBatchRunReportsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchRunReports as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes batchRunReports with error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunReportsRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchRunReports = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchRunReports(request), expectedError); + assert((client.innerApiCalls.batchRunReports as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchRunReports with closed client', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunReportsRequest()); + request.property = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchRunReports(request), expectedError); + }); + }); + + describe('batchRunPivotReports', () => { + it('invokes batchRunPivotReports without error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunPivotReportsRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunPivotReportsResponse()); + client.innerApiCalls.batchRunPivotReports = stubSimpleCall(expectedResponse); + const [response] = await client.batchRunPivotReports(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchRunPivotReports as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchRunPivotReports without error using callback', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunPivotReportsRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunPivotReportsResponse()); + client.innerApiCalls.batchRunPivotReports = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchRunPivotReports( + request, + (err?: Error|null, result?: protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchRunPivotReports as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes batchRunPivotReports with error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunPivotReportsRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchRunPivotReports = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchRunPivotReports(request), expectedError); + assert((client.innerApiCalls.batchRunPivotReports as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchRunPivotReports with closed client', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunPivotReportsRequest()); + request.property = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchRunPivotReports(request), expectedError); + }); + }); + + describe('getMetadata', () => { + it('invokes getMetadata without error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.GetMetadataRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.Metadata()); + client.innerApiCalls.getMetadata = stubSimpleCall(expectedResponse); + const [response] = await client.getMetadata(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getMetadata as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getMetadata without error using callback', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.GetMetadataRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.Metadata()); + client.innerApiCalls.getMetadata = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMetadata( + request, + (err?: Error|null, result?: protos.google.analytics.data.v1beta.IMetadata|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getMetadata as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getMetadata with error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.GetMetadataRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getMetadata = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMetadata(request), expectedError); + assert((client.innerApiCalls.getMetadata as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getMetadata with closed client', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.GetMetadataRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getMetadata(request), expectedError); + }); + }); + + describe('runRealtimeReport', () => { + it('invokes runRealtimeReport without error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunRealtimeReportRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.RunRealtimeReportResponse()); + client.innerApiCalls.runRealtimeReport = stubSimpleCall(expectedResponse); + const [response] = await client.runRealtimeReport(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.runRealtimeReport as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes runRealtimeReport without error using callback', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunRealtimeReportRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.RunRealtimeReportResponse()); + client.innerApiCalls.runRealtimeReport = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runRealtimeReport( + request, + (err?: Error|null, result?: protos.google.analytics.data.v1beta.IRunRealtimeReportResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.runRealtimeReport as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes runRealtimeReport with error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunRealtimeReportRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runRealtimeReport = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.runRealtimeReport(request), expectedError); + assert((client.innerApiCalls.runRealtimeReport as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes runRealtimeReport with closed client', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunRealtimeReportRequest()); + request.property = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.runRealtimeReport(request), expectedError); + }); + }); + + describe('checkCompatibility', () => { + it('invokes checkCompatibility without error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.CheckCompatibilityRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.CheckCompatibilityResponse()); + client.innerApiCalls.checkCompatibility = stubSimpleCall(expectedResponse); + const [response] = await client.checkCompatibility(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.checkCompatibility as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCompatibility without error using callback', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.CheckCompatibilityRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.CheckCompatibilityResponse()); + client.innerApiCalls.checkCompatibility = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.checkCompatibility( + request, + (err?: Error|null, result?: protos.google.analytics.data.v1beta.ICheckCompatibilityResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.checkCompatibility as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes checkCompatibility with error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.CheckCompatibilityRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.checkCompatibility = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCompatibility(request), expectedError); + assert((client.innerApiCalls.checkCompatibility as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCompatibility with closed client', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.data.v1beta.CheckCompatibilityRequest()); + request.property = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.checkCompatibility(request), expectedError); + }); + }); + + describe('Path templates', () => { + + describe('metadata', () => { + const fakePath = "/rendered/path/metadata"; + const expectedParameters = { + property: "propertyValue", + }; + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataPath', () => { + const result = client.metadataPath("propertyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromMetadataName', () => { + const result = client.matchPropertyFromMetadataName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.metadataPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1beta/tsconfig.json b/owl-bot-staging/v1beta/tsconfig.json new file mode 100644 index 000000000..c78f1c884 --- /dev/null +++ b/owl-bot-staging/v1beta/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/v1beta/webpack.config.js b/owl-bot-staging/v1beta/webpack.config.js new file mode 100644 index 000000000..f830d3fe1 --- /dev/null +++ b/owl-bot-staging/v1beta/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 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. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'BetaAnalyticsData', + filename: './beta-analytics-data.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From c5f81df59a0e1444897d1a7ff5530b6b882fa4a1 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 15 Jun 2022 21:49:26 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- owl-bot-staging/v1alpha/.eslintignore | 7 - owl-bot-staging/v1alpha/.eslintrc.json | 3 - owl-bot-staging/v1alpha/.gitignore | 14 - owl-bot-staging/v1alpha/.jsdoc.js | 55 - owl-bot-staging/v1alpha/.mocharc.js | 33 - owl-bot-staging/v1alpha/.prettierrc.js | 22 - owl-bot-staging/v1alpha/README.md | 1 - .../v1alpha/linkinator.config.json | 16 - owl-bot-staging/v1alpha/package.json | 64 - .../data/v1alpha/analytics_data_api.proto | 169 --- .../google/analytics/data/v1alpha/data.proto | 1233 ----------------- .../alpha_analytics_data.run_funnel_report.js | 128 -- ...etadata.google.analytics.data.v1alpha.json | 91 -- owl-bot-staging/v1alpha/src/index.ts | 25 - .../v1alpha/alpha_analytics_data_client.ts | 432 ------ .../alpha_analytics_data_client_config.json | 31 - .../alpha_analytics_data_proto_list.json | 4 - .../v1alpha/src/v1alpha/gapic_metadata.json | 33 - owl-bot-staging/v1alpha/src/v1alpha/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../v1alpha/system-test/install.ts | 49 - .../gapic_alpha_analytics_data_v1alpha.ts | 232 ---- owl-bot-staging/v1alpha/tsconfig.json | 19 - owl-bot-staging/v1alpha/webpack.config.js | 64 - owl-bot-staging/v1beta/.eslintignore | 7 - owl-bot-staging/v1beta/.eslintrc.json | 3 - owl-bot-staging/v1beta/.gitignore | 14 - owl-bot-staging/v1beta/.jsdoc.js | 55 - owl-bot-staging/v1beta/.mocharc.js | 33 - owl-bot-staging/v1beta/.prettierrc.js | 22 - owl-bot-staging/v1beta/README.md | 1 - owl-bot-staging/v1beta/linkinator.config.json | 16 - owl-bot-staging/v1beta/package.json | 64 - .../data/v1beta/analytics_data_api.proto | 620 --------- .../google/analytics/data/v1beta/data.proto | 959 ------------- ..._analytics_data.batch_run_pivot_reports.js | 69 - .../beta_analytics_data.batch_run_reports.js | 69 - ...beta_analytics_data.check_compatibility.js | 90 -- .../beta_analytics_data.get_metadata.js | 66 - .../beta_analytics_data.run_pivot_report.js | 121 -- ...beta_analytics_data.run_realtime_report.js | 113 -- .../v1beta/beta_analytics_data.run_report.js | 144 -- ...metadata.google.analytics.data.v1beta.json | 451 ------ owl-bot-staging/v1beta/src/index.ts | 25 - .../src/v1beta/beta_analytics_data_client.ts | 1067 -------------- .../beta_analytics_data_client_config.json | 73 - .../beta_analytics_data_proto_list.json | 4 - .../v1beta/src/v1beta/gapic_metadata.json | 93 -- owl-bot-staging/v1beta/src/v1beta/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - owl-bot-staging/v1beta/system-test/install.ts | 49 - .../test/gapic_beta_analytics_data_v1beta.ts | 847 ----------- owl-bot-staging/v1beta/tsconfig.json | 19 - owl-bot-staging/v1beta/webpack.config.js | 64 - .../data/v1alpha/analytics_data_api.proto | 5 +- .../google/analytics/data/v1alpha/data.proto | 11 +- protos/protos.d.ts | 90 +- protos/protos.js | 188 +-- protos/protos.json | 8 +- .../alpha_analytics_data.run_funnel_report.js | 4 +- ...etadata.google.analytics.data.v1alpha.json | 2 +- src/v1alpha/alpha_analytics_data_client.ts | 5 +- 64 files changed, 162 insertions(+), 8190 deletions(-) delete mode 100644 owl-bot-staging/v1alpha/.eslintignore delete mode 100644 owl-bot-staging/v1alpha/.eslintrc.json delete mode 100644 owl-bot-staging/v1alpha/.gitignore delete mode 100644 owl-bot-staging/v1alpha/.jsdoc.js delete mode 100644 owl-bot-staging/v1alpha/.mocharc.js delete mode 100644 owl-bot-staging/v1alpha/.prettierrc.js delete mode 100644 owl-bot-staging/v1alpha/README.md delete mode 100644 owl-bot-staging/v1alpha/linkinator.config.json delete mode 100644 owl-bot-staging/v1alpha/package.json delete mode 100644 owl-bot-staging/v1alpha/protos/google/analytics/data/v1alpha/analytics_data_api.proto delete mode 100644 owl-bot-staging/v1alpha/protos/google/analytics/data/v1alpha/data.proto delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.data.v1alpha.json delete mode 100644 owl-bot-staging/v1alpha/src/index.ts delete mode 100644 owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_client.ts delete mode 100644 owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_client_config.json delete mode 100644 owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_proto_list.json delete mode 100644 owl-bot-staging/v1alpha/src/v1alpha/gapic_metadata.json delete mode 100644 owl-bot-staging/v1alpha/src/v1alpha/index.ts delete mode 100644 owl-bot-staging/v1alpha/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/v1alpha/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/v1alpha/system-test/install.ts delete mode 100644 owl-bot-staging/v1alpha/test/gapic_alpha_analytics_data_v1alpha.ts delete mode 100644 owl-bot-staging/v1alpha/tsconfig.json delete mode 100644 owl-bot-staging/v1alpha/webpack.config.js delete mode 100644 owl-bot-staging/v1beta/.eslintignore delete mode 100644 owl-bot-staging/v1beta/.eslintrc.json delete mode 100644 owl-bot-staging/v1beta/.gitignore delete mode 100644 owl-bot-staging/v1beta/.jsdoc.js delete mode 100644 owl-bot-staging/v1beta/.mocharc.js delete mode 100644 owl-bot-staging/v1beta/.prettierrc.js delete mode 100644 owl-bot-staging/v1beta/README.md delete mode 100644 owl-bot-staging/v1beta/linkinator.config.json delete mode 100644 owl-bot-staging/v1beta/package.json delete mode 100644 owl-bot-staging/v1beta/protos/google/analytics/data/v1beta/analytics_data_api.proto delete mode 100644 owl-bot-staging/v1beta/protos/google/analytics/data/v1beta/data.proto delete mode 100644 owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js delete mode 100644 owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.batch_run_reports.js delete mode 100644 owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.check_compatibility.js delete mode 100644 owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.get_metadata.js delete mode 100644 owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_pivot_report.js delete mode 100644 owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_realtime_report.js delete mode 100644 owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_report.js delete mode 100644 owl-bot-staging/v1beta/samples/generated/v1beta/snippet_metadata.google.analytics.data.v1beta.json delete mode 100644 owl-bot-staging/v1beta/src/index.ts delete mode 100644 owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_client.ts delete mode 100644 owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_client_config.json delete mode 100644 owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_proto_list.json delete mode 100644 owl-bot-staging/v1beta/src/v1beta/gapic_metadata.json delete mode 100644 owl-bot-staging/v1beta/src/v1beta/index.ts delete mode 100644 owl-bot-staging/v1beta/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/v1beta/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/v1beta/system-test/install.ts delete mode 100644 owl-bot-staging/v1beta/test/gapic_beta_analytics_data_v1beta.ts delete mode 100644 owl-bot-staging/v1beta/tsconfig.json delete mode 100644 owl-bot-staging/v1beta/webpack.config.js diff --git a/owl-bot-staging/v1alpha/.eslintignore b/owl-bot-staging/v1alpha/.eslintignore deleted file mode 100644 index cfc348ec4..000000000 --- a/owl-bot-staging/v1alpha/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/v1alpha/.eslintrc.json b/owl-bot-staging/v1alpha/.eslintrc.json deleted file mode 100644 index 782153495..000000000 --- a/owl-bot-staging/v1alpha/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/v1alpha/.gitignore b/owl-bot-staging/v1alpha/.gitignore deleted file mode 100644 index 5d32b2378..000000000 --- a/owl-bot-staging/v1alpha/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -.coverage -coverage -.nyc_output -docs/ -out/ -build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/v1alpha/.jsdoc.js b/owl-bot-staging/v1alpha/.jsdoc.js deleted file mode 100644 index 51555adbf..000000000 --- a/owl-bot-staging/v1alpha/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2022 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/data', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/v1alpha/.mocharc.js b/owl-bot-staging/v1alpha/.mocharc.js deleted file mode 100644 index 481c522b0..000000000 --- a/owl-bot-staging/v1alpha/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/v1alpha/.prettierrc.js b/owl-bot-staging/v1alpha/.prettierrc.js deleted file mode 100644 index 494e14786..000000000 --- a/owl-bot-staging/v1alpha/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/v1alpha/README.md b/owl-bot-staging/v1alpha/README.md deleted file mode 100644 index 61b6042f8..000000000 --- a/owl-bot-staging/v1alpha/README.md +++ /dev/null @@ -1 +0,0 @@ -Data: Nodejs Client diff --git a/owl-bot-staging/v1alpha/linkinator.config.json b/owl-bot-staging/v1alpha/linkinator.config.json deleted file mode 100644 index befd23c86..000000000 --- a/owl-bot-staging/v1alpha/linkinator.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io", - "https://console.cloud.google.com/cloudshell", - "https://support.google.com" - ], - "silent": true, - "concurrency": 5, - "retry": true, - "retryErrors": true, - "retryErrorsCount": 5, - "retryErrorsJitter": 3000 -} diff --git a/owl-bot-staging/v1alpha/package.json b/owl-bot-staging/v1alpha/package.json deleted file mode 100644 index 61845d2ce..000000000 --- a/owl-bot-staging/v1alpha/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-cloud/data", - "version": "0.1.0", - "description": "Data client for Node.js", - "repository": "googleapis/nodejs-data", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google data", - "data", - "alpha analytics data" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^2.29.4" - }, - "devDependencies": { - "@types/mocha": "^9.1.0", - "@types/node": "^16.0.0", - "@types/sinon": "^10.0.8", - "c8": "^7.11.0", - "gts": "^3.1.0", - "jsdoc": "^3.6.7", - "jsdoc-fresh": "^1.1.1", - "jsdoc-region-tag": "^1.3.1", - "linkinator": "^3.0.0", - "mocha": "^9.1.4", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^13.0.0", - "ts-loader": "^9.2.6", - "typescript": "^4.5.5", - "webpack": "^5.67.0", - "webpack-cli": "^4.9.1" - }, - "engines": { - "node": ">=v10.24.0" - } -} diff --git a/owl-bot-staging/v1alpha/protos/google/analytics/data/v1alpha/analytics_data_api.proto b/owl-bot-staging/v1alpha/protos/google/analytics/data/v1alpha/analytics_data_api.proto deleted file mode 100644 index f86cf8dbd..000000000 --- a/owl-bot-staging/v1alpha/protos/google/analytics/data/v1alpha/analytics_data_api.proto +++ /dev/null @@ -1,169 +0,0 @@ -// 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 -// -// 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. - -syntax = "proto3"; - -package google.analytics.data.v1alpha; - -import "google/analytics/data/v1alpha/data.proto"; -import "google/api/annotations.proto"; -import "google/api/client.proto"; - -option go_package = "google.golang.org/genproto/googleapis/analytics/data/v1alpha;data"; -option java_multiple_files = true; -option java_outer_classname = "AnalyticsDataApiProto"; -option java_package = "com.google.analytics.data.v1alpha"; - -// Google Analytics reporting data service. -service AlphaAnalyticsData { - option (google.api.default_host) = "analyticsdata.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/analytics," - "https://www.googleapis.com/auth/analytics.readonly"; - - // Returns a customized funnel report of your Google Analytics event data. The - // data returned from the API is as a table with columns for the requested - // dimensions and metrics. - // - // Funnel exploration lets you visualize the steps your users take to complete - // a task and quickly see how well they are succeeding or failing at each - // step. For example, how do prospects become shoppers and then become buyers? - // How do one time buyers become repeat buyers? With this information, you can - // improve inefficient or abandoned customer journeys. To learn more, see [GA4 - // Funnel Explorations](https://support.google.com/analytics/answer/9327974). - rpc RunFunnelReport(RunFunnelReportRequest) returns (RunFunnelReportResponse) { - option (google.api.http) = { - post: "/v1alpha/{property=properties/*}:runFunnelReport" - body: "*" - }; - } -} - -// The request for a funnel report. -message RunFunnelReportRequest { - // Controls the dimensions present in the funnel visualization sub report - // response. - enum FunnelVisualizationType { - // Unspecified type. - FUNNEL_VISUALIZATION_TYPE_UNSPECIFIED = 0; - - // A standard (stepped) funnel. The funnel visualization sub report in the - // response will not contain date. - STANDARD_FUNNEL = 1; - - // A trended (line chart) funnel. The funnel visualization sub report in the - // response will contain the date dimension. - TRENDED_FUNNEL = 2; - } - - // A Google Analytics GA4 property identifier whose events are tracked. - // Specified in the URL path and not the body. To learn more, see [where to - // find your Property - // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - // Within a batch request, this property should either be unspecified or - // consistent with the batch-level property. - // - // Example: properties/1234 - string property = 1; - - // Date ranges of data to read. If multiple date ranges are requested, each - // response row will contain a zero based date range index. If two date - // ranges overlap, the event data for the overlapping days is included in the - // response rows for both date ranges. - repeated DateRange date_ranges = 2; - - // The configuration of this request's funnel. This funnel configuration is - // required. - Funnel funnel = 3; - - // If specified, this breakdown adds a dimension to the funnel table sub - // report response. This breakdown dimension expands each funnel step to the - // unique values of the breakdown dimension. For example, a breakdown by the - // `deviceCategory` dimension will create rows for `mobile`, `tablet`, - // `desktop`, and the total. - FunnelBreakdown funnel_breakdown = 4; - - // If specified, next action adds a dimension to the funnel visualization sub - // report response. This next action dimension expands each funnel step to the - // unique values of the next action. For example a next action of the - // `eventName` dimension will create rows for several events (i.e. - // `session_start` & `click`) and the total. - // - // Next action only supports `eventName` and most Page / Screen dimensions - // like `pageTitle` and `pagePath`. - FunnelNextAction funnel_next_action = 5; - - // The funnel visualization type controls the dimensions present in the funnel - // visualization sub report response. If not specified, `STANDARD_FUNNEL` is - // used. - FunnelVisualizationType funnel_visualization_type = 6; - - // The configurations of segments. Segments are subsets of a property's data. - // In a funnel report with segments, the funnel is evaluated in each segment. - // - // Each segment specified in this request - // produces a separate row in the response; in the response, each segment - // identified by its name. - // - // The segments parameter is optional. Requests are limited to 4 segments. - repeated Segment segments = 7; - - // The number of rows to return. If unspecified, 10,000 rows are returned. The - // API returns a maximum of 100,000 rows per request, no matter how many you - // ask for. `limit` must be positive. - // - // The API can also return fewer rows than the requested `limit`, if there - // aren't as many dimension values as the `limit`. - int64 limit = 9; - - // Dimension filters allow you to ask for only specific dimension values in - // the report. To learn more, see [Creating a Report: Dimension - // Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) - // for examples. Metrics cannot be used in this filter. - FilterExpression dimension_filter = 10; - - // Toggles whether to return the current state of this Analytics Property's - // quota. Quota is returned in [PropertyQuota](#PropertyQuota). - bool return_property_quota = 12; -} - -// The funnel report response contains two sub reports. The two sub reports are -// different combinations of dimensions and metrics. -message RunFunnelReportResponse { - // The funnel table is a report with the funnel step, segment, breakdown - // dimension, active users, completion rate, abandonments, and abandonments - // rate. - // - // The segment dimension is only present in this response if a segment was - // requested. The breakdown dimension is only present in this response if it - // was requested. - FunnelSubReport funnel_table = 1; - - // The funnel visualization is a report with the funnel step, segment, date, - // next action dimension, and active users. - // - // The segment dimension is only present in this response if a segment was - // requested. The date dimension is only present in this response if it was - // requested via the `TRENDED_FUNNEL` funnel type. The next action dimension - // is only present in the response if it was requested. - FunnelSubReport funnel_visualization = 2; - - // This Analytics Property's quota state including this request. - PropertyQuota property_quota = 3; - - // Identifies what kind of resource this message is. This `kind` is always the - // fixed string "analyticsData#runFunnelReport". Useful to distinguish between - // response types in JSON. - string kind = 4; -} diff --git a/owl-bot-staging/v1alpha/protos/google/analytics/data/v1alpha/data.proto b/owl-bot-staging/v1alpha/protos/google/analytics/data/v1alpha/data.proto deleted file mode 100644 index 9ef9f6143..000000000 --- a/owl-bot-staging/v1alpha/protos/google/analytics/data/v1alpha/data.proto +++ /dev/null @@ -1,1233 +0,0 @@ -// 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 -// -// 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. - -syntax = "proto3"; - -package google.analytics.data.v1alpha; - -import "google/protobuf/duration.proto"; - -option go_package = "google.golang.org/genproto/googleapis/analytics/data/v1alpha;data"; -option java_multiple_files = true; -option java_outer_classname = "ReportingApiProto"; -option java_package = "com.google.analytics.data.v1alpha"; - -// A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests -// are allowed up to 4 date ranges. -message DateRange { - // The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot - // be after `end_date`. The format `NdaysAgo`, `yesterday`, or `today` is also - // accepted, and in that case, the date is inferred based on the property's - // reporting time zone. - string start_date = 1; - - // The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot - // be before `start_date`. The format `NdaysAgo`, `yesterday`, or `today` is - // also accepted, and in that case, the date is inferred based on the - // property's reporting time zone. - string end_date = 2; - - // Assigns a name to this date range. The dimension `dateRange` is valued to - // this name in a report response. If set, cannot begin with `date_range_` or - // `RESERVED_`. If not set, date ranges are named by their zero based index in - // the request: `date_range_0`, `date_range_1`, etc. - string name = 3; -} - -// Dimensions are attributes of your data. For example, the dimension city -// indicates the city from which an event originates. Dimension values in report -// responses are strings; for example, the city could be "Paris" or "New York". -message Dimension { - // The name of the dimension. See the [API - // Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) - // for the list of dimension names. - // - // If `dimensionExpression` is specified, `name` can be any string that you - // would like within the allowed character set. For example if a - // `dimensionExpression` concatenates `country` and `city`, you could call - // that dimension `countryAndCity`. Dimension names that you choose must match - // the regular expression `^[a-zA-Z0-9_]$`. - // - // Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`, - // `dimensionExpression`, and `pivots`. - string name = 1; - - // One dimension can be the result of an expression of multiple dimensions. - // For example, dimension "country, city": concatenate(country, ", ", city). - DimensionExpression dimension_expression = 2; -} - -// Used to express a dimension which is the result of a formula of multiple -// dimensions. Example usages: -// 1) lower_case(dimension) -// 2) concatenate(dimension1, symbol, dimension2). -message DimensionExpression { - // Used to convert a dimension value to a single case. - message CaseExpression { - // Name of a dimension. The name must refer back to a name in dimensions - // field of the request. - string dimension_name = 1; - } - - // Used to combine dimension values to a single dimension. - message ConcatenateExpression { - // Names of dimensions. The names must refer back to names in the dimensions - // field of the request. - repeated string dimension_names = 1; - - // The delimiter placed between dimension names. - // - // Delimiters are often single characters such as "|" or "," but can be - // longer strings. If a dimension value contains the delimiter, both will be - // present in response with no distinction. For example if dimension 1 value - // = "US,FR", dimension 2 value = "JP", and delimiter = ",", then the - // response will contain "US,FR,JP". - string delimiter = 2; - } - - // Specify one type of dimension expression for `DimensionExpression`. - oneof one_expression { - // Used to convert a dimension value to lower case. - CaseExpression lower_case = 4; - - // Used to convert a dimension value to upper case. - CaseExpression upper_case = 5; - - // Used to combine dimension values to a single dimension. - // For example, dimension "country, city": concatenate(country, ", ", city). - ConcatenateExpression concatenate = 6; - } -} - -// To express dimension or metric filters. The fields in the same -// FilterExpression need to be either all dimensions or all metrics. -message FilterExpression { - // Specify one type of filter expression for `FilterExpression`. - oneof expr { - // The FilterExpressions in and_group have an AND relationship. - FilterExpressionList and_group = 1; - - // The FilterExpressions in or_group have an OR relationship. - FilterExpressionList or_group = 2; - - // The FilterExpression is NOT of not_expression. - FilterExpression not_expression = 3; - - // A primitive filter. In the same FilterExpression, all of the filter's - // field names need to be either all dimensions or all metrics. - Filter filter = 4; - } -} - -// A list of filter expressions. -message FilterExpressionList { - // A list of filter expressions. - repeated FilterExpression expressions = 1; -} - -// An expression to filter dimension or metric values. -message Filter { - // The dimension name or metric name. Must be a name defined in dimensions - // or metrics. - string field_name = 1; - - // Specify one type of filter for `Filter`. - oneof one_filter { - // Strings related filter. - StringFilter string_filter = 2; - - // A filter for in list values. - InListFilter in_list_filter = 3; - - // A filter for numeric or date values. - NumericFilter numeric_filter = 4; - - // A filter for between two values. - BetweenFilter between_filter = 5; - } -} - -// The filter for string -message StringFilter { - // The match type of a string filter - enum MatchType { - // Unspecified - MATCH_TYPE_UNSPECIFIED = 0; - - // Exact match of the string value. - EXACT = 1; - - // Begins with the string value. - BEGINS_WITH = 2; - - // Ends with the string value. - ENDS_WITH = 3; - - // Contains the string value. - CONTAINS = 4; - - // Full match for the regular expression with the string value. - FULL_REGEXP = 5; - - // Partial match for the regular expression with the string value. - PARTIAL_REGEXP = 6; - } - - // The match type for this filter. - MatchType match_type = 1; - - // The string value used for the matching. - string value = 2; - - // If true, the string value is case sensitive. - bool case_sensitive = 3; -} - -// The result needs to be in a list of string values. -message InListFilter { - // The list of string values. - // Must be non-empty. - repeated string values = 1; - - // If true, the string value is case sensitive. - bool case_sensitive = 2; -} - -// Filters for numeric or date values. -message NumericFilter { - // The operation applied to a numeric filter - enum Operation { - // Unspecified. - OPERATION_UNSPECIFIED = 0; - - // Equal - EQUAL = 1; - - // Less than - LESS_THAN = 2; - - // Less than or equal - LESS_THAN_OR_EQUAL = 3; - - // Greater than - GREATER_THAN = 4; - - // Greater than or equal - GREATER_THAN_OR_EQUAL = 5; - } - - // The operation type for this filter. - Operation operation = 1; - - // A numeric value or a date value. - NumericValue value = 2; -} - -// To express that the result needs to be between two numbers (inclusive). -message BetweenFilter { - // Begins with this number. - NumericValue from_value = 1; - - // Ends with this number. - NumericValue to_value = 2; -} - -// To represent a number. -message NumericValue { - // One of a numeric value - oneof one_value { - // Integer value - int64 int64_value = 1; - - // Double value - double double_value = 2; - } -} - -// Describes a dimension column in the report. Dimensions requested in a report -// produce column entries within rows and DimensionHeaders. However, dimensions -// used exclusively within filters or expressions do not produce columns in a -// report; correspondingly, those dimensions do not produce headers. -message DimensionHeader { - // The dimension's name. - string name = 1; -} - -// Describes a metric column in the report. Visible metrics requested in a -// report produce column entries within rows and MetricHeaders. However, -// metrics used exclusively within filters or expressions do not produce columns -// in a report; correspondingly, those metrics do not produce headers. -message MetricHeader { - // The metric's name. - string name = 1; - - // The metric's data type. - MetricType type = 2; -} - -// Report data for each row. -// For example if RunReportRequest contains: -// -// ```none -// "dimensions": [ -// { -// "name": "eventName" -// }, -// { -// "name": "countryId" -// } -// ], -// "metrics": [ -// { -// "name": "eventCount" -// } -// ] -// ``` -// -// One row with 'in_app_purchase' as the eventName, 'JP' as the countryId, and -// 15 as the eventCount, would be: -// -// ```none -// "dimensionValues": [ -// { -// "value": "in_app_purchase" -// }, -// { -// "value": "JP" -// } -// ], -// "metricValues": [ -// { -// "value": "15" -// } -// ] -// ``` -message Row { - // List of requested dimension values. In a PivotReport, dimension_values - // are only listed for dimensions included in a pivot. - repeated DimensionValue dimension_values = 1; - - // List of requested visible metric values. - repeated MetricValue metric_values = 2; -} - -// The value of a dimension. -message DimensionValue { - // One kind of dimension value - oneof one_value { - // Value as a string if the dimension type is a string. - string value = 1; - } -} - -// The value of a metric. -message MetricValue { - // One of metric value - oneof one_value { - // Measurement value. See MetricHeader for type. - string value = 4; - } -} - -// Current state of all quotas for this Analytics Property. If any quota for a -// property is exhausted, all requests to that property will return Resource -// Exhausted errors. -message PropertyQuota { - // Standard Analytics Properties can use up to 25,000 tokens per day; - // Analytics 360 Properties can use 250,000 tokens per day. Most requests - // consume fewer than 10 tokens. - QuotaStatus tokens_per_day = 1; - - // Standard Analytics Properties can use up to 5,000 tokens per hour; - // Analytics 360 Properties can use 50,000 tokens per hour. An API request - // consumes a single number of tokens, and that number is deducted from both - // the hourly and daily quotas. - QuotaStatus tokens_per_hour = 2; - - // Standard Analytics Properties can send up to 10 concurrent requests; - // Analytics 360 Properties can use up to 50 concurrent requests. - QuotaStatus concurrent_requests = 3; - - // Standard Analytics Properties and cloud project pairs can have up to 10 - // server errors per hour; Analytics 360 Properties and cloud project pairs - // can have up to 50 server errors per hour. - QuotaStatus server_errors_per_project_per_hour = 4; - - // Analytics Properties can send up to 120 requests with potentially - // thresholded dimensions per hour. In a batch request, each report request - // is individually counted for this quota if the request contains potentially - // thresholded dimensions. - QuotaStatus potentially_thresholded_requests_per_hour = 5; -} - -// Current state for a particular quota group. -message QuotaStatus { - // Quota consumed by this request. - int32 consumed = 1; - - // Quota remaining after this request. - int32 remaining = 2; -} - -// Breakdowns add a dimension to the funnel table sub report response. -message FunnelBreakdown { - // The dimension column added to the funnel table sub report response. The - // breakdown dimension breaks down each funnel step. A valid - // `breakdownDimension` is required if `funnelBreakdown` is specified. - Dimension breakdown_dimension = 1; - - // The maximum number of distinct values of the breakdown dimension to return - // in the response. A `limit` of `5` is used if limit is not specified. Limit - // must exceed zero and cannot exceed 15. - optional int64 limit = 2; -} - -// Next actions state the value for a dimension after the user has achieved -// a step but before the same user has achieved the next step. For example if -// the `nextActionDimension` is `eventName`, then `nextActionDimension` in the -// `i`th funnel step row will return first event after the event that qualified -// the user into the `i`th funnel step but before the user achieved the `i+1`th -// funnel step. -message FunnelNextAction { - // The dimension column added to the funnel visualization sub report response. - // The next action dimension returns the next dimension value of this - // dimension after the user has attained the `i`th funnel step. - // - // `nextActionDimension` currently only supports `eventName` and most Page / - // Screen dimensions like `pageTitle` and `pagePath`. `nextActionDimension` - // cannot be a dimension expression. - Dimension next_action_dimension = 1; - - // The maximum number of distinct values of the breakdown dimension to return - // in the response. A `limit` of `5` is used if limit is not specified. Limit - // must exceed zero and cannot exceed 5. - optional int64 limit = 2; -} - -// Configures the funnel in a funnel report request. A funnel reports on users -// as they pass through a sequence of steps. -// -// Funnel exploration lets you visualize the steps your users take to complete a -// task and quickly see how well they are succeeding or failing at each step. -// For example, how do prospects become shoppers and then become buyers? How do -// one time buyers become repeat buyers? With this information, you can improve -// inefficient or abandoned customer journeys. -message Funnel { - // In an open funnel, users can enter the funnel in any step, and in a closed - // funnel, users must enter the funnel in the first step. Optional. If - // unspecified, a closed funnel is used. - bool is_open_funnel = 1; - - // The sequential steps of this funnel. - repeated FunnelStep steps = 2; -} - -// Steps define the user journey you want to measure. Steps contain one or -// more conditions that your users must meet to be included in that step of -// the funnel journey. -message FunnelStep { - // The distinctive name for this step. If unspecified, steps will be named - // by a 1 based indexed name (i.e. "0. ", "1. ", etc.). This name defines - // string value returned by the `funnelStepName` dimension. For example, - // specifying `name = Purchase` in the request's third funnel step will - // produce `3. Purchase` in the funnel report response. - string name = 1; - - // If true, this step must directly follow the previous step. If false, - // there can be events between the previous step and this step. If - // unspecified, `isDirectlyFollowedBy` is treated as false. - bool is_directly_followed_by = 2; - - // If specified, this step must complete within this duration of the - // completion of the prior step. `withinDurationFromPriorStep` is inclusive - // of the endpoint at the microsecond granularity. For example a duration of - // 5 seconds can be completed at 4.9 or 5.0 seconds, but not 5 seconds and 1 - // microsecond. - // - // `withinDurationFromPriorStep` is optional, and if unspecified, steps may - // be separated by any time duration. - optional google.protobuf.Duration within_duration_from_prior_step = 3; - - // The condition that your users must meet to be included in this step of - // the funnel journey. - FunnelFilterExpression filter_expression = 4; -} - -// Funnel sub reports contain the dimension and metric data values. For example, -// 12 users reached the second step of the funnel. -message FunnelSubReport { - // Describes dimension columns. Funnel reports always include the funnel step - // dimension in sub report responses. Additional dimensions like breakdowns, - // dates, and next actions may be present in the response if requested. - repeated DimensionHeader dimension_headers = 1; - - // Describes metric columns. Funnel reports always include active users in sub - // report responses. The funnel table includes additional metrics like - // completion rate, abandonments, and abandonments rate. - repeated MetricHeader metric_headers = 2; - - // Rows of dimension value combinations and metric values in the report. - repeated Row rows = 3; - - // Metadata for the funnel report. - FunnelResponseMetadata metadata = 4; -} - -// User segments are subsets of users who engaged with your site or app. For -// example, users who have previously purchased; users who added items to their -// shopping carts, but didn’t complete a purchase. -message UserSegment { - // Defines which users are included in this segment. Optional. - UserSegmentCriteria user_inclusion_criteria = 1; - - // Defines which users are excluded in this segment. Optional. - UserSegmentExclusion exclusion = 2; -} - -// A user matches a criteria if the user's events meet the conditions in the -// criteria. -message UserSegmentCriteria { - // A user matches this criteria if the user matches each of these - // `andConditionGroups` and each of the `andSequenceGroups`. - // `andConditionGroups` may be empty if `andSequenceGroups` are specified. - repeated UserSegmentConditionGroup and_condition_groups = 1; - - // A user matches this criteria if the user matches each of these - // `andSequenceGroups` and each of the `andConditionGroups`. - // `andSequenceGroups` may be empty if `andConditionGroups` are specified. - repeated UserSegmentSequenceGroup and_sequence_groups = 2; -} - -// Scoping specifies which events are considered when evaluating if a user -// meets a criteria. -enum UserCriteriaScoping { - // Unspecified criteria scoping. Do not specify. - USER_CRITERIA_SCOPING_UNSPECIFIED = 0; - - // If the criteria is satisfied within one event, the user matches the - // criteria. - USER_CRITERIA_WITHIN_SAME_EVENT = 1; - - // If the criteria is satisfied within one session, the user matches the - // criteria. - USER_CRITERIA_WITHIN_SAME_SESSION = 2; - - // If the criteria is satisfied by any events for the user, the user - // matches the criteria. - USER_CRITERIA_ACROSS_ALL_SESSIONS = 3; -} - -// Conditions tell Analytics what data to include in or exclude from the -// segment. -message UserSegmentConditionGroup { - // Data is included or excluded from the segment based on if it matches - // the condition group. This scoping defines how many events the - // `segmentFilterExpression` is evaluated on before the condition group - // is determined to be matched or not. For example if `conditionScoping = - // USER_CRITERIA_WITHIN_SAME_SESSION`, the expression is evaluated on all - // events in a session, and then, the condition group is determined to be - // matched or not for this user. For example if `conditionScoping = - // USER_CRITERIA_WITHIN_SAME_EVENT`, the expression is evaluated on a single - // event, and then, the condition group is determined to be matched or not for - // this user. - // - // Optional. If unspecified, `conditionScoping = ACROSS_ALL_SESSIONS` is - // used. - UserCriteriaScoping condition_scoping = 1; - - // Data is included or excluded from the segment based on if it matches - // this expression. Expressions express criteria on dimension, metrics, - // and/or parameters. - SegmentFilterExpression segment_filter_expression = 2; -} - -// Define conditions that must occur in a specific order for the user to be -// a member of the segment. -message UserSegmentSequenceGroup { - // All sequence steps must be satisfied in the scoping for the user to - // match the sequence. For example if `sequenceScoping = - // USER_CRITERIA_WITHIN_SAME_SESSION`, all sequence steps must complete within - // one session for the user to match the sequence. `sequenceScoping = - // USER_CRITERIA_WITHIN_SAME_EVENT` is not supported. - // - // Optional. If unspecified, `conditionScoping = ACROSS_ALL_SESSIONS` is - // used. - UserCriteriaScoping sequence_scoping = 1; - - // Defines the time period in which the whole sequence must occur; for - // example, 30 Minutes. `sequenceMaximumDuration` is inclusive - // of the endpoint at the microsecond granularity. For example a sequence - // with a maximum duration of 5 seconds can be completed at 4.9 or 5.0 - // seconds, but not 5 seconds and 1 microsecond. - // - // `sequenceMaximumDuration` is optional, and if unspecified, sequences can - // be completed in any time duration. - google.protobuf.Duration sequence_maximum_duration = 2; - - // An ordered sequence of condition steps. A user's events must complete - // each step in order for the user to match the - // `UserSegmentSequenceGroup`. - repeated UserSequenceStep user_sequence_steps = 3; -} - -// A condition that must occur in the specified step order for this user -// to match the sequence. -message UserSequenceStep { - // If true, the event satisfying this step must be the very next event - // after the event satifying the last step. If false, this step indirectly - // follows the prior step; for example, there may be events between the - // prior step and this step. `isDirectlyFollowedBy` must be false for - // the first step. - bool is_directly_followed_by = 1; - - // This sequence step must be satisfied in the scoping for the user to - // match the sequence. For example if `sequenceScoping = - // WITHIN_SAME_SESSION`, this sequence steps must complete within one - // session for the user to match the sequence. `stepScoping = - // ACROSS_ALL_SESSIONS` is only allowed if the `sequenceScoping = - // ACROSS_ALL_SESSIONS`. - // - // Optional. If unspecified, `stepScoping` uses the same - // `UserCriteriaScoping` as the `sequenceScoping`. - UserCriteriaScoping step_scoping = 2; - - // A user matches this sequence step if their events match this - // expression. Expressions express criteria on dimension, metrics, - // and/or parameters. - SegmentFilterExpression segment_filter_expression = 3; -} - -// Specifies which users are excluded in this segment. -message UserSegmentExclusion { - // Specifies how long an exclusion will last if a user matches the - // `userExclusionCriteria`. - // - // Optional. If unspecified, `userExclusionDuration` of - // `USER_EXCLUSION_TEMPORARY` is used. - UserExclusionDuration user_exclusion_duration = 1; - - // If a user meets this condition, the user is excluded from membership in - // the segment for the `userExclusionDuration`. - UserSegmentCriteria user_exclusion_criteria = 2; -} - -// Enumerates options for how long an exclusion will last if a user matches -// the `userExclusionCriteria`. -enum UserExclusionDuration { - // Unspecified exclusion duration. Do not specify. - USER_EXCLUSION_DURATION_UNSPECIFIED = 0; - - // Temporarily exclude users from the segment during periods when the - // user meets the `userExclusionCriteria` condition. - USER_EXCLUSION_TEMPORARY = 1; - - // Permanently exclude users from the segment if the user ever meets the - // `userExclusionCriteria` condition. - USER_EXCLUSION_PERMANENT = 2; -} - -// Session segments are subsets of the sessions that occurred on your site or -// app: for example, all the sessions that originated from a particular -// advertising campaign. -message SessionSegment { - // Defines which sessions are included in this segment. Optional. - SessionSegmentCriteria session_inclusion_criteria = 1; - - // Defines which sessions are excluded in this segment. Optional. - SessionSegmentExclusion exclusion = 2; -} - -// A session matches a criteria if the session's events meet the conditions in -// the criteria. -message SessionSegmentCriteria { - // A session matches this criteria if the session matches each of these - // `andConditionGroups`. - repeated SessionSegmentConditionGroup and_condition_groups = 1; -} - -// Scoping specifies which events are considered when evaluating if a -// session meets a criteria. -enum SessionCriteriaScoping { - // Unspecified criteria scoping. Do not specify. - SESSION_CRITERIA_SCOPING_UNSPECIFIED = 0; - - // If the criteria is satisfied within one event, the session matches the - // criteria. - SESSION_CRITERIA_WITHIN_SAME_EVENT = 1; - - // If the criteria is satisfied within one session, the session matches - // the criteria. - SESSION_CRITERIA_WITHIN_SAME_SESSION = 2; -} - -// Conditions tell Analytics what data to include in or exclude from the -// segment. -message SessionSegmentConditionGroup { - // Data is included or excluded from the segment based on if it matches - // the condition group. This scoping defines how many events the - // `segmentFilterExpression` is evaluated on before the condition group - // is determined to be matched or not. For example if `conditionScoping = - // SESSION_CRITERIA_WITHIN_SAME_SESSION`, the expression is evaluated on all - // events in a session, and then, the condition group is determined to be - // matched or not for this session. For example if `conditionScoping = - // SESSION_CRITERIA_WITHIN_SAME_EVENT`, the expression is evaluated on a - // single event, and then, the condition group is determined to be matched or - // not for this session. - // - // Optional. If unspecified, a `conditionScoping` of `WITHIN_SAME_SESSION` - // is used. - SessionCriteriaScoping condition_scoping = 1; - - // Data is included or excluded from the segment based on if it matches - // this expression. Expressions express criteria on dimension, metrics, - // and/or parameters. - SegmentFilterExpression segment_filter_expression = 2; -} - -// Specifies which sessions are excluded in this segment. -message SessionSegmentExclusion { - // Specifies how long an exclusion will last if a session matches the - // `sessionExclusionCriteria`. - // - // Optional. If unspecified, a `sessionExclusionDuration` of - // `SESSION_EXCLUSION_TEMPORARY` is used. - SessionExclusionDuration session_exclusion_duration = 1; - - // If a session meets this condition, the session is excluded from - // membership in the segment for the `sessionExclusionDuration`. - SessionSegmentCriteria session_exclusion_criteria = 2; -} - -// Enumerates options for how long an exclusion will last if a session -// matches the `sessionExclusionCriteria`. -enum SessionExclusionDuration { - // Unspecified exclusion duration. Do not specify. - SESSION_EXCLUSION_DURATION_UNSPECIFIED = 0; - - // Temporarily exclude sessions from the segment during periods when the - // session meets the `sessionExclusionCriteria` condition. - SESSION_EXCLUSION_TEMPORARY = 1; - - // Permanently exclude sessions from the segment if the session ever meets - // the `sessionExclusionCriteria` condition. - SESSION_EXCLUSION_PERMANENT = 2; -} - -// Event segments are subsets of events that were triggered on your site or app. -// for example, all purchase events made in a particular location; app_exception -// events that occurred on a specific operating system. -message EventSegment { - // Defines which events are included in this segment. Optional. - EventSegmentCriteria event_inclusion_criteria = 1; - - // Defines which events are excluded in this segment. Optional. - EventSegmentExclusion exclusion = 2; -} - -// An event matches a criteria if the event meet the conditions in the -// criteria. -message EventSegmentCriteria { - // An event matches this criteria if the event matches each of these - // `andConditionGroups`. - repeated EventSegmentConditionGroup and_condition_groups = 1; -} - -// Scoping specifies which events are considered when evaluating if an event -// meets a criteria. -enum EventCriteriaScoping { - // Unspecified criteria scoping. Do not specify. - EVENT_CRITERIA_SCOPING_UNSPECIFIED = 0; - - // If the criteria is satisfied within one event, the event matches the - // criteria. - EVENT_CRITERIA_WITHIN_SAME_EVENT = 1; -} - -// Conditions tell Analytics what data to include in or exclude from the -// segment. -message EventSegmentConditionGroup { - // `conditionScoping` should always be `EVENT_CRITERIA_WITHIN_SAME_EVENT`. - // - // Optional. If unspecified, a `conditionScoping` of - // `EVENT_CRITERIA_WITHIN_SAME_EVENT` is used. - EventCriteriaScoping condition_scoping = 1; - - // Data is included or excluded from the segment based on if it matches - // this expression. Expressions express criteria on dimension, metrics, - // and/or parameters. - SegmentFilterExpression segment_filter_expression = 2; -} - -// Specifies which events are excluded in this segment. -message EventSegmentExclusion { - // `eventExclusionDuration` should always be `PERMANENTLY_EXCLUDE`. - // - // Optional. If unspecified, an `eventExclusionDuration` of - // `EVENT_EXCLUSION_PERMANENT` is used. - EventExclusionDuration event_exclusion_duration = 1; - - // If an event meets this condition, the event is excluded from membership - // in the segment for the `eventExclusionDuration`. - EventSegmentCriteria event_exclusion_criteria = 2; -} - -// Enumerates options for how long an exclusion will last if an event -// matches the `eventExclusionCriteria`. -enum EventExclusionDuration { - // Unspecified exclusion duration. Do not specify. - EVENT_EXCLUSION_DURATION_UNSPECIFIED = 0; - - // Permanently exclude events from the segment if the event ever meets - // the `eventExclusionCriteria` condition. - EVENT_EXCLUSION_PERMANENT = 1; -} - -// A segment is a subset of your Analytics data. For example, of your entire set -// of users, one segment might be users from a particular country or city. -// Another segment might be users who purchase a particular line of products or -// who visit a specific part of your site or trigger certain events in your app. -// -// To learn more, see [GA4 Segment -// Builder](https://support.google.com/analytics/answer/9304353). -message Segment { - // The name for this segment. If unspecified, segments are named "Segment". - // This name defines string value returned by the `segment` dimension. The - // `segment` dimension prefixes segment names by the 1-based index number of - // the segment in the request (i.e. "1. Segment", "2. Segment", etc.). - string name = 1; - - // A segment is specified in one scope. - oneof one_segment_scope { - // User segments are subsets of users who engaged with your site or app. - UserSegment user_segment = 2; - - // Session segments are subsets of the sessions that occurred on your site - // or app. - SessionSegment session_segment = 3; - - // Event segments are subsets of events that were triggered on your site or - // app. - EventSegment event_segment = 4; - } -} - -// Expresses combinations of segment filters. -message SegmentFilterExpression { - // Specify one type of filter for `SegmentFilterExpression`. - oneof expr { - // The SegmentFilterExpression in `andGroup` have an AND relationship. - SegmentFilterExpressionList and_group = 1; - - // The SegmentFilterExpression in `orGroup` have an OR relationship. - SegmentFilterExpressionList or_group = 2; - - // The SegmentFilterExpression is NOT of `notExpression`. - SegmentFilterExpression not_expression = 3; - - // A primitive segment filter. - SegmentFilter segment_filter = 4; - - // Creates a filter that matches events of a single event name. If a - // parameter filter expression is specified, only the subset of events that - // match both the single event name and the parameter filter expressions - // match this event filter. - SegmentEventFilter segment_event_filter = 5; - } -} - -// A list of segment filter expressions. -message SegmentFilterExpressionList { - // The list of segment filter expressions - repeated SegmentFilterExpression expressions = 1; -} - -// An expression to filter dimension or metric values. -message SegmentFilter { - // The dimension name or metric name. - string field_name = 1; - - // Specify one type of filter for `Filter`. - oneof one_filter { - // Strings related filter. - StringFilter string_filter = 4; - - // A filter for in list values. - InListFilter in_list_filter = 5; - - // A filter for numeric or date values. - NumericFilter numeric_filter = 6; - - // A filter for between two values. - BetweenFilter between_filter = 7; - } - - // Specifies the scope for the filter. - SegmentFilterScoping filter_scoping = 8; -} - -// Scopings specify how the dimensions & metrics of multiple events -// should be considered when evaluating a segment filter. -message SegmentFilterScoping { - // If `atAnyPointInTime` is true, this filter evaluates to true for all - // events if it evaluates to true for any event in the date range of the - // request. - // - // This `atAnyPointInTime` parameter does not extend the date range of - // events in the report. If `atAnyPointInTime` is true, only events within - // the report's date range are considered when evaluating this filter. - // - // This `atAnyPointInTime` is only able to be specified if the criteria - // scoping is `ACROSS_ALL_SESSIONS` and is not able to be specified in - // sequences. - // - // If the criteria scoping is `ACROSS_ALL_SESSIONS`, `atAnyPointInTime` = - // false is used if unspecified. - optional bool at_any_point_in_time = 1; -} - -// Creates a filter that matches events of a single event name. If a parameter -// filter expression is specified, only the subset of events that match both the -// single event name and the parameter filter expressions match this event -// filter. -message SegmentEventFilter { - // This filter matches events of this single event name. Event name is - // required. - optional string event_name = 1; - - // If specified, this filter matches events that match both the single event - // name and the parameter filter expressions. - // - // Inside the parameter filter expression, only parameter filters are - // available. - optional SegmentParameterFilterExpression segment_parameter_filter_expression = 2; -} - -// Expresses combinations of segment filter on parameters. -message SegmentParameterFilterExpression { - // Specify one type of filter for `SegmentParameterFilterExpression`. - oneof expr { - // The SegmentParameterFilterExpression in `andGroup` have an AND - // relationship. - SegmentParameterFilterExpressionList and_group = 1; - - // The SegmentParameterFilterExpression in `orGroup` have an OR - // relationship. - SegmentParameterFilterExpressionList or_group = 2; - - // The SegmentParameterFilterExpression is NOT of `notExpression`. - SegmentParameterFilterExpression not_expression = 3; - - // A primitive segment parameter filter. - SegmentParameterFilter segment_parameter_filter = 4; - } -} - -// A list of segment parameter filter expressions. -message SegmentParameterFilterExpressionList { - // The list of segment parameter filter expressions. - repeated SegmentParameterFilterExpression expressions = 1; -} - -// An expression to filter parameter values in a segment. -message SegmentParameterFilter { - // The field that is being filtered. - oneof one_parameter { - // This filter will be evaluated on the specified event parameter. Event - // parameters are logged as parameters of the event. Event parameters - // include fields like "firebase_screen" & "currency". - // - // Event parameters can only be used in segments & funnels and can only be - // used in a descendent filter from an EventFilter. In a descendent filter - // from an EventFilter either event or item parameters should be used. - string event_parameter_name = 1; - - // This filter will be evaluated on the specified item parameter. Item - // parameters are logged as parameters in the item array. Item parameters - // include fields like "item_name" & "item_category". - // - // Item parameters can only be used in segments & funnels and can only be - // used in a descendent filter from an EventFilter. In a descendent filter - // from an EventFilter either event or item parameters should be used. - // - // Item parameters are only available in ecommerce events. To learn more - // about ecommerce events, see the [Measure ecommerce] - // (https://developers.google.com/analytics/devguides/collection/ga4/ecommerce) - // guide. - string item_parameter_name = 2; - } - - // Specify one type of filter. - oneof one_filter { - // Strings related filter. - StringFilter string_filter = 4; - - // A filter for in list values. - InListFilter in_list_filter = 5; - - // A filter for numeric or date values. - NumericFilter numeric_filter = 6; - - // A filter for between two values. - BetweenFilter between_filter = 7; - } - - // Specifies the scope for the filter. - SegmentParameterFilterScoping filter_scoping = 8; -} - -// Scopings specify how multiple events should be considered when evaluating a -// segment parameter filter. -message SegmentParameterFilterScoping { - // Accumulates the parameter over the specified period of days before - // applying the filter. Only supported if criteria scoping is - // `ACROSS_ALL_SESSIONS` or `WITHIN_SAME_SESSION`. Only supported if the - // parameter is `event_count`. - // - // For example if `inAnyNDayPeriod` is 3, the event_name is "purchase", - // the event parameter is "event_count", and the Filter's criteria is - // greater than 5, this filter will accumulate the event count of purchase - // events over every 3 consecutive day period in the report's date range; a - // user will pass this Filter's criteria to be included in this segment if - // their count of purchase events exceeds 5 in any 3 consecutive day period. - // For example, the periods 2021-11-01 to 2021-11-03, 2021-11-02 to - // 2021-11-04, 2021-11-03 to 2021-11-05, and etc. will be considered. - // - // The date range is not extended for the purpose of having a full N day - // window near the start of the date range. For example if a report is for - // 2021-11-01 to 2021-11-10 and `inAnyNDayPeriod` = 3, the first two day - // period will be effectively shortened because no event data outside the - // report's date range will be read. For example, the first four periods - // will effectively be: 2021-11-01 to 2021-11-01, 2021-11-01 to 2021-11-02, - // 2021-11-01 to 2021-11-03, and 2021-11-02 to 2021-11-04. - // - // `inAnyNDayPeriod` is optional. If not specified, the - // `segmentParameterFilter` is applied to each event individually. - optional int64 in_any_n_day_period = 1; -} - -// Expresses combinations of funnel filters. -message FunnelFilterExpression { - // Specify one type of filter for `FunnelFilterExpression`. - oneof expr { - // The FunnelFilterExpression in `andGroup` have an AND relationship. - FunnelFilterExpressionList and_group = 1; - - // The FunnelFilterExpression in `orGroup` have an OR relationship. - FunnelFilterExpressionList or_group = 2; - - // The FunnelFilterExpression is NOT of `notExpression`. - FunnelFilterExpression not_expression = 3; - - // A funnel filter for a dimension or metric. - FunnelFieldFilter funnel_field_filter = 4; - - // Creates a filter that matches events of a single event name. If a - // parameter filter expression is specified, only the subset of events that - // match both the single event name and the parameter filter expressions - // match this event filter. - FunnelEventFilter funnel_event_filter = 5; - } -} - -// A list of funnel filter expressions. -message FunnelFilterExpressionList { - // The list of funnel filter expressions. - repeated FunnelFilterExpression expressions = 1; -} - -// An expression to filter dimension or metric values. -message FunnelFieldFilter { - // The dimension name or metric name. - string field_name = 1; - - // Specify one type of filter. - oneof one_filter { - // Strings related filter. - StringFilter string_filter = 4; - - // A filter for in list values. - InListFilter in_list_filter = 5; - - // A filter for numeric or date values. - NumericFilter numeric_filter = 6; - - // A filter for between two values. - BetweenFilter between_filter = 7; - } -} - -// Creates a filter that matches events of a single event name. If a parameter -// filter expression is specified, only the subset of events that match both the -// single event name and the parameter filter expressions match this event -// filter. -message FunnelEventFilter { - // This filter matches events of this single event name. Event name is - // required. - optional string event_name = 1; - - // If specified, this filter matches events that match both the single event - // name and the parameter filter expressions. - // - // Inside the parameter filter expression, only parameter filters are - // available. - optional FunnelParameterFilterExpression funnel_parameter_filter_expression = 2; -} - -// Expresses combinations of funnel filters on parameters. -message FunnelParameterFilterExpression { - // Specify one type of filter for `FunnelParameterFilterExpression`. - oneof expr { - // The FunnelParameterFilterExpression in `andGroup` have an AND - // relationship. - FunnelParameterFilterExpressionList and_group = 1; - - // The FunnelParameterFilterExpression in `orGroup` have an OR - // relationship. - FunnelParameterFilterExpressionList or_group = 2; - - // The FunnelParameterFilterExpression is NOT of `notExpression`. - FunnelParameterFilterExpression not_expression = 3; - - // A primitive funnel parameter filter. - FunnelParameterFilter funnel_parameter_filter = 4; - } -} - -// A list of funnel parameter filter expressions. -message FunnelParameterFilterExpressionList { - // The list of funnel parameter filter expressions. - repeated FunnelParameterFilterExpression expressions = 1; -} - -// An expression to filter parameter values in a funnel. -message FunnelParameterFilter { - // The field that is being filtered. - oneof one_parameter { - // This filter will be evaluated on the specified event parameter. Event - // parameters are logged as parameters of the event. Event parameters - // include fields like "firebase_screen" & "currency". - // - // Event parameters can only be used in segments & funnels and can only be - // used in a descendent filter from an EventFilter. In a descendent filter - // from an EventFilter either event or item parameters should be used. - string event_parameter_name = 1; - - // This filter will be evaluated on the specified item parameter. Item - // parameters are logged as parameters in the item array. Item parameters - // include fields like "item_name" & "item_category". - // - // Item parameters can only be used in segments & funnels and can only be - // used in a descendent filter from an EventFilter. In a descendent filter - // from an EventFilter either event or item parameters should be used. - // - // Item parameters are only available in ecommerce events. To learn more - // about ecommerce events, see the [Measure ecommerce] - // (https://developers.google.com/analytics/devguides/collection/ga4/ecommerce) - // guide. - string item_parameter_name = 2; - } - - // Specify one type of filter. - oneof one_filter { - // Strings related filter. - StringFilter string_filter = 4; - - // A filter for in list values. - InListFilter in_list_filter = 5; - - // A filter for numeric or date values. - NumericFilter numeric_filter = 6; - - // A filter for between two values. - BetweenFilter between_filter = 7; - } -} - -// The funnel report's response metadata carries additional information about -// the funnel report. -message FunnelResponseMetadata { - // If funnel report results are - // [sampled](https://support.google.com/analytics/answer/2637192), this - // describes what percentage of events were used in this funnel report. One - // `samplingMetadatas` is populated for each date range. Each - // `samplingMetadatas` corresponds to a date range in order that date ranges - // were specified in the request. - // - // However if the results are not sampled, this field will not be defined. - repeated SamplingMetadata sampling_metadatas = 1; -} - -// If funnel report results are -// [sampled](https://support.google.com/analytics/answer/2637192), this -// metadata describes what percentage of events were used in this funnel -// report for a date range. Sampling is the practice of analyzing a subset of -// all data in order to uncover the meaningful information in the larger data -// set. -message SamplingMetadata { - // The total number of events read in this sampled report for a date range. - // This is the size of the subset this property's data that was analyzed in - // this funnel report. - int64 samples_read_count = 1; - - // The total number of events present in this property's data that could - // have been analyzed in this funnel report for a date range. Sampling - // uncovers the meaningful information about the larger data set, and this - // is the size of the larger data set. - // - // To calculate the percentage of available data that was used in this - // funnel report, compute `samplesReadCount/samplingSpaceSize`. - int64 sampling_space_size = 2; -} - -// A metric's value type. -enum MetricType { - // Unspecified type. - METRIC_TYPE_UNSPECIFIED = 0; - - // Integer type. - TYPE_INTEGER = 1; - - // Floating point type. - TYPE_FLOAT = 2; - - // A duration of seconds; a special floating point type. - TYPE_SECONDS = 4; - - // A duration in milliseconds; a special floating point type. - TYPE_MILLISECONDS = 5; - - // A duration in minutes; a special floating point type. - TYPE_MINUTES = 6; - - // A duration in hours; a special floating point type. - TYPE_HOURS = 7; - - // A custom metric of standard type; a special floating point type. - TYPE_STANDARD = 8; - - // An amount of money; a special floating point type. - TYPE_CURRENCY = 9; - - // A length in feet; a special floating point type. - TYPE_FEET = 10; - - // A length in miles; a special floating point type. - TYPE_MILES = 11; - - // A length in meters; a special floating point type. - TYPE_METERS = 12; - - // A length in kilometers; a special floating point type. - TYPE_KILOMETERS = 13; -} diff --git a/owl-bot-staging/v1alpha/samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js deleted file mode 100644 index 6fe1b50b1..000000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js +++ /dev/null @@ -1,128 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START analyticsdata_v1alpha_generated_AlphaAnalyticsData_RunFunnelReport_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * A Google Analytics GA4 property identifier whose events are tracked. - * Specified in the URL path and not the body. To learn more, see where to - * find your Property - * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - * Within a batch request, this property should either be unspecified or - * consistent with the batch-level property. - * Example: properties/1234 - */ - // const property = 'abc123' - /** - * Date ranges of data to read. If multiple date ranges are requested, each - * response row will contain a zero based date range index. If two date - * ranges overlap, the event data for the overlapping days is included in the - * response rows for both date ranges. - */ - // const dateRanges = 1234 - /** - * The configuration of this request's funnel. This funnel configuration is - * required. - */ - // const funnel = {} - /** - * If specified, this breakdown adds a dimension to the funnel table sub - * report response. This breakdown dimension expands each funnel step to the - * unique values of the breakdown dimension. For example, a breakdown by the - * `deviceCategory` dimension will create rows for `mobile`, `tablet`, - * `desktop`, and the total. - */ - // const funnelBreakdown = {} - /** - * If specified, next action adds a dimension to the funnel visualization sub - * report response. This next action dimension expands each funnel step to the - * unique values of the next action. For example a next action of the - * `eventName` dimension will create rows for several events (i.e. - * `session_start` & `click`) and the total. - * Next action only supports `eventName` and most Page / Screen dimensions - * like `pageTitle` and `pagePath`. - */ - // const funnelNextAction = {} - /** - * The funnel visualization type controls the dimensions present in the funnel - * visualization sub report response. If not specified, `STANDARD_FUNNEL` is - * used. - */ - // const funnelVisualizationType = {} - /** - * The configurations of segments. Segments are subsets of a property's data. - * In a funnel report with segments, the funnel is evaluated in each segment. - * Each segment specified in this request - * produces a separate row in the response; in the response, each segment - * identified by its name. - * The segments parameter is optional. Requests are limited to 4 segments. - */ - // const segments = 1234 - /** - * The number of rows to return. If unspecified, 10,000 rows are returned. The - * API returns a maximum of 100,000 rows per request, no matter how many you - * ask for. `limit` must be positive. - * The API can also return fewer rows than the requested `limit`, if there - * aren't as many dimension values as the `limit`. - */ - // const limit = 1234 - /** - * Dimension filters allow you to ask for only specific dimension values in - * the report. To learn more, see Creating a Report: Dimension - * Filters (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) - * for examples. Metrics cannot be used in this filter. - */ - // const dimensionFilter = {} - /** - * Toggles whether to return the current state of this Analytics Property's - * quota. Quota is returned in PropertyQuota (#PropertyQuota). - */ - // const returnPropertyQuota = true - - // Imports the Data library - const {AlphaAnalyticsDataClient} = require('@google-cloud/data').v1alpha; - - // Instantiates a client - const dataClient = new AlphaAnalyticsDataClient(); - - async function callRunFunnelReport() { - // Construct request - const request = { - }; - - // Run request - const response = await dataClient.runFunnelReport(request); - console.log(response); - } - - callRunFunnelReport(); - // [END analyticsdata_v1alpha_generated_AlphaAnalyticsData_RunFunnelReport_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.data.v1alpha.json b/owl-bot-staging/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.data.v1alpha.json deleted file mode 100644 index a6468db65..000000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.data.v1alpha.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-data", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.analytics.data.v1alpha", - "version": "v1alpha" - } - ] - }, - "snippets": [ - { - "regionTag": "analyticsdata_v1alpha_generated_AlphaAnalyticsData_RunFunnelReport_async", - "title": "AlphaAnalyticsData runFunnelReport Sample", - "origin": "API_DEFINITION", - "description": " Returns a customized funnel report of your Google Analytics event data. The data returned from the API is as a table with columns for the requested dimensions and metrics. Funnel exploration lets you visualize the steps your users take to complete a task and quickly see how well they are succeeding or failing at each step. For example, how do prospects become shoppers and then become buyers? How do one time buyers become repeat buyers? With this information, you can improve inefficient or abandoned customer journeys. To learn more, see [GA4 Funnel Explorations](https://support.google.com/analytics/answer/9327974).", - "canonical": true, - "file": "alpha_analytics_data.run_funnel_report.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 120, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RunFunnelReport", - "fullName": "google.analytics.data.v1alpha.AlphaAnalyticsData.RunFunnelReport", - "async": true, - "parameters": [ - { - "name": "property", - "type": "TYPE_STRING" - }, - { - "name": "date_ranges", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "funnel", - "type": ".google.analytics.data.v1alpha.Funnel" - }, - { - "name": "funnel_breakdown", - "type": ".google.analytics.data.v1alpha.FunnelBreakdown" - }, - { - "name": "funnel_next_action", - "type": ".google.analytics.data.v1alpha.FunnelNextAction" - }, - { - "name": "funnel_visualization_type", - "type": ".google.analytics.data.v1alpha.RunFunnelReportRequest.FunnelVisualizationType" - }, - { - "name": "segments", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "limit", - "type": "TYPE_INT64" - }, - { - "name": "dimension_filter", - "type": ".google.analytics.data.v1alpha.FilterExpression" - }, - { - "name": "return_property_quota", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.analytics.data.v1alpha.RunFunnelReportResponse", - "client": { - "shortName": "AlphaAnalyticsDataClient", - "fullName": "google.analytics.data.v1alpha.AlphaAnalyticsDataClient" - }, - "method": { - "shortName": "RunFunnelReport", - "fullName": "google.analytics.data.v1alpha.AlphaAnalyticsData.RunFunnelReport", - "service": { - "shortName": "AlphaAnalyticsData", - "fullName": "google.analytics.data.v1alpha.AlphaAnalyticsData" - } - } - } - } - ] -} diff --git a/owl-bot-staging/v1alpha/src/index.ts b/owl-bot-staging/v1alpha/src/index.ts deleted file mode 100644 index 926ad988e..000000000 --- a/owl-bot-staging/v1alpha/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1alpha from './v1alpha'; -const AlphaAnalyticsDataClient = v1alpha.AlphaAnalyticsDataClient; -type AlphaAnalyticsDataClient = v1alpha.AlphaAnalyticsDataClient; -export {v1alpha, AlphaAnalyticsDataClient}; -export default {v1alpha, AlphaAnalyticsDataClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_client.ts b/owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_client.ts deleted file mode 100644 index f1002543e..000000000 --- a/owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_client.ts +++ /dev/null @@ -1,432 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; - -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1alpha/alpha_analytics_data_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './alpha_analytics_data_client_config.json'; - -const version = require('../../../package.json').version; - -/** - * Google Analytics reporting data service. - * @class - * @memberof v1alpha - */ -export class AlphaAnalyticsDataClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - alphaAnalyticsDataStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of AlphaAnalyticsDataClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof AlphaAnalyticsDataClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.analytics.data.v1alpha.AlphaAnalyticsData', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.alphaAnalyticsDataStub) { - return this.alphaAnalyticsDataStub; - } - - // Put together the "service stub" for - // google.analytics.data.v1alpha.AlphaAnalyticsData. - this.alphaAnalyticsDataStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.analytics.data.v1alpha.AlphaAnalyticsData') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.analytics.data.v1alpha.AlphaAnalyticsData, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const alphaAnalyticsDataStubMethods = - ['runFunnelReport']; - for (const methodName of alphaAnalyticsDataStubMethods) { - const callPromise = this.alphaAnalyticsDataStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.alphaAnalyticsDataStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'analyticsdata.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'analyticsdata.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/analytics', - 'https://www.googleapis.com/auth/analytics.readonly' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Returns a customized funnel report of your Google Analytics event data. The - * data returned from the API is as a table with columns for the requested - * dimensions and metrics. - * - * Funnel exploration lets you visualize the steps your users take to complete - * a task and quickly see how well they are succeeding or failing at each - * step. For example, how do prospects become shoppers and then become buyers? - * How do one time buyers become repeat buyers? With this information, you can - * improve inefficient or abandoned customer journeys. To learn more, see [GA4 - * Funnel Explorations](https://support.google.com/analytics/answer/9327974). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.property - * A Google Analytics GA4 property identifier whose events are tracked. - * Specified in the URL path and not the body. To learn more, see [where to - * find your Property - * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - * Within a batch request, this property should either be unspecified or - * consistent with the batch-level property. - * - * Example: properties/1234 - * @param {number[]} request.dateRanges - * Date ranges of data to read. If multiple date ranges are requested, each - * response row will contain a zero based date range index. If two date - * ranges overlap, the event data for the overlapping days is included in the - * response rows for both date ranges. - * @param {google.analytics.data.v1alpha.Funnel} request.funnel - * The configuration of this request's funnel. This funnel configuration is - * required. - * @param {google.analytics.data.v1alpha.FunnelBreakdown} request.funnelBreakdown - * If specified, this breakdown adds a dimension to the funnel table sub - * report response. This breakdown dimension expands each funnel step to the - * unique values of the breakdown dimension. For example, a breakdown by the - * `deviceCategory` dimension will create rows for `mobile`, `tablet`, - * `desktop`, and the total. - * @param {google.analytics.data.v1alpha.FunnelNextAction} request.funnelNextAction - * If specified, next action adds a dimension to the funnel visualization sub - * report response. This next action dimension expands each funnel step to the - * unique values of the next action. For example a next action of the - * `eventName` dimension will create rows for several events (i.e. - * `session_start` & `click`) and the total. - * - * Next action only supports `eventName` and most Page / Screen dimensions - * like `pageTitle` and `pagePath`. - * @param {google.analytics.data.v1alpha.RunFunnelReportRequest.FunnelVisualizationType} request.funnelVisualizationType - * The funnel visualization type controls the dimensions present in the funnel - * visualization sub report response. If not specified, `STANDARD_FUNNEL` is - * used. - * @param {number[]} request.segments - * The configurations of segments. Segments are subsets of a property's data. - * In a funnel report with segments, the funnel is evaluated in each segment. - * - * Each segment specified in this request - * produces a separate row in the response; in the response, each segment - * identified by its name. - * - * The segments parameter is optional. Requests are limited to 4 segments. - * @param {number} request.limit - * The number of rows to return. If unspecified, 10,000 rows are returned. The - * API returns a maximum of 100,000 rows per request, no matter how many you - * ask for. `limit` must be positive. - * - * The API can also return fewer rows than the requested `limit`, if there - * aren't as many dimension values as the `limit`. - * @param {google.analytics.data.v1alpha.FilterExpression} request.dimensionFilter - * Dimension filters allow you to ask for only specific dimension values in - * the report. To learn more, see [Creating a Report: Dimension - * Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) - * for examples. Metrics cannot be used in this filter. - * @param {boolean} request.returnPropertyQuota - * Toggles whether to return the current state of this Analytics Property's - * quota. Quota is returned in [PropertyQuota](#PropertyQuota). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [RunFunnelReportResponse]{@link google.analytics.data.v1alpha.RunFunnelReportResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js - * region_tag:analyticsdata_v1alpha_generated_AlphaAnalyticsData_RunFunnelReport_async - */ - runFunnelReport( - request?: protos.google.analytics.data.v1alpha.IRunFunnelReportRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, - protos.google.analytics.data.v1alpha.IRunFunnelReportRequest|undefined, {}|undefined - ]>; - runFunnelReport( - request: protos.google.analytics.data.v1alpha.IRunFunnelReportRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, - protos.google.analytics.data.v1alpha.IRunFunnelReportRequest|null|undefined, - {}|null|undefined>): void; - runFunnelReport( - request: protos.google.analytics.data.v1alpha.IRunFunnelReportRequest, - callback: Callback< - protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, - protos.google.analytics.data.v1alpha.IRunFunnelReportRequest|null|undefined, - {}|null|undefined>): void; - runFunnelReport( - request?: protos.google.analytics.data.v1alpha.IRunFunnelReportRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, - protos.google.analytics.data.v1alpha.IRunFunnelReportRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, - protos.google.analytics.data.v1alpha.IRunFunnelReportRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, - protos.google.analytics.data.v1alpha.IRunFunnelReportRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'property': request.property || '', - }); - this.initialize(); - return this.innerApiCalls.runFunnelReport(request, options, callback); - } - - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.alphaAnalyticsDataStub && !this._terminated) { - return this.alphaAnalyticsDataStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_client_config.json b/owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_client_config.json deleted file mode 100644 index 89acd1c25..000000000 --- a/owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_client_config.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "interfaces": { - "google.analytics.data.v1alpha.AlphaAnalyticsData": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "RunFunnelReport": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_proto_list.json b/owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_proto_list.json deleted file mode 100644 index 5047e31ed..000000000 --- a/owl-bot-staging/v1alpha/src/v1alpha/alpha_analytics_data_proto_list.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "../../protos/google/analytics/data/v1alpha/analytics_data_api.proto", - "../../protos/google/analytics/data/v1alpha/data.proto" -] diff --git a/owl-bot-staging/v1alpha/src/v1alpha/gapic_metadata.json b/owl-bot-staging/v1alpha/src/v1alpha/gapic_metadata.json deleted file mode 100644 index d96e93cb5..000000000 --- a/owl-bot-staging/v1alpha/src/v1alpha/gapic_metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.analytics.data.v1alpha", - "libraryPackage": "@google-cloud/data", - "services": { - "AlphaAnalyticsData": { - "clients": { - "grpc": { - "libraryClient": "AlphaAnalyticsDataClient", - "rpcs": { - "RunFunnelReport": { - "methods": [ - "runFunnelReport" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "AlphaAnalyticsDataClient", - "rpcs": { - "RunFunnelReport": { - "methods": [ - "runFunnelReport" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/v1alpha/src/v1alpha/index.ts b/owl-bot-staging/v1alpha/src/v1alpha/index.ts deleted file mode 100644 index 9adb2d521..000000000 --- a/owl-bot-staging/v1alpha/src/v1alpha/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {AlphaAnalyticsDataClient} from './alpha_analytics_data_client'; diff --git a/owl-bot-staging/v1alpha/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v1alpha/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 947d5b1cc..000000000 --- a/owl-bot-staging/v1alpha/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const data = require('@google-cloud/data'); - -function main() { - const alphaAnalyticsDataClient = new data.AlphaAnalyticsDataClient(); -} - -main(); diff --git a/owl-bot-staging/v1alpha/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v1alpha/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 93674d4db..000000000 --- a/owl-bot-staging/v1alpha/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {AlphaAnalyticsDataClient} from '@google-cloud/data'; - -// check that the client class type name can be used -function doStuffWithAlphaAnalyticsDataClient(client: AlphaAnalyticsDataClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const alphaAnalyticsDataClient = new AlphaAnalyticsDataClient(); - doStuffWithAlphaAnalyticsDataClient(alphaAnalyticsDataClient); -} - -main(); diff --git a/owl-bot-staging/v1alpha/system-test/install.ts b/owl-bot-staging/v1alpha/system-test/install.ts deleted file mode 100644 index 8ec452229..000000000 --- a/owl-bot-staging/v1alpha/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import { packNTest } from 'pack-n-play'; -import { readFileSync } from 'fs'; -import { describe, it } from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/v1alpha/test/gapic_alpha_analytics_data_v1alpha.ts b/owl-bot-staging/v1alpha/test/gapic_alpha_analytics_data_v1alpha.ts deleted file mode 100644 index 654a76199..000000000 --- a/owl-bot-staging/v1alpha/test/gapic_alpha_analytics_data_v1alpha.ts +++ /dev/null @@ -1,232 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as alphaanalyticsdataModule from '../src'; - -import {protobuf} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -describe('v1alpha.AlphaAnalyticsDataClient', () => { - it('has servicePath', () => { - const servicePath = alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.alphaAnalyticsDataStub, undefined); - await client.initialize(); - assert(client.alphaAnalyticsDataStub); - }); - - it('has close method for the initialized client', done => { - const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.alphaAnalyticsDataStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.alphaAnalyticsDataStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('runFunnelReport', () => { - it('invokes runFunnelReport without error', async () => { - const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1alpha.RunFunnelReportRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1alpha.RunFunnelReportResponse()); - client.innerApiCalls.runFunnelReport = stubSimpleCall(expectedResponse); - const [response] = await client.runFunnelReport(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.runFunnelReport as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes runFunnelReport without error using callback', async () => { - const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1alpha.RunFunnelReportRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1alpha.RunFunnelReportResponse()); - client.innerApiCalls.runFunnelReport = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.runFunnelReport( - request, - (err?: Error|null, result?: protos.google.analytics.data.v1alpha.IRunFunnelReportResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.runFunnelReport as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes runFunnelReport with error', async () => { - const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1alpha.RunFunnelReportRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.runFunnelReport = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.runFunnelReport(request), expectedError); - assert((client.innerApiCalls.runFunnelReport as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes runFunnelReport with closed client', async () => { - const client = new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1alpha.RunFunnelReportRequest()); - request.property = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.runFunnelReport(request), expectedError); - }); - }); -}); diff --git a/owl-bot-staging/v1alpha/tsconfig.json b/owl-bot-staging/v1alpha/tsconfig.json deleted file mode 100644 index c78f1c884..000000000 --- a/owl-bot-staging/v1alpha/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/v1alpha/webpack.config.js b/owl-bot-staging/v1alpha/webpack.config.js deleted file mode 100644 index f5f52a892..000000000 --- a/owl-bot-staging/v1alpha/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 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. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'AlphaAnalyticsData', - filename: './alpha-analytics-data.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/owl-bot-staging/v1beta/.eslintignore b/owl-bot-staging/v1beta/.eslintignore deleted file mode 100644 index cfc348ec4..000000000 --- a/owl-bot-staging/v1beta/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/v1beta/.eslintrc.json b/owl-bot-staging/v1beta/.eslintrc.json deleted file mode 100644 index 782153495..000000000 --- a/owl-bot-staging/v1beta/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/v1beta/.gitignore b/owl-bot-staging/v1beta/.gitignore deleted file mode 100644 index 5d32b2378..000000000 --- a/owl-bot-staging/v1beta/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -.coverage -coverage -.nyc_output -docs/ -out/ -build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/v1beta/.jsdoc.js b/owl-bot-staging/v1beta/.jsdoc.js deleted file mode 100644 index a28a7a092..000000000 --- a/owl-bot-staging/v1beta/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2022 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-analytics/data', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/v1beta/.mocharc.js b/owl-bot-staging/v1beta/.mocharc.js deleted file mode 100644 index 481c522b0..000000000 --- a/owl-bot-staging/v1beta/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/v1beta/.prettierrc.js b/owl-bot-staging/v1beta/.prettierrc.js deleted file mode 100644 index 494e14786..000000000 --- a/owl-bot-staging/v1beta/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/v1beta/README.md b/owl-bot-staging/v1beta/README.md deleted file mode 100644 index 61b6042f8..000000000 --- a/owl-bot-staging/v1beta/README.md +++ /dev/null @@ -1 +0,0 @@ -Data: Nodejs Client diff --git a/owl-bot-staging/v1beta/linkinator.config.json b/owl-bot-staging/v1beta/linkinator.config.json deleted file mode 100644 index befd23c86..000000000 --- a/owl-bot-staging/v1beta/linkinator.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io", - "https://console.cloud.google.com/cloudshell", - "https://support.google.com" - ], - "silent": true, - "concurrency": 5, - "retry": true, - "retryErrors": true, - "retryErrorsCount": 5, - "retryErrorsJitter": 3000 -} diff --git a/owl-bot-staging/v1beta/package.json b/owl-bot-staging/v1beta/package.json deleted file mode 100644 index 8b5966b2d..000000000 --- a/owl-bot-staging/v1beta/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-analytics/data", - "version": "0.1.0", - "description": "Data client for Node.js", - "repository": "googleapis/nodejs-data", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google data", - "data", - "beta analytics data" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^2.29.4" - }, - "devDependencies": { - "@types/mocha": "^9.1.0", - "@types/node": "^16.0.0", - "@types/sinon": "^10.0.8", - "c8": "^7.11.0", - "gts": "^3.1.0", - "jsdoc": "^3.6.7", - "jsdoc-fresh": "^1.1.1", - "jsdoc-region-tag": "^1.3.1", - "linkinator": "^3.0.0", - "mocha": "^9.1.4", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^13.0.0", - "ts-loader": "^9.2.6", - "typescript": "^4.5.5", - "webpack": "^5.67.0", - "webpack-cli": "^4.9.1" - }, - "engines": { - "node": ">=v10.24.0" - } -} diff --git a/owl-bot-staging/v1beta/protos/google/analytics/data/v1beta/analytics_data_api.proto b/owl-bot-staging/v1beta/protos/google/analytics/data/v1beta/analytics_data_api.proto deleted file mode 100644 index b32577e76..000000000 --- a/owl-bot-staging/v1beta/protos/google/analytics/data/v1beta/analytics_data_api.proto +++ /dev/null @@ -1,620 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.analytics.data.v1beta; - -import "google/analytics/data/v1beta/data.proto"; -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; - -option go_package = "google.golang.org/genproto/googleapis/analytics/data/v1beta;data"; -option java_multiple_files = true; -option java_outer_classname = "AnalyticsDataApiProto"; -option java_package = "com.google.analytics.data.v1beta"; - -// Google Analytics reporting data service. -service BetaAnalyticsData { - option (google.api.default_host) = "analyticsdata.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/analytics," - "https://www.googleapis.com/auth/analytics.readonly"; - - // 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. - rpc RunReport(RunReportRequest) returns (RunReportResponse) { - option (google.api.http) = { - post: "/v1beta/{property=properties/*}:runReport" - body: "*" - }; - } - - // Returns a customized pivot report of your Google Analytics event data. - // Pivot reports are more advanced and expressive formats than regular - // reports. In a pivot report, dimensions are only visible if they are - // included in a pivot. Multiple pivots can be specified to further dissect - // your data. - rpc RunPivotReport(RunPivotReportRequest) returns (RunPivotReportResponse) { - option (google.api.http) = { - post: "/v1beta/{property=properties/*}:runPivotReport" - body: "*" - }; - } - - // Returns multiple reports in a batch. All reports must be for the same - // GA4 Property. - rpc BatchRunReports(BatchRunReportsRequest) returns (BatchRunReportsResponse) { - option (google.api.http) = { - post: "/v1beta/{property=properties/*}:batchRunReports" - body: "*" - }; - } - - // Returns multiple pivot reports in a batch. All reports must be for the same - // GA4 Property. - rpc BatchRunPivotReports(BatchRunPivotReportsRequest) returns (BatchRunPivotReportsResponse) { - option (google.api.http) = { - post: "/v1beta/{property=properties/*}:batchRunPivotReports" - body: "*" - }; - } - - // Returns metadata for dimensions and metrics available in reporting methods. - // Used to explore the dimensions and metrics. In this method, a Google - // Analytics GA4 Property Identifier is specified in the request, and - // the metadata response includes Custom dimensions and metrics as well as - // Universal metadata. - // - // For example if a custom metric with parameter name `levels_unlocked` is - // registered to a property, the Metadata response will contain - // `customEvent:levels_unlocked`. Universal metadata are dimensions and - // metrics applicable to any property such as `country` and `totalUsers`. - rpc GetMetadata(GetMetadataRequest) returns (Metadata) { - option (google.api.http) = { - get: "/v1beta/{name=properties/*/metadata}" - }; - option (google.api.method_signature) = "name"; - } - - // 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. - rpc RunRealtimeReport(RunRealtimeReportRequest) returns (RunRealtimeReportResponse) { - option (google.api.http) = { - post: "/v1beta/{property=properties/*}:runRealtimeReport" - body: "*" - }; - } - - // This compatibility method lists dimensions and metrics that can be added to - // a report request and maintain compatibility. This method fails if the - // request's dimensions and metrics are incompatible. - // - // In Google Analytics, reports fail if they request incompatible dimensions - // and/or metrics; in that case, you will need to remove dimensions and/or - // metrics from the incompatible report until the report is compatible. - // - // The Realtime and Core reports have different compatibility rules. This - // method checks compatibility for Core reports. - rpc CheckCompatibility(CheckCompatibilityRequest) returns (CheckCompatibilityResponse) { - option (google.api.http) = { - post: "/v1beta/{property=properties/*}:checkCompatibility" - body: "*" - }; - } -} - -// The request for compatibility information for a report's dimensions and -// metrics. Check compatibility provides a preview of the compatibility of a -// report; fields shared with the `runReport` request should be the same values -// as in your `runReport` request. -message CheckCompatibilityRequest { - // A Google Analytics GA4 property identifier whose events are tracked. To - // learn more, see [where to find your Property - // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - // `property` should be the same value as in your `runReport` request. - // - // Example: properties/1234 - // - // Set the Property ID to 0 for compatibility checking on dimensions and - // metrics common to all properties. In this special mode, this method will - // not return custom dimensions and metrics. - string property = 1; - - // The dimensions in this report. `dimensions` should be the same value as in - // your `runReport` request. - repeated Dimension dimensions = 2; - - // The metrics in this report. `metrics` should be the same value as in your - // `runReport` request. - repeated Metric metrics = 3; - - // The filter clause of dimensions. `dimensionFilter` should be the same value - // as in your `runReport` request. - FilterExpression dimension_filter = 4; - - // The filter clause of metrics. `metricFilter` should be the same value as in - // your `runReport` request - FilterExpression metric_filter = 5; - - // Filters the dimensions and metrics in the response to just this - // compatibility. Commonly used as `”compatibilityFilter”: “COMPATIBLE”` - // to only return compatible dimensions & metrics. - Compatibility compatibility_filter = 6; -} - -// The compatibility response with the compatibility of each dimension & metric. -message CheckCompatibilityResponse { - // The compatibility of each dimension. - repeated DimensionCompatibility dimension_compatibilities = 1; - - // The compatibility of each metric. - repeated MetricCompatibility metric_compatibilities = 2; -} - -// The dimensions and metrics currently accepted in reporting methods. -message Metadata { - option (google.api.resource) = { - type: "analyticsdata.googleapis.com/Metadata" - pattern: "properties/{property}/metadata" - }; - - // Resource name of this metadata. - string name = 3; - - // The dimension descriptions. - repeated DimensionMetadata dimensions = 1; - - // The metric descriptions. - repeated MetricMetadata metrics = 2; -} - -// The request to generate a report. -message RunReportRequest { - // A Google Analytics GA4 property identifier whose events are tracked. - // Specified in the URL path and not the body. To learn more, see [where to - // find your Property - // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - // Within a batch request, this property should either be unspecified or - // consistent with the batch-level property. - // - // Example: properties/1234 - string property = 1; - - // The dimensions requested and displayed. - repeated Dimension dimensions = 2; - - // The metrics requested and displayed. - repeated Metric metrics = 3; - - // Date ranges of data to read. If multiple date ranges are requested, each - // response row will contain a zero based date range index. If two date - // ranges overlap, the event data for the overlapping days is included in the - // response rows for both date ranges. In a cohort request, this `dateRanges` - // must be unspecified. - repeated DateRange date_ranges = 4; - - // Dimension filters allow you to ask for only specific dimension values in - // the report. To learn more, see [Fundamentals of Dimension - // Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) - // for examples. Metrics cannot be used in this filter. - FilterExpression dimension_filter = 5; - - // The filter clause of metrics. Applied at post aggregation phase, similar to - // SQL having-clause. Dimensions cannot be used in this filter. - FilterExpression metric_filter = 6; - - // The row count of the start row. The first row is counted as row 0. - // - // When paging, the first request does not specify offset; or equivalently, - // sets offset to 0; the first request returns the first `limit` of rows. The - // second request sets offset to the `limit` of the first request; the second - // request returns the second `limit` of rows. - // - // To learn more about this pagination parameter, see - // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). - int64 offset = 7; - - // The number of rows to return. If unspecified, 10,000 rows are returned. The - // API returns a maximum of 100,000 rows per request, no matter how many you - // ask for. `limit` must be positive. - // - // The API can also return fewer rows than the requested `limit`, if there - // aren't as many dimension values as the `limit`. For instance, there are - // fewer than 300 possible values for the dimension `country`, so when - // reporting on only `country`, you can't get more than 300 rows, even if you - // set `limit` to a higher value. - // - // To learn more about this pagination parameter, see - // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). - int64 limit = 8; - - // Aggregation of metrics. Aggregated metric values will be shown in rows - // where the dimension_values are set to "RESERVED_(MetricAggregation)". - repeated MetricAggregation metric_aggregations = 9; - - // Specifies how rows are ordered in the response. - repeated OrderBy order_bys = 10; - - // A currency code in ISO4217 format, such as "AED", "USD", "JPY". - // If the field is empty, the report uses the property's default currency. - string currency_code = 11; - - // Cohort group associated with this request. If there is a cohort group - // in the request the 'cohort' dimension must be present. - CohortSpec cohort_spec = 12; - - // If false or unspecified, each row with all metrics equal to 0 will not be - // returned. If true, these rows will be returned if they are not separately - // removed by a filter. - bool keep_empty_rows = 13; - - // Toggles whether to return the current state of this Analytics Property's - // quota. Quota is returned in [PropertyQuota](#PropertyQuota). - bool return_property_quota = 14; -} - -// The response report table corresponding to a request. -message RunReportResponse { - // Describes dimension columns. The number of DimensionHeaders and ordering of - // DimensionHeaders matches the dimensions present in rows. - repeated DimensionHeader dimension_headers = 1; - - // Describes metric columns. The number of MetricHeaders and ordering of - // MetricHeaders matches the metrics present in rows. - repeated MetricHeader metric_headers = 2; - - // Rows of dimension value combinations and metric values in the report. - repeated Row rows = 3; - - // If requested, the totaled values of metrics. - repeated Row totals = 4; - - // If requested, the maximum values of metrics. - repeated Row maximums = 5; - - // If requested, the minimum values of metrics. - repeated Row minimums = 6; - - // The total number of rows in the query result. `rowCount` is independent of - // the number of rows returned in the response, the `limit` request - // parameter, and the `offset` request parameter. For example if a query - // returns 175 rows and includes `limit` of 50 in the API request, the - // response will contain `rowCount` of 175 but only 50 rows. - // - // To learn more about this pagination parameter, see - // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). - int32 row_count = 7; - - // Metadata for the report. - ResponseMetaData metadata = 8; - - // This Analytics Property's quota state including this request. - PropertyQuota property_quota = 9; - - // Identifies what kind of resource this message is. This `kind` is always the - // fixed string "analyticsData#runReport". Useful to distinguish between - // response types in JSON. - string kind = 10; -} - -// The request to generate a pivot report. -message RunPivotReportRequest { - // A Google Analytics GA4 property identifier whose events are tracked. - // Specified in the URL path and not the body. To learn more, see [where to - // find your Property - // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - // Within a batch request, this property should either be unspecified or - // consistent with the batch-level property. - // - // Example: properties/1234 - string property = 1; - - // The dimensions requested. All defined dimensions must be used by one of the - // following: dimension_expression, dimension_filter, pivots, order_bys. - repeated Dimension dimensions = 2; - - // The metrics requested, at least one metric needs to be specified. All - // defined metrics must be used by one of the following: metric_expression, - // metric_filter, order_bys. - repeated Metric metrics = 3; - - // The date range to retrieve event data for the report. If multiple date - // ranges are specified, event data from each date range is used in the - // report. A special dimension with field name "dateRange" can be included in - // a Pivot's field names; if included, the report compares between date - // ranges. In a cohort request, this `dateRanges` must be unspecified. - repeated DateRange date_ranges = 4; - - // Describes the visual format of the report's dimensions in columns or rows. - // The union of the fieldNames (dimension names) in all pivots must be a - // subset of dimension names defined in Dimensions. No two pivots can share a - // dimension. A dimension is only visible if it appears in a pivot. - repeated Pivot pivots = 5; - - // The filter clause of dimensions. Dimensions must be requested to be used in - // this filter. Metrics cannot be used in this filter. - FilterExpression dimension_filter = 6; - - // The filter clause of metrics. Applied at post aggregation phase, similar to - // SQL having-clause. Metrics must be requested to be used in this filter. - // Dimensions cannot be used in this filter. - FilterExpression metric_filter = 7; - - // A currency code in ISO4217 format, such as "AED", "USD", "JPY". - // If the field is empty, the report uses the property's default currency. - string currency_code = 8; - - // Cohort group associated with this request. If there is a cohort group - // in the request the 'cohort' dimension must be present. - CohortSpec cohort_spec = 9; - - // If false or unspecified, each row with all metrics equal to 0 will not be - // returned. If true, these rows will be returned if they are not separately - // removed by a filter. - bool keep_empty_rows = 10; - - // Toggles whether to return the current state of this Analytics Property's - // quota. Quota is returned in [PropertyQuota](#PropertyQuota). - bool return_property_quota = 11; -} - -// The response pivot report table corresponding to a pivot request. -message RunPivotReportResponse { - // Summarizes the columns and rows created by a pivot. Each pivot in the - // request produces one header in the response. If we have a request like - // this: - // - // "pivots": [{ - // "fieldNames": ["country", - // "city"] - // }, - // { - // "fieldNames": "eventName" - // }] - // - // We will have the following `pivotHeaders` in the response: - // - // "pivotHeaders" : [{ - // "dimensionHeaders": [{ - // "dimensionValues": [ - // { "value": "United Kingdom" }, - // { "value": "London" } - // ] - // }, - // { - // "dimensionValues": [ - // { "value": "Japan" }, - // { "value": "Osaka" } - // ] - // }] - // }, - // { - // "dimensionHeaders": [{ - // "dimensionValues": [{ "value": "session_start" }] - // }, - // { - // "dimensionValues": [{ "value": "scroll" }] - // }] - // }] - repeated PivotHeader pivot_headers = 1; - - // Describes dimension columns. The number of DimensionHeaders and ordering of - // DimensionHeaders matches the dimensions present in rows. - repeated DimensionHeader dimension_headers = 2; - - // Describes metric columns. The number of MetricHeaders and ordering of - // MetricHeaders matches the metrics present in rows. - repeated MetricHeader metric_headers = 3; - - // Rows of dimension value combinations and metric values in the report. - repeated Row rows = 4; - - // Aggregation of metric values. Can be totals, minimums, or maximums. The - // returned aggregations are controlled by the metric_aggregations in the - // pivot. The type of aggregation returned in each row is shown by the - // dimension_values which are set to "RESERVED_". - repeated Row aggregates = 5; - - // Metadata for the report. - ResponseMetaData metadata = 6; - - // This Analytics Property's quota state including this request. - PropertyQuota property_quota = 7; - - // Identifies what kind of resource this message is. This `kind` is always the - // fixed string "analyticsData#runPivotReport". Useful to distinguish between - // response types in JSON. - string kind = 8; -} - -// The batch request containing multiple report requests. -message BatchRunReportsRequest { - // A Google Analytics GA4 property identifier whose events are tracked. - // Specified in the URL path and not the body. To learn more, see [where to - // find your Property - // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - // This property must be specified for the batch. The property within - // RunReportRequest may either be unspecified or consistent with this - // property. - // - // Example: properties/1234 - string property = 1; - - // Individual requests. Each request has a separate report response. Each - // batch request is allowed up to 5 requests. - repeated RunReportRequest requests = 2; -} - -// The batch response containing multiple reports. -message BatchRunReportsResponse { - // Individual responses. Each response has a separate report request. - repeated RunReportResponse reports = 1; - - // Identifies what kind of resource this message is. This `kind` is always the - // fixed string "analyticsData#batchRunReports". Useful to distinguish between - // response types in JSON. - string kind = 2; -} - -// The batch request containing multiple pivot report requests. -message BatchRunPivotReportsRequest { - // A Google Analytics GA4 property identifier whose events are tracked. - // Specified in the URL path and not the body. To learn more, see [where to - // find your Property - // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - // This property must be specified for the batch. The property within - // RunPivotReportRequest may either be unspecified or consistent with this - // property. - // - // Example: properties/1234 - string property = 1; - - // Individual requests. Each request has a separate pivot report response. - // Each batch request is allowed up to 5 requests. - repeated RunPivotReportRequest requests = 2; -} - -// The batch response containing multiple pivot reports. -message BatchRunPivotReportsResponse { - // Individual responses. Each response has a separate pivot report request. - repeated RunPivotReportResponse pivot_reports = 1; - - // Identifies what kind of resource this message is. This `kind` is always the - // fixed string "analyticsData#batchRunPivotReports". Useful to distinguish - // between response types in JSON. - string kind = 2; -} - -// Request for a property's dimension and metric metadata. -message GetMetadataRequest { - // 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 - // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - // - // Example: properties/1234/metadata - // - // Set the Property ID to 0 for dimensions and metrics common to all - // properties. In this special mode, this method will not return custom - // dimensions and metrics. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsdata.googleapis.com/Metadata" - } - ]; -} - -// The request to generate a realtime report. -message RunRealtimeReportRequest { - // A Google Analytics GA4 property identifier whose events are tracked. - // Specified in the URL path and not the body. To learn more, see [where to - // find your Property - // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - // - // Example: properties/1234 - string property = 1; - - // The dimensions requested and displayed. - repeated Dimension dimensions = 2; - - // The metrics requested and displayed. - repeated Metric metrics = 3; - - // The filter clause of dimensions. Dimensions must be requested to be used in - // this filter. Metrics cannot be used in this filter. - FilterExpression dimension_filter = 4; - - // The filter clause of metrics. Applied at post aggregation phase, similar to - // SQL having-clause. Metrics must be requested to be used in this filter. - // Dimensions cannot be used in this filter. - FilterExpression metric_filter = 5; - - // The number of rows to return. If unspecified, 10,000 rows are returned. The - // API returns a maximum of 100,000 rows per request, no matter how many you - // ask for. `limit` must be positive. - // - // The API can also return fewer rows than the requested `limit`, if there - // aren't as many dimension values as the `limit`. For instance, there are - // fewer than 300 possible values for the dimension `country`, so when - // reporting on only `country`, you can't get more than 300 rows, even if you - // set `limit` to a higher value. - int64 limit = 6; - - // Aggregation of metrics. Aggregated metric values will be shown in rows - // where the dimension_values are set to "RESERVED_(MetricAggregation)". - repeated MetricAggregation metric_aggregations = 7; - - // Specifies how rows are ordered in the response. - repeated OrderBy order_bys = 8; - - // Toggles whether to return the current state of this Analytics Property's - // Realtime quota. Quota is returned in [PropertyQuota](#PropertyQuota). - bool return_property_quota = 9; - - // The minute ranges of event data to read. If unspecified, one minute range - // for the last 30 minutes will be used. If multiple minute ranges are - // requested, each response row will contain a zero based minute range index. - // If two minute ranges overlap, the event data for the overlapping minutes is - // included in the response rows for both minute ranges. - repeated MinuteRange minute_ranges = 10; -} - -// The response realtime report table corresponding to a request. -message RunRealtimeReportResponse { - // Describes dimension columns. The number of DimensionHeaders and ordering of - // DimensionHeaders matches the dimensions present in rows. - repeated DimensionHeader dimension_headers = 1; - - // Describes metric columns. The number of MetricHeaders and ordering of - // MetricHeaders matches the metrics present in rows. - repeated MetricHeader metric_headers = 2; - - // Rows of dimension value combinations and metric values in the report. - repeated Row rows = 3; - - // If requested, the totaled values of metrics. - repeated Row totals = 4; - - // If requested, the maximum values of metrics. - repeated Row maximums = 5; - - // If requested, the minimum values of metrics. - repeated Row minimums = 6; - - // The total number of rows in the query result. `rowCount` is independent of - // the number of rows returned in the response and the `limit` request - // parameter. For example if a query returns 175 rows and includes `limit` - // of 50 in the API request, the response will contain `rowCount` of 175 but - // only 50 rows. - int32 row_count = 7; - - // This Analytics Property's Realtime quota state including this request. - PropertyQuota property_quota = 8; - - // Identifies what kind of resource this message is. This `kind` is always the - // fixed string "analyticsData#runRealtimeReport". Useful to distinguish - // between response types in JSON. - string kind = 9; -} diff --git a/owl-bot-staging/v1beta/protos/google/analytics/data/v1beta/data.proto b/owl-bot-staging/v1beta/protos/google/analytics/data/v1beta/data.proto deleted file mode 100644 index a33d45538..000000000 --- a/owl-bot-staging/v1beta/protos/google/analytics/data/v1beta/data.proto +++ /dev/null @@ -1,959 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.analytics.data.v1beta; - -option go_package = "google.golang.org/genproto/googleapis/analytics/data/v1beta;data"; -option java_multiple_files = true; -option java_outer_classname = "ReportingApiProto"; -option java_package = "com.google.analytics.data.v1beta"; - -// A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests -// are allowed up to 4 date ranges. -message DateRange { - // The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot - // be after `end_date`. The format `NdaysAgo`, `yesterday`, or `today` is also - // accepted, and in that case, the date is inferred based on the property's - // reporting time zone. - string start_date = 1; - - // The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot - // be before `start_date`. The format `NdaysAgo`, `yesterday`, or `today` is - // also accepted, and in that case, the date is inferred based on the - // property's reporting time zone. - string end_date = 2; - - // Assigns a name to this date range. The dimension `dateRange` is valued to - // this name in a report response. If set, cannot begin with `date_range_` or - // `RESERVED_`. If not set, date ranges are named by their zero based index in - // the request: `date_range_0`, `date_range_1`, etc. - string name = 3; -} - -// A contiguous set of minutes: startMinutesAgo, startMinutesAgo + 1, ..., -// endMinutesAgo. Requests are allowed up to 2 minute ranges. -message MinuteRange { - // The inclusive start minute for the query as a number of minutes before now. - // For example, `"startMinutesAgo": 29` specifies the report should include - // event data from 29 minutes ago and after. Cannot be after `endMinutesAgo`. - // - // If unspecified, `startMinutesAgo` is defaulted to 29. Standard Analytics - // properties can request up to the last 30 minutes of event data - // (`startMinutesAgo <= 29`), and Google Analytics 360 properties can request - // up to the last 60 minutes of event data (`startMinutesAgo <= 59`). - optional int32 start_minutes_ago = 1; - - // The inclusive end minute for the query as a number of minutes before now. - // Cannot be before `startMinutesAgo`. For example, `"endMinutesAgo": 15` - // specifies the report should include event data from prior to 15 minutes - // ago. - // - // If unspecified, `endMinutesAgo` is defaulted to 0. Standard Analytics - // properties can request any minute in the last 30 minutes of event data - // (`endMinutesAgo <= 29`), and Google Analytics 360 properties can request - // any minute in the last 60 minutes of event data (`endMinutesAgo <= 59`). - optional int32 end_minutes_ago = 2; - - // Assigns a name to this minute range. The dimension `dateRange` is valued to - // this name in a report response. If set, cannot begin with `date_range_` or - // `RESERVED_`. If not set, minute ranges are named by their zero based index - // in the request: `date_range_0`, `date_range_1`, etc. - string name = 3; -} - -// Dimensions are attributes of your data. For example, the dimension city -// indicates the city from which an event originates. Dimension values in report -// responses are strings; for example, city could be "Paris" or "New York". -// Requests are allowed up to 9 dimensions. -message Dimension { - // The name of the dimension. See the [API - // Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) - // for the list of dimension names. - // - // If `dimensionExpression` is specified, `name` can be any string that you - // would like within the allowed character set. For example if a - // `dimensionExpression` concatenates `country` and `city`, you could call - // that dimension `countryAndCity`. Dimension names that you choose must match - // the regular expression `^[a-zA-Z0-9_]$`. - // - // Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`, - // `dimensionExpression`, and `pivots`. - string name = 1; - - // One dimension can be the result of an expression of multiple dimensions. - // For example, dimension "country, city": concatenate(country, ", ", city). - DimensionExpression dimension_expression = 2; -} - -// Used to express a dimension which is the result of a formula of multiple -// dimensions. Example usages: -// 1) lower_case(dimension) -// 2) concatenate(dimension1, symbol, dimension2). -message DimensionExpression { - // Used to convert a dimension value to a single case. - message CaseExpression { - // Name of a dimension. The name must refer back to a name in dimensions - // field of the request. - string dimension_name = 1; - } - - // Used to combine dimension values to a single dimension. - message ConcatenateExpression { - // Names of dimensions. The names must refer back to names in the dimensions - // field of the request. - repeated string dimension_names = 1; - - // The delimiter placed between dimension names. - // - // Delimiters are often single characters such as "|" or "," but can be - // longer strings. If a dimension value contains the delimiter, both will be - // present in response with no distinction. For example if dimension 1 value - // = "US,FR", dimension 2 value = "JP", and delimiter = ",", then the - // response will contain "US,FR,JP". - string delimiter = 2; - } - - // Specify one type of dimension expression for `DimensionExpression`. - oneof one_expression { - // Used to convert a dimension value to lower case. - CaseExpression lower_case = 4; - - // Used to convert a dimension value to upper case. - CaseExpression upper_case = 5; - - // Used to combine dimension values to a single dimension. - // For example, dimension "country, city": concatenate(country, ", ", city). - ConcatenateExpression concatenate = 6; - } -} - -// The quantitative measurements of a report. For example, the metric -// `eventCount` is the total number of events. Requests are allowed up to 10 -// metrics. -message Metric { - // The name of the metric. See the [API - // Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics) - // for the list of metric names. - // - // If `expression` is specified, `name` can be any string that you would like - // within the allowed character set. For example if `expression` is - // `screenPageViews/sessions`, you could call that metric's name = - // `viewsPerSession`. Metric names that you choose must match the regular - // expression `^[a-zA-Z0-9_]$`. - // - // Metrics are referenced by `name` in `metricFilter`, `orderBys`, and metric - // `expression`. - string name = 1; - - // A mathematical expression for derived metrics. For example, the metric - // Event count per user is `eventCount/totalUsers`. - string expression = 2; - - // Indicates if a metric is invisible in the report response. If a metric is - // invisible, the metric will not produce a column in the response, but can be - // used in `metricFilter`, `orderBys`, or a metric `expression`. - bool invisible = 3; -} - -// To express dimension or metric filters. -// The fields in the same FilterExpression need to be either all dimensions or -// all metrics. -message FilterExpression { - // Specify one type of filter expression for `FilterExpression`. - oneof expr { - // The FilterExpressions in and_group have an AND relationship. - FilterExpressionList and_group = 1; - - // The FilterExpressions in or_group have an OR relationship. - FilterExpressionList or_group = 2; - - // The FilterExpression is NOT of not_expression. - FilterExpression not_expression = 3; - - // A primitive filter. - // All fields in filter in same FilterExpression needs to be either all - // dimensions or metrics. - Filter filter = 4; - } -} - -// A list of filter expressions. -message FilterExpressionList { - // A list of filter expressions. - repeated FilterExpression expressions = 1; -} - -// An expression to filter dimension or metric values. -message Filter { - // The filter for string - message StringFilter { - // The match type of a string filter - enum MatchType { - // Unspecified - MATCH_TYPE_UNSPECIFIED = 0; - - // Exact match of the string value. - EXACT = 1; - - // Begins with the string value. - BEGINS_WITH = 2; - - // Ends with the string value. - ENDS_WITH = 3; - - // Contains the string value. - CONTAINS = 4; - - // Full regular expression match with the string value. - FULL_REGEXP = 5; - - // Partial regular expression match with the string value. - PARTIAL_REGEXP = 6; - } - - // The match type for this filter. - MatchType match_type = 1; - - // The string value used for the matching. - string value = 2; - - // If true, the string value is case sensitive. - bool case_sensitive = 3; - } - - // The result needs to be in a list of string values. - message InListFilter { - // The list of string values. - // Must be non-empty. - repeated string values = 1; - - // If true, the string value is case sensitive. - bool case_sensitive = 2; - } - - // Filters for numeric or date values. - message NumericFilter { - // The operation applied to a numeric filter - enum Operation { - // Unspecified. - OPERATION_UNSPECIFIED = 0; - - // Equal - EQUAL = 1; - - // Less than - LESS_THAN = 2; - - // Less than or equal - LESS_THAN_OR_EQUAL = 3; - - // Greater than - GREATER_THAN = 4; - - // Greater than or equal - GREATER_THAN_OR_EQUAL = 5; - } - - // The operation type for this filter. - Operation operation = 1; - - // A numeric value or a date value. - NumericValue value = 2; - } - - // To express that the result needs to be between two numbers (inclusive). - message BetweenFilter { - // Begins with this number. - NumericValue from_value = 1; - - // Ends with this number. - NumericValue to_value = 2; - } - - // The dimension name or metric name. Must be a name defined in dimensions - // or metrics. - string field_name = 1; - - // Specify one type of filter for `Filter`. - oneof one_filter { - // Strings related filter. - StringFilter string_filter = 3; - - // A filter for in list values. - InListFilter in_list_filter = 4; - - // A filter for numeric or date values. - NumericFilter numeric_filter = 5; - - // A filter for two values. - BetweenFilter between_filter = 6; - } -} - -// The sort options. -message OrderBy { - // Sorts by metric values. - message MetricOrderBy { - // A metric name in the request to order by. - string metric_name = 1; - } - - // Sorts by dimension values. - message DimensionOrderBy { - // Rule to order the string dimension values by. - enum OrderType { - // Unspecified. - ORDER_TYPE_UNSPECIFIED = 0; - - // Alphanumeric sort by Unicode code point. For example, "2" < "A" < "X" < - // "b" < "z". - ALPHANUMERIC = 1; - - // Case insensitive alphanumeric sort by lower case Unicode code point. - // For example, "2" < "A" < "b" < "X" < "z". - CASE_INSENSITIVE_ALPHANUMERIC = 2; - - // Dimension values are converted to numbers before sorting. For example - // in NUMERIC sort, "25" < "100", and in `ALPHANUMERIC` sort, "100" < - // "25". Non-numeric dimension values all have equal ordering value below - // all numeric values. - NUMERIC = 3; - } - - // A dimension name in the request to order by. - string dimension_name = 1; - - // Controls the rule for dimension value ordering. - OrderType order_type = 2; - } - - // Sorts by a pivot column group. - message PivotOrderBy { - // A pair of dimension names and values. Rows with this dimension pivot pair - // are ordered by the metric's value. - // - // For example if pivots = {{"browser", "Chrome"}} and - // metric_name = "Sessions", - // then the rows will be sorted based on Sessions in Chrome. - // - // ---------|----------|----------------|----------|---------------- - // | Chrome | Chrome | Safari | Safari - // ---------|----------|----------------|----------|---------------- - // Country | Sessions | Pages/Sessions | Sessions | Pages/Sessions - // ---------|----------|----------------|----------|---------------- - // US | 2 | 2 | 3 | 1 - // ---------|----------|----------------|----------|---------------- - // Canada | 3 | 1 | 4 | 1 - // ---------|----------|----------------|----------|---------------- - message PivotSelection { - // Must be a dimension name from the request. - string dimension_name = 1; - - // Order by only when the named dimension is this value. - string dimension_value = 2; - } - - // In the response to order by, order rows by this column. Must be a metric - // name from the request. - string metric_name = 1; - - // Used to select a dimension name and value pivot. If multiple pivot - // selections are given, the sort occurs on rows where all pivot selection - // dimension name and value pairs match the row's dimension name and value - // pair. - repeated PivotSelection pivot_selections = 2; - } - - // Specify one type of order by for `OrderBy`. - oneof one_order_by { - // Sorts results by a metric's values. - MetricOrderBy metric = 1; - - // Sorts results by a dimension's values. - DimensionOrderBy dimension = 2; - - // Sorts results by a metric's values within a pivot column group. - PivotOrderBy pivot = 3; - } - - // If true, sorts by descending order. - bool desc = 4; -} - -// Describes the visible dimension columns and rows in the report response. -message Pivot { - // Dimension names for visible columns in the report response. Including - // "dateRange" produces a date range column; for each row in the response, - // dimension values in the date range column will indicate the corresponding - // date range from the request. - repeated string field_names = 1; - - // Specifies how dimensions are ordered in the pivot. In the first Pivot, the - // OrderBys determine Row and PivotDimensionHeader ordering; in subsequent - // Pivots, the OrderBys determine only PivotDimensionHeader ordering. - // Dimensions specified in these OrderBys must be a subset of - // Pivot.field_names. - repeated OrderBy order_bys = 2; - - // The row count of the start row. The first row is counted as row 0. - int64 offset = 3; - - // The number of unique combinations of dimension values to return in this - // pivot. The `limit` parameter is required. A `limit` of 10,000 is common for - // single pivot requests. - // - // The product of the `limit` for each `pivot` in a `RunPivotReportRequest` - // must not exceed 100,000. For example, a two pivot request with `limit: - // 1000` in each pivot will fail because the product is `1,000,000`. - int64 limit = 4; - - // Aggregate the metrics by dimensions in this pivot using the specified - // metric_aggregations. - repeated MetricAggregation metric_aggregations = 5; -} - -// The specification of cohorts for a cohort report. -// -// Cohort reports create a time series of user retention for the cohort. For -// example, you could select the cohort of users that were acquired in the first -// week of September and follow that cohort for the next six weeks. Selecting -// the users acquired in the first week of September cohort is specified in the -// `cohort` object. Following that cohort for the next six weeks is specified in -// the `cohortsRange` object. -// -// For examples, see [Cohort Report -// Examples](https://developers.google.com/analytics/devguides/reporting/data/v1/advanced#cohort_report_examples). -// -// The report response could show a weekly time series where say your app has -// retained 60% of this cohort after three weeks and 25% of this cohort after -// six weeks. These two percentages can be calculated by the metric -// `cohortActiveUsers/cohortTotalUsers` and will be separate rows in the report. -message CohortSpec { - // Defines the selection criteria to group users into cohorts. - // - // Most cohort reports define only a single cohort. If multiple cohorts are - // specified, each cohort can be recognized in the report by their name. - repeated Cohort cohorts = 1; - - // Cohort reports follow cohorts over an extended reporting date range. This - // range specifies an offset duration to follow the cohorts over. - CohortsRange cohorts_range = 2; - - // Optional settings for a cohort report. - CohortReportSettings cohort_report_settings = 3; -} - -// Defines a cohort selection criteria. A cohort is a group of users who share -// a common characteristic. For example, users with the same `firstSessionDate` -// belong to the same cohort. -message Cohort { - // Assigns a name to this cohort. The dimension `cohort` is valued to this - // name in a report response. If set, cannot begin with `cohort_` or - // `RESERVED_`. If not set, cohorts are named by their zero based index - // `cohort_0`, `cohort_1`, etc. - string name = 1; - - // Dimension used by the cohort. Required and only supports - // `firstSessionDate`. - string dimension = 2; - - // The cohort selects users whose first touch date is between start date and - // end date defined in the `dateRange`. This `dateRange` does not specify the - // full date range of event data that is present in a cohort report. In a - // cohort report, this `dateRange` is extended by the granularity and offset - // present in the `cohortsRange`; event data for the extended reporting date - // range is present in a cohort report. - // - // In a cohort request, this `dateRange` is required and the `dateRanges` in - // the `RunReportRequest` or `RunPivotReportRequest` must be unspecified. - // - // This `dateRange` should generally be aligned with the cohort's granularity. - // If `CohortsRange` uses daily granularity, this `dateRange` can be a single - // day. If `CohortsRange` uses weekly granularity, this `dateRange` can be - // aligned to a week boundary, starting at Sunday and ending Saturday. If - // `CohortsRange` uses monthly granularity, this `dateRange` can be aligned to - // a month, starting at the first and ending on the last day of the month. - DateRange date_range = 3; -} - -// Configures the extended reporting date range for a cohort report. Specifies -// an offset duration to follow the cohorts over. -message CohortsRange { - // The granularity used to interpret the `startOffset` and `endOffset` for the - // extended reporting date range for a cohort report. - enum Granularity { - // Should never be specified. - GRANULARITY_UNSPECIFIED = 0; - - // Daily granularity. Commonly used if the cohort's `dateRange` is a single - // day and the request contains `cohortNthDay`. - DAILY = 1; - - // Weekly granularity. Commonly used if the cohort's `dateRange` is a week - // in duration (starting on Sunday and ending on Saturday) and the request - // contains `cohortNthWeek`. - WEEKLY = 2; - - // Monthly granularity. Commonly used if the cohort's `dateRange` is a month - // in duration and the request contains `cohortNthMonth`. - MONTHLY = 3; - } - - // Required. The granularity used to interpret the `startOffset` and - // `endOffset` for the extended reporting date range for a cohort report. - Granularity granularity = 1; - - // `startOffset` specifies the start date of the extended reporting date range - // for a cohort report. `startOffset` is commonly set to 0 so that reports - // contain data from the acquisition of the cohort forward. - // - // If `granularity` is `DAILY`, the `startDate` of the extended reporting date - // range is `startDate` of the cohort plus `startOffset` days. - // - // If `granularity` is `WEEKLY`, the `startDate` of the extended reporting - // date range is `startDate` of the cohort plus `startOffset * 7` days. - // - // If `granularity` is `MONTHLY`, the `startDate` of the extended reporting - // date range is `startDate` of the cohort plus `startOffset * 30` days. - int32 start_offset = 2; - - // Required. `endOffset` specifies the end date of the extended reporting date - // range for a cohort report. `endOffset` can be any positive integer but is - // commonly set to 5 to 10 so that reports contain data on the cohort for the - // next several granularity time periods. - // - // If `granularity` is `DAILY`, the `endDate` of the extended reporting date - // range is `endDate` of the cohort plus `endOffset` days. - // - // If `granularity` is `WEEKLY`, the `endDate` of the extended reporting date - // range is `endDate` of the cohort plus `endOffset * 7` days. - // - // If `granularity` is `MONTHLY`, the `endDate` of the extended reporting date - // range is `endDate` of the cohort plus `endOffset * 30` days. - int32 end_offset = 3; -} - -// Optional settings of a cohort report. -message CohortReportSettings { - // If true, accumulates the result from first touch day to the end day. Not - // supported in `RunReportRequest`. - bool accumulate = 1; -} - -// Response's metadata carrying additional information about the report content. -message ResponseMetaData { - // The schema restrictions actively enforced in creating this report. To learn - // more, see [Access and data-restriction - // management](https://support.google.com/analytics/answer/10851388). - message SchemaRestrictionResponse { - // A metric actively restricted in creating the report. - message ActiveMetricRestriction { - // The name of the restricted metric. - optional string metric_name = 1; - - // The reason for this metric's restriction. - repeated RestrictedMetricType restricted_metric_types = 2; - } - - // All restrictions actively enforced in creating the report. For example, - // `purchaseRevenue` always has the restriction type `REVENUE_DATA`. - // However, this active response restriction is only populated if the user's - // custom role disallows access to `REVENUE_DATA`. - repeated ActiveMetricRestriction active_metric_restrictions = 1; - } - - // If true, indicates some buckets of dimension combinations are rolled into - // "(other)" row. This can happen for high cardinality reports. - bool data_loss_from_other_row = 3; - - // Describes the schema restrictions actively enforced in creating this - // report. To learn more, see [Access and data-restriction - // management](https://support.google.com/analytics/answer/10851388). - optional SchemaRestrictionResponse schema_restriction_response = 4; - - // The currency code used in this report. Intended to be used in formatting - // currency metrics like `purchaseRevenue` for visualization. If currency_code - // was specified in the request, this response parameter will echo the request - // parameter; otherwise, this response parameter is the property's current - // currency_code. - // - // Currency codes are string encodings of currency types from the ISO 4217 - // standard (https://en.wikipedia.org/wiki/ISO_4217); for example "USD", - // "EUR", "JPY". To learn more, see - // https://support.google.com/analytics/answer/9796179. - optional string currency_code = 5; - - // The property's current timezone. Intended to be used to interpret - // time-based dimensions like `hour` and `minute`. Formatted as strings from - // the IANA Time Zone database (https://www.iana.org/time-zones); for example - // "America/New_York" or "Asia/Tokyo". - optional string time_zone = 6; - - // If empty reason is specified, the report is empty for this reason. - optional string empty_reason = 7; -} - -// Describes a dimension column in the report. Dimensions requested in a report -// produce column entries within rows and DimensionHeaders. However, dimensions -// used exclusively within filters or expressions do not produce columns in a -// report; correspondingly, those dimensions do not produce headers. -message DimensionHeader { - // The dimension's name. - string name = 1; -} - -// Describes a metric column in the report. Visible metrics requested in a -// report produce column entries within rows and MetricHeaders. However, -// metrics used exclusively within filters or expressions do not produce columns -// in a report; correspondingly, those metrics do not produce headers. -message MetricHeader { - // The metric's name. - string name = 1; - - // The metric's data type. - MetricType type = 2; -} - -// Dimensions' values in a single pivot. -message PivotHeader { - // The size is the same as the cardinality of the corresponding dimension - // combinations. - repeated PivotDimensionHeader pivot_dimension_headers = 1; - - // The cardinality of the pivot. The total number of rows for this pivot's - // fields regardless of how the parameters `offset` and `limit` are specified - // in the request. - int32 row_count = 2; -} - -// Summarizes dimension values from a row for this pivot. -message PivotDimensionHeader { - // Values of multiple dimensions in a pivot. - repeated DimensionValue dimension_values = 1; -} - -// Report data for each row. -// For example if RunReportRequest contains: -// -// ```none -// "dimensions": [ -// { -// "name": "eventName" -// }, -// { -// "name": "countryId" -// } -// ], -// "metrics": [ -// { -// "name": "eventCount" -// } -// ] -// ``` -// -// One row with 'in_app_purchase' as the eventName, 'JP' as the countryId, and -// 15 as the eventCount, would be: -// -// ```none -// "dimensionValues": [ -// { -// "value": "in_app_purchase" -// }, -// { -// "value": "JP" -// } -// ], -// "metricValues": [ -// { -// "value": "15" -// } -// ] -// ``` -message Row { - // List of requested dimension values. In a PivotReport, dimension_values - // are only listed for dimensions included in a pivot. - repeated DimensionValue dimension_values = 1; - - // List of requested visible metric values. - repeated MetricValue metric_values = 2; -} - -// The value of a dimension. -message DimensionValue { - // One kind of dimension value - oneof one_value { - // Value as a string if the dimension type is a string. - string value = 1; - } -} - -// The value of a metric. -message MetricValue { - // One of metric value - oneof one_value { - // Measurement value. See MetricHeader for type. - string value = 4; - } -} - -// To represent a number. -message NumericValue { - // One of a numeric value - oneof one_value { - // Integer value - int64 int64_value = 1; - - // Double value - double double_value = 2; - } -} - -// Current state of all quotas for this Analytics Property. If any quota for a -// property is exhausted, all requests to that property will return Resource -// Exhausted errors. -message PropertyQuota { - // Standard Analytics Properties can use up to 25,000 tokens per day; - // Analytics 360 Properties can use 250,000 tokens per day. Most requests - // consume fewer than 10 tokens. - QuotaStatus tokens_per_day = 1; - - // Standard Analytics Properties can use up to 5,000 tokens per hour; - // Analytics 360 Properties can use 50,000 tokens per hour. An API request - // consumes a single number of tokens, and that number is deducted from both - // the hourly and daily quotas. - QuotaStatus tokens_per_hour = 2; - - // Standard Analytics Properties can send up to 10 concurrent requests; - // Analytics 360 Properties can use up to 50 concurrent requests. - QuotaStatus concurrent_requests = 3; - - // Standard Analytics Properties and cloud project pairs can have up to 10 - // server errors per hour; Analytics 360 Properties and cloud project pairs - // can have up to 50 server errors per hour. - QuotaStatus server_errors_per_project_per_hour = 4; - - // Analytics Properties can send up to 120 requests with potentially - // thresholded dimensions per hour. In a batch request, each report request - // is individually counted for this quota if the request contains potentially - // thresholded dimensions. - QuotaStatus potentially_thresholded_requests_per_hour = 5; -} - -// Current state for a particular quota group. -message QuotaStatus { - // Quota consumed by this request. - int32 consumed = 1; - - // Quota remaining after this request. - int32 remaining = 2; -} - -// Explains a dimension. -message DimensionMetadata { - // This dimension's name. Useable in [Dimension](#Dimension)'s `name`. For - // example, `eventName`. - string api_name = 1; - - // This dimension's name within the Google Analytics user interface. For - // example, `Event name`. - string ui_name = 2; - - // Description of how this dimension is used and calculated. - string description = 3; - - // Still usable but deprecated names for this dimension. If populated, this - // dimension is available by either `apiName` or one of `deprecatedApiNames` - // for a period of time. After the deprecation period, the dimension will be - // available only by `apiName`. - repeated string deprecated_api_names = 4; - - // True if the dimension is a custom dimension for this property. - bool custom_definition = 5; - - // The display name of the category that this dimension belongs to. Similar - // dimensions and metrics are categorized together. - string category = 7; -} - -// Explains a metric. -message MetricMetadata { - // Justifications for why this metric is blocked. - enum BlockedReason { - // Will never be specified in API response. - BLOCKED_REASON_UNSPECIFIED = 0; - - // If present, your access is blocked to revenue related metrics for this - // property, and this metric is revenue related. - NO_REVENUE_METRICS = 1; - - // If present, your access is blocked to cost related metrics for this - // property, and this metric is cost related. - NO_COST_METRICS = 2; - } - - // A metric name. Useable in [Metric](#Metric)'s `name`. For example, - // `eventCount`. - string api_name = 1; - - // This metric's name within the Google Analytics user interface. For example, - // `Event count`. - string ui_name = 2; - - // Description of how this metric is used and calculated. - string description = 3; - - // Still usable but deprecated names for this metric. If populated, this - // metric is available by either `apiName` or one of `deprecatedApiNames` - // for a period of time. After the deprecation period, the metric will be - // available only by `apiName`. - repeated string deprecated_api_names = 4; - - // The type of this metric. - MetricType type = 5; - - // The mathematical expression for this derived metric. Can be used in - // [Metric](#Metric)'s `expression` field for equivalent reports. Most metrics - // are not expressions, and for non-expressions, this field is empty. - string expression = 6; - - // True if the metric is a custom metric for this property. - bool custom_definition = 7; - - // If reasons are specified, your access is blocked to this metric for this - // property. API requests from you to this property for this metric will - // succeed; however, the report will contain only zeros for this metric. API - // requests with metric filters on blocked metrics will fail. If reasons are - // empty, you have access to this metric. - // - // To learn more, see [Access and data-restriction - // management](https://support.google.com/analytics/answer/10851388). - repeated BlockedReason blocked_reasons = 8; - - // The display name of the category that this metrics belongs to. Similar - // dimensions and metrics are categorized together. - string category = 10; -} - -// The compatibility for a single dimension. -message DimensionCompatibility { - // The dimension metadata contains the API name for this compatibility - // information. The dimension metadata also contains other helpful information - // like the UI name and description. - optional DimensionMetadata dimension_metadata = 1; - - // The compatibility of this dimension. If the compatibility is COMPATIBLE, - // this dimension can be successfully added to the report. - optional Compatibility compatibility = 2; -} - -// The compatibility for a single metric. -message MetricCompatibility { - // The metric metadata contains the API name for this compatibility - // information. The metric metadata also contains other helpful information - // like the UI name and description. - optional MetricMetadata metric_metadata = 1; - - // The compatibility of this metric. If the compatibility is COMPATIBLE, - // this metric can be successfully added to the report. - optional Compatibility compatibility = 2; -} - -// Represents aggregation of metrics. -enum MetricAggregation { - // Unspecified operator. - METRIC_AGGREGATION_UNSPECIFIED = 0; - - // SUM operator. - TOTAL = 1; - - // Minimum operator. - MINIMUM = 5; - - // Maximum operator. - MAXIMUM = 6; - - // Count operator. - COUNT = 4; -} - -// A metric's value type. -enum MetricType { - // Unspecified type. - METRIC_TYPE_UNSPECIFIED = 0; - - // Integer type. - TYPE_INTEGER = 1; - - // Floating point type. - TYPE_FLOAT = 2; - - // A duration of seconds; a special floating point type. - TYPE_SECONDS = 4; - - // A duration in milliseconds; a special floating point type. - TYPE_MILLISECONDS = 5; - - // A duration in minutes; a special floating point type. - TYPE_MINUTES = 6; - - // A duration in hours; a special floating point type. - TYPE_HOURS = 7; - - // A custom metric of standard type; a special floating point type. - TYPE_STANDARD = 8; - - // An amount of money; a special floating point type. - TYPE_CURRENCY = 9; - - // A length in feet; a special floating point type. - TYPE_FEET = 10; - - // A length in miles; a special floating point type. - TYPE_MILES = 11; - - // A length in meters; a special floating point type. - TYPE_METERS = 12; - - // A length in kilometers; a special floating point type. - TYPE_KILOMETERS = 13; -} - -// Categories of data that you may be restricted from viewing on certain GA4 -// properties. -enum RestrictedMetricType { - // Unspecified type. - RESTRICTED_METRIC_TYPE_UNSPECIFIED = 0; - - // Cost metrics such as `adCost`. - COST_DATA = 1; - - // Revenue metrics such as `purchaseRevenue`. - REVENUE_DATA = 2; -} - -// The compatibility types for a single dimension or metric. -enum Compatibility { - // Unspecified compatibility. - COMPATIBILITY_UNSPECIFIED = 0; - - // The dimension or metric is compatible. This dimension or metric can be - // successfully added to a report. - COMPATIBLE = 1; - - // The dimension or metric is incompatible. This dimension or metric cannot be - // successfully added to a report. - INCOMPATIBLE = 2; -} diff --git a/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js b/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js deleted file mode 100644 index be57e2ecb..000000000 --- a/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js +++ /dev/null @@ -1,69 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunPivotReports_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * A Google Analytics GA4 property identifier whose events are tracked. - * Specified in the URL path and not the body. To learn more, see where to - * find your Property - * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - * This property must be specified for the batch. The property within - * RunPivotReportRequest may either be unspecified or consistent with this - * property. - * Example: properties/1234 - */ - // const property = 'abc123' - /** - * Individual requests. Each request has a separate pivot report response. - * Each batch request is allowed up to 5 requests. - */ - // const requests = 1234 - - // Imports the Data library - const {BetaAnalyticsDataClient} = require('@google-analytics/data').v1beta; - - // Instantiates a client - const dataClient = new BetaAnalyticsDataClient(); - - async function callBatchRunPivotReports() { - // Construct request - const request = { - }; - - // Run request - const response = await dataClient.batchRunPivotReports(request); - console.log(response); - } - - callBatchRunPivotReports(); - // [END analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunPivotReports_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.batch_run_reports.js b/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.batch_run_reports.js deleted file mode 100644 index 4677d77f1..000000000 --- a/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.batch_run_reports.js +++ /dev/null @@ -1,69 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunReports_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * A Google Analytics GA4 property identifier whose events are tracked. - * Specified in the URL path and not the body. To learn more, see where to - * find your Property - * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - * This property must be specified for the batch. The property within - * RunReportRequest may either be unspecified or consistent with this - * property. - * Example: properties/1234 - */ - // const property = 'abc123' - /** - * Individual requests. Each request has a separate report response. Each - * batch request is allowed up to 5 requests. - */ - // const requests = 1234 - - // Imports the Data library - const {BetaAnalyticsDataClient} = require('@google-analytics/data').v1beta; - - // Instantiates a client - const dataClient = new BetaAnalyticsDataClient(); - - async function callBatchRunReports() { - // Construct request - const request = { - }; - - // Run request - const response = await dataClient.batchRunReports(request); - console.log(response); - } - - callBatchRunReports(); - // [END analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunReports_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.check_compatibility.js b/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.check_compatibility.js deleted file mode 100644 index e5ef6a610..000000000 --- a/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.check_compatibility.js +++ /dev/null @@ -1,90 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START analyticsdata_v1beta_generated_BetaAnalyticsData_CheckCompatibility_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * A Google Analytics GA4 property identifier whose events are tracked. To - * learn more, see where to find your Property - * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - * `property` should be the same value as in your `runReport` request. - * Example: properties/1234 - * Set the Property ID to 0 for compatibility checking on dimensions and - * metrics common to all properties. In this special mode, this method will - * not return custom dimensions and metrics. - */ - // const property = 'abc123' - /** - * The dimensions in this report. `dimensions` should be the same value as in - * your `runReport` request. - */ - // const dimensions = 1234 - /** - * The metrics in this report. `metrics` should be the same value as in your - * `runReport` request. - */ - // const metrics = 1234 - /** - * The filter clause of dimensions. `dimensionFilter` should be the same value - * as in your `runReport` request. - */ - // const dimensionFilter = {} - /** - * The filter clause of metrics. `metricFilter` should be the same value as in - * your `runReport` request - */ - // const metricFilter = {} - /** - * Filters the dimensions and metrics in the response to just this - * compatibility. Commonly used as `”compatibilityFilter”: “COMPATIBLE”` - * to only return compatible dimensions & metrics. - */ - // const compatibilityFilter = {} - - // Imports the Data library - const {BetaAnalyticsDataClient} = require('@google-analytics/data').v1beta; - - // Instantiates a client - const dataClient = new BetaAnalyticsDataClient(); - - async function callCheckCompatibility() { - // Construct request - const request = { - }; - - // Run request - const response = await dataClient.checkCompatibility(request); - console.log(response); - } - - callCheckCompatibility(); - // [END analyticsdata_v1beta_generated_BetaAnalyticsData_CheckCompatibility_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.get_metadata.js b/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.get_metadata.js deleted file mode 100644 index e489bbda5..000000000 --- a/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.get_metadata.js +++ /dev/null @@ -1,66 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START analyticsdata_v1beta_generated_BetaAnalyticsData_GetMetadata_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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 - * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - * Example: properties/1234/metadata - * Set the Property ID to 0 for dimensions and metrics common to all - * properties. In this special mode, this method will not return custom - * dimensions and metrics. - */ - // const name = 'abc123' - - // Imports the Data library - const {BetaAnalyticsDataClient} = require('@google-analytics/data').v1beta; - - // Instantiates a client - const dataClient = new BetaAnalyticsDataClient(); - - async function callGetMetadata() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataClient.getMetadata(request); - console.log(response); - } - - callGetMetadata(); - // [END analyticsdata_v1beta_generated_BetaAnalyticsData_GetMetadata_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_pivot_report.js b/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_pivot_report.js deleted file mode 100644 index 4bb4c0483..000000000 --- a/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_pivot_report.js +++ /dev/null @@ -1,121 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START analyticsdata_v1beta_generated_BetaAnalyticsData_RunPivotReport_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * A Google Analytics GA4 property identifier whose events are tracked. - * Specified in the URL path and not the body. To learn more, see where to - * find your Property - * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - * Within a batch request, this property should either be unspecified or - * consistent with the batch-level property. - * Example: properties/1234 - */ - // const property = 'abc123' - /** - * The dimensions requested. All defined dimensions must be used by one of the - * following: dimension_expression, dimension_filter, pivots, order_bys. - */ - // const dimensions = 1234 - /** - * The metrics requested, at least one metric needs to be specified. All - * defined metrics must be used by one of the following: metric_expression, - * metric_filter, order_bys. - */ - // const metrics = 1234 - /** - * The date range to retrieve event data for the report. If multiple date - * ranges are specified, event data from each date range is used in the - * report. A special dimension with field name "dateRange" can be included in - * a Pivot's field names; if included, the report compares between date - * ranges. In a cohort request, this `dateRanges` must be unspecified. - */ - // const dateRanges = 1234 - /** - * Describes the visual format of the report's dimensions in columns or rows. - * The union of the fieldNames (dimension names) in all pivots must be a - * subset of dimension names defined in Dimensions. No two pivots can share a - * dimension. A dimension is only visible if it appears in a pivot. - */ - // const pivots = 1234 - /** - * The filter clause of dimensions. Dimensions must be requested to be used in - * this filter. Metrics cannot be used in this filter. - */ - // const dimensionFilter = {} - /** - * The filter clause of metrics. Applied at post aggregation phase, similar to - * SQL having-clause. Metrics must be requested to be used in this filter. - * Dimensions cannot be used in this filter. - */ - // const metricFilter = {} - /** - * A currency code in ISO4217 format, such as "AED", "USD", "JPY". - * If the field is empty, the report uses the property's default currency. - */ - // const currencyCode = 'abc123' - /** - * Cohort group associated with this request. If there is a cohort group - * in the request the 'cohort' dimension must be present. - */ - // const cohortSpec = {} - /** - * If false or unspecified, each row with all metrics equal to 0 will not be - * returned. If true, these rows will be returned if they are not separately - * removed by a filter. - */ - // const keepEmptyRows = true - /** - * Toggles whether to return the current state of this Analytics Property's - * quota. Quota is returned in PropertyQuota (#PropertyQuota). - */ - // const returnPropertyQuota = true - - // Imports the Data library - const {BetaAnalyticsDataClient} = require('@google-analytics/data').v1beta; - - // Instantiates a client - const dataClient = new BetaAnalyticsDataClient(); - - async function callRunPivotReport() { - // Construct request - const request = { - }; - - // Run request - const response = await dataClient.runPivotReport(request); - console.log(response); - } - - callRunPivotReport(); - // [END analyticsdata_v1beta_generated_BetaAnalyticsData_RunPivotReport_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_realtime_report.js b/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_realtime_report.js deleted file mode 100644 index 12618945c..000000000 --- a/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_realtime_report.js +++ /dev/null @@ -1,113 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START analyticsdata_v1beta_generated_BetaAnalyticsData_RunRealtimeReport_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * A Google Analytics GA4 property identifier whose events are tracked. - * Specified in the URL path and not the body. To learn more, see where to - * find your Property - * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - * Example: properties/1234 - */ - // const property = 'abc123' - /** - * The dimensions requested and displayed. - */ - // const dimensions = 1234 - /** - * The metrics requested and displayed. - */ - // const metrics = 1234 - /** - * The filter clause of dimensions. Dimensions must be requested to be used in - * this filter. Metrics cannot be used in this filter. - */ - // const dimensionFilter = {} - /** - * The filter clause of metrics. Applied at post aggregation phase, similar to - * SQL having-clause. Metrics must be requested to be used in this filter. - * Dimensions cannot be used in this filter. - */ - // const metricFilter = {} - /** - * The number of rows to return. If unspecified, 10,000 rows are returned. The - * API returns a maximum of 100,000 rows per request, no matter how many you - * ask for. `limit` must be positive. - * The API can also return fewer rows than the requested `limit`, if there - * aren't as many dimension values as the `limit`. For instance, there are - * fewer than 300 possible values for the dimension `country`, so when - * reporting on only `country`, you can't get more than 300 rows, even if you - * set `limit` to a higher value. - */ - // const limit = 1234 - /** - * Aggregation of metrics. Aggregated metric values will be shown in rows - * where the dimension_values are set to "RESERVED_(MetricAggregation)". - */ - // const metricAggregations = 1234 - /** - * Specifies how rows are ordered in the response. - */ - // const orderBys = 1234 - /** - * Toggles whether to return the current state of this Analytics Property's - * Realtime quota. Quota is returned in PropertyQuota (#PropertyQuota). - */ - // const returnPropertyQuota = true - /** - * The minute ranges of event data to read. If unspecified, one minute range - * for the last 30 minutes will be used. If multiple minute ranges are - * requested, each response row will contain a zero based minute range index. - * If two minute ranges overlap, the event data for the overlapping minutes is - * included in the response rows for both minute ranges. - */ - // const minuteRanges = 1234 - - // Imports the Data library - const {BetaAnalyticsDataClient} = require('@google-analytics/data').v1beta; - - // Instantiates a client - const dataClient = new BetaAnalyticsDataClient(); - - async function callRunRealtimeReport() { - // Construct request - const request = { - }; - - // Run request - const response = await dataClient.runRealtimeReport(request); - console.log(response); - } - - callRunRealtimeReport(); - // [END analyticsdata_v1beta_generated_BetaAnalyticsData_RunRealtimeReport_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_report.js b/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_report.js deleted file mode 100644 index 1da71d36b..000000000 --- a/owl-bot-staging/v1beta/samples/generated/v1beta/beta_analytics_data.run_report.js +++ /dev/null @@ -1,144 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START analyticsdata_v1beta_generated_BetaAnalyticsData_RunReport_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * A Google Analytics GA4 property identifier whose events are tracked. - * Specified in the URL path and not the body. To learn more, see where to - * find your Property - * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - * Within a batch request, this property should either be unspecified or - * consistent with the batch-level property. - * Example: properties/1234 - */ - // const property = 'abc123' - /** - * The dimensions requested and displayed. - */ - // const dimensions = 1234 - /** - * The metrics requested and displayed. - */ - // const metrics = 1234 - /** - * Date ranges of data to read. If multiple date ranges are requested, each - * response row will contain a zero based date range index. If two date - * ranges overlap, the event data for the overlapping days is included in the - * response rows for both date ranges. In a cohort request, this `dateRanges` - * must be unspecified. - */ - // const dateRanges = 1234 - /** - * Dimension filters allow you to ask for only specific dimension values in - * the report. To learn more, see Fundamentals of Dimension - * Filters (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) - * for examples. Metrics cannot be used in this filter. - */ - // const dimensionFilter = {} - /** - * The filter clause of metrics. Applied at post aggregation phase, similar to - * SQL having-clause. Dimensions cannot be used in this filter. - */ - // const metricFilter = {} - /** - * The row count of the start row. The first row is counted as row 0. - * When paging, the first request does not specify offset; or equivalently, - * sets offset to 0; the first request returns the first `limit` of rows. The - * second request sets offset to the `limit` of the first request; the second - * request returns the second `limit` of rows. - * To learn more about this pagination parameter, see - * Pagination (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). - */ - // const offset = 1234 - /** - * The number of rows to return. If unspecified, 10,000 rows are returned. The - * API returns a maximum of 100,000 rows per request, no matter how many you - * ask for. `limit` must be positive. - * The API can also return fewer rows than the requested `limit`, if there - * aren't as many dimension values as the `limit`. For instance, there are - * fewer than 300 possible values for the dimension `country`, so when - * reporting on only `country`, you can't get more than 300 rows, even if you - * set `limit` to a higher value. - * To learn more about this pagination parameter, see - * Pagination (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). - */ - // const limit = 1234 - /** - * Aggregation of metrics. Aggregated metric values will be shown in rows - * where the dimension_values are set to "RESERVED_(MetricAggregation)". - */ - // const metricAggregations = 1234 - /** - * Specifies how rows are ordered in the response. - */ - // const orderBys = 1234 - /** - * A currency code in ISO4217 format, such as "AED", "USD", "JPY". - * If the field is empty, the report uses the property's default currency. - */ - // const currencyCode = 'abc123' - /** - * Cohort group associated with this request. If there is a cohort group - * in the request the 'cohort' dimension must be present. - */ - // const cohortSpec = {} - /** - * If false or unspecified, each row with all metrics equal to 0 will not be - * returned. If true, these rows will be returned if they are not separately - * removed by a filter. - */ - // const keepEmptyRows = true - /** - * Toggles whether to return the current state of this Analytics Property's - * quota. Quota is returned in PropertyQuota (#PropertyQuota). - */ - // const returnPropertyQuota = true - - // Imports the Data library - const {BetaAnalyticsDataClient} = require('@google-analytics/data').v1beta; - - // Instantiates a client - const dataClient = new BetaAnalyticsDataClient(); - - async function callRunReport() { - // Construct request - const request = { - }; - - // Run request - const response = await dataClient.runReport(request); - console.log(response); - } - - callRunReport(); - // [END analyticsdata_v1beta_generated_BetaAnalyticsData_RunReport_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta/samples/generated/v1beta/snippet_metadata.google.analytics.data.v1beta.json b/owl-bot-staging/v1beta/samples/generated/v1beta/snippet_metadata.google.analytics.data.v1beta.json deleted file mode 100644 index 37e2aa574..000000000 --- a/owl-bot-staging/v1beta/samples/generated/v1beta/snippet_metadata.google.analytics.data.v1beta.json +++ /dev/null @@ -1,451 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-data", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.analytics.data.v1beta", - "version": "v1beta" - } - ] - }, - "snippets": [ - { - "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_RunReport_async", - "title": "BetaAnalyticsData runReport Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "beta_analytics_data.run_report.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 136, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RunReport", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.RunReport", - "async": true, - "parameters": [ - { - "name": "property", - "type": "TYPE_STRING" - }, - { - "name": "dimensions", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "metrics", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "date_ranges", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "dimension_filter", - "type": ".google.analytics.data.v1beta.FilterExpression" - }, - { - "name": "metric_filter", - "type": ".google.analytics.data.v1beta.FilterExpression" - }, - { - "name": "offset", - "type": "TYPE_INT64" - }, - { - "name": "limit", - "type": "TYPE_INT64" - }, - { - "name": "metric_aggregations", - "type": "TYPE_ENUM[]" - }, - { - "name": "order_bys", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "currency_code", - "type": "TYPE_STRING" - }, - { - "name": "cohort_spec", - "type": ".google.analytics.data.v1beta.CohortSpec" - }, - { - "name": "keep_empty_rows", - "type": "TYPE_BOOL" - }, - { - "name": "return_property_quota", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.analytics.data.v1beta.RunReportResponse", - "client": { - "shortName": "BetaAnalyticsDataClient", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsDataClient" - }, - "method": { - "shortName": "RunReport", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.RunReport", - "service": { - "shortName": "BetaAnalyticsData", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsData" - } - } - } - }, - { - "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_RunPivotReport_async", - "title": "BetaAnalyticsData runPivotReport Sample", - "origin": "API_DEFINITION", - "description": " Returns a customized pivot report of your Google Analytics event data. Pivot reports are more advanced and expressive formats than regular reports. In a pivot report, dimensions are only visible if they are included in a pivot. Multiple pivots can be specified to further dissect your data.", - "canonical": true, - "file": "beta_analytics_data.run_pivot_report.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 113, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RunPivotReport", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.RunPivotReport", - "async": true, - "parameters": [ - { - "name": "property", - "type": "TYPE_STRING" - }, - { - "name": "dimensions", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "metrics", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "date_ranges", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "pivots", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "dimension_filter", - "type": ".google.analytics.data.v1beta.FilterExpression" - }, - { - "name": "metric_filter", - "type": ".google.analytics.data.v1beta.FilterExpression" - }, - { - "name": "currency_code", - "type": "TYPE_STRING" - }, - { - "name": "cohort_spec", - "type": ".google.analytics.data.v1beta.CohortSpec" - }, - { - "name": "keep_empty_rows", - "type": "TYPE_BOOL" - }, - { - "name": "return_property_quota", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.analytics.data.v1beta.RunPivotReportResponse", - "client": { - "shortName": "BetaAnalyticsDataClient", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsDataClient" - }, - "method": { - "shortName": "RunPivotReport", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.RunPivotReport", - "service": { - "shortName": "BetaAnalyticsData", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsData" - } - } - } - }, - { - "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunReports_async", - "title": "BetaAnalyticsData batchRunReports Sample", - "origin": "API_DEFINITION", - "description": " Returns multiple reports in a batch. All reports must be for the same GA4 Property.", - "canonical": true, - "file": "beta_analytics_data.batch_run_reports.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchRunReports", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.BatchRunReports", - "async": true, - "parameters": [ - { - "name": "property", - "type": "TYPE_STRING" - }, - { - "name": "requests", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.analytics.data.v1beta.BatchRunReportsResponse", - "client": { - "shortName": "BetaAnalyticsDataClient", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsDataClient" - }, - "method": { - "shortName": "BatchRunReports", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.BatchRunReports", - "service": { - "shortName": "BetaAnalyticsData", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsData" - } - } - } - }, - { - "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunPivotReports_async", - "title": "BetaAnalyticsData batchRunPivotReports Sample", - "origin": "API_DEFINITION", - "description": " Returns multiple pivot reports in a batch. All reports must be for the same GA4 Property.", - "canonical": true, - "file": "beta_analytics_data.batch_run_pivot_reports.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchRunPivotReports", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.BatchRunPivotReports", - "async": true, - "parameters": [ - { - "name": "property", - "type": "TYPE_STRING" - }, - { - "name": "requests", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.analytics.data.v1beta.BatchRunPivotReportsResponse", - "client": { - "shortName": "BetaAnalyticsDataClient", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsDataClient" - }, - "method": { - "shortName": "BatchRunPivotReports", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.BatchRunPivotReports", - "service": { - "shortName": "BetaAnalyticsData", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsData" - } - } - } - }, - { - "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_GetMetadata_async", - "title": "BetaAnalyticsData getMetadata Sample", - "origin": "API_DEFINITION", - "description": " Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics GA4 Property Identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata. For example if a custom metric with parameter name `levels_unlocked` is registered to a property, the Metadata response will contain `customEvent:levels_unlocked`. Universal metadata are dimensions and metrics applicable to any property such as `country` and `totalUsers`.", - "canonical": true, - "file": "beta_analytics_data.get_metadata.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetMetadata", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.GetMetadata", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.data.v1beta.Metadata", - "client": { - "shortName": "BetaAnalyticsDataClient", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsDataClient" - }, - "method": { - "shortName": "GetMetadata", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.GetMetadata", - "service": { - "shortName": "BetaAnalyticsData", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsData" - } - } - } - }, - { - "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_RunRealtimeReport_async", - "title": "BetaAnalyticsData runRealtimeReport Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "beta_analytics_data.run_realtime_report.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 105, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RunRealtimeReport", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.RunRealtimeReport", - "async": true, - "parameters": [ - { - "name": "property", - "type": "TYPE_STRING" - }, - { - "name": "dimensions", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "metrics", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "dimension_filter", - "type": ".google.analytics.data.v1beta.FilterExpression" - }, - { - "name": "metric_filter", - "type": ".google.analytics.data.v1beta.FilterExpression" - }, - { - "name": "limit", - "type": "TYPE_INT64" - }, - { - "name": "metric_aggregations", - "type": "TYPE_ENUM[]" - }, - { - "name": "order_bys", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "return_property_quota", - "type": "TYPE_BOOL" - }, - { - "name": "minute_ranges", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.analytics.data.v1beta.RunRealtimeReportResponse", - "client": { - "shortName": "BetaAnalyticsDataClient", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsDataClient" - }, - "method": { - "shortName": "RunRealtimeReport", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.RunRealtimeReport", - "service": { - "shortName": "BetaAnalyticsData", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsData" - } - } - } - }, - { - "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_CheckCompatibility_async", - "title": "BetaAnalyticsData checkCompatibility Sample", - "origin": "API_DEFINITION", - "description": " This compatibility method lists dimensions and metrics that can be added to a report request and maintain compatibility. This method fails if the request's dimensions and metrics are incompatible. In Google Analytics, reports fail if they request incompatible dimensions and/or metrics; in that case, you will need to remove dimensions and/or metrics from the incompatible report until the report is compatible. The Realtime and Core reports have different compatibility rules. This method checks compatibility for Core reports.", - "canonical": true, - "file": "beta_analytics_data.check_compatibility.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 82, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CheckCompatibility", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.CheckCompatibility", - "async": true, - "parameters": [ - { - "name": "property", - "type": "TYPE_STRING" - }, - { - "name": "dimensions", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "metrics", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "dimension_filter", - "type": ".google.analytics.data.v1beta.FilterExpression" - }, - { - "name": "metric_filter", - "type": ".google.analytics.data.v1beta.FilterExpression" - }, - { - "name": "compatibility_filter", - "type": ".google.analytics.data.v1beta.Compatibility" - } - ], - "resultType": ".google.analytics.data.v1beta.CheckCompatibilityResponse", - "client": { - "shortName": "BetaAnalyticsDataClient", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsDataClient" - }, - "method": { - "shortName": "CheckCompatibility", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.CheckCompatibility", - "service": { - "shortName": "BetaAnalyticsData", - "fullName": "google.analytics.data.v1beta.BetaAnalyticsData" - } - } - } - } - ] -} diff --git a/owl-bot-staging/v1beta/src/index.ts b/owl-bot-staging/v1beta/src/index.ts deleted file mode 100644 index 03c54ab9b..000000000 --- a/owl-bot-staging/v1beta/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1beta from './v1beta'; -const BetaAnalyticsDataClient = v1beta.BetaAnalyticsDataClient; -type BetaAnalyticsDataClient = v1beta.BetaAnalyticsDataClient; -export {v1beta, BetaAnalyticsDataClient}; -export default {v1beta, BetaAnalyticsDataClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_client.ts b/owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_client.ts deleted file mode 100644 index c05aac27b..000000000 --- a/owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_client.ts +++ /dev/null @@ -1,1067 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; - -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta/beta_analytics_data_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './beta_analytics_data_client_config.json'; - -const version = require('../../../package.json').version; - -/** - * Google Analytics reporting data service. - * @class - * @memberof v1beta - */ -export class BetaAnalyticsDataClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - betaAnalyticsDataStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of BetaAnalyticsDataClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof BetaAnalyticsDataClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - metadataPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/metadata' - ), - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.analytics.data.v1beta.BetaAnalyticsData', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.betaAnalyticsDataStub) { - return this.betaAnalyticsDataStub; - } - - // Put together the "service stub" for - // google.analytics.data.v1beta.BetaAnalyticsData. - this.betaAnalyticsDataStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.analytics.data.v1beta.BetaAnalyticsData') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.analytics.data.v1beta.BetaAnalyticsData, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const betaAnalyticsDataStubMethods = - ['runReport', 'runPivotReport', 'batchRunReports', 'batchRunPivotReports', 'getMetadata', 'runRealtimeReport', 'checkCompatibility']; - for (const methodName of betaAnalyticsDataStubMethods) { - const callPromise = this.betaAnalyticsDataStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.betaAnalyticsDataStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'analyticsdata.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'analyticsdata.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/analytics', - 'https://www.googleapis.com/auth/analytics.readonly' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.property - * A Google Analytics GA4 property identifier whose events are tracked. - * Specified in the URL path and not the body. To learn more, see [where to - * find your Property - * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - * Within a batch request, this property should either be unspecified or - * consistent with the batch-level property. - * - * Example: properties/1234 - * @param {number[]} request.dimensions - * The dimensions requested and displayed. - * @param {number[]} request.metrics - * The metrics requested and displayed. - * @param {number[]} request.dateRanges - * Date ranges of data to read. If multiple date ranges are requested, each - * response row will contain a zero based date range index. If two date - * ranges overlap, the event data for the overlapping days is included in the - * response rows for both date ranges. In a cohort request, this `dateRanges` - * must be unspecified. - * @param {google.analytics.data.v1beta.FilterExpression} request.dimensionFilter - * Dimension filters allow you to ask for only specific dimension values in - * the report. To learn more, see [Fundamentals of Dimension - * Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) - * for examples. Metrics cannot be used in this filter. - * @param {google.analytics.data.v1beta.FilterExpression} request.metricFilter - * The filter clause of metrics. Applied at post aggregation phase, similar to - * SQL having-clause. Dimensions cannot be used in this filter. - * @param {number} request.offset - * The row count of the start row. The first row is counted as row 0. - * - * When paging, the first request does not specify offset; or equivalently, - * sets offset to 0; the first request returns the first `limit` of rows. The - * second request sets offset to the `limit` of the first request; the second - * request returns the second `limit` of rows. - * - * To learn more about this pagination parameter, see - * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). - * @param {number} request.limit - * The number of rows to return. If unspecified, 10,000 rows are returned. The - * API returns a maximum of 100,000 rows per request, no matter how many you - * ask for. `limit` must be positive. - * - * The API can also return fewer rows than the requested `limit`, if there - * aren't as many dimension values as the `limit`. For instance, there are - * fewer than 300 possible values for the dimension `country`, so when - * reporting on only `country`, you can't get more than 300 rows, even if you - * set `limit` to a higher value. - * - * To learn more about this pagination parameter, see - * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). - * @param {number[]} request.metricAggregations - * Aggregation of metrics. Aggregated metric values will be shown in rows - * where the dimension_values are set to "RESERVED_(MetricAggregation)". - * @param {number[]} request.orderBys - * Specifies how rows are ordered in the response. - * @param {string} request.currencyCode - * A currency code in ISO4217 format, such as "AED", "USD", "JPY". - * If the field is empty, the report uses the property's default currency. - * @param {google.analytics.data.v1beta.CohortSpec} request.cohortSpec - * Cohort group associated with this request. If there is a cohort group - * in the request the 'cohort' dimension must be present. - * @param {boolean} request.keepEmptyRows - * If false or unspecified, each row with all metrics equal to 0 will not be - * returned. If true, these rows will be returned if they are not separately - * removed by a filter. - * @param {boolean} request.returnPropertyQuota - * Toggles whether to return the current state of this Analytics Property's - * quota. Quota is returned in [PropertyQuota](#PropertyQuota). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [RunReportResponse]{@link google.analytics.data.v1beta.RunReportResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta/beta_analytics_data.run_report.js - * region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_RunReport_async - */ - runReport( - request?: protos.google.analytics.data.v1beta.IRunReportRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.data.v1beta.IRunReportResponse, - protos.google.analytics.data.v1beta.IRunReportRequest|undefined, {}|undefined - ]>; - runReport( - request: protos.google.analytics.data.v1beta.IRunReportRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.data.v1beta.IRunReportResponse, - protos.google.analytics.data.v1beta.IRunReportRequest|null|undefined, - {}|null|undefined>): void; - runReport( - request: protos.google.analytics.data.v1beta.IRunReportRequest, - callback: Callback< - protos.google.analytics.data.v1beta.IRunReportResponse, - protos.google.analytics.data.v1beta.IRunReportRequest|null|undefined, - {}|null|undefined>): void; - runReport( - request?: protos.google.analytics.data.v1beta.IRunReportRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.data.v1beta.IRunReportResponse, - protos.google.analytics.data.v1beta.IRunReportRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.data.v1beta.IRunReportResponse, - protos.google.analytics.data.v1beta.IRunReportRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.data.v1beta.IRunReportResponse, - protos.google.analytics.data.v1beta.IRunReportRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'property': request.property || '', - }); - this.initialize(); - return this.innerApiCalls.runReport(request, options, callback); - } -/** - * Returns a customized pivot report of your Google Analytics event data. - * Pivot reports are more advanced and expressive formats than regular - * reports. In a pivot report, dimensions are only visible if they are - * included in a pivot. Multiple pivots can be specified to further dissect - * your data. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.property - * A Google Analytics GA4 property identifier whose events are tracked. - * Specified in the URL path and not the body. To learn more, see [where to - * find your Property - * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - * Within a batch request, this property should either be unspecified or - * consistent with the batch-level property. - * - * Example: properties/1234 - * @param {number[]} request.dimensions - * The dimensions requested. All defined dimensions must be used by one of the - * following: dimension_expression, dimension_filter, pivots, order_bys. - * @param {number[]} request.metrics - * The metrics requested, at least one metric needs to be specified. All - * defined metrics must be used by one of the following: metric_expression, - * metric_filter, order_bys. - * @param {number[]} request.dateRanges - * The date range to retrieve event data for the report. If multiple date - * ranges are specified, event data from each date range is used in the - * report. A special dimension with field name "dateRange" can be included in - * a Pivot's field names; if included, the report compares between date - * ranges. In a cohort request, this `dateRanges` must be unspecified. - * @param {number[]} request.pivots - * Describes the visual format of the report's dimensions in columns or rows. - * The union of the fieldNames (dimension names) in all pivots must be a - * subset of dimension names defined in Dimensions. No two pivots can share a - * dimension. A dimension is only visible if it appears in a pivot. - * @param {google.analytics.data.v1beta.FilterExpression} request.dimensionFilter - * The filter clause of dimensions. Dimensions must be requested to be used in - * this filter. Metrics cannot be used in this filter. - * @param {google.analytics.data.v1beta.FilterExpression} request.metricFilter - * The filter clause of metrics. Applied at post aggregation phase, similar to - * SQL having-clause. Metrics must be requested to be used in this filter. - * Dimensions cannot be used in this filter. - * @param {string} request.currencyCode - * A currency code in ISO4217 format, such as "AED", "USD", "JPY". - * If the field is empty, the report uses the property's default currency. - * @param {google.analytics.data.v1beta.CohortSpec} request.cohortSpec - * Cohort group associated with this request. If there is a cohort group - * in the request the 'cohort' dimension must be present. - * @param {boolean} request.keepEmptyRows - * If false or unspecified, each row with all metrics equal to 0 will not be - * returned. If true, these rows will be returned if they are not separately - * removed by a filter. - * @param {boolean} request.returnPropertyQuota - * Toggles whether to return the current state of this Analytics Property's - * quota. Quota is returned in [PropertyQuota](#PropertyQuota). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [RunPivotReportResponse]{@link google.analytics.data.v1beta.RunPivotReportResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta/beta_analytics_data.run_pivot_report.js - * region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_RunPivotReport_async - */ - runPivotReport( - request?: protos.google.analytics.data.v1beta.IRunPivotReportRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.data.v1beta.IRunPivotReportResponse, - protos.google.analytics.data.v1beta.IRunPivotReportRequest|undefined, {}|undefined - ]>; - runPivotReport( - request: protos.google.analytics.data.v1beta.IRunPivotReportRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.data.v1beta.IRunPivotReportResponse, - protos.google.analytics.data.v1beta.IRunPivotReportRequest|null|undefined, - {}|null|undefined>): void; - runPivotReport( - request: protos.google.analytics.data.v1beta.IRunPivotReportRequest, - callback: Callback< - protos.google.analytics.data.v1beta.IRunPivotReportResponse, - protos.google.analytics.data.v1beta.IRunPivotReportRequest|null|undefined, - {}|null|undefined>): void; - runPivotReport( - request?: protos.google.analytics.data.v1beta.IRunPivotReportRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.data.v1beta.IRunPivotReportResponse, - protos.google.analytics.data.v1beta.IRunPivotReportRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.data.v1beta.IRunPivotReportResponse, - protos.google.analytics.data.v1beta.IRunPivotReportRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.data.v1beta.IRunPivotReportResponse, - protos.google.analytics.data.v1beta.IRunPivotReportRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'property': request.property || '', - }); - this.initialize(); - return this.innerApiCalls.runPivotReport(request, options, callback); - } -/** - * Returns multiple reports in a batch. All reports must be for the same - * GA4 Property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.property - * A Google Analytics GA4 property identifier whose events are tracked. - * Specified in the URL path and not the body. To learn more, see [where to - * find your Property - * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - * This property must be specified for the batch. The property within - * RunReportRequest may either be unspecified or consistent with this - * property. - * - * Example: properties/1234 - * @param {number[]} request.requests - * Individual requests. Each request has a separate report response. Each - * batch request is allowed up to 5 requests. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [BatchRunReportsResponse]{@link google.analytics.data.v1beta.BatchRunReportsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta/beta_analytics_data.batch_run_reports.js - * region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunReports_async - */ - batchRunReports( - request?: protos.google.analytics.data.v1beta.IBatchRunReportsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.data.v1beta.IBatchRunReportsResponse, - protos.google.analytics.data.v1beta.IBatchRunReportsRequest|undefined, {}|undefined - ]>; - batchRunReports( - request: protos.google.analytics.data.v1beta.IBatchRunReportsRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.data.v1beta.IBatchRunReportsResponse, - protos.google.analytics.data.v1beta.IBatchRunReportsRequest|null|undefined, - {}|null|undefined>): void; - batchRunReports( - request: protos.google.analytics.data.v1beta.IBatchRunReportsRequest, - callback: Callback< - protos.google.analytics.data.v1beta.IBatchRunReportsResponse, - protos.google.analytics.data.v1beta.IBatchRunReportsRequest|null|undefined, - {}|null|undefined>): void; - batchRunReports( - request?: protos.google.analytics.data.v1beta.IBatchRunReportsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.data.v1beta.IBatchRunReportsResponse, - protos.google.analytics.data.v1beta.IBatchRunReportsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.data.v1beta.IBatchRunReportsResponse, - protos.google.analytics.data.v1beta.IBatchRunReportsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.data.v1beta.IBatchRunReportsResponse, - protos.google.analytics.data.v1beta.IBatchRunReportsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'property': request.property || '', - }); - this.initialize(); - return this.innerApiCalls.batchRunReports(request, options, callback); - } -/** - * Returns multiple pivot reports in a batch. All reports must be for the same - * GA4 Property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.property - * A Google Analytics GA4 property identifier whose events are tracked. - * Specified in the URL path and not the body. To learn more, see [where to - * find your Property - * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - * This property must be specified for the batch. The property within - * RunPivotReportRequest may either be unspecified or consistent with this - * property. - * - * Example: properties/1234 - * @param {number[]} request.requests - * Individual requests. Each request has a separate pivot report response. - * Each batch request is allowed up to 5 requests. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [BatchRunPivotReportsResponse]{@link google.analytics.data.v1beta.BatchRunPivotReportsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js - * region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunPivotReports_async - */ - batchRunPivotReports( - request?: protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse, - protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest|undefined, {}|undefined - ]>; - batchRunPivotReports( - request: protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse, - protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest|null|undefined, - {}|null|undefined>): void; - batchRunPivotReports( - request: protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest, - callback: Callback< - protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse, - protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest|null|undefined, - {}|null|undefined>): void; - batchRunPivotReports( - request?: protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse, - protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse, - protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse, - protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'property': request.property || '', - }); - this.initialize(); - return this.innerApiCalls.batchRunPivotReports(request, options, callback); - } -/** - * Returns metadata for dimensions and metrics available in reporting methods. - * Used to explore the dimensions and metrics. In this method, a Google - * Analytics GA4 Property Identifier is specified in the request, and - * the metadata response includes Custom dimensions and metrics as well as - * Universal metadata. - * - * For example if a custom metric with parameter name `levels_unlocked` is - * registered to a property, the Metadata response will contain - * `customEvent:levels_unlocked`. Universal metadata are dimensions and - * metrics applicable to any property such as `country` and `totalUsers`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.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 - * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - * - * Example: properties/1234/metadata - * - * Set the Property ID to 0 for dimensions and metrics common to all - * properties. In this special mode, this method will not return custom - * dimensions and metrics. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Metadata]{@link google.analytics.data.v1beta.Metadata}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta/beta_analytics_data.get_metadata.js - * region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_GetMetadata_async - */ - getMetadata( - request?: protos.google.analytics.data.v1beta.IGetMetadataRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.data.v1beta.IMetadata, - protos.google.analytics.data.v1beta.IGetMetadataRequest|undefined, {}|undefined - ]>; - getMetadata( - request: protos.google.analytics.data.v1beta.IGetMetadataRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.data.v1beta.IMetadata, - protos.google.analytics.data.v1beta.IGetMetadataRequest|null|undefined, - {}|null|undefined>): void; - getMetadata( - request: protos.google.analytics.data.v1beta.IGetMetadataRequest, - callback: Callback< - protos.google.analytics.data.v1beta.IMetadata, - protos.google.analytics.data.v1beta.IGetMetadataRequest|null|undefined, - {}|null|undefined>): void; - getMetadata( - request?: protos.google.analytics.data.v1beta.IGetMetadataRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.data.v1beta.IMetadata, - protos.google.analytics.data.v1beta.IGetMetadataRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.data.v1beta.IMetadata, - protos.google.analytics.data.v1beta.IGetMetadataRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.data.v1beta.IMetadata, - protos.google.analytics.data.v1beta.IGetMetadataRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getMetadata(request, options, callback); - } -/** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.property - * A Google Analytics GA4 property identifier whose events are tracked. - * Specified in the URL path and not the body. To learn more, see [where to - * find your Property - * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - * - * Example: properties/1234 - * @param {number[]} request.dimensions - * The dimensions requested and displayed. - * @param {number[]} request.metrics - * The metrics requested and displayed. - * @param {google.analytics.data.v1beta.FilterExpression} request.dimensionFilter - * The filter clause of dimensions. Dimensions must be requested to be used in - * this filter. Metrics cannot be used in this filter. - * @param {google.analytics.data.v1beta.FilterExpression} request.metricFilter - * The filter clause of metrics. Applied at post aggregation phase, similar to - * SQL having-clause. Metrics must be requested to be used in this filter. - * Dimensions cannot be used in this filter. - * @param {number} request.limit - * The number of rows to return. If unspecified, 10,000 rows are returned. The - * API returns a maximum of 100,000 rows per request, no matter how many you - * ask for. `limit` must be positive. - * - * The API can also return fewer rows than the requested `limit`, if there - * aren't as many dimension values as the `limit`. For instance, there are - * fewer than 300 possible values for the dimension `country`, so when - * reporting on only `country`, you can't get more than 300 rows, even if you - * set `limit` to a higher value. - * @param {number[]} request.metricAggregations - * Aggregation of metrics. Aggregated metric values will be shown in rows - * where the dimension_values are set to "RESERVED_(MetricAggregation)". - * @param {number[]} request.orderBys - * Specifies how rows are ordered in the response. - * @param {boolean} request.returnPropertyQuota - * Toggles whether to return the current state of this Analytics Property's - * Realtime quota. Quota is returned in [PropertyQuota](#PropertyQuota). - * @param {number[]} request.minuteRanges - * The minute ranges of event data to read. If unspecified, one minute range - * for the last 30 minutes will be used. If multiple minute ranges are - * requested, each response row will contain a zero based minute range index. - * If two minute ranges overlap, the event data for the overlapping minutes is - * included in the response rows for both minute ranges. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [RunRealtimeReportResponse]{@link google.analytics.data.v1beta.RunRealtimeReportResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta/beta_analytics_data.run_realtime_report.js - * region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_RunRealtimeReport_async - */ - runRealtimeReport( - request?: protos.google.analytics.data.v1beta.IRunRealtimeReportRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.data.v1beta.IRunRealtimeReportResponse, - protos.google.analytics.data.v1beta.IRunRealtimeReportRequest|undefined, {}|undefined - ]>; - runRealtimeReport( - request: protos.google.analytics.data.v1beta.IRunRealtimeReportRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.data.v1beta.IRunRealtimeReportResponse, - protos.google.analytics.data.v1beta.IRunRealtimeReportRequest|null|undefined, - {}|null|undefined>): void; - runRealtimeReport( - request: protos.google.analytics.data.v1beta.IRunRealtimeReportRequest, - callback: Callback< - protos.google.analytics.data.v1beta.IRunRealtimeReportResponse, - protos.google.analytics.data.v1beta.IRunRealtimeReportRequest|null|undefined, - {}|null|undefined>): void; - runRealtimeReport( - request?: protos.google.analytics.data.v1beta.IRunRealtimeReportRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.data.v1beta.IRunRealtimeReportResponse, - protos.google.analytics.data.v1beta.IRunRealtimeReportRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.data.v1beta.IRunRealtimeReportResponse, - protos.google.analytics.data.v1beta.IRunRealtimeReportRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.data.v1beta.IRunRealtimeReportResponse, - protos.google.analytics.data.v1beta.IRunRealtimeReportRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'property': request.property || '', - }); - this.initialize(); - return this.innerApiCalls.runRealtimeReport(request, options, callback); - } -/** - * This compatibility method lists dimensions and metrics that can be added to - * a report request and maintain compatibility. This method fails if the - * request's dimensions and metrics are incompatible. - * - * In Google Analytics, reports fail if they request incompatible dimensions - * and/or metrics; in that case, you will need to remove dimensions and/or - * metrics from the incompatible report until the report is compatible. - * - * The Realtime and Core reports have different compatibility rules. This - * method checks compatibility for Core reports. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.property - * A Google Analytics GA4 property identifier whose events are tracked. To - * learn more, see [where to find your Property - * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). - * `property` should be the same value as in your `runReport` request. - * - * Example: properties/1234 - * - * Set the Property ID to 0 for compatibility checking on dimensions and - * metrics common to all properties. In this special mode, this method will - * not return custom dimensions and metrics. - * @param {number[]} request.dimensions - * The dimensions in this report. `dimensions` should be the same value as in - * your `runReport` request. - * @param {number[]} request.metrics - * The metrics in this report. `metrics` should be the same value as in your - * `runReport` request. - * @param {google.analytics.data.v1beta.FilterExpression} request.dimensionFilter - * The filter clause of dimensions. `dimensionFilter` should be the same value - * as in your `runReport` request. - * @param {google.analytics.data.v1beta.FilterExpression} request.metricFilter - * The filter clause of metrics. `metricFilter` should be the same value as in - * your `runReport` request - * @param {google.analytics.data.v1beta.Compatibility} request.compatibilityFilter - * Filters the dimensions and metrics in the response to just this - * compatibility. Commonly used as `”compatibilityFilter”: “COMPATIBLE”` - * to only return compatible dimensions & metrics. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CheckCompatibilityResponse]{@link google.analytics.data.v1beta.CheckCompatibilityResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta/beta_analytics_data.check_compatibility.js - * region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_CheckCompatibility_async - */ - checkCompatibility( - request?: protos.google.analytics.data.v1beta.ICheckCompatibilityRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.data.v1beta.ICheckCompatibilityResponse, - protos.google.analytics.data.v1beta.ICheckCompatibilityRequest|undefined, {}|undefined - ]>; - checkCompatibility( - request: protos.google.analytics.data.v1beta.ICheckCompatibilityRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.data.v1beta.ICheckCompatibilityResponse, - protos.google.analytics.data.v1beta.ICheckCompatibilityRequest|null|undefined, - {}|null|undefined>): void; - checkCompatibility( - request: protos.google.analytics.data.v1beta.ICheckCompatibilityRequest, - callback: Callback< - protos.google.analytics.data.v1beta.ICheckCompatibilityResponse, - protos.google.analytics.data.v1beta.ICheckCompatibilityRequest|null|undefined, - {}|null|undefined>): void; - checkCompatibility( - request?: protos.google.analytics.data.v1beta.ICheckCompatibilityRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.data.v1beta.ICheckCompatibilityResponse, - protos.google.analytics.data.v1beta.ICheckCompatibilityRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.data.v1beta.ICheckCompatibilityResponse, - protos.google.analytics.data.v1beta.ICheckCompatibilityRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.data.v1beta.ICheckCompatibilityResponse, - protos.google.analytics.data.v1beta.ICheckCompatibilityRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'property': request.property || '', - }); - this.initialize(); - return this.innerApiCalls.checkCompatibility(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified metadata resource name string. - * - * @param {string} property - * @returns {string} Resource name string. - */ - metadataPath(property:string) { - return this.pathTemplates.metadataPathTemplate.render({ - property: property, - }); - } - - /** - * Parse the property from Metadata resource. - * - * @param {string} metadataName - * A fully-qualified path representing Metadata resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromMetadataName(metadataName: string) { - return this.pathTemplates.metadataPathTemplate.match(metadataName).property; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.betaAnalyticsDataStub && !this._terminated) { - return this.betaAnalyticsDataStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_client_config.json b/owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_client_config.json deleted file mode 100644 index 6cea5f968..000000000 --- a/owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_client_config.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "interfaces": { - "google.analytics.data.v1beta.BetaAnalyticsData": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unknown": [ - "UNKNOWN" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "RunReport": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RunPivotReport": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchRunReports": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchRunPivotReports": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetMetadata": { - "timeout_millis": 60000, - "retry_codes_name": "unknown", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "RunRealtimeReport": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CheckCompatibility": { - "timeout_millis": 60000, - "retry_codes_name": "unknown", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - } - } - } - } -} diff --git a/owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_proto_list.json b/owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_proto_list.json deleted file mode 100644 index 89471a423..000000000 --- a/owl-bot-staging/v1beta/src/v1beta/beta_analytics_data_proto_list.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "../../protos/google/analytics/data/v1beta/analytics_data_api.proto", - "../../protos/google/analytics/data/v1beta/data.proto" -] diff --git a/owl-bot-staging/v1beta/src/v1beta/gapic_metadata.json b/owl-bot-staging/v1beta/src/v1beta/gapic_metadata.json deleted file mode 100644 index 3ec307b6a..000000000 --- a/owl-bot-staging/v1beta/src/v1beta/gapic_metadata.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.analytics.data.v1beta", - "libraryPackage": "@google-analytics/data", - "services": { - "BetaAnalyticsData": { - "clients": { - "grpc": { - "libraryClient": "BetaAnalyticsDataClient", - "rpcs": { - "RunReport": { - "methods": [ - "runReport" - ] - }, - "RunPivotReport": { - "methods": [ - "runPivotReport" - ] - }, - "BatchRunReports": { - "methods": [ - "batchRunReports" - ] - }, - "BatchRunPivotReports": { - "methods": [ - "batchRunPivotReports" - ] - }, - "GetMetadata": { - "methods": [ - "getMetadata" - ] - }, - "RunRealtimeReport": { - "methods": [ - "runRealtimeReport" - ] - }, - "CheckCompatibility": { - "methods": [ - "checkCompatibility" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "BetaAnalyticsDataClient", - "rpcs": { - "RunReport": { - "methods": [ - "runReport" - ] - }, - "RunPivotReport": { - "methods": [ - "runPivotReport" - ] - }, - "BatchRunReports": { - "methods": [ - "batchRunReports" - ] - }, - "BatchRunPivotReports": { - "methods": [ - "batchRunPivotReports" - ] - }, - "GetMetadata": { - "methods": [ - "getMetadata" - ] - }, - "RunRealtimeReport": { - "methods": [ - "runRealtimeReport" - ] - }, - "CheckCompatibility": { - "methods": [ - "checkCompatibility" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/v1beta/src/v1beta/index.ts b/owl-bot-staging/v1beta/src/v1beta/index.ts deleted file mode 100644 index 36af99e4a..000000000 --- a/owl-bot-staging/v1beta/src/v1beta/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {BetaAnalyticsDataClient} from './beta_analytics_data_client'; diff --git a/owl-bot-staging/v1beta/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v1beta/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 75c874a34..000000000 --- a/owl-bot-staging/v1beta/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const data = require('@google-analytics/data'); - -function main() { - const betaAnalyticsDataClient = new data.BetaAnalyticsDataClient(); -} - -main(); diff --git a/owl-bot-staging/v1beta/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v1beta/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index f052efcd6..000000000 --- a/owl-bot-staging/v1beta/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {BetaAnalyticsDataClient} from '@google-analytics/data'; - -// check that the client class type name can be used -function doStuffWithBetaAnalyticsDataClient(client: BetaAnalyticsDataClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const betaAnalyticsDataClient = new BetaAnalyticsDataClient(); - doStuffWithBetaAnalyticsDataClient(betaAnalyticsDataClient); -} - -main(); diff --git a/owl-bot-staging/v1beta/system-test/install.ts b/owl-bot-staging/v1beta/system-test/install.ts deleted file mode 100644 index 8ec452229..000000000 --- a/owl-bot-staging/v1beta/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import { packNTest } from 'pack-n-play'; -import { readFileSync } from 'fs'; -import { describe, it } from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/v1beta/test/gapic_beta_analytics_data_v1beta.ts b/owl-bot-staging/v1beta/test/gapic_beta_analytics_data_v1beta.ts deleted file mode 100644 index 002375486..000000000 --- a/owl-bot-staging/v1beta/test/gapic_beta_analytics_data_v1beta.ts +++ /dev/null @@ -1,847 +0,0 @@ -// 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as betaanalyticsdataModule from '../src'; - -import {protobuf} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -describe('v1beta.BetaAnalyticsDataClient', () => { - it('has servicePath', () => { - const servicePath = betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.betaAnalyticsDataStub, undefined); - await client.initialize(); - assert(client.betaAnalyticsDataStub); - }); - - it('has close method for the initialized client', done => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.betaAnalyticsDataStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.betaAnalyticsDataStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('runReport', () => { - it('invokes runReport without error', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunReportRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.RunReportResponse()); - client.innerApiCalls.runReport = stubSimpleCall(expectedResponse); - const [response] = await client.runReport(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.runReport as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes runReport without error using callback', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunReportRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.RunReportResponse()); - client.innerApiCalls.runReport = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.runReport( - request, - (err?: Error|null, result?: protos.google.analytics.data.v1beta.IRunReportResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.runReport as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes runReport with error', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunReportRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.runReport = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.runReport(request), expectedError); - assert((client.innerApiCalls.runReport as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes runReport with closed client', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunReportRequest()); - request.property = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.runReport(request), expectedError); - }); - }); - - describe('runPivotReport', () => { - it('invokes runPivotReport without error', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunPivotReportRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.RunPivotReportResponse()); - client.innerApiCalls.runPivotReport = stubSimpleCall(expectedResponse); - const [response] = await client.runPivotReport(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.runPivotReport as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes runPivotReport without error using callback', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunPivotReportRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.RunPivotReportResponse()); - client.innerApiCalls.runPivotReport = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.runPivotReport( - request, - (err?: Error|null, result?: protos.google.analytics.data.v1beta.IRunPivotReportResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.runPivotReport as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes runPivotReport with error', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunPivotReportRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.runPivotReport = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.runPivotReport(request), expectedError); - assert((client.innerApiCalls.runPivotReport as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes runPivotReport with closed client', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunPivotReportRequest()); - request.property = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.runPivotReport(request), expectedError); - }); - }); - - describe('batchRunReports', () => { - it('invokes batchRunReports without error', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunReportsRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunReportsResponse()); - client.innerApiCalls.batchRunReports = stubSimpleCall(expectedResponse); - const [response] = await client.batchRunReports(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchRunReports as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchRunReports without error using callback', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunReportsRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunReportsResponse()); - client.innerApiCalls.batchRunReports = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchRunReports( - request, - (err?: Error|null, result?: protos.google.analytics.data.v1beta.IBatchRunReportsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchRunReports as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes batchRunReports with error', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunReportsRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchRunReports = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchRunReports(request), expectedError); - assert((client.innerApiCalls.batchRunReports as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchRunReports with closed client', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunReportsRequest()); - request.property = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchRunReports(request), expectedError); - }); - }); - - describe('batchRunPivotReports', () => { - it('invokes batchRunPivotReports without error', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunPivotReportsRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunPivotReportsResponse()); - client.innerApiCalls.batchRunPivotReports = stubSimpleCall(expectedResponse); - const [response] = await client.batchRunPivotReports(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchRunPivotReports as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchRunPivotReports without error using callback', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunPivotReportsRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunPivotReportsResponse()); - client.innerApiCalls.batchRunPivotReports = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchRunPivotReports( - request, - (err?: Error|null, result?: protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchRunPivotReports as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes batchRunPivotReports with error', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunPivotReportsRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchRunPivotReports = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchRunPivotReports(request), expectedError); - assert((client.innerApiCalls.batchRunPivotReports as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchRunPivotReports with closed client', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.BatchRunPivotReportsRequest()); - request.property = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchRunPivotReports(request), expectedError); - }); - }); - - describe('getMetadata', () => { - it('invokes getMetadata without error', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.GetMetadataRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.Metadata()); - client.innerApiCalls.getMetadata = stubSimpleCall(expectedResponse); - const [response] = await client.getMetadata(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getMetadata as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getMetadata without error using callback', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.GetMetadataRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.Metadata()); - client.innerApiCalls.getMetadata = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getMetadata( - request, - (err?: Error|null, result?: protos.google.analytics.data.v1beta.IMetadata|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getMetadata as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getMetadata with error', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.GetMetadataRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getMetadata = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getMetadata(request), expectedError); - assert((client.innerApiCalls.getMetadata as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getMetadata with closed client', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.GetMetadataRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getMetadata(request), expectedError); - }); - }); - - describe('runRealtimeReport', () => { - it('invokes runRealtimeReport without error', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunRealtimeReportRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.RunRealtimeReportResponse()); - client.innerApiCalls.runRealtimeReport = stubSimpleCall(expectedResponse); - const [response] = await client.runRealtimeReport(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.runRealtimeReport as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes runRealtimeReport without error using callback', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunRealtimeReportRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.RunRealtimeReportResponse()); - client.innerApiCalls.runRealtimeReport = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.runRealtimeReport( - request, - (err?: Error|null, result?: protos.google.analytics.data.v1beta.IRunRealtimeReportResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.runRealtimeReport as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes runRealtimeReport with error', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunRealtimeReportRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.runRealtimeReport = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.runRealtimeReport(request), expectedError); - assert((client.innerApiCalls.runRealtimeReport as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes runRealtimeReport with closed client', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.RunRealtimeReportRequest()); - request.property = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.runRealtimeReport(request), expectedError); - }); - }); - - describe('checkCompatibility', () => { - it('invokes checkCompatibility without error', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.CheckCompatibilityRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.CheckCompatibilityResponse()); - client.innerApiCalls.checkCompatibility = stubSimpleCall(expectedResponse); - const [response] = await client.checkCompatibility(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.checkCompatibility as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCompatibility without error using callback', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.CheckCompatibilityRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.data.v1beta.CheckCompatibilityResponse()); - client.innerApiCalls.checkCompatibility = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.checkCompatibility( - request, - (err?: Error|null, result?: protos.google.analytics.data.v1beta.ICheckCompatibilityResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.checkCompatibility as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes checkCompatibility with error', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.CheckCompatibilityRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.checkCompatibility = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCompatibility(request), expectedError); - assert((client.innerApiCalls.checkCompatibility as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCompatibility with closed client', async () => { - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.data.v1beta.CheckCompatibilityRequest()); - request.property = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.checkCompatibility(request), expectedError); - }); - }); - - describe('Path templates', () => { - - describe('metadata', () => { - const fakePath = "/rendered/path/metadata"; - const expectedParameters = { - property: "propertyValue", - }; - const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataPath', () => { - const result = client.metadataPath("propertyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromMetadataName', () => { - const result = client.matchPropertyFromMetadataName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.metadataPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1beta/tsconfig.json b/owl-bot-staging/v1beta/tsconfig.json deleted file mode 100644 index c78f1c884..000000000 --- a/owl-bot-staging/v1beta/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/v1beta/webpack.config.js b/owl-bot-staging/v1beta/webpack.config.js deleted file mode 100644 index f830d3fe1..000000000 --- a/owl-bot-staging/v1beta/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 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. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'BetaAnalyticsData', - filename: './beta-analytics-data.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/protos/google/analytics/data/v1alpha/analytics_data_api.proto b/protos/google/analytics/data/v1alpha/analytics_data_api.proto index 64be8151e..f86cf8dbd 100644 --- a/protos/google/analytics/data/v1alpha/analytics_data_api.proto +++ b/protos/google/analytics/data/v1alpha/analytics_data_api.proto @@ -96,9 +96,12 @@ message RunFunnelReportRequest { // If specified, next action adds a dimension to the funnel visualization sub // report response. This next action dimension expands each funnel step to the - // unique values of the next action. For example a breakdown by the + // unique values of the next action. For example a next action of the // `eventName` dimension will create rows for several events (i.e. // `session_start` & `click`) and the total. + // + // Next action only supports `eventName` and most Page / Screen dimensions + // like `pageTitle` and `pagePath`. FunnelNextAction funnel_next_action = 5; // The funnel visualization type controls the dimensions present in the funnel diff --git a/protos/google/analytics/data/v1alpha/data.proto b/protos/google/analytics/data/v1alpha/data.proto index 6c566e200..9ef9f6143 100644 --- a/protos/google/analytics/data/v1alpha/data.proto +++ b/protos/google/analytics/data/v1alpha/data.proto @@ -403,7 +403,10 @@ message FunnelNextAction { // The dimension column added to the funnel visualization sub report response. // The next action dimension returns the next dimension value of this // dimension after the user has attained the `i`th funnel step. - // `nextActionDimension` currently only supports the `eventName` dimension. + // + // `nextActionDimension` currently only supports `eventName` and most Page / + // Screen dimensions like `pageTitle` and `pagePath`. `nextActionDimension` + // cannot be a dimension expression. Dimension next_action_dimension = 1; // The maximum number of distinct values of the breakdown dimension to return @@ -1026,8 +1029,8 @@ message FunnelFilterExpression { // The FunnelFilterExpression is NOT of `notExpression`. FunnelFilterExpression not_expression = 3; - // A primitive funnel filter. - FunnelFilter funnel_filter = 4; + // A funnel filter for a dimension or metric. + FunnelFieldFilter funnel_field_filter = 4; // Creates a filter that matches events of a single event name. If a // parameter filter expression is specified, only the subset of events that @@ -1044,7 +1047,7 @@ message FunnelFilterExpressionList { } // An expression to filter dimension or metric values. -message FunnelFilter { +message FunnelFieldFilter { // The dimension name or metric name. string field_name = 1; diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 84c7cd283..190c7c5f5 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -8535,8 +8535,8 @@ export namespace google { /** FunnelFilterExpression notExpression */ notExpression?: (google.analytics.data.v1alpha.IFunnelFilterExpression|null); - /** FunnelFilterExpression funnelFilter */ - funnelFilter?: (google.analytics.data.v1alpha.IFunnelFilter|null); + /** FunnelFilterExpression funnelFieldFilter */ + funnelFieldFilter?: (google.analytics.data.v1alpha.IFunnelFieldFilter|null); /** FunnelFilterExpression funnelEventFilter */ funnelEventFilter?: (google.analytics.data.v1alpha.IFunnelEventFilter|null); @@ -8560,14 +8560,14 @@ export namespace google { /** FunnelFilterExpression notExpression. */ public notExpression?: (google.analytics.data.v1alpha.IFunnelFilterExpression|null); - /** FunnelFilterExpression funnelFilter. */ - public funnelFilter?: (google.analytics.data.v1alpha.IFunnelFilter|null); + /** FunnelFilterExpression funnelFieldFilter. */ + public funnelFieldFilter?: (google.analytics.data.v1alpha.IFunnelFieldFilter|null); /** FunnelFilterExpression funnelEventFilter. */ public funnelEventFilter?: (google.analytics.data.v1alpha.IFunnelEventFilter|null); /** FunnelFilterExpression expr. */ - public expr?: ("andGroup"|"orGroup"|"notExpression"|"funnelFilter"|"funnelEventFilter"); + public expr?: ("andGroup"|"orGroup"|"notExpression"|"funnelFieldFilter"|"funnelEventFilter"); /** * Creates a new FunnelFilterExpression instance using the specified properties. @@ -8730,118 +8730,118 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of a FunnelFilter. */ - interface IFunnelFilter { + /** Properties of a FunnelFieldFilter. */ + interface IFunnelFieldFilter { - /** FunnelFilter fieldName */ + /** FunnelFieldFilter fieldName */ fieldName?: (string|null); - /** FunnelFilter stringFilter */ + /** FunnelFieldFilter stringFilter */ stringFilter?: (google.analytics.data.v1alpha.IStringFilter|null); - /** FunnelFilter inListFilter */ + /** FunnelFieldFilter inListFilter */ inListFilter?: (google.analytics.data.v1alpha.IInListFilter|null); - /** FunnelFilter numericFilter */ + /** FunnelFieldFilter numericFilter */ numericFilter?: (google.analytics.data.v1alpha.INumericFilter|null); - /** FunnelFilter betweenFilter */ + /** FunnelFieldFilter betweenFilter */ betweenFilter?: (google.analytics.data.v1alpha.IBetweenFilter|null); } - /** Represents a FunnelFilter. */ - class FunnelFilter implements IFunnelFilter { + /** Represents a FunnelFieldFilter. */ + class FunnelFieldFilter implements IFunnelFieldFilter { /** - * Constructs a new FunnelFilter. + * Constructs a new FunnelFieldFilter. * @param [properties] Properties to set */ - constructor(properties?: google.analytics.data.v1alpha.IFunnelFilter); + constructor(properties?: google.analytics.data.v1alpha.IFunnelFieldFilter); - /** FunnelFilter fieldName. */ + /** FunnelFieldFilter fieldName. */ public fieldName: string; - /** FunnelFilter stringFilter. */ + /** FunnelFieldFilter stringFilter. */ public stringFilter?: (google.analytics.data.v1alpha.IStringFilter|null); - /** FunnelFilter inListFilter. */ + /** FunnelFieldFilter inListFilter. */ public inListFilter?: (google.analytics.data.v1alpha.IInListFilter|null); - /** FunnelFilter numericFilter. */ + /** FunnelFieldFilter numericFilter. */ public numericFilter?: (google.analytics.data.v1alpha.INumericFilter|null); - /** FunnelFilter betweenFilter. */ + /** FunnelFieldFilter betweenFilter. */ public betweenFilter?: (google.analytics.data.v1alpha.IBetweenFilter|null); - /** FunnelFilter oneFilter. */ + /** FunnelFieldFilter oneFilter. */ public oneFilter?: ("stringFilter"|"inListFilter"|"numericFilter"|"betweenFilter"); /** - * Creates a new FunnelFilter instance using the specified properties. + * Creates a new FunnelFieldFilter instance using the specified properties. * @param [properties] Properties to set - * @returns FunnelFilter instance + * @returns FunnelFieldFilter instance */ - public static create(properties?: google.analytics.data.v1alpha.IFunnelFilter): google.analytics.data.v1alpha.FunnelFilter; + public static create(properties?: google.analytics.data.v1alpha.IFunnelFieldFilter): google.analytics.data.v1alpha.FunnelFieldFilter; /** - * Encodes the specified FunnelFilter message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelFilter.verify|verify} messages. - * @param message FunnelFilter message or plain object to encode + * Encodes the specified FunnelFieldFilter message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelFieldFilter.verify|verify} messages. + * @param message FunnelFieldFilter message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.analytics.data.v1alpha.IFunnelFilter, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.analytics.data.v1alpha.IFunnelFieldFilter, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FunnelFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelFilter.verify|verify} messages. - * @param message FunnelFilter message or plain object to encode + * Encodes the specified FunnelFieldFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelFieldFilter.verify|verify} messages. + * @param message FunnelFieldFilter message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.analytics.data.v1alpha.IFunnelFilter, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.analytics.data.v1alpha.IFunnelFieldFilter, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FunnelFilter message from the specified reader or buffer. + * Decodes a FunnelFieldFilter message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FunnelFilter + * @returns FunnelFieldFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.FunnelFilter; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.FunnelFieldFilter; /** - * Decodes a FunnelFilter message from the specified reader or buffer, length delimited. + * Decodes a FunnelFieldFilter message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FunnelFilter + * @returns FunnelFieldFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.FunnelFilter; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.FunnelFieldFilter; /** - * Verifies a FunnelFilter message. + * Verifies a FunnelFieldFilter message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a FunnelFilter message from a plain object. Also converts values to their respective internal types. + * Creates a FunnelFieldFilter message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FunnelFilter + * @returns FunnelFieldFilter */ - public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.FunnelFilter; + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.FunnelFieldFilter; /** - * Creates a plain object from a FunnelFilter message. Also converts values to other types if specified. - * @param message FunnelFilter + * Creates a plain object from a FunnelFieldFilter message. Also converts values to other types if specified. + * @param message FunnelFieldFilter * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.analytics.data.v1alpha.FunnelFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.analytics.data.v1alpha.FunnelFieldFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FunnelFilter to JSON. + * Converts this FunnelFieldFilter to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; diff --git a/protos/protos.js b/protos/protos.js index 0cd92d868..088e3fc2e 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -22215,7 +22215,7 @@ * @property {google.analytics.data.v1alpha.IFunnelFilterExpressionList|null} [andGroup] FunnelFilterExpression andGroup * @property {google.analytics.data.v1alpha.IFunnelFilterExpressionList|null} [orGroup] FunnelFilterExpression orGroup * @property {google.analytics.data.v1alpha.IFunnelFilterExpression|null} [notExpression] FunnelFilterExpression notExpression - * @property {google.analytics.data.v1alpha.IFunnelFilter|null} [funnelFilter] FunnelFilterExpression funnelFilter + * @property {google.analytics.data.v1alpha.IFunnelFieldFilter|null} [funnelFieldFilter] FunnelFilterExpression funnelFieldFilter * @property {google.analytics.data.v1alpha.IFunnelEventFilter|null} [funnelEventFilter] FunnelFilterExpression funnelEventFilter */ @@ -22259,12 +22259,12 @@ FunnelFilterExpression.prototype.notExpression = null; /** - * FunnelFilterExpression funnelFilter. - * @member {google.analytics.data.v1alpha.IFunnelFilter|null|undefined} funnelFilter + * FunnelFilterExpression funnelFieldFilter. + * @member {google.analytics.data.v1alpha.IFunnelFieldFilter|null|undefined} funnelFieldFilter * @memberof google.analytics.data.v1alpha.FunnelFilterExpression * @instance */ - FunnelFilterExpression.prototype.funnelFilter = null; + FunnelFilterExpression.prototype.funnelFieldFilter = null; /** * FunnelFilterExpression funnelEventFilter. @@ -22279,12 +22279,12 @@ /** * FunnelFilterExpression expr. - * @member {"andGroup"|"orGroup"|"notExpression"|"funnelFilter"|"funnelEventFilter"|undefined} expr + * @member {"andGroup"|"orGroup"|"notExpression"|"funnelFieldFilter"|"funnelEventFilter"|undefined} expr * @memberof google.analytics.data.v1alpha.FunnelFilterExpression * @instance */ Object.defineProperty(FunnelFilterExpression.prototype, "expr", { - get: $util.oneOfGetter($oneOfFields = ["andGroup", "orGroup", "notExpression", "funnelFilter", "funnelEventFilter"]), + get: $util.oneOfGetter($oneOfFields = ["andGroup", "orGroup", "notExpression", "funnelFieldFilter", "funnelEventFilter"]), set: $util.oneOfSetter($oneOfFields) }); @@ -22318,8 +22318,8 @@ $root.google.analytics.data.v1alpha.FunnelFilterExpressionList.encode(message.orGroup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.notExpression != null && Object.hasOwnProperty.call(message, "notExpression")) $root.google.analytics.data.v1alpha.FunnelFilterExpression.encode(message.notExpression, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.funnelFilter != null && Object.hasOwnProperty.call(message, "funnelFilter")) - $root.google.analytics.data.v1alpha.FunnelFilter.encode(message.funnelFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.funnelFieldFilter != null && Object.hasOwnProperty.call(message, "funnelFieldFilter")) + $root.google.analytics.data.v1alpha.FunnelFieldFilter.encode(message.funnelFieldFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.funnelEventFilter != null && Object.hasOwnProperty.call(message, "funnelEventFilter")) $root.google.analytics.data.v1alpha.FunnelEventFilter.encode(message.funnelEventFilter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; @@ -22366,7 +22366,7 @@ message.notExpression = $root.google.analytics.data.v1alpha.FunnelFilterExpression.decode(reader, reader.uint32()); break; case 4: - message.funnelFilter = $root.google.analytics.data.v1alpha.FunnelFilter.decode(reader, reader.uint32()); + message.funnelFieldFilter = $root.google.analytics.data.v1alpha.FunnelFieldFilter.decode(reader, reader.uint32()); break; case 5: message.funnelEventFilter = $root.google.analytics.data.v1alpha.FunnelEventFilter.decode(reader, reader.uint32()); @@ -22435,14 +22435,14 @@ return "notExpression." + error; } } - if (message.funnelFilter != null && message.hasOwnProperty("funnelFilter")) { + if (message.funnelFieldFilter != null && message.hasOwnProperty("funnelFieldFilter")) { if (properties.expr === 1) return "expr: multiple values"; properties.expr = 1; { - var error = $root.google.analytics.data.v1alpha.FunnelFilter.verify(message.funnelFilter); + var error = $root.google.analytics.data.v1alpha.FunnelFieldFilter.verify(message.funnelFieldFilter); if (error) - return "funnelFilter." + error; + return "funnelFieldFilter." + error; } } if (message.funnelEventFilter != null && message.hasOwnProperty("funnelEventFilter")) { @@ -22485,10 +22485,10 @@ throw TypeError(".google.analytics.data.v1alpha.FunnelFilterExpression.notExpression: object expected"); message.notExpression = $root.google.analytics.data.v1alpha.FunnelFilterExpression.fromObject(object.notExpression); } - if (object.funnelFilter != null) { - if (typeof object.funnelFilter !== "object") - throw TypeError(".google.analytics.data.v1alpha.FunnelFilterExpression.funnelFilter: object expected"); - message.funnelFilter = $root.google.analytics.data.v1alpha.FunnelFilter.fromObject(object.funnelFilter); + if (object.funnelFieldFilter != null) { + if (typeof object.funnelFieldFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelFilterExpression.funnelFieldFilter: object expected"); + message.funnelFieldFilter = $root.google.analytics.data.v1alpha.FunnelFieldFilter.fromObject(object.funnelFieldFilter); } if (object.funnelEventFilter != null) { if (typeof object.funnelEventFilter !== "object") @@ -22526,10 +22526,10 @@ if (options.oneofs) object.expr = "notExpression"; } - if (message.funnelFilter != null && message.hasOwnProperty("funnelFilter")) { - object.funnelFilter = $root.google.analytics.data.v1alpha.FunnelFilter.toObject(message.funnelFilter, options); + if (message.funnelFieldFilter != null && message.hasOwnProperty("funnelFieldFilter")) { + object.funnelFieldFilter = $root.google.analytics.data.v1alpha.FunnelFieldFilter.toObject(message.funnelFieldFilter, options); if (options.oneofs) - object.expr = "funnelFilter"; + object.expr = "funnelFieldFilter"; } if (message.funnelEventFilter != null && message.hasOwnProperty("funnelEventFilter")) { object.funnelEventFilter = $root.google.analytics.data.v1alpha.FunnelEventFilter.toObject(message.funnelEventFilter, options); @@ -22761,28 +22761,28 @@ return FunnelFilterExpressionList; })(); - v1alpha.FunnelFilter = (function() { + v1alpha.FunnelFieldFilter = (function() { /** - * Properties of a FunnelFilter. + * Properties of a FunnelFieldFilter. * @memberof google.analytics.data.v1alpha - * @interface IFunnelFilter - * @property {string|null} [fieldName] FunnelFilter fieldName - * @property {google.analytics.data.v1alpha.IStringFilter|null} [stringFilter] FunnelFilter stringFilter - * @property {google.analytics.data.v1alpha.IInListFilter|null} [inListFilter] FunnelFilter inListFilter - * @property {google.analytics.data.v1alpha.INumericFilter|null} [numericFilter] FunnelFilter numericFilter - * @property {google.analytics.data.v1alpha.IBetweenFilter|null} [betweenFilter] FunnelFilter betweenFilter + * @interface IFunnelFieldFilter + * @property {string|null} [fieldName] FunnelFieldFilter fieldName + * @property {google.analytics.data.v1alpha.IStringFilter|null} [stringFilter] FunnelFieldFilter stringFilter + * @property {google.analytics.data.v1alpha.IInListFilter|null} [inListFilter] FunnelFieldFilter inListFilter + * @property {google.analytics.data.v1alpha.INumericFilter|null} [numericFilter] FunnelFieldFilter numericFilter + * @property {google.analytics.data.v1alpha.IBetweenFilter|null} [betweenFilter] FunnelFieldFilter betweenFilter */ /** - * Constructs a new FunnelFilter. + * Constructs a new FunnelFieldFilter. * @memberof google.analytics.data.v1alpha - * @classdesc Represents a FunnelFilter. - * @implements IFunnelFilter + * @classdesc Represents a FunnelFieldFilter. + * @implements IFunnelFieldFilter * @constructor - * @param {google.analytics.data.v1alpha.IFunnelFilter=} [properties] Properties to set + * @param {google.analytics.data.v1alpha.IFunnelFieldFilter=} [properties] Properties to set */ - function FunnelFilter(properties) { + function FunnelFieldFilter(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22790,81 +22790,81 @@ } /** - * FunnelFilter fieldName. + * FunnelFieldFilter fieldName. * @member {string} fieldName - * @memberof google.analytics.data.v1alpha.FunnelFilter + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter * @instance */ - FunnelFilter.prototype.fieldName = ""; + FunnelFieldFilter.prototype.fieldName = ""; /** - * FunnelFilter stringFilter. + * FunnelFieldFilter stringFilter. * @member {google.analytics.data.v1alpha.IStringFilter|null|undefined} stringFilter - * @memberof google.analytics.data.v1alpha.FunnelFilter + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter * @instance */ - FunnelFilter.prototype.stringFilter = null; + FunnelFieldFilter.prototype.stringFilter = null; /** - * FunnelFilter inListFilter. + * FunnelFieldFilter inListFilter. * @member {google.analytics.data.v1alpha.IInListFilter|null|undefined} inListFilter - * @memberof google.analytics.data.v1alpha.FunnelFilter + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter * @instance */ - FunnelFilter.prototype.inListFilter = null; + FunnelFieldFilter.prototype.inListFilter = null; /** - * FunnelFilter numericFilter. + * FunnelFieldFilter numericFilter. * @member {google.analytics.data.v1alpha.INumericFilter|null|undefined} numericFilter - * @memberof google.analytics.data.v1alpha.FunnelFilter + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter * @instance */ - FunnelFilter.prototype.numericFilter = null; + FunnelFieldFilter.prototype.numericFilter = null; /** - * FunnelFilter betweenFilter. + * FunnelFieldFilter betweenFilter. * @member {google.analytics.data.v1alpha.IBetweenFilter|null|undefined} betweenFilter - * @memberof google.analytics.data.v1alpha.FunnelFilter + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter * @instance */ - FunnelFilter.prototype.betweenFilter = null; + FunnelFieldFilter.prototype.betweenFilter = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * FunnelFilter oneFilter. + * FunnelFieldFilter oneFilter. * @member {"stringFilter"|"inListFilter"|"numericFilter"|"betweenFilter"|undefined} oneFilter - * @memberof google.analytics.data.v1alpha.FunnelFilter + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter * @instance */ - Object.defineProperty(FunnelFilter.prototype, "oneFilter", { + Object.defineProperty(FunnelFieldFilter.prototype, "oneFilter", { get: $util.oneOfGetter($oneOfFields = ["stringFilter", "inListFilter", "numericFilter", "betweenFilter"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new FunnelFilter instance using the specified properties. + * Creates a new FunnelFieldFilter instance using the specified properties. * @function create - * @memberof google.analytics.data.v1alpha.FunnelFilter + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter * @static - * @param {google.analytics.data.v1alpha.IFunnelFilter=} [properties] Properties to set - * @returns {google.analytics.data.v1alpha.FunnelFilter} FunnelFilter instance + * @param {google.analytics.data.v1alpha.IFunnelFieldFilter=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.FunnelFieldFilter} FunnelFieldFilter instance */ - FunnelFilter.create = function create(properties) { - return new FunnelFilter(properties); + FunnelFieldFilter.create = function create(properties) { + return new FunnelFieldFilter(properties); }; /** - * Encodes the specified FunnelFilter message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelFilter.verify|verify} messages. + * Encodes the specified FunnelFieldFilter message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelFieldFilter.verify|verify} messages. * @function encode - * @memberof google.analytics.data.v1alpha.FunnelFilter + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter * @static - * @param {google.analytics.data.v1alpha.IFunnelFilter} message FunnelFilter message or plain object to encode + * @param {google.analytics.data.v1alpha.IFunnelFieldFilter} message FunnelFieldFilter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FunnelFilter.encode = function encode(message, writer) { + FunnelFieldFilter.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) @@ -22881,33 +22881,33 @@ }; /** - * Encodes the specified FunnelFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelFilter.verify|verify} messages. + * Encodes the specified FunnelFieldFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelFieldFilter.verify|verify} messages. * @function encodeDelimited - * @memberof google.analytics.data.v1alpha.FunnelFilter + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter * @static - * @param {google.analytics.data.v1alpha.IFunnelFilter} message FunnelFilter message or plain object to encode + * @param {google.analytics.data.v1alpha.IFunnelFieldFilter} message FunnelFieldFilter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FunnelFilter.encodeDelimited = function encodeDelimited(message, writer) { + FunnelFieldFilter.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FunnelFilter message from the specified reader or buffer. + * Decodes a FunnelFieldFilter message from the specified reader or buffer. * @function decode - * @memberof google.analytics.data.v1alpha.FunnelFilter + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.data.v1alpha.FunnelFilter} FunnelFilter + * @returns {google.analytics.data.v1alpha.FunnelFieldFilter} FunnelFieldFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FunnelFilter.decode = function decode(reader, length) { + FunnelFieldFilter.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.FunnelFilter(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.FunnelFieldFilter(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -22935,30 +22935,30 @@ }; /** - * Decodes a FunnelFilter message from the specified reader or buffer, length delimited. + * Decodes a FunnelFieldFilter message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.analytics.data.v1alpha.FunnelFilter + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.data.v1alpha.FunnelFilter} FunnelFilter + * @returns {google.analytics.data.v1alpha.FunnelFieldFilter} FunnelFieldFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FunnelFilter.decodeDelimited = function decodeDelimited(reader) { + FunnelFieldFilter.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FunnelFilter message. + * Verifies a FunnelFieldFilter message. * @function verify - * @memberof google.analytics.data.v1alpha.FunnelFilter + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FunnelFilter.verify = function verify(message) { + FunnelFieldFilter.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; @@ -23007,52 +23007,52 @@ }; /** - * Creates a FunnelFilter message from a plain object. Also converts values to their respective internal types. + * Creates a FunnelFieldFilter message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.analytics.data.v1alpha.FunnelFilter + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter * @static * @param {Object.} object Plain object - * @returns {google.analytics.data.v1alpha.FunnelFilter} FunnelFilter + * @returns {google.analytics.data.v1alpha.FunnelFieldFilter} FunnelFieldFilter */ - FunnelFilter.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.data.v1alpha.FunnelFilter) + FunnelFieldFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.FunnelFieldFilter) return object; - var message = new $root.google.analytics.data.v1alpha.FunnelFilter(); + var message = new $root.google.analytics.data.v1alpha.FunnelFieldFilter(); if (object.fieldName != null) message.fieldName = String(object.fieldName); if (object.stringFilter != null) { if (typeof object.stringFilter !== "object") - throw TypeError(".google.analytics.data.v1alpha.FunnelFilter.stringFilter: object expected"); + throw TypeError(".google.analytics.data.v1alpha.FunnelFieldFilter.stringFilter: object expected"); message.stringFilter = $root.google.analytics.data.v1alpha.StringFilter.fromObject(object.stringFilter); } if (object.inListFilter != null) { if (typeof object.inListFilter !== "object") - throw TypeError(".google.analytics.data.v1alpha.FunnelFilter.inListFilter: object expected"); + throw TypeError(".google.analytics.data.v1alpha.FunnelFieldFilter.inListFilter: object expected"); message.inListFilter = $root.google.analytics.data.v1alpha.InListFilter.fromObject(object.inListFilter); } if (object.numericFilter != null) { if (typeof object.numericFilter !== "object") - throw TypeError(".google.analytics.data.v1alpha.FunnelFilter.numericFilter: object expected"); + throw TypeError(".google.analytics.data.v1alpha.FunnelFieldFilter.numericFilter: object expected"); message.numericFilter = $root.google.analytics.data.v1alpha.NumericFilter.fromObject(object.numericFilter); } if (object.betweenFilter != null) { if (typeof object.betweenFilter !== "object") - throw TypeError(".google.analytics.data.v1alpha.FunnelFilter.betweenFilter: object expected"); + throw TypeError(".google.analytics.data.v1alpha.FunnelFieldFilter.betweenFilter: object expected"); message.betweenFilter = $root.google.analytics.data.v1alpha.BetweenFilter.fromObject(object.betweenFilter); } return message; }; /** - * Creates a plain object from a FunnelFilter message. Also converts values to other types if specified. + * Creates a plain object from a FunnelFieldFilter message. Also converts values to other types if specified. * @function toObject - * @memberof google.analytics.data.v1alpha.FunnelFilter + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter * @static - * @param {google.analytics.data.v1alpha.FunnelFilter} message FunnelFilter + * @param {google.analytics.data.v1alpha.FunnelFieldFilter} message FunnelFieldFilter * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FunnelFilter.toObject = function toObject(message, options) { + FunnelFieldFilter.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -23084,17 +23084,17 @@ }; /** - * Converts this FunnelFilter to JSON. + * Converts this FunnelFieldFilter to JSON. * @function toJSON - * @memberof google.analytics.data.v1alpha.FunnelFilter + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter * @instance * @returns {Object.} JSON object */ - FunnelFilter.prototype.toJSON = function toJSON() { + FunnelFieldFilter.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return FunnelFilter; + return FunnelFieldFilter; })(); v1alpha.FunnelEventFilter = (function() { diff --git a/protos/protos.json b/protos/protos.json index 5c7d158d7..3d8c8f672 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -1976,7 +1976,7 @@ "andGroup", "orGroup", "notExpression", - "funnelFilter", + "funnelFieldFilter", "funnelEventFilter" ] } @@ -1994,8 +1994,8 @@ "type": "FunnelFilterExpression", "id": 3 }, - "funnelFilter": { - "type": "FunnelFilter", + "funnelFieldFilter": { + "type": "FunnelFieldFilter", "id": 4 }, "funnelEventFilter": { @@ -2013,7 +2013,7 @@ } } }, - "FunnelFilter": { + "FunnelFieldFilter": { "oneofs": { "oneFilter": { "oneof": [ diff --git a/samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js b/samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js index cc4e1bf76..6fe1b50b1 100644 --- a/samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js +++ b/samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js @@ -58,9 +58,11 @@ function main() { /** * If specified, next action adds a dimension to the funnel visualization sub * report response. This next action dimension expands each funnel step to the - * unique values of the next action. For example a breakdown by the + * unique values of the next action. For example a next action of the * `eventName` dimension will create rows for several events (i.e. * `session_start` & `click`) and the total. + * Next action only supports `eventName` and most Page / Screen dimensions + * like `pageTitle` and `pagePath`. */ // const funnelNextAction = {} /** diff --git a/samples/generated/v1alpha/snippet_metadata.google.analytics.data.v1alpha.json b/samples/generated/v1alpha/snippet_metadata.google.analytics.data.v1alpha.json index 789a5cadf..31a141231 100644 --- a/samples/generated/v1alpha/snippet_metadata.google.analytics.data.v1alpha.json +++ b/samples/generated/v1alpha/snippet_metadata.google.analytics.data.v1alpha.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 118, + "end": 120, "type": "FULL" } ], diff --git a/src/v1alpha/alpha_analytics_data_client.ts b/src/v1alpha/alpha_analytics_data_client.ts index b34ab8161..cc0c777d9 100644 --- a/src/v1alpha/alpha_analytics_data_client.ts +++ b/src/v1alpha/alpha_analytics_data_client.ts @@ -325,9 +325,12 @@ export class AlphaAnalyticsDataClient { * @param {google.analytics.data.v1alpha.FunnelNextAction} request.funnelNextAction * If specified, next action adds a dimension to the funnel visualization sub * report response. This next action dimension expands each funnel step to the - * unique values of the next action. For example a breakdown by the + * unique values of the next action. For example a next action of the * `eventName` dimension will create rows for several events (i.e. * `session_start` & `click`) and the total. + * + * Next action only supports `eventName` and most Page / Screen dimensions + * like `pageTitle` and `pagePath`. * @param {google.analytics.data.v1alpha.RunFunnelReportRequest.FunnelVisualizationType} request.funnelVisualizationType * The funnel visualization type controls the dimensions present in the funnel * visualization sub report response. If not specified, `STANDARD_FUNNEL` is