From 72465ab876f73d9de91e9267921cabcf46e7851b Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 24 Jun 2022 11:10:51 +0000 Subject: [PATCH 1/2] feat: support regapic LRO Use gapic-generator-typescript v2.15.1. PiperOrigin-RevId: 456946341 Source-Link: https://github.com/googleapis/googleapis/commit/88fd18d9d3b872b3d06a3d9392879f50b5bf3ce5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/accfa371f667439313335c64042b063c1c53102e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWNjZmEzNzFmNjY3NDM5MzEzMzM1YzY0MDQyYjA2M2MxYzUzMTAyZSJ9 --- 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 + .../admin/v1alpha/analytics_admin.proto | 2041 ++++ .../analytics/admin/v1alpha/resources.proto | 1161 ++ ...ervice.acknowledge_user_data_collection.js | 69 + ...splay_video360_advertiser_link_proposal.js | 59 + ..._admin_service.archive_custom_dimension.js | 59 + ...ics_admin_service.archive_custom_metric.js | 59 + ...nalytics_admin_service.audit_user_links.js | 74 + ...s_admin_service.batch_create_user_links.js | 73 + ...s_admin_service.batch_delete_user_links.js | 67 + ...tics_admin_service.batch_get_user_links.js | 68 + ...s_admin_service.batch_update_user_links.js | 67 + ...splay_video360_advertiser_link_proposal.js | 59 + ...s_admin_service.create_conversion_event.js | 64 + ...s_admin_service.create_custom_dimension.js | 63 + ...tics_admin_service.create_custom_metric.js | 63 + ...lytics_admin_service.create_data_stream.js | 63 + ...create_display_video360_advertiser_link.js | 63 + ...splay_video360_advertiser_link_proposal.js | 63 + ...tics_admin_service.create_firebase_link.js | 64 + ...cs_admin_service.create_google_ads_link.js | 63 + ...vice.create_measurement_protocol_secret.js | 64 + ...analytics_admin_service.create_property.js | 59 + ...nalytics_admin_service.create_user_link.js | 68 + .../analytics_admin_service.delete_account.js | 60 + ...s_admin_service.delete_conversion_event.js | 60 + ...lytics_admin_service.delete_data_stream.js | 59 + ...delete_display_video360_advertiser_link.js | 59 + ...splay_video360_advertiser_link_proposal.js | 59 + ...tics_admin_service.delete_firebase_link.js | 59 + ...cs_admin_service.delete_google_ads_link.js | 58 + ...vice.delete_measurement_protocol_secret.js | 60 + ...analytics_admin_service.delete_property.js | 60 + ...nalytics_admin_service.delete_user_link.js | 58 + .../analytics_admin_service.get_account.js | 60 + ...tics_admin_service.get_conversion_event.js | 60 + ...tics_admin_service.get_custom_dimension.js | 59 + ...alytics_admin_service.get_custom_metric.js | 59 + ...min_service.get_data_retention_settings.js | 61 + ...admin_service.get_data_sharing_settings.js | 60 + ...analytics_admin_service.get_data_stream.js | 59 + ...ce.get_display_video360_advertiser_link.js | 59 + ...splay_video360_advertiser_link_proposal.js | 59 + ...ytics_admin_service.get_global_site_tag.js | 61 + ...min_service.get_google_signals_settings.js | 59 + ...service.get_measurement_protocol_secret.js | 60 + .../analytics_admin_service.get_property.js | 60 + .../analytics_admin_service.get_user_link.js | 58 + ...cs_admin_service.list_account_summaries.js | 69 + .../analytics_admin_service.list_accounts.js | 75 + ...cs_admin_service.list_conversion_events.js | 74 + ...cs_admin_service.list_custom_dimensions.js | 73 + ...ytics_admin_service.list_custom_metrics.js | 73 + ...alytics_admin_service.list_data_streams.js | 73 + ...play_video360_advertiser_link_proposals.js | 75 + ....list_display_video360_advertiser_links.js | 74 + ...ytics_admin_service.list_firebase_links.js | 75 + ...ics_admin_service.list_google_ads_links.js | 73 + ...rvice.list_measurement_protocol_secrets.js | 75 + ...analytics_admin_service.list_properties.js | 94 + ...analytics_admin_service.list_user_links.js | 74 + ..._admin_service.provision_account_ticket.js | 62 + ...in_service.search_change_history_events.js | 101 + .../analytics_admin_service.update_account.js | 66 + ...s_admin_service.update_custom_dimension.js | 64 + ...tics_admin_service.update_custom_metric.js | 64 + ..._service.update_data_retention_settings.js | 66 + ...lytics_admin_service.update_data_stream.js | 64 + ...update_display_video360_advertiser_link.js | 64 + ...cs_admin_service.update_google_ads_link.js | 64 + ..._service.update_google_signals_settings.js | 66 + ...vice.update_measurement_protocol_secret.js | 62 + ...analytics_admin_service.update_property.js | 67 + ...nalytics_admin_service.update_user_link.js | 58 + ...tadata.google.analytics.admin.v1alpha.json | 3111 ++++++ owl-bot-staging/v1alpha/src/index.ts | 25 + .../v1alpha/analytics_admin_service_client.ts | 8074 ++++++++++++++ ...analytics_admin_service_client_config.json | 394 + .../analytics_admin_service_proto_list.json | 4 + .../v1alpha/src/v1alpha/gapic_metadata.json | 793 ++ 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_analytics_admin_service_v1alpha.ts | 9428 +++++++++++++++++ owl-bot-staging/v1alpha/tsconfig.json | 19 + owl-bot-staging/v1alpha/webpack.config.js | 64 + 95 files changed, 30078 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/admin/v1alpha/analytics_admin.proto create mode 100644 owl-bot-staging/v1alpha/protos/google/analytics/admin/v1alpha/resources.proto create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.acknowledge_user_data_collection.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_dimension.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_metric.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.audit_user_links.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_user_links.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_user_links.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_user_links.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_user_links.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_conversion_event.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_dimension.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_metric.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_data_stream.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link_proposal.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_firebase_link.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_google_ads_link.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_measurement_protocol_secret.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_property.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_user_link.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_account.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_conversion_event.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_data_stream.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_firebase_link.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_google_ads_link.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_measurement_protocol_secret.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_property.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_user_link.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_account.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_conversion_event.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_dimension.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_metric.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_retention_settings.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_sharing_settings.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_stream.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link_proposal.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_global_site_tag.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_google_signals_settings.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_measurement_protocol_secret.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_property.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_user_link.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_account_summaries.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_accounts.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_conversion_events.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_dimensions.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_metrics.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_data_streams.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_link_proposals.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_links.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_firebase_links.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_google_ads_links.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_measurement_protocol_secrets.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_properties.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_user_links.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.provision_account_ticket.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.search_change_history_events.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_account.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_dimension.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_metric.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_retention_settings.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_stream.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_display_video360_advertiser_link.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_ads_link.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_signals_settings.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_measurement_protocol_secret.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_property.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_user_link.js create mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.admin.v1alpha.json create mode 100644 owl-bot-staging/v1alpha/src/index.ts create mode 100644 owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_client.ts create mode 100644 owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_client_config.json create mode 100644 owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_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_analytics_admin_service_v1alpha.ts create mode 100644 owl-bot-staging/v1alpha/tsconfig.json create mode 100644 owl-bot-staging/v1alpha/webpack.config.js diff --git a/owl-bot-staging/v1alpha/.eslintignore b/owl-bot-staging/v1alpha/.eslintignore new file mode 100644 index 0000000..cfc348e --- /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 0000000..7821534 --- /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 0000000..5d32b23 --- /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 0000000..59f18fd --- /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-analytics/admin', + 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 0000000..481c522 --- /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 0000000..494e147 --- /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 0000000..5d45b74 --- /dev/null +++ b/owl-bot-staging/v1alpha/README.md @@ -0,0 +1 @@ +Admin: 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 0000000..befd23c --- /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 0000000..425a16e --- /dev/null +++ b/owl-bot-staging/v1alpha/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-analytics/admin", + "version": "0.1.0", + "description": "Admin client for Node.js", + "repository": "googleapis/nodejs-admin", + "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 admin", + "admin", + "analytics admin service" + ], + "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": "^3.1.1" + }, + "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": ">=v12" + } +} diff --git a/owl-bot-staging/v1alpha/protos/google/analytics/admin/v1alpha/analytics_admin.proto b/owl-bot-staging/v1alpha/protos/google/analytics/admin/v1alpha/analytics_admin.proto new file mode 100644 index 0000000..00fe854 --- /dev/null +++ b/owl-bot-staging/v1alpha/protos/google/analytics/admin/v1alpha/analytics_admin.proto @@ -0,0 +1,2041 @@ +// 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.admin.v1alpha; + +import "google/analytics/admin/v1alpha/resources.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/analytics/admin/v1alpha;admin"; +option java_multiple_files = true; +option java_outer_classname = "AnalyticsAdminProto"; +option java_package = "com.google.analytics.admin.v1alpha"; + +// Service Interface for the Analytics Admin API (GA4). +service AnalyticsAdminService { + option (google.api.default_host) = "analyticsadmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/analytics.edit," + "https://www.googleapis.com/auth/analytics.manage.users," + "https://www.googleapis.com/auth/analytics.manage.users.readonly," + "https://www.googleapis.com/auth/analytics.readonly"; + + // Lookup for a single Account. + rpc GetAccount(GetAccountRequest) returns (Account) { + option (google.api.http) = { + get: "/v1alpha/{name=accounts/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns all accounts accessible by the caller. + // + // Note that these accounts might not currently have GA4 properties. + // Soft-deleted (ie: "trashed") accounts are excluded by default. + // Returns an empty list if no relevant accounts are found. + rpc ListAccounts(ListAccountsRequest) returns (ListAccountsResponse) { + option (google.api.http) = { + get: "/v1alpha/accounts" + }; + } + + // Marks target Account as soft-deleted (ie: "trashed") and returns it. + // + // This API does not have a method to restore soft-deleted accounts. + // However, they can be restored using the Trash Can UI. + // + // If the accounts are not restored before the expiration time, the account + // and all child resources (eg: Properties, GoogleAdsLinks, Streams, + // UserLinks) will be permanently purged. + // https://support.google.com/analytics/answer/6154772 + // + // Returns an error if the target is not found. + rpc DeleteAccount(DeleteAccountRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=accounts/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates an account. + rpc UpdateAccount(UpdateAccountRequest) returns (Account) { + option (google.api.http) = { + patch: "/v1alpha/{account.name=accounts/*}" + body: "account" + }; + option (google.api.method_signature) = "account,update_mask"; + } + + // Requests a ticket for creating an account. + rpc ProvisionAccountTicket(ProvisionAccountTicketRequest) returns (ProvisionAccountTicketResponse) { + option (google.api.http) = { + post: "/v1alpha/accounts:provisionAccountTicket" + body: "*" + }; + } + + // Returns summaries of all accounts accessible by the caller. + rpc ListAccountSummaries(ListAccountSummariesRequest) returns (ListAccountSummariesResponse) { + option (google.api.http) = { + get: "/v1alpha/accountSummaries" + }; + } + + // Lookup for a single "GA4" Property. + rpc GetProperty(GetPropertyRequest) returns (Property) { + option (google.api.http) = { + get: "/v1alpha/{name=properties/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns child Properties under the specified parent Account. + // + // Only "GA4" properties will be returned. + // Properties will be excluded if the caller does not have access. + // Soft-deleted (ie: "trashed") properties are excluded by default. + // Returns an empty list if no relevant properties are found. + rpc ListProperties(ListPropertiesRequest) returns (ListPropertiesResponse) { + option (google.api.http) = { + get: "/v1alpha/properties" + }; + } + + // Creates an "GA4" property with the specified location and attributes. + rpc CreateProperty(CreatePropertyRequest) returns (Property) { + option (google.api.http) = { + post: "/v1alpha/properties" + body: "property" + }; + option (google.api.method_signature) = "property"; + } + + // Marks target Property as soft-deleted (ie: "trashed") and returns it. + // + // This API does not have a method to restore soft-deleted properties. + // However, they can be restored using the Trash Can UI. + // + // If the properties are not restored before the expiration time, the Property + // and all child resources (eg: GoogleAdsLinks, Streams, UserLinks) + // will be permanently purged. + // https://support.google.com/analytics/answer/6154772 + // + // Returns an error if the target is not found, or is not an GA4 Property. + rpc DeleteProperty(DeletePropertyRequest) returns (Property) { + option (google.api.http) = { + delete: "/v1alpha/{name=properties/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a property. + rpc UpdateProperty(UpdatePropertyRequest) returns (Property) { + option (google.api.http) = { + patch: "/v1alpha/{property.name=properties/*}" + body: "property" + }; + option (google.api.method_signature) = "property,update_mask"; + } + + // Gets information about a user's link to an account or property. + rpc GetUserLink(GetUserLinkRequest) returns (UserLink) { + option (google.api.http) = { + get: "/v1alpha/{name=accounts/*/userLinks/*}" + additional_bindings { + get: "/v1alpha/{name=properties/*/userLinks/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Gets information about multiple users' links to an account or property. + rpc BatchGetUserLinks(BatchGetUserLinksRequest) returns (BatchGetUserLinksResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=accounts/*}/userLinks:batchGet" + additional_bindings { + get: "/v1alpha/{parent=properties/*}/userLinks:batchGet" + } + }; + } + + // Lists all user links on an account or property. + rpc ListUserLinks(ListUserLinksRequest) returns (ListUserLinksResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=accounts/*}/userLinks" + additional_bindings { + get: "/v1alpha/{parent=properties/*}/userLinks" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all user links on an account or property, including implicit ones + // that come from effective permissions granted by groups or organization + // admin roles. + // + // If a returned user link does not have direct permissions, they cannot + // be removed from the account or property directly with the DeleteUserLink + // command. They have to be removed from the group/etc that gives them + // permissions, which is currently only usable/discoverable in the GA or GMP + // UIs. + rpc AuditUserLinks(AuditUserLinksRequest) returns (AuditUserLinksResponse) { + option (google.api.http) = { + post: "/v1alpha/{parent=accounts/*}/userLinks:audit" + body: "*" + additional_bindings { + post: "/v1alpha/{parent=properties/*}/userLinks:audit" + body: "*" + } + }; + } + + // Creates a user link on an account or property. + // + // If the user with the specified email already has permissions on the + // account or property, then the user's existing permissions will be unioned + // with the permissions specified in the new UserLink. + rpc CreateUserLink(CreateUserLinkRequest) returns (UserLink) { + option (google.api.http) = { + post: "/v1alpha/{parent=accounts/*}/userLinks" + body: "user_link" + additional_bindings { + post: "/v1alpha/{parent=properties/*}/userLinks" + body: "user_link" + } + }; + option (google.api.method_signature) = "parent,user_link"; + } + + // Creates information about multiple users' links to an account or property. + // + // This method is transactional. If any UserLink cannot be created, none of + // the UserLinks will be created. + rpc BatchCreateUserLinks(BatchCreateUserLinksRequest) returns (BatchCreateUserLinksResponse) { + option (google.api.http) = { + post: "/v1alpha/{parent=accounts/*}/userLinks:batchCreate" + body: "*" + additional_bindings { + post: "/v1alpha/{parent=properties/*}/userLinks:batchCreate" + body: "*" + } + }; + } + + // Updates a user link on an account or property. + rpc UpdateUserLink(UpdateUserLinkRequest) returns (UserLink) { + option (google.api.http) = { + patch: "/v1alpha/{user_link.name=accounts/*/userLinks/*}" + body: "user_link" + additional_bindings { + patch: "/v1alpha/{user_link.name=properties/*/userLinks/*}" + body: "user_link" + } + }; + option (google.api.method_signature) = "user_link"; + } + + // Updates information about multiple users' links to an account or property. + rpc BatchUpdateUserLinks(BatchUpdateUserLinksRequest) returns (BatchUpdateUserLinksResponse) { + option (google.api.http) = { + post: "/v1alpha/{parent=accounts/*}/userLinks:batchUpdate" + body: "*" + additional_bindings { + post: "/v1alpha/{parent=properties/*}/userLinks:batchUpdate" + body: "*" + } + }; + } + + // Deletes a user link on an account or property. + rpc DeleteUserLink(DeleteUserLinkRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=accounts/*/userLinks/*}" + additional_bindings { + delete: "/v1alpha/{name=properties/*/userLinks/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Deletes information about multiple users' links to an account or property. + rpc BatchDeleteUserLinks(BatchDeleteUserLinksRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1alpha/{parent=accounts/*}/userLinks:batchDelete" + body: "*" + additional_bindings { + post: "/v1alpha/{parent=properties/*}/userLinks:batchDelete" + body: "*" + } + }; + } + + // Creates a FirebaseLink. + // + // Properties can have at most one FirebaseLink. + rpc CreateFirebaseLink(CreateFirebaseLinkRequest) returns (FirebaseLink) { + option (google.api.http) = { + post: "/v1alpha/{parent=properties/*}/firebaseLinks" + body: "firebase_link" + }; + option (google.api.method_signature) = "parent,firebase_link"; + } + + // Deletes a FirebaseLink on a property + rpc DeleteFirebaseLink(DeleteFirebaseLinkRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=properties/*/firebaseLinks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists FirebaseLinks on a property. + // Properties can have at most one FirebaseLink. + rpc ListFirebaseLinks(ListFirebaseLinksRequest) returns (ListFirebaseLinksResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=properties/*}/firebaseLinks" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns the Site Tag for the specified web stream. + // Site Tags are immutable singletons. + rpc GetGlobalSiteTag(GetGlobalSiteTagRequest) returns (GlobalSiteTag) { + option (google.api.http) = { + get: "/v1alpha/{name=properties/*/dataStreams/*/globalSiteTag}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a GoogleAdsLink. + rpc CreateGoogleAdsLink(CreateGoogleAdsLinkRequest) returns (GoogleAdsLink) { + option (google.api.http) = { + post: "/v1alpha/{parent=properties/*}/googleAdsLinks" + body: "google_ads_link" + }; + option (google.api.method_signature) = "parent,google_ads_link"; + } + + // Updates a GoogleAdsLink on a property + rpc UpdateGoogleAdsLink(UpdateGoogleAdsLinkRequest) returns (GoogleAdsLink) { + option (google.api.http) = { + patch: "/v1alpha/{google_ads_link.name=properties/*/googleAdsLinks/*}" + body: "google_ads_link" + }; + option (google.api.method_signature) = "google_ads_link,update_mask"; + } + + // Deletes a GoogleAdsLink on a property + rpc DeleteGoogleAdsLink(DeleteGoogleAdsLinkRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=properties/*/googleAdsLinks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists GoogleAdsLinks on a property. + rpc ListGoogleAdsLinks(ListGoogleAdsLinksRequest) returns (ListGoogleAdsLinksResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=properties/*}/googleAdsLinks" + }; + option (google.api.method_signature) = "parent"; + } + + // Get data sharing settings on an account. + // Data sharing settings are singletons. + rpc GetDataSharingSettings(GetDataSharingSettingsRequest) returns (DataSharingSettings) { + option (google.api.http) = { + get: "/v1alpha/{name=accounts/*/dataSharingSettings}" + }; + option (google.api.method_signature) = "name"; + } + + // Lookup for a single "GA4" MeasurementProtocolSecret. + rpc GetMeasurementProtocolSecret(GetMeasurementProtocolSecretRequest) returns (MeasurementProtocolSecret) { + option (google.api.http) = { + get: "/v1alpha/{name=properties/*/dataStreams/*/measurementProtocolSecrets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns child MeasurementProtocolSecrets under the specified parent + // Property. + rpc ListMeasurementProtocolSecrets(ListMeasurementProtocolSecretsRequest) returns (ListMeasurementProtocolSecretsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=properties/*/dataStreams/*}/measurementProtocolSecrets" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a measurement protocol secret. + rpc CreateMeasurementProtocolSecret(CreateMeasurementProtocolSecretRequest) returns (MeasurementProtocolSecret) { + option (google.api.http) = { + post: "/v1alpha/{parent=properties/*/dataStreams/*}/measurementProtocolSecrets" + body: "measurement_protocol_secret" + }; + option (google.api.method_signature) = "parent,measurement_protocol_secret"; + } + + // Deletes target MeasurementProtocolSecret. + rpc DeleteMeasurementProtocolSecret(DeleteMeasurementProtocolSecretRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=properties/*/dataStreams/*/measurementProtocolSecrets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a measurement protocol secret. + rpc UpdateMeasurementProtocolSecret(UpdateMeasurementProtocolSecretRequest) returns (MeasurementProtocolSecret) { + option (google.api.http) = { + patch: "/v1alpha/{measurement_protocol_secret.name=properties/*/dataStreams/*/measurementProtocolSecrets/*}" + body: "measurement_protocol_secret" + }; + option (google.api.method_signature) = "measurement_protocol_secret,update_mask"; + } + + // Acknowledges the terms of user data collection for the specified property. + // + // This acknowledgement must be completed (either in the Google Analytics UI + // or via this API) before MeasurementProtocolSecret resources may be created. + rpc AcknowledgeUserDataCollection(AcknowledgeUserDataCollectionRequest) returns (AcknowledgeUserDataCollectionResponse) { + option (google.api.http) = { + post: "/v1alpha/{property=properties/*}:acknowledgeUserDataCollection" + body: "*" + }; + } + + // Searches through all changes to an account or its children given the + // specified set of filters. + rpc SearchChangeHistoryEvents(SearchChangeHistoryEventsRequest) returns (SearchChangeHistoryEventsResponse) { + option (google.api.http) = { + post: "/v1alpha/{account=accounts/*}:searchChangeHistoryEvents" + body: "*" + }; + } + + // Lookup for Google Signals settings for a property. + rpc GetGoogleSignalsSettings(GetGoogleSignalsSettingsRequest) returns (GoogleSignalsSettings) { + option (google.api.http) = { + get: "/v1alpha/{name=properties/*/googleSignalsSettings}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates Google Signals settings for a property. + rpc UpdateGoogleSignalsSettings(UpdateGoogleSignalsSettingsRequest) returns (GoogleSignalsSettings) { + option (google.api.http) = { + patch: "/v1alpha/{google_signals_settings.name=properties/*/googleSignalsSettings}" + body: "google_signals_settings" + }; + option (google.api.method_signature) = "google_signals_settings,update_mask"; + } + + // Creates a conversion event with the specified attributes. + rpc CreateConversionEvent(CreateConversionEventRequest) returns (ConversionEvent) { + option (google.api.http) = { + post: "/v1alpha/{parent=properties/*}/conversionEvents" + body: "conversion_event" + }; + option (google.api.method_signature) = "parent,conversion_event"; + } + + // Retrieve a single conversion event. + rpc GetConversionEvent(GetConversionEventRequest) returns (ConversionEvent) { + option (google.api.http) = { + get: "/v1alpha/{name=properties/*/conversionEvents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes a conversion event in a property. + rpc DeleteConversionEvent(DeleteConversionEventRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=properties/*/conversionEvents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns a list of conversion events in the specified parent property. + // + // Returns an empty list if no conversion events are found. + rpc ListConversionEvents(ListConversionEventsRequest) returns (ListConversionEventsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=properties/*}/conversionEvents" + }; + option (google.api.method_signature) = "parent"; + } + + // Look up a single DisplayVideo360AdvertiserLink + rpc GetDisplayVideo360AdvertiserLink(GetDisplayVideo360AdvertiserLinkRequest) returns (DisplayVideo360AdvertiserLink) { + option (google.api.http) = { + get: "/v1alpha/{name=properties/*/displayVideo360AdvertiserLinks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all DisplayVideo360AdvertiserLinks on a property. + rpc ListDisplayVideo360AdvertiserLinks(ListDisplayVideo360AdvertiserLinksRequest) returns (ListDisplayVideo360AdvertiserLinksResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=properties/*}/displayVideo360AdvertiserLinks" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a DisplayVideo360AdvertiserLink. + // This can only be utilized by users who have proper authorization both on + // the Google Analytics property and on the Display & Video 360 advertiser. + // Users who do not have access to the Display & Video 360 advertiser should + // instead seek to create a DisplayVideo360LinkProposal. + rpc CreateDisplayVideo360AdvertiserLink(CreateDisplayVideo360AdvertiserLinkRequest) returns (DisplayVideo360AdvertiserLink) { + option (google.api.http) = { + post: "/v1alpha/{parent=properties/*}/displayVideo360AdvertiserLinks" + body: "display_video_360_advertiser_link" + }; + option (google.api.method_signature) = "parent,display_video_360_advertiser_link"; + } + + // Deletes a DisplayVideo360AdvertiserLink on a property. + rpc DeleteDisplayVideo360AdvertiserLink(DeleteDisplayVideo360AdvertiserLinkRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=properties/*/displayVideo360AdvertiserLinks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a DisplayVideo360AdvertiserLink on a property. + rpc UpdateDisplayVideo360AdvertiserLink(UpdateDisplayVideo360AdvertiserLinkRequest) returns (DisplayVideo360AdvertiserLink) { + option (google.api.http) = { + patch: "/v1alpha/{display_video_360_advertiser_link.name=properties/*/displayVideo360AdvertiserLinks/*}" + body: "display_video_360_advertiser_link" + }; + option (google.api.method_signature) = "display_video_360_advertiser_link,update_mask"; + } + + // Lookup for a single DisplayVideo360AdvertiserLinkProposal. + rpc GetDisplayVideo360AdvertiserLinkProposal(GetDisplayVideo360AdvertiserLinkProposalRequest) returns (DisplayVideo360AdvertiserLinkProposal) { + option (google.api.http) = { + get: "/v1alpha/{name=properties/*/displayVideo360AdvertiserLinkProposals/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists DisplayVideo360AdvertiserLinkProposals on a property. + rpc ListDisplayVideo360AdvertiserLinkProposals(ListDisplayVideo360AdvertiserLinkProposalsRequest) returns (ListDisplayVideo360AdvertiserLinkProposalsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=properties/*}/displayVideo360AdvertiserLinkProposals" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a DisplayVideo360AdvertiserLinkProposal. + rpc CreateDisplayVideo360AdvertiserLinkProposal(CreateDisplayVideo360AdvertiserLinkProposalRequest) returns (DisplayVideo360AdvertiserLinkProposal) { + option (google.api.http) = { + post: "/v1alpha/{parent=properties/*}/displayVideo360AdvertiserLinkProposals" + body: "display_video_360_advertiser_link_proposal" + }; + option (google.api.method_signature) = "parent,display_video_360_advertiser_link_proposal"; + } + + // Deletes a DisplayVideo360AdvertiserLinkProposal on a property. + // This can only be used on cancelled proposals. + rpc DeleteDisplayVideo360AdvertiserLinkProposal(DeleteDisplayVideo360AdvertiserLinkProposalRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=properties/*/displayVideo360AdvertiserLinkProposals/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Approves a DisplayVideo360AdvertiserLinkProposal. + // The DisplayVideo360AdvertiserLinkProposal will be deleted and a new + // DisplayVideo360AdvertiserLink will be created. + rpc ApproveDisplayVideo360AdvertiserLinkProposal(ApproveDisplayVideo360AdvertiserLinkProposalRequest) returns (ApproveDisplayVideo360AdvertiserLinkProposalResponse) { + option (google.api.http) = { + post: "/v1alpha/{name=properties/*/displayVideo360AdvertiserLinkProposals/*}:approve" + body: "*" + }; + } + + // Cancels a DisplayVideo360AdvertiserLinkProposal. + // Cancelling can mean either: + // - Declining a proposal initiated from Display & Video 360 + // - Withdrawing a proposal initiated from Google Analytics + // After being cancelled, a proposal will eventually be deleted automatically. + rpc CancelDisplayVideo360AdvertiserLinkProposal(CancelDisplayVideo360AdvertiserLinkProposalRequest) returns (DisplayVideo360AdvertiserLinkProposal) { + option (google.api.http) = { + post: "/v1alpha/{name=properties/*/displayVideo360AdvertiserLinkProposals/*}:cancel" + body: "*" + }; + } + + // Creates a CustomDimension. + rpc CreateCustomDimension(CreateCustomDimensionRequest) returns (CustomDimension) { + option (google.api.http) = { + post: "/v1alpha/{parent=properties/*}/customDimensions" + body: "custom_dimension" + }; + option (google.api.method_signature) = "parent,custom_dimension"; + } + + // Updates a CustomDimension on a property. + rpc UpdateCustomDimension(UpdateCustomDimensionRequest) returns (CustomDimension) { + option (google.api.http) = { + patch: "/v1alpha/{custom_dimension.name=properties/*/customDimensions/*}" + body: "custom_dimension" + }; + option (google.api.method_signature) = "custom_dimension,update_mask"; + } + + // Lists CustomDimensions on a property. + rpc ListCustomDimensions(ListCustomDimensionsRequest) returns (ListCustomDimensionsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=properties/*}/customDimensions" + }; + option (google.api.method_signature) = "parent"; + } + + // Archives a CustomDimension on a property. + rpc ArchiveCustomDimension(ArchiveCustomDimensionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1alpha/{name=properties/*/customDimensions/*}:archive" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Lookup for a single CustomDimension. + rpc GetCustomDimension(GetCustomDimensionRequest) returns (CustomDimension) { + option (google.api.http) = { + get: "/v1alpha/{name=properties/*/customDimensions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a CustomMetric. + rpc CreateCustomMetric(CreateCustomMetricRequest) returns (CustomMetric) { + option (google.api.http) = { + post: "/v1alpha/{parent=properties/*}/customMetrics" + body: "custom_metric" + }; + option (google.api.method_signature) = "parent,custom_metric"; + } + + // Updates a CustomMetric on a property. + rpc UpdateCustomMetric(UpdateCustomMetricRequest) returns (CustomMetric) { + option (google.api.http) = { + patch: "/v1alpha/{custom_metric.name=properties/*/customMetrics/*}" + body: "custom_metric" + }; + option (google.api.method_signature) = "custom_metric,update_mask"; + } + + // Lists CustomMetrics on a property. + rpc ListCustomMetrics(ListCustomMetricsRequest) returns (ListCustomMetricsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=properties/*}/customMetrics" + }; + option (google.api.method_signature) = "parent"; + } + + // Archives a CustomMetric on a property. + rpc ArchiveCustomMetric(ArchiveCustomMetricRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1alpha/{name=properties/*/customMetrics/*}:archive" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Lookup for a single CustomMetric. + rpc GetCustomMetric(GetCustomMetricRequest) returns (CustomMetric) { + option (google.api.http) = { + get: "/v1alpha/{name=properties/*/customMetrics/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns the singleton data retention settings for this property. + rpc GetDataRetentionSettings(GetDataRetentionSettingsRequest) returns (DataRetentionSettings) { + option (google.api.http) = { + get: "/v1alpha/{name=properties/*/dataRetentionSettings}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the singleton data retention settings for this property. + rpc UpdateDataRetentionSettings(UpdateDataRetentionSettingsRequest) returns (DataRetentionSettings) { + option (google.api.http) = { + patch: "/v1alpha/{data_retention_settings.name=properties/*/dataRetentionSettings}" + body: "data_retention_settings" + }; + option (google.api.method_signature) = "data_retention_settings,update_mask"; + } + + // Creates a DataStream. + rpc CreateDataStream(CreateDataStreamRequest) returns (DataStream) { + option (google.api.http) = { + post: "/v1alpha/{parent=properties/*}/dataStreams" + body: "data_stream" + }; + option (google.api.method_signature) = "parent,data_stream"; + } + + // Deletes a DataStream on a property. + rpc DeleteDataStream(DeleteDataStreamRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=properties/*/dataStreams/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a DataStream on a property. + rpc UpdateDataStream(UpdateDataStreamRequest) returns (DataStream) { + option (google.api.http) = { + patch: "/v1alpha/{data_stream.name=properties/*/dataStreams/*}" + body: "data_stream" + }; + option (google.api.method_signature) = "data_stream,update_mask"; + } + + // Lists DataStreams on a property. + rpc ListDataStreams(ListDataStreamsRequest) returns (ListDataStreamsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=properties/*}/dataStreams" + }; + option (google.api.method_signature) = "parent"; + } + + // Lookup for a single DataStream. + rpc GetDataStream(GetDataStreamRequest) returns (DataStream) { + option (google.api.http) = { + get: "/v1alpha/{name=properties/*/dataStreams/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for GetAccount RPC. +message GetAccountRequest { + // Required. The name of the account to lookup. + // Format: accounts/{account} + // Example: "accounts/100" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/Account" + } + ]; +} + +// Request message for ListAccounts RPC. +message ListAccountsRequest { + // The maximum number of resources to return. The service may return + // fewer than this value, even if there are additional pages. + // If unspecified, at most 50 resources will be returned. + // The maximum value is 200; (higher values will be coerced to the maximum) + int32 page_size = 1; + + // A page token, received from a previous `ListAccounts` call. + // Provide this to retrieve the subsequent page. + // When paginating, all other parameters provided to `ListAccounts` must + // match the call that provided the page token. + string page_token = 2; + + // Whether to include soft-deleted (ie: "trashed") Accounts in the + // results. Accounts can be inspected to determine whether they are deleted or + // not. + bool show_deleted = 3; +} + +// Request message for ListAccounts RPC. +message ListAccountsResponse { + // Results that were accessible to the caller. + repeated Account accounts = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for DeleteAccount RPC. +message DeleteAccountRequest { + // Required. The name of the Account to soft-delete. + // Format: accounts/{account} + // Example: "accounts/100" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/Account" + } + ]; +} + +// Request message for UpdateAccount RPC. +message UpdateAccountRequest { + // Required. The account to update. + // The account's `name` field is used to identify the account. + Account account = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to be updated. Field names must be in snake case + // (e.g., "field_to_update"). Omitted fields will not be updated. To replace + // the entire entity, use one path with the string "*" to match all fields. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for ProvisionAccountTicket RPC. +message ProvisionAccountTicketRequest { + // The account to create. + Account account = 1; + + // Redirect URI where the user will be sent after accepting Terms of Service. + // Must be configured in Developers Console as a Redirect URI + string redirect_uri = 2; +} + +// Response message for ProvisionAccountTicket RPC. +message ProvisionAccountTicketResponse { + // The param to be passed in the ToS link. + string account_ticket_id = 1; +} + +// Request message for GetProperty RPC. +message GetPropertyRequest { + // Required. The name of the property to lookup. + // Format: properties/{property_id} + // Example: "properties/1000" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/Property" + } + ]; +} + +// Request message for ListProperties RPC. +message ListPropertiesRequest { + // Required. An expression for filtering the results of the request. + // Fields eligible for filtering are: + // `parent:`(The resource name of the parent account/property) or + // `ancestor:`(The resource name of the parent account) or + // `firebase_project:`(The id or number of the linked firebase project). + // Some examples of filters: + // + // ``` + // | Filter | Description | + // |-----------------------------|-------------------------------------------| + // | parent:accounts/123 | The account with account id: 123. | + // | parent:properties/123 | The property with property id: 123. | + // | ancestor:accounts/123 | The account with account id: 123. | + // | firebase_project:project-id | The firebase project with id: project-id. | + // | firebase_project:123 | The firebase project with number: 123. | + // ``` + string filter = 1 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of resources to return. The service may return + // fewer than this value, even if there are additional pages. + // If unspecified, at most 50 resources will be returned. + // The maximum value is 200; (higher values will be coerced to the maximum) + int32 page_size = 2; + + // A page token, received from a previous `ListProperties` call. + // Provide this to retrieve the subsequent page. + // When paginating, all other parameters provided to `ListProperties` must + // match the call that provided the page token. + string page_token = 3; + + // Whether to include soft-deleted (ie: "trashed") Properties in the + // results. Properties can be inspected to determine whether they are deleted + // or not. + bool show_deleted = 4; +} + +// Response message for ListProperties RPC. +message ListPropertiesResponse { + // Results that matched the filter criteria and were accessible to the caller. + repeated Property properties = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for UpdateProperty RPC. +message UpdatePropertyRequest { + // Required. The property to update. + // The property's `name` field is used to identify the property to be + // updated. + Property property = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to be updated. Field names must be in snake case + // (e.g., "field_to_update"). Omitted fields will not be updated. To replace + // the entire entity, use one path with the string "*" to match all fields. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for CreateProperty RPC. +message CreatePropertyRequest { + // Required. The property to create. + // Note: the supplied property must specify its parent. + Property property = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DeleteProperty RPC. +message DeletePropertyRequest { + // Required. The name of the Property to soft-delete. + // Format: properties/{property_id} + // Example: "properties/1000" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/Property" + } + ]; +} + +// Request message for GetUserLink RPC. +message GetUserLinkRequest { + // Required. Example format: accounts/1234/userLinks/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/UserLink" + } + ]; +} + +// Request message for BatchGetUserLinks RPC. +message BatchGetUserLinksRequest { + // Required. The account or property that all user links in the request are + // for. The parent of all provided values for the 'names' field must match + // this field. + // Example format: accounts/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/UserLink" + } + ]; + + // Required. The names of the user links to retrieve. + // A maximum of 1000 user links can be retrieved in a batch. + // Format: accounts/{accountId}/userLinks/{userLinkId} + repeated string names = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/UserLink" + } + ]; +} + +// Response message for BatchGetUserLinks RPC. +message BatchGetUserLinksResponse { + // The requested user links. + repeated UserLink user_links = 1; +} + +// Request message for ListUserLinks RPC. +message ListUserLinksRequest { + // Required. Example format: accounts/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/UserLink" + } + ]; + + // The maximum number of user links to return. + // The service may return fewer than this value. + // If unspecified, at most 200 user links will be returned. + // The maximum value is 500; values above 500 will be coerced to 500. + int32 page_size = 2; + + // A page token, received from a previous `ListUserLinks` call. + // Provide this to retrieve the subsequent page. + // When paginating, all other parameters provided to `ListUserLinks` must + // match the call that provided the page token. + string page_token = 3; +} + +// Response message for ListUserLinks RPC. +message ListUserLinksResponse { + // List of UserLinks. These will be ordered stably, but in an arbitrary order. + repeated UserLink user_links = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for AuditUserLinks RPC. +message AuditUserLinksRequest { + // Required. Example format: accounts/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/UserLink" + } + ]; + + // The maximum number of user links to return. + // The service may return fewer than this value. + // If unspecified, at most 1000 user links will be returned. + // The maximum value is 5000; values above 5000 will be coerced to 5000. + int32 page_size = 2; + + // A page token, received from a previous `AuditUserLinks` call. + // Provide this to retrieve the subsequent page. + // When paginating, all other parameters provided to `AuditUserLinks` must + // match the call that provided the page token. + string page_token = 3; +} + +// Response message for AuditUserLinks RPC. +message AuditUserLinksResponse { + // List of AuditUserLinks. These will be ordered stably, but in an arbitrary + // order. + repeated AuditUserLink user_links = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for CreateUserLink RPC. +// +// Users can have multiple email addresses associated with their Google +// account, and one of these email addresses is the "primary" email address. +// Any of the email addresses associated with a Google account may be used +// for a new UserLink, but the returned UserLink will always contain the +// "primary" email address. As a result, the input and output email address +// for this request may differ. +message CreateUserLinkRequest { + // Required. Example format: accounts/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/UserLink" + } + ]; + + // Optional. If set, then email the new user notifying them that they've been granted + // permissions to the resource. + bool notify_new_user = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The user link to create. + UserLink user_link = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for BatchCreateUserLinks RPC. +message BatchCreateUserLinksRequest { + // Required. The account or property that all user links in the request are for. + // This field is required. The parent field in the CreateUserLinkRequest + // messages must either be empty or match this field. + // Example format: accounts/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/UserLink" + } + ]; + + // Optional. If set, then email the new users notifying them that they've been granted + // permissions to the resource. Regardless of whether this is set or not, + // notify_new_user field inside each individual request is ignored. + bool notify_new_users = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The requests specifying the user links to create. + // A maximum of 1000 user links can be created in a batch. + repeated CreateUserLinkRequest requests = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for BatchCreateUserLinks RPC. +message BatchCreateUserLinksResponse { + // The user links created. + repeated UserLink user_links = 1; +} + +// Request message for UpdateUserLink RPC. +message UpdateUserLinkRequest { + // Required. The user link to update. + UserLink user_link = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for BatchUpdateUserLinks RPC. +message BatchUpdateUserLinksRequest { + // Required. The account or property that all user links in the request are + // for. The parent field in the UpdateUserLinkRequest messages must either be + // empty or match this field. + // Example format: accounts/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/UserLink" + } + ]; + + // Required. The requests specifying the user links to update. + // A maximum of 1000 user links can be updated in a batch. + repeated UpdateUserLinkRequest requests = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for BatchUpdateUserLinks RPC. +message BatchUpdateUserLinksResponse { + // The user links updated. + repeated UserLink user_links = 1; +} + +// Request message for DeleteUserLink RPC. +message DeleteUserLinkRequest { + // Required. Example format: accounts/1234/userLinks/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/UserLink" + } + ]; +} + +// Request message for BatchDeleteUserLinks RPC. +message BatchDeleteUserLinksRequest { + // Required. The account or property that all user links in the request are + // for. The parent of all values for user link names to delete must match this + // field. + // Example format: accounts/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/UserLink" + } + ]; + + // Required. The requests specifying the user links to update. + // A maximum of 1000 user links can be updated in a batch. + repeated DeleteUserLinkRequest requests = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for CreateFirebaseLink RPC +message CreateFirebaseLinkRequest { + // Required. Format: properties/{property_id} + // Example: properties/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/FirebaseLink" + } + ]; + + // Required. The Firebase link to create. + FirebaseLink firebase_link = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DeleteFirebaseLink RPC +message DeleteFirebaseLinkRequest { + // Required. Format: properties/{property_id}/firebaseLinks/{firebase_link_id} + // Example: properties/1234/firebaseLinks/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/FirebaseLink" + } + ]; +} + +// Request message for ListFirebaseLinks RPC +message ListFirebaseLinksRequest { + // Required. Format: properties/{property_id} + // Example: properties/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/FirebaseLink" + } + ]; + + // The maximum number of resources to return. The service may return + // fewer than this value, even if there are additional pages. + // If unspecified, at most 50 resources will be returned. + // The maximum value is 200; (higher values will be coerced to the maximum) + int32 page_size = 2; + + // A page token, received from a previous `ListFirebaseLinks` call. + // Provide this to retrieve the subsequent page. + // When paginating, all other parameters provided to `ListProperties` must + // match the call that provided the page token. + string page_token = 3; +} + +// Response message for ListFirebaseLinks RPC +message ListFirebaseLinksResponse { + // List of FirebaseLinks. This will have at most one value. + repeated FirebaseLink firebase_links = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + // Currently, Google Analytics supports only one FirebaseLink per property, + // so this will never be populated. + string next_page_token = 2; +} + +// Request message for GetGlobalSiteTag RPC. +message GetGlobalSiteTagRequest { + // Required. The name of the site tag to lookup. + // Note that site tags are singletons and do not have unique IDs. + // Format: properties/{property_id}/dataStreams/{stream_id}/globalSiteTag + // Example: "properties/123/dataStreams/456/globalSiteTag" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/GlobalSiteTag" + } + ]; +} + +// Request message for CreateGoogleAdsLink RPC +message CreateGoogleAdsLinkRequest { + // Required. Example format: properties/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/GoogleAdsLink" + } + ]; + + // Required. The GoogleAdsLink to create. + GoogleAdsLink google_ads_link = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for UpdateGoogleAdsLink RPC +message UpdateGoogleAdsLinkRequest { + // The GoogleAdsLink to update + GoogleAdsLink google_ads_link = 1; + + // Required. The list of fields to be updated. Field names must be in snake case + // (e.g., "field_to_update"). Omitted fields will not be updated. To replace + // the entire entity, use one path with the string "*" to match all fields. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DeleteGoogleAdsLink RPC. +message DeleteGoogleAdsLinkRequest { + // Required. Example format: properties/1234/googleAdsLinks/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/GoogleAdsLink" + } + ]; +} + +// Request message for ListGoogleAdsLinks RPC. +message ListGoogleAdsLinksRequest { + // Required. Example format: properties/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/GoogleAdsLink" + } + ]; + + // The maximum number of resources to return. + // If unspecified, at most 50 resources will be returned. + // The maximum value is 200 (higher values will be coerced to the maximum). + int32 page_size = 2; + + // A page token, received from a previous `ListGoogleAdsLinks` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListGoogleAdsLinks` must + // match the call that provided the page token. + string page_token = 3; +} + +// Response message for ListGoogleAdsLinks RPC. +message ListGoogleAdsLinksResponse { + // List of GoogleAdsLinks. + repeated GoogleAdsLink google_ads_links = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for GetDataSharingSettings RPC. +message GetDataSharingSettingsRequest { + // Required. The name of the settings to lookup. + // Format: accounts/{account}/dataSharingSettings + // Example: "accounts/1000/dataSharingSettings" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/DataSharingSettings" + } + ]; +} + +// Request message for ListAccountSummaries RPC. +message ListAccountSummariesRequest { + // The maximum number of AccountSummary resources to return. The service may + // return fewer than this value, even if there are additional pages. + // If unspecified, at most 50 resources will be returned. + // The maximum value is 200; (higher values will be coerced to the maximum) + int32 page_size = 1; + + // A page token, received from a previous `ListAccountSummaries` call. + // Provide this to retrieve the subsequent page. + // When paginating, all other parameters provided to `ListAccountSummaries` + // must match the call that provided the page token. + string page_token = 2; +} + +// Response message for ListAccountSummaries RPC. +message ListAccountSummariesResponse { + // Account summaries of all accounts the caller has access to. + repeated AccountSummary account_summaries = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for AcknowledgeUserDataCollection RPC. +message AcknowledgeUserDataCollectionRequest { + // Required. The property for which to acknowledge user data collection. + string property = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/Property" + } + ]; + + // Required. An acknowledgement that the caller of this method understands the terms + // of user data collection. + // + // This field must contain the exact value: + // "I acknowledge that I have the necessary privacy disclosures and rights + // from my end users for the collection and processing of their data, + // including the association of such data with the visitation information + // Google Analytics collects from my site and/or app property." + string acknowledgement = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for AcknowledgeUserDataCollection RPC. +message AcknowledgeUserDataCollectionResponse { + +} + +// Request message for SearchChangeHistoryEvents RPC. +message SearchChangeHistoryEventsRequest { + // Required. The account resource for which to return change history resources. + string account = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/Account" + } + ]; + + // Optional. Resource name for a child property. If set, only return changes + // made to this property or its child resources. + string property = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/Property" + } + ]; + + // Optional. If set, only return changes if they are for a resource that matches at + // least one of these types. + repeated ChangeHistoryResourceType resource_type = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, only return changes that match one or more of these types of + // actions. + repeated ActionType action = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, only return changes if they are made by a user in this list. + repeated string actor_email = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, only return changes made after this time (inclusive). + google.protobuf.Timestamp earliest_change_time = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, only return changes made before this time (inclusive). + google.protobuf.Timestamp latest_change_time = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of ChangeHistoryEvent items to return. + // The service may return fewer than this value, even if there are additional + // pages. If unspecified, at most 50 items will be returned. + // The maximum value is 200 (higher values will be coerced to the maximum). + int32 page_size = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `SearchChangeHistoryEvents` call. + // Provide this to retrieve the subsequent page. When paginating, all other + // parameters provided to `SearchChangeHistoryEvents` must match the call that + // provided the page token. + string page_token = 9 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for SearchAccounts RPC. +message SearchChangeHistoryEventsResponse { + // Results that were accessible to the caller. + repeated ChangeHistoryEvent change_history_events = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for GetMeasurementProtocolSecret RPC. +message GetMeasurementProtocolSecretRequest { + // Required. The name of the measurement protocol secret to lookup. + // Format: + // properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/MeasurementProtocolSecret" + } + ]; +} + +// Request message for CreateMeasurementProtocolSecret RPC +message CreateMeasurementProtocolSecretRequest { + // Required. The parent resource where this secret will be created. + // Format: properties/{property}/dataStreams/{dataStream} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/MeasurementProtocolSecret" + } + ]; + + // Required. The measurement protocol secret to create. + MeasurementProtocolSecret measurement_protocol_secret = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DeleteMeasurementProtocolSecret RPC +message DeleteMeasurementProtocolSecretRequest { + // Required. The name of the MeasurementProtocolSecret to delete. + // Format: + // properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/MeasurementProtocolSecret" + } + ]; +} + +// Request message for UpdateMeasurementProtocolSecret RPC +message UpdateMeasurementProtocolSecretRequest { + // Required. The measurement protocol secret to update. + MeasurementProtocolSecret measurement_protocol_secret = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. Omitted fields will not be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for ListMeasurementProtocolSecret RPC +message ListMeasurementProtocolSecretsRequest { + // Required. The resource name of the parent stream. + // Format: + // properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/MeasurementProtocolSecret" + } + ]; + + // The maximum number of resources to return. + // If unspecified, at most 10 resources will be returned. + // The maximum value is 10. Higher values will be coerced to the maximum. + int32 page_size = 2; + + // A page token, received from a previous `ListMeasurementProtocolSecrets` + // call. Provide this to retrieve the subsequent page. When paginating, all + // other parameters provided to `ListMeasurementProtocolSecrets` must match + // the call that provided the page token. + string page_token = 3; +} + +// Response message for ListMeasurementProtocolSecret RPC +message ListMeasurementProtocolSecretsResponse { + // A list of secrets for the parent stream specified in the request. + repeated MeasurementProtocolSecret measurement_protocol_secrets = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for GetGoogleSignalsSettings RPC +message GetGoogleSignalsSettingsRequest { + // Required. The name of the google signals settings to retrieve. + // Format: properties/{property}/googleSignalsSettings + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/GoogleSignalsSettings" + } + ]; +} + +// Request message for UpdateGoogleSignalsSettings RPC +message UpdateGoogleSignalsSettingsRequest { + // Required. The settings to update. + // The `name` field is used to identify the settings to be updated. + GoogleSignalsSettings google_signals_settings = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to be updated. Field names must be in snake case + // (e.g., "field_to_update"). Omitted fields will not be updated. To replace + // the entire entity, use one path with the string "*" to match all fields. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for CreateConversionEvent RPC +message CreateConversionEventRequest { + // Required. The conversion event to create. + ConversionEvent conversion_event = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource name of the parent property where this conversion event will + // be created. Format: properties/123 + string parent = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/ConversionEvent" + } + ]; +} + +// Request message for GetConversionEvent RPC +message GetConversionEventRequest { + // Required. The resource name of the conversion event to retrieve. + // Format: properties/{property}/conversionEvents/{conversion_event} + // Example: "properties/123/conversionEvents/456" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/ConversionEvent" + } + ]; +} + +// Request message for DeleteConversionEvent RPC +message DeleteConversionEventRequest { + // Required. The resource name of the conversion event to delete. + // Format: properties/{property}/conversionEvents/{conversion_event} + // Example: "properties/123/conversionEvents/456" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/ConversionEvent" + } + ]; +} + +// Request message for ListConversionEvents RPC +message ListConversionEventsRequest { + // Required. The resource name of the parent property. + // Example: 'properties/123' + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/ConversionEvent" + } + ]; + + // The maximum number of resources to return. + // If unspecified, at most 50 resources will be returned. + // The maximum value is 200; (higher values will be coerced to the maximum) + int32 page_size = 2; + + // A page token, received from a previous `ListConversionEvents` call. + // Provide this to retrieve the subsequent page. + // When paginating, all other parameters provided to `ListConversionEvents` + // must match the call that provided the page token. + string page_token = 3; +} + +// Response message for ListConversionEvents RPC. +message ListConversionEventsResponse { + // The requested conversion events + repeated ConversionEvent conversion_events = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for GetDisplayVideo360AdvertiserLink RPC. +message GetDisplayVideo360AdvertiserLinkRequest { + // Required. The name of the DisplayVideo360AdvertiserLink to get. + // Example format: properties/1234/displayVideo360AdvertiserLink/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLink" + } + ]; +} + +// Request message for ListDisplayVideo360AdvertiserLinks RPC. +message ListDisplayVideo360AdvertiserLinksRequest { + // Required. Example format: properties/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLink" + } + ]; + + // The maximum number of resources to return. + // If unspecified, at most 50 resources will be returned. + // The maximum value is 200 (higher values will be coerced to the maximum). + int32 page_size = 2; + + // A page token, received from a previous `ListDisplayVideo360AdvertiserLinks` + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListDisplayVideo360AdvertiserLinks` must match the call that provided the + // page token. + string page_token = 3; +} + +// Response message for ListDisplayVideo360AdvertiserLinks RPC. +message ListDisplayVideo360AdvertiserLinksResponse { + // List of DisplayVideo360AdvertiserLinks. + repeated DisplayVideo360AdvertiserLink display_video_360_advertiser_links = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for CreateDisplayVideo360AdvertiserLink RPC. +message CreateDisplayVideo360AdvertiserLinkRequest { + // Required. Example format: properties/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLink" + } + ]; + + // Required. The DisplayVideo360AdvertiserLink to create. + DisplayVideo360AdvertiserLink display_video_360_advertiser_link = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DeleteDisplayVideo360AdvertiserLink RPC. +message DeleteDisplayVideo360AdvertiserLinkRequest { + // Required. The name of the DisplayVideo360AdvertiserLink to delete. + // Example format: properties/1234/displayVideo360AdvertiserLinks/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLink" + } + ]; +} + +// Request message for UpdateDisplayVideo360AdvertiserLink RPC. +message UpdateDisplayVideo360AdvertiserLinkRequest { + // The DisplayVideo360AdvertiserLink to update + DisplayVideo360AdvertiserLink display_video_360_advertiser_link = 1; + + // Required. The list of fields to be updated. Omitted fields will not be updated. + // To replace the entire entity, use one path with the string "*" to match + // all fields. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for GetDisplayVideo360AdvertiserLinkProposal RPC. +message GetDisplayVideo360AdvertiserLinkProposalRequest { + // Required. The name of the DisplayVideo360AdvertiserLinkProposal to get. + // Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLinkProposal" + } + ]; +} + +// Request message for ListDisplayVideo360AdvertiserLinkProposals RPC. +message ListDisplayVideo360AdvertiserLinkProposalsRequest { + // Required. Example format: properties/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLinkProposal" + } + ]; + + // The maximum number of resources to return. + // If unspecified, at most 50 resources will be returned. + // The maximum value is 200 (higher values will be coerced to the maximum). + int32 page_size = 2; + + // A page token, received from a previous + // `ListDisplayVideo360AdvertiserLinkProposals` call. Provide this to retrieve + // the subsequent page. + // + // When paginating, all other parameters provided to + // `ListDisplayVideo360AdvertiserLinkProposals` must match the call that + // provided the page token. + string page_token = 3; +} + +// Response message for ListDisplayVideo360AdvertiserLinkProposals RPC. +message ListDisplayVideo360AdvertiserLinkProposalsResponse { + // List of DisplayVideo360AdvertiserLinkProposals. + repeated DisplayVideo360AdvertiserLinkProposal display_video_360_advertiser_link_proposals = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for CreateDisplayVideo360AdvertiserLinkProposal RPC. +message CreateDisplayVideo360AdvertiserLinkProposalRequest { + // Required. Example format: properties/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLinkProposal" + } + ]; + + // Required. The DisplayVideo360AdvertiserLinkProposal to create. + DisplayVideo360AdvertiserLinkProposal display_video_360_advertiser_link_proposal = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DeleteDisplayVideo360AdvertiserLinkProposal RPC. +message DeleteDisplayVideo360AdvertiserLinkProposalRequest { + // Required. The name of the DisplayVideo360AdvertiserLinkProposal to delete. + // Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLinkProposal" + } + ]; +} + +// Request message for ApproveDisplayVideo360AdvertiserLinkProposal RPC. +message ApproveDisplayVideo360AdvertiserLinkProposalRequest { + // Required. The name of the DisplayVideo360AdvertiserLinkProposal to approve. + // Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLinkProposal" + } + ]; +} + +// Response message for ApproveDisplayVideo360AdvertiserLinkProposal RPC. +message ApproveDisplayVideo360AdvertiserLinkProposalResponse { + // The DisplayVideo360AdvertiserLink created as a result of approving the + // proposal. + DisplayVideo360AdvertiserLink display_video_360_advertiser_link = 1; +} + +// Request message for CancelDisplayVideo360AdvertiserLinkProposal RPC. +message CancelDisplayVideo360AdvertiserLinkProposalRequest { + // Required. The name of the DisplayVideo360AdvertiserLinkProposal to cancel. + // Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLinkProposal" + } + ]; +} + +// Request message for CreateCustomDimension RPC. +message CreateCustomDimensionRequest { + // Required. Example format: properties/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/CustomDimension" + } + ]; + + // Required. The CustomDimension to create. + CustomDimension custom_dimension = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for UpdateCustomDimension RPC. +message UpdateCustomDimensionRequest { + // The CustomDimension to update + CustomDimension custom_dimension = 1; + + // Required. The list of fields to be updated. Omitted fields will not be updated. + // To replace the entire entity, use one path with the string "*" to match + // all fields. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for ListCustomDimensions RPC. +message ListCustomDimensionsRequest { + // Required. Example format: properties/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/CustomDimension" + } + ]; + + // The maximum number of resources to return. + // If unspecified, at most 50 resources will be returned. + // The maximum value is 200 (higher values will be coerced to the maximum). + int32 page_size = 2; + + // A page token, received from a previous `ListCustomDimensions` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListCustomDimensions` + // must match the call that provided the page token. + string page_token = 3; +} + +// Response message for ListCustomDimensions RPC. +message ListCustomDimensionsResponse { + // List of CustomDimensions. + repeated CustomDimension custom_dimensions = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for ArchiveCustomDimension RPC. +message ArchiveCustomDimensionRequest { + // Required. The name of the CustomDimension to archive. + // Example format: properties/1234/customDimensions/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/CustomDimension" + } + ]; +} + +// Request message for GetCustomDimension RPC. +message GetCustomDimensionRequest { + // Required. The name of the CustomDimension to get. + // Example format: properties/1234/customDimensions/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/CustomDimension" + } + ]; +} + +// Request message for CreateCustomMetric RPC. +message CreateCustomMetricRequest { + // Required. Example format: properties/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/CustomMetric" + } + ]; + + // Required. The CustomMetric to create. + CustomMetric custom_metric = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for UpdateCustomMetric RPC. +message UpdateCustomMetricRequest { + // The CustomMetric to update + CustomMetric custom_metric = 1; + + // Required. The list of fields to be updated. Omitted fields will not be updated. + // To replace the entire entity, use one path with the string "*" to match + // all fields. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for ListCustomMetrics RPC. +message ListCustomMetricsRequest { + // Required. Example format: properties/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/CustomMetric" + } + ]; + + // The maximum number of resources to return. + // If unspecified, at most 50 resources will be returned. + // The maximum value is 200 (higher values will be coerced to the maximum). + int32 page_size = 2; + + // A page token, received from a previous `ListCustomMetrics` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListCustomMetrics` must + // match the call that provided the page token. + string page_token = 3; +} + +// Response message for ListCustomMetrics RPC. +message ListCustomMetricsResponse { + // List of CustomMetrics. + repeated CustomMetric custom_metrics = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for ArchiveCustomMetric RPC. +message ArchiveCustomMetricRequest { + // Required. The name of the CustomMetric to archive. + // Example format: properties/1234/customMetrics/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/CustomMetric" + } + ]; +} + +// Request message for GetCustomMetric RPC. +message GetCustomMetricRequest { + // Required. The name of the CustomMetric to get. + // Example format: properties/1234/customMetrics/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/CustomMetric" + } + ]; +} + +// Request message for GetDataRetentionSettings RPC. +message GetDataRetentionSettingsRequest { + // Required. The name of the settings to lookup. + // Format: + // properties/{property}/dataRetentionSettings + // Example: "properties/1000/dataRetentionSettings" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/DataRetentionSettings" + } + ]; +} + +// Request message for UpdateDataRetentionSettings RPC. +message UpdateDataRetentionSettingsRequest { + // Required. The settings to update. + // The `name` field is used to identify the settings to be updated. + DataRetentionSettings data_retention_settings = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to be updated. Field names must be in snake case + // (e.g., "field_to_update"). Omitted fields will not be updated. To replace + // the entire entity, use one path with the string "*" to match all fields. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for CreateDataStream RPC. +message CreateDataStreamRequest { + // Required. Example format: properties/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/DataStream" + } + ]; + + // Required. The DataStream to create. + DataStream data_stream = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DeleteDataStream RPC. +message DeleteDataStreamRequest { + // Required. The name of the DataStream to delete. + // Example format: properties/1234/dataStreams/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/DataStream" + } + ]; +} + +// Request message for UpdateDataStream RPC. +message UpdateDataStreamRequest { + // The DataStream to update + DataStream data_stream = 1; + + // Required. The list of fields to be updated. Omitted fields will not be updated. + // To replace the entire entity, use one path with the string "*" to match + // all fields. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for ListDataStreams RPC. +message ListDataStreamsRequest { + // Required. Example format: properties/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/DataStream" + } + ]; + + // The maximum number of resources to return. + // If unspecified, at most 50 resources will be returned. + // The maximum value is 200 (higher values will be coerced to the maximum). + int32 page_size = 2; + + // A page token, received from a previous `ListDataStreams` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListDataStreams` must + // match the call that provided the page token. + string page_token = 3; +} + +// Response message for ListDataStreams RPC. +message ListDataStreamsResponse { + // List of DataStreams. + repeated DataStream data_streams = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for GetDataStream RPC. +message GetDataStreamRequest { + // Required. The name of the DataStream to get. + // Example format: properties/1234/dataStreams/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/DataStream" + } + ]; +} diff --git a/owl-bot-staging/v1alpha/protos/google/analytics/admin/v1alpha/resources.proto b/owl-bot-staging/v1alpha/protos/google/analytics/admin/v1alpha/resources.proto new file mode 100644 index 0000000..d441d10 --- /dev/null +++ b/owl-bot-staging/v1alpha/protos/google/analytics/admin/v1alpha/resources.proto @@ -0,0 +1,1161 @@ +// 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.admin.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option go_package = "google.golang.org/genproto/googleapis/analytics/admin/v1alpha;admin"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.google.analytics.admin.v1alpha"; + +// The category selected for this property, used for industry benchmarking. +enum IndustryCategory { + // Industry category unspecified + INDUSTRY_CATEGORY_UNSPECIFIED = 0; + + // Automotive + AUTOMOTIVE = 1; + + // Business and industrial markets + BUSINESS_AND_INDUSTRIAL_MARKETS = 2; + + // Finance + FINANCE = 3; + + // Healthcare + HEALTHCARE = 4; + + // Technology + TECHNOLOGY = 5; + + // Travel + TRAVEL = 6; + + // Other + OTHER = 7; + + // Arts and entertainment + ARTS_AND_ENTERTAINMENT = 8; + + // Beauty and fitness + BEAUTY_AND_FITNESS = 9; + + // Books and literature + BOOKS_AND_LITERATURE = 10; + + // Food and drink + FOOD_AND_DRINK = 11; + + // Games + GAMES = 12; + + // Hobbies and leisure + HOBBIES_AND_LEISURE = 13; + + // Home and garden + HOME_AND_GARDEN = 14; + + // Internet and telecom + INTERNET_AND_TELECOM = 15; + + // Law and government + LAW_AND_GOVERNMENT = 16; + + // News + NEWS = 17; + + // Online communities + ONLINE_COMMUNITIES = 18; + + // People and society + PEOPLE_AND_SOCIETY = 19; + + // Pets and animals + PETS_AND_ANIMALS = 20; + + // Real estate + REAL_ESTATE = 21; + + // Reference + REFERENCE = 22; + + // Science + SCIENCE = 23; + + // Sports + SPORTS = 24; + + // Jobs and education + JOBS_AND_EDUCATION = 25; + + // Shopping + SHOPPING = 26; +} + +// Various levels of service for Google Analytics. +enum ServiceLevel { + // Service level not specified or invalid. + SERVICE_LEVEL_UNSPECIFIED = 0; + + // The standard version of Google Analytics. + GOOGLE_ANALYTICS_STANDARD = 1; + + // The paid, premium version of Google Analytics. + GOOGLE_ANALYTICS_360 = 2; +} + +// Different kinds of actors that can make changes to Google Analytics +// resources. +enum ActorType { + // Unknown or unspecified actor type. + ACTOR_TYPE_UNSPECIFIED = 0; + + // Changes made by the user specified in actor_email. + USER = 1; + + // Changes made by the Google Analytics system. + SYSTEM = 2; + + // Changes made by Google Analytics support team staff. + SUPPORT = 3; +} + +// Types of actions that may change a resource. +enum ActionType { + // Action type unknown or not specified. + ACTION_TYPE_UNSPECIFIED = 0; + + // Resource was created in this change. + CREATED = 1; + + // Resource was updated in this change. + UPDATED = 2; + + // Resource was deleted in this change. + DELETED = 3; +} + +// Types of resources whose changes may be returned from change history. +enum ChangeHistoryResourceType { + // Resource type unknown or not specified. + CHANGE_HISTORY_RESOURCE_TYPE_UNSPECIFIED = 0; + + // Account resource + ACCOUNT = 1; + + // Property resource + PROPERTY = 2; + + // FirebaseLink resource + FIREBASE_LINK = 6; + + // GoogleAdsLink resource + GOOGLE_ADS_LINK = 7; + + // GoogleSignalsSettings resource + GOOGLE_SIGNALS_SETTINGS = 8; + + // ConversionEvent resource + CONVERSION_EVENT = 9; + + // MeasurementProtocolSecret resource + MEASUREMENT_PROTOCOL_SECRET = 10; + + // CustomDimension resource + CUSTOM_DIMENSION = 11; + + // CustomMetric resource + CUSTOM_METRIC = 12; + + // DataRetentionSettings resource + DATA_RETENTION_SETTINGS = 13; + + // DisplayVideo360AdvertiserLink resource + DISPLAY_VIDEO_360_ADVERTISER_LINK = 14; + + // DisplayVideo360AdvertiserLinkProposal resource + DISPLAY_VIDEO_360_ADVERTISER_LINK_PROPOSAL = 15; + + // DataStream resource + DATA_STREAM = 18; +} + +// Status of the Google Signals settings (i.e., whether this feature has been +// enabled for the property). +enum GoogleSignalsState { + // Google Signals status defaults to GOOGLE_SIGNALS_STATE_UNSPECIFIED to + // represent that the user has not made an explicit choice. + GOOGLE_SIGNALS_STATE_UNSPECIFIED = 0; + + // Google Signals is enabled. + GOOGLE_SIGNALS_ENABLED = 1; + + // Google Signals is disabled. + GOOGLE_SIGNALS_DISABLED = 2; +} + +// Consent field of the Google Signals settings (i.e., whether the user has +// consented to the Google Signals terms of service.) +enum GoogleSignalsConsent { + // Google Signals consent value defaults to + // GOOGLE_SIGNALS_CONSENT_UNSPECIFIED. This will be treated as + // GOOGLE_SIGNALS_CONSENT_NOT_CONSENTED. + GOOGLE_SIGNALS_CONSENT_UNSPECIFIED = 0; + + // Terms of service have been accepted + GOOGLE_SIGNALS_CONSENT_CONSENTED = 2; + + // Terms of service have not been accepted + GOOGLE_SIGNALS_CONSENT_NOT_CONSENTED = 1; +} + +// An indication of which product the user initiated a link proposal from. +enum LinkProposalInitiatingProduct { + // Unspecified product. + LINK_PROPOSAL_INITIATING_PRODUCT_UNSPECIFIED = 0; + + // This proposal was created by a user from Google Analytics. + GOOGLE_ANALYTICS = 1; + + // This proposal was created by a user from a linked product (not Google + // Analytics). + LINKED_PRODUCT = 2; +} + +// The state of a link proposal resource. +enum LinkProposalState { + // Unspecified state + LINK_PROPOSAL_STATE_UNSPECIFIED = 0; + + // This proposal is awaiting review from a Google Analytics user. This + // proposal will automatically expire after some time. + AWAITING_REVIEW_FROM_GOOGLE_ANALYTICS = 1; + + // This proposal is awaiting review from a user of a linked product. This + // proposal will automatically expire after some time. + AWAITING_REVIEW_FROM_LINKED_PRODUCT = 2; + + // This proposal has been withdrawn by an admin on the initiating product. + // This proposal will be automatically deleted after some time. + WITHDRAWN = 3; + + // This proposal has been declined by an admin on the receiving product. This + // proposal will be automatically deleted after some time. + DECLINED = 4; + + // This proposal expired due to lack of response from an admin on the + // receiving product. This proposal will be automatically deleted after some + // time. + EXPIRED = 5; + + // This proposal has become obsolete because a link was directly created to + // the same external product resource that this proposal specifies. This + // proposal will be automatically deleted after some time. + OBSOLETE = 6; +} + +// A resource message representing a Google Analytics account. +message Account { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/Account" + pattern: "accounts/{account}" + }; + + // Output only. Resource name of this account. + // Format: accounts/{account} + // Example: "accounts/100" + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when this account was originally created. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when account payload fields were last updated. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Human-readable display name for this account. + string display_name = 4 [(google.api.field_behavior) = REQUIRED]; + + // Country of business. Must be a Unicode CLDR region code. + string region_code = 5; + + // Output only. Indicates whether this Account is soft-deleted or not. Deleted + // accounts are excluded from List results unless specifically requested. + bool deleted = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A resource message representing a Google Analytics GA4 property. +message Property { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/Property" + pattern: "properties/{property}" + }; + + // Output only. Resource name of this property. + // Format: properties/{property_id} + // Example: "properties/1000" + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the entity was originally created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when entity payload fields were last updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. Resource name of this property's logical parent. + // + // Note: The Property-Moving UI can be used to change the parent. + // Format: accounts/{account} + // Example: "accounts/100" + string parent = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. Human-readable display name for this property. + // + // The max allowed display name length is 100 UTF-16 code units. + string display_name = 5 [(google.api.field_behavior) = REQUIRED]; + + // Industry associated with this property + // Example: AUTOMOTIVE, FOOD_AND_DRINK + IndustryCategory industry_category = 6; + + // Required. Reporting Time Zone, used as the day boundary for reports, regardless of + // where the data originates. If the time zone honors DST, Analytics will + // automatically adjust for the changes. + // + // NOTE: Changing the time zone only affects data going forward, and is not + // applied retroactively. + // + // Format: https://www.iana.org/time-zones + // Example: "America/Los_Angeles" + string time_zone = 7 [(google.api.field_behavior) = REQUIRED]; + + // The currency type used in reports involving monetary values. + // + // + // Format: https://en.wikipedia.org/wiki/ISO_4217 + // Examples: "USD", "EUR", "JPY" + string currency_code = 8; + + // Output only. The Google Analytics service level that applies to this property. + ServiceLevel service_level = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If set, the time at which this property was trashed. If not set, then this + // property is not currently in the trash can. + google.protobuf.Timestamp delete_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If set, the time at which this trashed property will be permanently + // deleted. If not set, then this property is not currently in the trash can + // and is not slated to be deleted. + google.protobuf.Timestamp expire_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The resource name of the parent account + // Format: accounts/{account_id} + // Example: "accounts/123" + string account = 13 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/Account" + } + ]; +} + +// A resource message representing a data stream. +message DataStream { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/DataStream" + pattern: "properties/{property}/dataStreams/{data_stream}" + }; + + // Data specific to web streams. + message WebStreamData { + // Output only. Analytics "Measurement ID", without the "G-" prefix. + // Example: "G-1A2BCD345E" would just be "1A2BCD345E" + string measurement_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. ID of the corresponding web app in Firebase, if any. + // This ID can change if the web app is deleted and recreated. + string firebase_app_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. Domain name of the web app being measured, or empty. + // Example: "http://www.google.com", "https://www.google.com" + string default_uri = 3 [(google.api.field_behavior) = IMMUTABLE]; + } + + // Data specific to Android app streams. + message AndroidAppStreamData { + // Output only. ID of the corresponding Android app in Firebase, if any. + // This ID can change if the Android app is deleted and recreated. + string firebase_app_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The package name for the app being measured. + // Example: "com.example.myandroidapp" + string package_name = 2 [(google.api.field_behavior) = IMMUTABLE]; + } + + // Data specific to iOS app streams. + message IosAppStreamData { + // Output only. ID of the corresponding iOS app in Firebase, if any. + // This ID can change if the iOS app is deleted and recreated. + string firebase_app_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Immutable. The Apple App Store Bundle ID for the app + // Example: "com.example.myiosapp" + string bundle_id = 2 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + } + + // The type of the data stream. + enum DataStreamType { + // Type unknown or not specified. + DATA_STREAM_TYPE_UNSPECIFIED = 0; + + // Web data stream. + WEB_DATA_STREAM = 1; + + // Android app data stream. + ANDROID_APP_DATA_STREAM = 2; + + // iOS app data stream. + IOS_APP_DATA_STREAM = 3; + } + + // Data for specific data stream types. The message that will be + // set corresponds to the type of this stream. + oneof stream_data { + // Data specific to web streams. Must be populated if type is + // WEB_DATA_STREAM. + WebStreamData web_stream_data = 6; + + // Data specific to Android app streams. Must be populated if type is + // ANDROID_APP_DATA_STREAM. + AndroidAppStreamData android_app_stream_data = 7; + + // Data specific to iOS app streams. Must be populated if type is + // IOS_APP_DATA_STREAM. + IosAppStreamData ios_app_stream_data = 8; + } + + // Output only. Resource name of this Data Stream. + // Format: properties/{property_id}/dataStreams/{stream_id} + // Example: "properties/1000/dataStreams/2000" + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Immutable. The type of this DataStream resource. + DataStreamType type = 2 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + + // Human-readable display name for the Data Stream. + // + // Required for web data streams. + // + // The max allowed display name length is 255 UTF-16 code units. + string display_name = 3; + + // Output only. Time when this stream was originally created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when stream payload fields were last updated. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A resource message representing a user's permissions on an Account or +// Property resource. +message UserLink { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/UserLink" + pattern: "accounts/{account}/userLinks/{user_link}" + pattern: "properties/{property}/userLinks/{user_link}" + }; + + // Output only. Example format: properties/1234/userLinks/5678 + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. Email address of the user to link + string email_address = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Roles directly assigned to this user for this account or property. + // + // Valid values: + // predefinedRoles/viewer + // predefinedRoles/analyst + // predefinedRoles/editor + // predefinedRoles/admin + // predefinedRoles/no-cost-data + // predefinedRoles/no-revenue-data + // + // Excludes roles that are inherited from a higher-level entity, group, + // or organization admin role. + // + // A UserLink that is updated to have an empty list of direct_roles will be + // deleted. + repeated string direct_roles = 3; +} + +// Read-only resource used to summarize a principal's effective roles. +message AuditUserLink { + // Example format: properties/1234/userLinks/5678 + string name = 1; + + // Email address of the linked user + string email_address = 2; + + // Roles directly assigned to this user for this entity. + // + // Format: predefinedRoles/viewer + // + // Excludes roles that are inherited from an account (if this is for a + // property), group, or organization admin role. + repeated string direct_roles = 3; + + // Union of all permissions a user has at this account or property (includes + // direct permissions, group-inherited permissions, etc.). + // + // Format: predefinedRoles/viewer + repeated string effective_roles = 4; +} + +// A link between a GA4 property and a Firebase project. +message FirebaseLink { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/FirebaseLink" + pattern: "properties/{property}/firebaseLinks/{firebase_link}" + }; + + // Output only. Example format: properties/1234/firebaseLinks/5678 + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. Firebase project resource name. When creating a FirebaseLink, you may + // provide this resource name using either a project number or project ID. + // Once this resource has been created, returned FirebaseLinks will always + // have a project_name that contains a project number. + // + // Format: 'projects/{project number}' + // Example: 'projects/1234' + string project = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. Time when this FirebaseLink was originally created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Read-only resource with the tag for sending data from a website to a +// DataStream. Only present for web DataStream resources. +message GlobalSiteTag { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/GlobalSiteTag" + pattern: "properties/{property}/dataStreams/{data_stream}/globalSiteTag" + }; + + // Output only. Resource name for this GlobalSiteTag resource. + // Format: properties/{property_id}/dataStreams/{stream_id}/globalSiteTag + // Example: "properties/123/dataStreams/456/globalSiteTag" + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. JavaScript code snippet to be pasted as the first item into the head tag of + // every webpage to measure. + string snippet = 2 [(google.api.field_behavior) = IMMUTABLE]; +} + +// A link between a GA4 property and a Google Ads account. +message GoogleAdsLink { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/GoogleAdsLink" + pattern: "properties/{property}/googleAdsLinks/{google_ads_link}" + }; + + // Output only. Format: properties/{propertyId}/googleAdsLinks/{googleAdsLinkId} + // + // Note: googleAdsLinkId is not the Google Ads customer ID. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. Google Ads customer ID. + string customer_id = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. If true, this link is for a Google Ads manager account. + bool can_manage_clients = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Enable personalized advertising features with this integration. + // Automatically publish my Google Analytics audience lists and Google + // Analytics remarketing events/parameters to the linked Google Ads account. + // If this field is not set on create/update, it will be defaulted to true. + google.protobuf.BoolValue ads_personalization_enabled = 5; + + // Output only. Time when this link was originally created. + google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when this link was last updated. + google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Email address of the user that created the link. + // An empty string will be returned if the email address can't be retrieved. + string creator_email_address = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A resource message representing data sharing settings of a Google Analytics +// account. +message DataSharingSettings { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/DataSharingSettings" + pattern: "accounts/{account}/dataSharingSettings" + }; + + // Output only. Resource name. + // Format: accounts/{account}/dataSharingSettings + // Example: "accounts/1000/dataSharingSettings" + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Allows Google support to access the data in order to help troubleshoot + // issues. + bool sharing_with_google_support_enabled = 2; + + // Allows Google sales teams that are assigned to the customer to access the + // data in order to suggest configuration changes to improve results. + // Sales team restrictions still apply when enabled. + bool sharing_with_google_assigned_sales_enabled = 3; + + // Allows any of Google sales to access the data in order to suggest + // configuration changes to improve results. + bool sharing_with_google_any_sales_enabled = 4; + + // Allows Google to use the data to improve other Google products or services. + bool sharing_with_google_products_enabled = 5; + + // Allows Google to share the data anonymously in aggregate form with others. + bool sharing_with_others_enabled = 6; +} + +// A virtual resource representing an overview of an account and +// all its child GA4 properties. +message AccountSummary { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/AccountSummary" + pattern: "accountSummaries/{account_summary}" + }; + + // Resource name for this account summary. + // Format: accountSummaries/{account_id} + // Example: "accountSummaries/1000" + string name = 1; + + // Resource name of account referred to by this account summary + // Format: accounts/{account_id} + // Example: "accounts/1000" + string account = 2 [(google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/Account" + }]; + + // Display name for the account referred to in this account summary. + string display_name = 3; + + // List of summaries for child accounts of this account. + repeated PropertySummary property_summaries = 4; +} + +// A virtual resource representing metadata for a GA4 property. +message PropertySummary { + // Resource name of property referred to by this property summary + // Format: properties/{property_id} + // Example: "properties/1000" + string property = 1 [(google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/Property" + }]; + + // Display name for the property referred to in this property summary. + string display_name = 2; +} + +// A secret value used for sending hits to Measurement Protocol. +message MeasurementProtocolSecret { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/MeasurementProtocolSecret" + pattern: "properties/{property}/dataStreams/{data_stream}/measurementProtocolSecrets/{measurement_protocol_secret}" + }; + + // Output only. Resource name of this secret. This secret may be a child of any type of + // stream. + // Format: + // properties/{property}/webDataStreams/{webDataStream}/measurementProtocolSecrets/{measurementProtocolSecret} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Human-readable display name for this secret. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The measurement protocol secret value. Pass this value to the api_secret + // field of the Measurement Protocol API when sending hits to this + // secret's parent property. + string secret_value = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A set of changes within a Google Analytics account or its child properties +// that resulted from the same cause. Common causes would be updates made in the +// Google Analytics UI, changes from customer support, or automatic Google +// Analytics system changes. +message ChangeHistoryEvent { + // ID of this change history event. This ID is unique across Google Analytics. + string id = 1; + + // Time when change was made. + google.protobuf.Timestamp change_time = 2; + + // The type of actor that made this change. + ActorType actor_type = 3; + + // Email address of the Google account that made the change. This will be a + // valid email address if the actor field is set to USER, and empty otherwise. + // Google accounts that have been deleted will cause an error. + string user_actor_email = 4; + + // If true, then the list of changes returned was filtered, and does not + // represent all changes that occurred in this event. + bool changes_filtered = 5; + + // A list of changes made in this change history event that fit the filters + // specified in SearchChangeHistoryEventsRequest. + repeated ChangeHistoryChange changes = 6; +} + +// A description of a change to a single Google Analytics resource. +message ChangeHistoryChange { + // A snapshot of a resource as before or after the result of a change in + // change history. + message ChangeHistoryResource { + oneof resource { + // A snapshot of an Account resource in change history. + Account account = 1; + + // A snapshot of a Property resource in change history. + Property property = 2; + + // A snapshot of a FirebaseLink resource in change history. + FirebaseLink firebase_link = 6; + + // A snapshot of a GoogleAdsLink resource in change history. + GoogleAdsLink google_ads_link = 7; + + // A snapshot of a GoogleSignalsSettings resource in change history. + GoogleSignalsSettings google_signals_settings = 8; + + // A snapshot of a DisplayVideo360AdvertiserLink resource in change + // history. + DisplayVideo360AdvertiserLink display_video_360_advertiser_link = 9; + + // A snapshot of a DisplayVideo360AdvertiserLinkProposal resource in + // change history. + DisplayVideo360AdvertiserLinkProposal display_video_360_advertiser_link_proposal = 10; + + // A snapshot of a ConversionEvent resource in change history. + ConversionEvent conversion_event = 11; + + // A snapshot of a MeasurementProtocolSecret resource in change history. + MeasurementProtocolSecret measurement_protocol_secret = 12; + + // A snapshot of a CustomDimension resource in change history. + CustomDimension custom_dimension = 13; + + // A snapshot of a CustomMetric resource in change history. + CustomMetric custom_metric = 14; + + // A snapshot of a data retention settings resource in change history. + DataRetentionSettings data_retention_settings = 15; + + // A snapshot of a DataStream resource in change history. + DataStream data_stream = 18; + } + } + + // Resource name of the resource whose changes are described by this entry. + string resource = 1; + + // The type of action that changed this resource. + ActionType action = 2; + + // Resource contents from before the change was made. If this resource was + // created in this change, this field will be missing. + ChangeHistoryResource resource_before_change = 3; + + // Resource contents from after the change was made. If this resource was + // deleted in this change, this field will be missing. + ChangeHistoryResource resource_after_change = 4; +} + +// A link between a GA4 property and a Display & Video 360 advertiser. +message DisplayVideo360AdvertiserLink { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLink" + pattern: "properties/{property}/displayVideo360AdvertiserLinks/{display_video_360_advertiser_link}" + }; + + // Output only. The resource name for this DisplayVideo360AdvertiserLink resource. + // Format: properties/{propertyId}/displayVideo360AdvertiserLinks/{linkId} + // + // Note: linkId is not the Display & Video 360 Advertiser ID + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The Display & Video 360 Advertiser's advertiser ID. + string advertiser_id = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The display name of the Display & Video 360 Advertiser. + string advertiser_display_name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Enables personalized advertising features with this integration. + // If this field is not set on create/update, it will be defaulted to true. + google.protobuf.BoolValue ads_personalization_enabled = 4; + + // Immutable. Enables the import of campaign data from Display & Video 360 into the GA4 + // property. After link creation, this can only be updated from the Display & + // Video 360 product. + // If this field is not set on create, it will be defaulted to true. + google.protobuf.BoolValue campaign_data_sharing_enabled = 5 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. Enables the import of cost data from Display & Video 360 into the GA4 + // property. This can only be enabled if campaign_data_sharing_enabled is + // enabled. After link creation, this can only be updated from the Display & + // Video 360 product. + // If this field is not set on create, it will be defaulted to true. + google.protobuf.BoolValue cost_data_sharing_enabled = 6 [(google.api.field_behavior) = IMMUTABLE]; +} + +// A proposal for a link between a GA4 property and a Display & Video 360 +// advertiser. +// +// A proposal is converted to a DisplayVideo360AdvertiserLink once approved. +// Google Analytics admins approve inbound proposals while Display & Video 360 +// admins approve outbound proposals. +message DisplayVideo360AdvertiserLinkProposal { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLinkProposal" + pattern: "properties/{property}/displayVideo360AdvertiserLinkProposals/{display_video_360_advertiser_link_proposal}" + }; + + // Output only. The resource name for this DisplayVideo360AdvertiserLinkProposal resource. + // Format: + // properties/{propertyId}/displayVideo360AdvertiserLinkProposals/{proposalId} + // + // Note: proposalId is not the Display & Video 360 Advertiser ID + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The Display & Video 360 Advertiser's advertiser ID. + string advertiser_id = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The status information for this link proposal. + LinkProposalStatusDetails link_proposal_status_details = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The display name of the Display & Video Advertiser. + // Only populated for proposals that originated from Display & Video 360. + string advertiser_display_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. On a proposal being sent to Display & Video 360, this field must be set to + // the email address of an admin on the target advertiser. This is used to + // verify that the Google Analytics admin is aware of at least one admin on + // the Display & Video 360 Advertiser. This does not restrict approval of the + // proposal to a single user. Any admin on the Display & Video 360 Advertiser + // may approve the proposal. + string validation_email = 5 [(google.api.field_behavior) = INPUT_ONLY]; + + // Immutable. Enables personalized advertising features with this integration. + // If this field is not set on create, it will be defaulted to true. + google.protobuf.BoolValue ads_personalization_enabled = 6 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. Enables the import of campaign data from Display & Video 360. + // If this field is not set on create, it will be defaulted to true. + google.protobuf.BoolValue campaign_data_sharing_enabled = 7 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. Enables the import of cost data from Display & Video 360. + // This can only be enabled if campaign_data_sharing_enabled is enabled. + // If this field is not set on create, it will be defaulted to true. + google.protobuf.BoolValue cost_data_sharing_enabled = 8 [(google.api.field_behavior) = IMMUTABLE]; +} + +// Status information for a link proposal. +message LinkProposalStatusDetails { + // Output only. The source of this proposal. + LinkProposalInitiatingProduct link_proposal_initiating_product = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The email address of the user that proposed this linkage. + string requestor_email = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of this proposal. + LinkProposalState link_proposal_state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A conversion event in a Google Analytics property. +message ConversionEvent { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/ConversionEvent" + pattern: "properties/{property}/conversionEvents/{conversion_event}" + }; + + // Output only. Resource name of this conversion event. + // Format: properties/{property}/conversionEvents/{conversion_event} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The event name for this conversion event. + // Examples: 'click', 'purchase' + string event_name = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. Time when this conversion event was created in the property. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If set, this event can currently be deleted via DeleteConversionEvent. + bool deletable = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If set to true, this conversion event refers to a custom event. If set to + // false, this conversion event refers to a default event in GA. Default + // events typically have special meaning in GA. Default events are usually + // created for you by the GA system, but in some cases can be created by + // property admins. Custom events count towards the maximum number of + // custom conversion events that may be created per property. + bool custom = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Settings values for Google Signals. This is a singleton resource. +message GoogleSignalsSettings { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/GoogleSignalsSettings" + pattern: "properties/{property}/googleSignalsSettings" + }; + + // Output only. Resource name of this setting. + // Format: properties/{property_id}/googleSignalsSettings + // Example: "properties/1000/googleSignalsSettings" + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Status of this setting. + GoogleSignalsState state = 3; + + // Output only. Terms of Service acceptance. + GoogleSignalsConsent consent = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A definition for a CustomDimension. +message CustomDimension { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/CustomDimension" + pattern: "properties/{property}/customDimensions/{custom_dimension}" + }; + + // Valid values for the scope of this dimension. + enum DimensionScope { + // Scope unknown or not specified. + DIMENSION_SCOPE_UNSPECIFIED = 0; + + // Dimension scoped to an event. + EVENT = 1; + + // Dimension scoped to a user. + USER = 2; + } + + // Output only. Resource name for this CustomDimension resource. + // Format: properties/{property}/customDimensions/{customDimension} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Immutable. Tagging parameter name for this custom dimension. + // + // If this is a user-scoped dimension, then this is the user property name. + // If this is an event-scoped dimension, then this is the event parameter + // name. + // + // May only contain alphanumeric and underscore characters, starting with a + // letter. Max length of 24 characters for user-scoped dimensions, 40 + // characters for event-scoped dimensions. + string parameter_name = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Display name for this custom dimension as shown in the Analytics UI. + // Max length of 82 characters, alphanumeric plus space and underscore + // starting with a letter. Legacy system-generated display names may contain + // square brackets, but updates to this field will never permit square + // brackets. + string display_name = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Description for this custom dimension. Max length of 150 characters. + string description = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Immutable. The scope of this dimension. + DimensionScope scope = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. If set to true, sets this dimension as NPA and excludes it from ads + // personalization. + // + // This is currently only supported by user-scoped custom dimensions. + bool disallow_ads_personalization = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// A definition for a custom metric. +message CustomMetric { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/CustomMetric" + pattern: "properties/{property}/customMetrics/{custom_metric}" + }; + + // Possible types of representing the custom metric's value. + // + // Currency representation may change in the future, requiring a breaking API + // change. + enum MeasurementUnit { + // MeasurementUnit unspecified or missing. + MEASUREMENT_UNIT_UNSPECIFIED = 0; + + // This metric uses default units. + STANDARD = 1; + + // This metric measures a currency. + CURRENCY = 2; + + // This metric measures feet. + FEET = 3; + + // This metric measures meters. + METERS = 4; + + // This metric measures kilometers. + KILOMETERS = 5; + + // This metric measures miles. + MILES = 6; + + // This metric measures milliseconds. + MILLISECONDS = 7; + + // This metric measures seconds. + SECONDS = 8; + + // This metric measures minutes. + MINUTES = 9; + + // This metric measures hours. + HOURS = 10; + } + + // The scope of this metric. + enum MetricScope { + // Scope unknown or not specified. + METRIC_SCOPE_UNSPECIFIED = 0; + + // Metric scoped to an event. + EVENT = 1; + } + + // Labels that mark the data in this custom metric as data that should be + // restricted to specific users. + enum RestrictedMetricType { + // Type unknown or unspecified. + RESTRICTED_METRIC_TYPE_UNSPECIFIED = 0; + + // Metric reports cost data. + COST_DATA = 1; + + // Metric reports revenue data. + REVENUE_DATA = 2; + } + + // Output only. Resource name for this CustomMetric resource. + // Format: properties/{property}/customMetrics/{customMetric} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Immutable. Tagging name for this custom metric. + // + // If this is an event-scoped metric, then this is the event parameter + // name. + // + // May only contain alphanumeric and underscore charactes, starting with a + // letter. Max length of 40 characters for event-scoped metrics. + string parameter_name = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Display name for this custom metric as shown in the Analytics UI. + // Max length of 82 characters, alphanumeric plus space and underscore + // starting with a letter. Legacy system-generated display names may contain + // square brackets, but updates to this field will never permit square + // brackets. + string display_name = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Description for this custom dimension. + // Max length of 150 characters. + string description = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The type for the custom metric's value. + MeasurementUnit measurement_unit = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. Immutable. The scope of this custom metric. + MetricScope scope = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Types of restricted data that this metric may contain. Required for metrics + // with CURRENCY measurement unit. Must be empty for metrics with a + // non-CURRENCY measurement unit. + repeated RestrictedMetricType restricted_metric_type = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings values for data retention. This is a singleton resource. +message DataRetentionSettings { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/DataRetentionSettings" + pattern: "properties/{property}/dataRetentionSettings" + }; + + // Valid values for the data retention duration. + enum RetentionDuration { + // Data retention time duration is not specified. + RETENTION_DURATION_UNSPECIFIED = 0; + + // The data retention time duration is 2 months. + TWO_MONTHS = 1; + + // The data retention time duration is 14 months. + FOURTEEN_MONTHS = 3; + + // The data retention time duration is 26 months. + // Available to 360 properties only. + TWENTY_SIX_MONTHS = 4; + + // The data retention time duration is 38 months. + // Available to 360 properties only. + THIRTY_EIGHT_MONTHS = 5; + + // The data retention time duration is 50 months. + // Available to 360 properties only. + FIFTY_MONTHS = 6; + } + + // Output only. Resource name for this DataRetentionSetting resource. + // Format: properties/{property}/dataRetentionSettings + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The length of time that event-level data is retained. + RetentionDuration event_data_retention = 2; + + // If true, reset the retention period for the user identifier with every + // event from that user. + bool reset_user_data_on_new_activity = 3; +} diff --git a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.acknowledge_user_data_collection.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.acknowledge_user_data_collection.js new file mode 100644 index 0000000..5bcfc38 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.acknowledge_user_data_collection.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(property, acknowledgement) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_AcknowledgeUserDataCollection_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The property for which to acknowledge user data collection. + */ + // const property = 'abc123' + /** + * Required. An acknowledgement that the caller of this method understands the terms + * of user data collection. + * This field must contain the exact value: + * "I acknowledge that I have the necessary privacy disclosures and rights + * from my end users for the collection and processing of their data, + * including the association of such data with the visitation information + * Google Analytics collects from my site and/or app property." + */ + // const acknowledgement = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callAcknowledgeUserDataCollection() { + // Construct request + const request = { + property, + acknowledgement, + }; + + // Run request + const response = await adminClient.acknowledgeUserDataCollection(request); + console.log(response); + } + + callAcknowledgeUserDataCollection(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_AcknowledgeUserDataCollection_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/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js new file mode 100644 index 0000000..1f691a3 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js @@ -0,0 +1,59 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_ApproveDisplayVideo360AdvertiserLinkProposal_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the DisplayVideo360AdvertiserLinkProposal to approve. + * Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callApproveDisplayVideo360AdvertiserLinkProposal() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.approveDisplayVideo360AdvertiserLinkProposal(request); + console.log(response); + } + + callApproveDisplayVideo360AdvertiserLinkProposal(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ApproveDisplayVideo360AdvertiserLinkProposal_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/analytics_admin_service.archive_custom_dimension.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_dimension.js new file mode 100644 index 0000000..48be3a7 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_dimension.js @@ -0,0 +1,59 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveCustomDimension_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the CustomDimension to archive. + * Example format: properties/1234/customDimensions/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callArchiveCustomDimension() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.archiveCustomDimension(request); + console.log(response); + } + + callArchiveCustomDimension(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveCustomDimension_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/analytics_admin_service.archive_custom_metric.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_metric.js new file mode 100644 index 0000000..5afad70 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_metric.js @@ -0,0 +1,59 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveCustomMetric_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the CustomMetric to archive. + * Example format: properties/1234/customMetrics/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callArchiveCustomMetric() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.archiveCustomMetric(request); + console.log(response); + } + + callArchiveCustomMetric(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveCustomMetric_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/analytics_admin_service.audit_user_links.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.audit_user_links.js new file mode 100644 index 0000000..14e86fb --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.audit_user_links.js @@ -0,0 +1,74 @@ +// 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(parent) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_AuditUserLinks_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: accounts/1234 + */ + // const parent = 'abc123' + /** + * The maximum number of user links to return. + * The service may return fewer than this value. + * If unspecified, at most 1000 user links will be returned. + * The maximum value is 5000; values above 5000 will be coerced to 5000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `AuditUserLinks` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `AuditUserLinks` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callAuditUserLinks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await adminClient.auditUserLinksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callAuditUserLinks(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_AuditUserLinks_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/analytics_admin_service.batch_create_user_links.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_user_links.js new file mode 100644 index 0000000..cf09400 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_user_links.js @@ -0,0 +1,73 @@ +// 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(parent, requests) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchCreateUserLinks_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The account or property that all user links in the request are for. + * This field is required. The parent field in the CreateUserLinkRequest + * messages must either be empty or match this field. + * Example format: accounts/1234 + */ + // const parent = 'abc123' + /** + * Optional. If set, then email the new users notifying them that they've been granted + * permissions to the resource. Regardless of whether this is set or not, + * notify_new_user field inside each individual request is ignored. + */ + // const notifyNewUsers = true + /** + * Required. The requests specifying the user links to create. + * A maximum of 1000 user links can be created in a batch. + */ + // const requests = 1234 + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callBatchCreateUserLinks() { + // Construct request + const request = { + parent, + requests, + }; + + // Run request + const response = await adminClient.batchCreateUserLinks(request); + console.log(response); + } + + callBatchCreateUserLinks(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchCreateUserLinks_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/analytics_admin_service.batch_delete_user_links.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_user_links.js new file mode 100644 index 0000000..9e6d2d6 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_user_links.js @@ -0,0 +1,67 @@ +// 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(parent, requests) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchDeleteUserLinks_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The account or property that all user links in the request are + * for. The parent of all values for user link names to delete must match this + * field. + * Example format: accounts/1234 + */ + // const parent = 'abc123' + /** + * Required. The requests specifying the user links to update. + * A maximum of 1000 user links can be updated in a batch. + */ + // const requests = 1234 + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callBatchDeleteUserLinks() { + // Construct request + const request = { + parent, + requests, + }; + + // Run request + const response = await adminClient.batchDeleteUserLinks(request); + console.log(response); + } + + callBatchDeleteUserLinks(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchDeleteUserLinks_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/analytics_admin_service.batch_get_user_links.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_user_links.js new file mode 100644 index 0000000..b43c877 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_user_links.js @@ -0,0 +1,68 @@ +// 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(parent, names) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchGetUserLinks_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The account or property that all user links in the request are + * for. The parent of all provided values for the 'names' field must match + * this field. + * Example format: accounts/1234 + */ + // const parent = 'abc123' + /** + * Required. The names of the user links to retrieve. + * A maximum of 1000 user links can be retrieved in a batch. + * Format: accounts/{accountId}/userLinks/{userLinkId} + */ + // const names = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callBatchGetUserLinks() { + // Construct request + const request = { + parent, + names, + }; + + // Run request + const response = await adminClient.batchGetUserLinks(request); + console.log(response); + } + + callBatchGetUserLinks(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchGetUserLinks_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/analytics_admin_service.batch_update_user_links.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_user_links.js new file mode 100644 index 0000000..b3e8d49 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_user_links.js @@ -0,0 +1,67 @@ +// 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(parent, requests) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchUpdateUserLinks_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The account or property that all user links in the request are + * for. The parent field in the UpdateUserLinkRequest messages must either be + * empty or match this field. + * Example format: accounts/1234 + */ + // const parent = 'abc123' + /** + * Required. The requests specifying the user links to update. + * A maximum of 1000 user links can be updated in a batch. + */ + // const requests = 1234 + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callBatchUpdateUserLinks() { + // Construct request + const request = { + parent, + requests, + }; + + // Run request + const response = await adminClient.batchUpdateUserLinks(request); + console.log(response); + } + + callBatchUpdateUserLinks(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchUpdateUserLinks_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/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js new file mode 100644 index 0000000..9003bf7 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js @@ -0,0 +1,59 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_CancelDisplayVideo360AdvertiserLinkProposal_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the DisplayVideo360AdvertiserLinkProposal to cancel. + * Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callCancelDisplayVideo360AdvertiserLinkProposal() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.cancelDisplayVideo360AdvertiserLinkProposal(request); + console.log(response); + } + + callCancelDisplayVideo360AdvertiserLinkProposal(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CancelDisplayVideo360AdvertiserLinkProposal_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/analytics_admin_service.create_conversion_event.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_conversion_event.js new file mode 100644 index 0000000..4e29bae --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_conversion_event.js @@ -0,0 +1,64 @@ +// 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(conversionEvent, parent) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateConversionEvent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The conversion event to create. + */ + // const conversionEvent = {} + /** + * Required. The resource name of the parent property where this conversion event will + * be created. Format: properties/123 + */ + // const parent = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callCreateConversionEvent() { + // Construct request + const request = { + conversionEvent, + parent, + }; + + // Run request + const response = await adminClient.createConversionEvent(request); + console.log(response); + } + + callCreateConversionEvent(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateConversionEvent_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/analytics_admin_service.create_custom_dimension.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_dimension.js new file mode 100644 index 0000000..015b39d --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_dimension.js @@ -0,0 +1,63 @@ +// 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(parent, customDimension) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateCustomDimension_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: properties/1234 + */ + // const parent = 'abc123' + /** + * Required. The CustomDimension to create. + */ + // const customDimension = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callCreateCustomDimension() { + // Construct request + const request = { + parent, + customDimension, + }; + + // Run request + const response = await adminClient.createCustomDimension(request); + console.log(response); + } + + callCreateCustomDimension(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateCustomDimension_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/analytics_admin_service.create_custom_metric.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_metric.js new file mode 100644 index 0000000..896c7ca --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_metric.js @@ -0,0 +1,63 @@ +// 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(parent, customMetric) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateCustomMetric_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: properties/1234 + */ + // const parent = 'abc123' + /** + * Required. The CustomMetric to create. + */ + // const customMetric = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callCreateCustomMetric() { + // Construct request + const request = { + parent, + customMetric, + }; + + // Run request + const response = await adminClient.createCustomMetric(request); + console.log(response); + } + + callCreateCustomMetric(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateCustomMetric_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/analytics_admin_service.create_data_stream.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_data_stream.js new file mode 100644 index 0000000..447c77a --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_data_stream.js @@ -0,0 +1,63 @@ +// 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(parent, dataStream) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDataStream_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: properties/1234 + */ + // const parent = 'abc123' + /** + * Required. The DataStream to create. + */ + // const dataStream = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callCreateDataStream() { + // Construct request + const request = { + parent, + dataStream, + }; + + // Run request + const response = await adminClient.createDataStream(request); + console.log(response); + } + + callCreateDataStream(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDataStream_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/analytics_admin_service.create_display_video360_advertiser_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link.js new file mode 100644 index 0000000..fc9ecfc --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link.js @@ -0,0 +1,63 @@ +// 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(parent, displayVideo_360AdvertiserLink) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDisplayVideo360AdvertiserLink_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: properties/1234 + */ + // const parent = 'abc123' + /** + * Required. The DisplayVideo360AdvertiserLink to create. + */ + // const displayVideo_360AdvertiserLink = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callCreateDisplayVideo360AdvertiserLink() { + // Construct request + const request = { + parent, + displayVideo_360AdvertiserLink, + }; + + // Run request + const response = await adminClient.createDisplayVideo360AdvertiserLink(request); + console.log(response); + } + + callCreateDisplayVideo360AdvertiserLink(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDisplayVideo360AdvertiserLink_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/analytics_admin_service.create_display_video360_advertiser_link_proposal.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link_proposal.js new file mode 100644 index 0000000..9815ab9 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link_proposal.js @@ -0,0 +1,63 @@ +// 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(parent, displayVideo_360AdvertiserLinkProposal) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDisplayVideo360AdvertiserLinkProposal_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: properties/1234 + */ + // const parent = 'abc123' + /** + * Required. The DisplayVideo360AdvertiserLinkProposal to create. + */ + // const displayVideo_360AdvertiserLinkProposal = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callCreateDisplayVideo360AdvertiserLinkProposal() { + // Construct request + const request = { + parent, + displayVideo_360AdvertiserLinkProposal, + }; + + // Run request + const response = await adminClient.createDisplayVideo360AdvertiserLinkProposal(request); + console.log(response); + } + + callCreateDisplayVideo360AdvertiserLinkProposal(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDisplayVideo360AdvertiserLinkProposal_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/analytics_admin_service.create_firebase_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_firebase_link.js new file mode 100644 index 0000000..2022590 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_firebase_link.js @@ -0,0 +1,64 @@ +// 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(parent, firebaseLink) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateFirebaseLink_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Format: properties/{property_id} + * Example: properties/1234 + */ + // const parent = 'abc123' + /** + * Required. The Firebase link to create. + */ + // const firebaseLink = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callCreateFirebaseLink() { + // Construct request + const request = { + parent, + firebaseLink, + }; + + // Run request + const response = await adminClient.createFirebaseLink(request); + console.log(response); + } + + callCreateFirebaseLink(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateFirebaseLink_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/analytics_admin_service.create_google_ads_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_google_ads_link.js new file mode 100644 index 0000000..fc6c764 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_google_ads_link.js @@ -0,0 +1,63 @@ +// 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(parent, googleAdsLink) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateGoogleAdsLink_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: properties/1234 + */ + // const parent = 'abc123' + /** + * Required. The GoogleAdsLink to create. + */ + // const googleAdsLink = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callCreateGoogleAdsLink() { + // Construct request + const request = { + parent, + googleAdsLink, + }; + + // Run request + const response = await adminClient.createGoogleAdsLink(request); + console.log(response); + } + + callCreateGoogleAdsLink(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateGoogleAdsLink_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/analytics_admin_service.create_measurement_protocol_secret.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_measurement_protocol_secret.js new file mode 100644 index 0000000..0eaa5d7 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_measurement_protocol_secret.js @@ -0,0 +1,64 @@ +// 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(parent, measurementProtocolSecret) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateMeasurementProtocolSecret_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this secret will be created. + * Format: properties/{property}/dataStreams/{dataStream} + */ + // const parent = 'abc123' + /** + * Required. The measurement protocol secret to create. + */ + // const measurementProtocolSecret = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callCreateMeasurementProtocolSecret() { + // Construct request + const request = { + parent, + measurementProtocolSecret, + }; + + // Run request + const response = await adminClient.createMeasurementProtocolSecret(request); + console.log(response); + } + + callCreateMeasurementProtocolSecret(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateMeasurementProtocolSecret_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/analytics_admin_service.create_property.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_property.js new file mode 100644 index 0000000..37a2653 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_property.js @@ -0,0 +1,59 @@ +// 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(property) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateProperty_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The property to create. + * Note: the supplied property must specify its parent. + */ + // const property = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callCreateProperty() { + // Construct request + const request = { + property, + }; + + // Run request + const response = await adminClient.createProperty(request); + console.log(response); + } + + callCreateProperty(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateProperty_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/analytics_admin_service.create_user_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_user_link.js new file mode 100644 index 0000000..7f10712 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_user_link.js @@ -0,0 +1,68 @@ +// 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(parent, userLink) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateUserLink_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: accounts/1234 + */ + // const parent = 'abc123' + /** + * Optional. If set, then email the new user notifying them that they've been granted + * permissions to the resource. + */ + // const notifyNewUser = true + /** + * Required. The user link to create. + */ + // const userLink = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callCreateUserLink() { + // Construct request + const request = { + parent, + userLink, + }; + + // Run request + const response = await adminClient.createUserLink(request); + console.log(response); + } + + callCreateUserLink(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateUserLink_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/analytics_admin_service.delete_account.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_account.js new file mode 100644 index 0000000..0881043 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_account.js @@ -0,0 +1,60 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteAccount_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Account to soft-delete. + * Format: accounts/{account} + * Example: "accounts/100" + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callDeleteAccount() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteAccount(request); + console.log(response); + } + + callDeleteAccount(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteAccount_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/analytics_admin_service.delete_conversion_event.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_conversion_event.js new file mode 100644 index 0000000..4d82df8 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_conversion_event.js @@ -0,0 +1,60 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteConversionEvent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the conversion event to delete. + * Format: properties/{property}/conversionEvents/{conversion_event} + * Example: "properties/123/conversionEvents/456" + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callDeleteConversionEvent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteConversionEvent(request); + console.log(response); + } + + callDeleteConversionEvent(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteConversionEvent_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/analytics_admin_service.delete_data_stream.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_data_stream.js new file mode 100644 index 0000000..9ee9e2e --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_data_stream.js @@ -0,0 +1,59 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDataStream_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the DataStream to delete. + * Example format: properties/1234/dataStreams/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callDeleteDataStream() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteDataStream(request); + console.log(response); + } + + callDeleteDataStream(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDataStream_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/analytics_admin_service.delete_display_video360_advertiser_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link.js new file mode 100644 index 0000000..6709f70 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link.js @@ -0,0 +1,59 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDisplayVideo360AdvertiserLink_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the DisplayVideo360AdvertiserLink to delete. + * Example format: properties/1234/displayVideo360AdvertiserLinks/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callDeleteDisplayVideo360AdvertiserLink() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteDisplayVideo360AdvertiserLink(request); + console.log(response); + } + + callDeleteDisplayVideo360AdvertiserLink(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDisplayVideo360AdvertiserLink_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/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js new file mode 100644 index 0000000..49e71c4 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js @@ -0,0 +1,59 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDisplayVideo360AdvertiserLinkProposal_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the DisplayVideo360AdvertiserLinkProposal to delete. + * Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callDeleteDisplayVideo360AdvertiserLinkProposal() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteDisplayVideo360AdvertiserLinkProposal(request); + console.log(response); + } + + callDeleteDisplayVideo360AdvertiserLinkProposal(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDisplayVideo360AdvertiserLinkProposal_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/analytics_admin_service.delete_firebase_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_firebase_link.js new file mode 100644 index 0000000..fa775a8 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_firebase_link.js @@ -0,0 +1,59 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteFirebaseLink_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Format: properties/{property_id}/firebaseLinks/{firebase_link_id} + * Example: properties/1234/firebaseLinks/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callDeleteFirebaseLink() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteFirebaseLink(request); + console.log(response); + } + + callDeleteFirebaseLink(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteFirebaseLink_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/analytics_admin_service.delete_google_ads_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_google_ads_link.js new file mode 100644 index 0000000..7e48599 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_google_ads_link.js @@ -0,0 +1,58 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteGoogleAdsLink_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: properties/1234/googleAdsLinks/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callDeleteGoogleAdsLink() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteGoogleAdsLink(request); + console.log(response); + } + + callDeleteGoogleAdsLink(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteGoogleAdsLink_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/analytics_admin_service.delete_measurement_protocol_secret.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_measurement_protocol_secret.js new file mode 100644 index 0000000..6bb0eab --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_measurement_protocol_secret.js @@ -0,0 +1,60 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteMeasurementProtocolSecret_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the MeasurementProtocolSecret to delete. + * Format: + * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret} + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callDeleteMeasurementProtocolSecret() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteMeasurementProtocolSecret(request); + console.log(response); + } + + callDeleteMeasurementProtocolSecret(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteMeasurementProtocolSecret_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/analytics_admin_service.delete_property.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_property.js new file mode 100644 index 0000000..a013f3d --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_property.js @@ -0,0 +1,60 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteProperty_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Property to soft-delete. + * Format: properties/{property_id} + * Example: "properties/1000" + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callDeleteProperty() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteProperty(request); + console.log(response); + } + + callDeleteProperty(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteProperty_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/analytics_admin_service.delete_user_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_user_link.js new file mode 100644 index 0000000..c8e6197 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_user_link.js @@ -0,0 +1,58 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteUserLink_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: accounts/1234/userLinks/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callDeleteUserLink() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteUserLink(request); + console.log(response); + } + + callDeleteUserLink(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteUserLink_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/analytics_admin_service.get_account.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_account.js new file mode 100644 index 0000000..a8d2bd2 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_account.js @@ -0,0 +1,60 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAccount_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the account to lookup. + * Format: accounts/{account} + * Example: "accounts/100" + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetAccount() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getAccount(request); + console.log(response); + } + + callGetAccount(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAccount_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/analytics_admin_service.get_conversion_event.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_conversion_event.js new file mode 100644 index 0000000..8eaf6d1 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_conversion_event.js @@ -0,0 +1,60 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetConversionEvent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the conversion event to retrieve. + * Format: properties/{property}/conversionEvents/{conversion_event} + * Example: "properties/123/conversionEvents/456" + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetConversionEvent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getConversionEvent(request); + console.log(response); + } + + callGetConversionEvent(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetConversionEvent_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/analytics_admin_service.get_custom_dimension.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_dimension.js new file mode 100644 index 0000000..cf71366 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_dimension.js @@ -0,0 +1,59 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetCustomDimension_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the CustomDimension to get. + * Example format: properties/1234/customDimensions/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetCustomDimension() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getCustomDimension(request); + console.log(response); + } + + callGetCustomDimension(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetCustomDimension_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/analytics_admin_service.get_custom_metric.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_metric.js new file mode 100644 index 0000000..3ee1ce9 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_metric.js @@ -0,0 +1,59 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetCustomMetric_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the CustomMetric to get. + * Example format: properties/1234/customMetrics/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetCustomMetric() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getCustomMetric(request); + console.log(response); + } + + callGetCustomMetric(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetCustomMetric_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/analytics_admin_service.get_data_retention_settings.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_retention_settings.js new file mode 100644 index 0000000..7a73434 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_retention_settings.js @@ -0,0 +1,61 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataRetentionSettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the settings to lookup. + * Format: + * properties/{property}/dataRetentionSettings + * Example: "properties/1000/dataRetentionSettings" + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetDataRetentionSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getDataRetentionSettings(request); + console.log(response); + } + + callGetDataRetentionSettings(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataRetentionSettings_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/analytics_admin_service.get_data_sharing_settings.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_sharing_settings.js new file mode 100644 index 0000000..651593e --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_sharing_settings.js @@ -0,0 +1,60 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataSharingSettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the settings to lookup. + * Format: accounts/{account}/dataSharingSettings + * Example: "accounts/1000/dataSharingSettings" + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetDataSharingSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getDataSharingSettings(request); + console.log(response); + } + + callGetDataSharingSettings(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataSharingSettings_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/analytics_admin_service.get_data_stream.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_stream.js new file mode 100644 index 0000000..9e94747 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_stream.js @@ -0,0 +1,59 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataStream_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the DataStream to get. + * Example format: properties/1234/dataStreams/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetDataStream() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getDataStream(request); + console.log(response); + } + + callGetDataStream(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataStream_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/analytics_admin_service.get_display_video360_advertiser_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link.js new file mode 100644 index 0000000..fede533 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link.js @@ -0,0 +1,59 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDisplayVideo360AdvertiserLink_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the DisplayVideo360AdvertiserLink to get. + * Example format: properties/1234/displayVideo360AdvertiserLink/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetDisplayVideo360AdvertiserLink() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getDisplayVideo360AdvertiserLink(request); + console.log(response); + } + + callGetDisplayVideo360AdvertiserLink(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDisplayVideo360AdvertiserLink_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/analytics_admin_service.get_display_video360_advertiser_link_proposal.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link_proposal.js new file mode 100644 index 0000000..b13181c --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link_proposal.js @@ -0,0 +1,59 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDisplayVideo360AdvertiserLinkProposal_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the DisplayVideo360AdvertiserLinkProposal to get. + * Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetDisplayVideo360AdvertiserLinkProposal() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getDisplayVideo360AdvertiserLinkProposal(request); + console.log(response); + } + + callGetDisplayVideo360AdvertiserLinkProposal(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDisplayVideo360AdvertiserLinkProposal_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/analytics_admin_service.get_global_site_tag.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_global_site_tag.js new file mode 100644 index 0000000..159694c --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_global_site_tag.js @@ -0,0 +1,61 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetGlobalSiteTag_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the site tag to lookup. + * Note that site tags are singletons and do not have unique IDs. + * Format: properties/{property_id}/dataStreams/{stream_id}/globalSiteTag + * Example: "properties/123/dataStreams/456/globalSiteTag" + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetGlobalSiteTag() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getGlobalSiteTag(request); + console.log(response); + } + + callGetGlobalSiteTag(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetGlobalSiteTag_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/analytics_admin_service.get_google_signals_settings.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_google_signals_settings.js new file mode 100644 index 0000000..6843a1c --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_google_signals_settings.js @@ -0,0 +1,59 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetGoogleSignalsSettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the google signals settings to retrieve. + * Format: properties/{property}/googleSignalsSettings + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetGoogleSignalsSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getGoogleSignalsSettings(request); + console.log(response); + } + + callGetGoogleSignalsSettings(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetGoogleSignalsSettings_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/analytics_admin_service.get_measurement_protocol_secret.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_measurement_protocol_secret.js new file mode 100644 index 0000000..c8fd3d4 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_measurement_protocol_secret.js @@ -0,0 +1,60 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetMeasurementProtocolSecret_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the measurement protocol secret to lookup. + * Format: + * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret} + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetMeasurementProtocolSecret() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getMeasurementProtocolSecret(request); + console.log(response); + } + + callGetMeasurementProtocolSecret(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetMeasurementProtocolSecret_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/analytics_admin_service.get_property.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_property.js new file mode 100644 index 0000000..789def7 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_property.js @@ -0,0 +1,60 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetProperty_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the property to lookup. + * Format: properties/{property_id} + * Example: "properties/1000" + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetProperty() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getProperty(request); + console.log(response); + } + + callGetProperty(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetProperty_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/analytics_admin_service.get_user_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_user_link.js new file mode 100644 index 0000000..9fedb79 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_user_link.js @@ -0,0 +1,58 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetUserLink_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: accounts/1234/userLinks/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetUserLink() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getUserLink(request); + console.log(response); + } + + callGetUserLink(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetUserLink_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/analytics_admin_service.list_account_summaries.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_account_summaries.js new file mode 100644 index 0000000..98d74df --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_account_summaries.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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccountSummaries_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The maximum number of AccountSummary resources to return. The service may + * return fewer than this value, even if there are additional pages. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200; (higher values will be coerced to the maximum) + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListAccountSummaries` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccountSummaries` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callListAccountSummaries() { + // Construct request + const request = { + }; + + // Run request + const iterable = await adminClient.listAccountSummariesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAccountSummaries(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccountSummaries_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/analytics_admin_service.list_accounts.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_accounts.js new file mode 100644 index 0000000..a31cb17 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_accounts.js @@ -0,0 +1,75 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccounts_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The maximum number of resources to return. The service may return + * fewer than this value, even if there are additional pages. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200; (higher values will be coerced to the maximum) + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListAccounts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccounts` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Whether to include soft-deleted (ie: "trashed") Accounts in the + * results. Accounts can be inspected to determine whether they are deleted or + * not. + */ + // const showDeleted = true + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callListAccounts() { + // Construct request + const request = { + }; + + // Run request + const iterable = await adminClient.listAccountsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAccounts(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccounts_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/analytics_admin_service.list_conversion_events.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_conversion_events.js new file mode 100644 index 0000000..c5e1b27 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_conversion_events.js @@ -0,0 +1,74 @@ +// 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(parent) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListConversionEvents_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent property. + * Example: 'properties/123' + */ + // const parent = 'abc123' + /** + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200; (higher values will be coerced to the maximum) + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListConversionEvents` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListConversionEvents` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callListConversionEvents() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await adminClient.listConversionEventsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListConversionEvents(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListConversionEvents_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/analytics_admin_service.list_custom_dimensions.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_dimensions.js new file mode 100644 index 0000000..fc6cd93 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_dimensions.js @@ -0,0 +1,73 @@ +// 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(parent) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListCustomDimensions_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: properties/1234 + */ + // const parent = 'abc123' + /** + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListCustomDimensions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListCustomDimensions` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callListCustomDimensions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await adminClient.listCustomDimensionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCustomDimensions(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListCustomDimensions_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/analytics_admin_service.list_custom_metrics.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_metrics.js new file mode 100644 index 0000000..84b2067 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_metrics.js @@ -0,0 +1,73 @@ +// 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(parent) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListCustomMetrics_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: properties/1234 + */ + // const parent = 'abc123' + /** + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListCustomMetrics` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListCustomMetrics` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callListCustomMetrics() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await adminClient.listCustomMetricsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCustomMetrics(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListCustomMetrics_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/analytics_admin_service.list_data_streams.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_data_streams.js new file mode 100644 index 0000000..76d3d10 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_data_streams.js @@ -0,0 +1,73 @@ +// 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(parent) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDataStreams_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: properties/1234 + */ + // const parent = 'abc123' + /** + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListDataStreams` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListDataStreams` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callListDataStreams() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await adminClient.listDataStreamsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDataStreams(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDataStreams_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/analytics_admin_service.list_display_video360_advertiser_link_proposals.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_link_proposals.js new file mode 100644 index 0000000..2ed63f6 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_link_proposals.js @@ -0,0 +1,75 @@ +// 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(parent) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDisplayVideo360AdvertiserLinkProposals_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: properties/1234 + */ + // const parent = 'abc123' + /** + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + */ + // const pageSize = 1234 + /** + * A page token, received from a previous + * `ListDisplayVideo360AdvertiserLinkProposals` call. Provide this to retrieve + * the subsequent page. + * When paginating, all other parameters provided to + * `ListDisplayVideo360AdvertiserLinkProposals` must match the call that + * provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callListDisplayVideo360AdvertiserLinkProposals() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await adminClient.listDisplayVideo360AdvertiserLinkProposalsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDisplayVideo360AdvertiserLinkProposals(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDisplayVideo360AdvertiserLinkProposals_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/analytics_admin_service.list_display_video360_advertiser_links.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_links.js new file mode 100644 index 0000000..1363794 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_links.js @@ -0,0 +1,74 @@ +// 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(parent) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDisplayVideo360AdvertiserLinks_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: properties/1234 + */ + // const parent = 'abc123' + /** + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListDisplayVideo360AdvertiserLinks` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListDisplayVideo360AdvertiserLinks` must match the call that provided the + * page token. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callListDisplayVideo360AdvertiserLinks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await adminClient.listDisplayVideo360AdvertiserLinksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDisplayVideo360AdvertiserLinks(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDisplayVideo360AdvertiserLinks_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/analytics_admin_service.list_firebase_links.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_firebase_links.js new file mode 100644 index 0000000..07fb24d --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_firebase_links.js @@ -0,0 +1,75 @@ +// 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(parent) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListFirebaseLinks_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Format: properties/{property_id} + * Example: properties/1234 + */ + // const parent = 'abc123' + /** + * The maximum number of resources to return. The service may return + * fewer than this value, even if there are additional pages. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200; (higher values will be coerced to the maximum) + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListFirebaseLinks` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListProperties` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callListFirebaseLinks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await adminClient.listFirebaseLinksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListFirebaseLinks(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListFirebaseLinks_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/analytics_admin_service.list_google_ads_links.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_google_ads_links.js new file mode 100644 index 0000000..96b093b --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_google_ads_links.js @@ -0,0 +1,73 @@ +// 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(parent) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListGoogleAdsLinks_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: properties/1234 + */ + // const parent = 'abc123' + /** + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListGoogleAdsLinks` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListGoogleAdsLinks` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callListGoogleAdsLinks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await adminClient.listGoogleAdsLinksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListGoogleAdsLinks(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListGoogleAdsLinks_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/analytics_admin_service.list_measurement_protocol_secrets.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_measurement_protocol_secrets.js new file mode 100644 index 0000000..60896d4 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_measurement_protocol_secrets.js @@ -0,0 +1,75 @@ +// 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(parent) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListMeasurementProtocolSecrets_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent stream. + * Format: + * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets + */ + // const parent = 'abc123' + /** + * The maximum number of resources to return. + * If unspecified, at most 10 resources will be returned. + * The maximum value is 10. Higher values will be coerced to the maximum. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListMeasurementProtocolSecrets` + * call. Provide this to retrieve the subsequent page. When paginating, all + * other parameters provided to `ListMeasurementProtocolSecrets` must match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callListMeasurementProtocolSecrets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await adminClient.listMeasurementProtocolSecretsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListMeasurementProtocolSecrets(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListMeasurementProtocolSecrets_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/analytics_admin_service.list_properties.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_properties.js new file mode 100644 index 0000000..9020527 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_properties.js @@ -0,0 +1,94 @@ +// 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(filter) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListProperties_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. An expression for filtering the results of the request. + * Fields eligible for filtering are: + * `parent:`(The resource name of the parent account/property) or + * `ancestor:`(The resource name of the parent account) or + * `firebase_project:`(The id or number of the linked firebase project). + * Some examples of filters: + * ``` + * | Filter | Description | + * |-----------------------------|-------------------------------------------| + * | parent:accounts/123 | The account with account id: 123. | + * | parent:properties/123 | The property with property id: 123. | + * | ancestor:accounts/123 | The account with account id: 123. | + * | firebase_project:project-id | The firebase project with id: project-id. | + * | firebase_project:123 | The firebase project with number: 123. | + * ``` + */ + // const filter = 'abc123' + /** + * The maximum number of resources to return. The service may return + * fewer than this value, even if there are additional pages. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200; (higher values will be coerced to the maximum) + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListProperties` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListProperties` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Whether to include soft-deleted (ie: "trashed") Properties in the + * results. Properties can be inspected to determine whether they are deleted + * or not. + */ + // const showDeleted = true + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callListProperties() { + // Construct request + const request = { + filter, + }; + + // Run request + const iterable = await adminClient.listPropertiesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListProperties(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListProperties_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/analytics_admin_service.list_user_links.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_user_links.js new file mode 100644 index 0000000..0f0975f --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_user_links.js @@ -0,0 +1,74 @@ +// 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(parent) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListUserLinks_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: accounts/1234 + */ + // const parent = 'abc123' + /** + * The maximum number of user links to return. + * The service may return fewer than this value. + * If unspecified, at most 200 user links will be returned. + * The maximum value is 500; values above 500 will be coerced to 500. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListUserLinks` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListUserLinks` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callListUserLinks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await adminClient.listUserLinksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListUserLinks(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListUserLinks_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/analytics_admin_service.provision_account_ticket.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.provision_account_ticket.js new file mode 100644 index 0000000..9c92550 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.provision_account_ticket.js @@ -0,0 +1,62 @@ +// 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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_ProvisionAccountTicket_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The account to create. + */ + // const account = {} + /** + * Redirect URI where the user will be sent after accepting Terms of Service. + * Must be configured in Developers Console as a Redirect URI + */ + // const redirectUri = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callProvisionAccountTicket() { + // Construct request + const request = { + }; + + // Run request + const response = await adminClient.provisionAccountTicket(request); + console.log(response); + } + + callProvisionAccountTicket(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ProvisionAccountTicket_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/analytics_admin_service.search_change_history_events.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.search_change_history_events.js new file mode 100644 index 0000000..b9f9d57 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.search_change_history_events.js @@ -0,0 +1,101 @@ +// 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(account) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_SearchChangeHistoryEvents_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The account resource for which to return change history resources. + */ + // const account = 'abc123' + /** + * Optional. Resource name for a child property. If set, only return changes + * made to this property or its child resources. + */ + // const property = 'abc123' + /** + * Optional. If set, only return changes if they are for a resource that matches at + * least one of these types. + */ + // const resourceType = 1234 + /** + * Optional. If set, only return changes that match one or more of these types of + * actions. + */ + // const action = 1234 + /** + * Optional. If set, only return changes if they are made by a user in this list. + */ + // const actorEmail = 'abc123' + /** + * Optional. If set, only return changes made after this time (inclusive). + */ + // const earliestChangeTime = {} + /** + * Optional. If set, only return changes made before this time (inclusive). + */ + // const latestChangeTime = {} + /** + * Optional. The maximum number of ChangeHistoryEvent items to return. + * The service may return fewer than this value, even if there are additional + * pages. If unspecified, at most 50 items will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `SearchChangeHistoryEvents` call. + * Provide this to retrieve the subsequent page. When paginating, all other + * parameters provided to `SearchChangeHistoryEvents` must match the call that + * provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callSearchChangeHistoryEvents() { + // Construct request + const request = { + account, + }; + + // Run request + const iterable = await adminClient.searchChangeHistoryEventsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchChangeHistoryEvents(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_SearchChangeHistoryEvents_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/analytics_admin_service.update_account.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_account.js new file mode 100644 index 0000000..4a3829a --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_account.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(account, updateMask) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAccount_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The account to update. + * The account's `name` field is used to identify the account. + */ + // const account = {} + /** + * Required. The list of fields to be updated. Field names must be in snake case + * (e.g., "field_to_update"). Omitted fields will not be updated. To replace + * the entire entity, use one path with the string "*" to match all fields. + */ + // const updateMask = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callUpdateAccount() { + // Construct request + const request = { + account, + updateMask, + }; + + // Run request + const response = await adminClient.updateAccount(request); + console.log(response); + } + + callUpdateAccount(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAccount_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/analytics_admin_service.update_custom_dimension.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_dimension.js new file mode 100644 index 0000000..b6638b1 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_dimension.js @@ -0,0 +1,64 @@ +// 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(updateMask) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateCustomDimension_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The CustomDimension to update + */ + // const customDimension = {} + /** + * Required. The list of fields to be updated. Omitted fields will not be updated. + * To replace the entire entity, use one path with the string "*" to match + * all fields. + */ + // const updateMask = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callUpdateCustomDimension() { + // Construct request + const request = { + updateMask, + }; + + // Run request + const response = await adminClient.updateCustomDimension(request); + console.log(response); + } + + callUpdateCustomDimension(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateCustomDimension_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/analytics_admin_service.update_custom_metric.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_metric.js new file mode 100644 index 0000000..50af269 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_metric.js @@ -0,0 +1,64 @@ +// 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(updateMask) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateCustomMetric_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The CustomMetric to update + */ + // const customMetric = {} + /** + * Required. The list of fields to be updated. Omitted fields will not be updated. + * To replace the entire entity, use one path with the string "*" to match + * all fields. + */ + // const updateMask = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callUpdateCustomMetric() { + // Construct request + const request = { + updateMask, + }; + + // Run request + const response = await adminClient.updateCustomMetric(request); + console.log(response); + } + + callUpdateCustomMetric(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateCustomMetric_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/analytics_admin_service.update_data_retention_settings.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_retention_settings.js new file mode 100644 index 0000000..13e6dd5 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_retention_settings.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(dataRetentionSettings, updateMask) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDataRetentionSettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The settings to update. + * The `name` field is used to identify the settings to be updated. + */ + // const dataRetentionSettings = {} + /** + * Required. The list of fields to be updated. Field names must be in snake case + * (e.g., "field_to_update"). Omitted fields will not be updated. To replace + * the entire entity, use one path with the string "*" to match all fields. + */ + // const updateMask = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callUpdateDataRetentionSettings() { + // Construct request + const request = { + dataRetentionSettings, + updateMask, + }; + + // Run request + const response = await adminClient.updateDataRetentionSettings(request); + console.log(response); + } + + callUpdateDataRetentionSettings(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDataRetentionSettings_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/analytics_admin_service.update_data_stream.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_stream.js new file mode 100644 index 0000000..f3c6fc7 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_stream.js @@ -0,0 +1,64 @@ +// 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(updateMask) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDataStream_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The DataStream to update + */ + // const dataStream = {} + /** + * Required. The list of fields to be updated. Omitted fields will not be updated. + * To replace the entire entity, use one path with the string "*" to match + * all fields. + */ + // const updateMask = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callUpdateDataStream() { + // Construct request + const request = { + updateMask, + }; + + // Run request + const response = await adminClient.updateDataStream(request); + console.log(response); + } + + callUpdateDataStream(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDataStream_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/analytics_admin_service.update_display_video360_advertiser_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_display_video360_advertiser_link.js new file mode 100644 index 0000000..1697b7a --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_display_video360_advertiser_link.js @@ -0,0 +1,64 @@ +// 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(updateMask) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDisplayVideo360AdvertiserLink_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The DisplayVideo360AdvertiserLink to update + */ + // const displayVideo_360AdvertiserLink = {} + /** + * Required. The list of fields to be updated. Omitted fields will not be updated. + * To replace the entire entity, use one path with the string "*" to match + * all fields. + */ + // const updateMask = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callUpdateDisplayVideo360AdvertiserLink() { + // Construct request + const request = { + updateMask, + }; + + // Run request + const response = await adminClient.updateDisplayVideo360AdvertiserLink(request); + console.log(response); + } + + callUpdateDisplayVideo360AdvertiserLink(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDisplayVideo360AdvertiserLink_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/analytics_admin_service.update_google_ads_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_ads_link.js new file mode 100644 index 0000000..ba2fae4 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_ads_link.js @@ -0,0 +1,64 @@ +// 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(updateMask) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateGoogleAdsLink_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The GoogleAdsLink to update + */ + // const googleAdsLink = {} + /** + * Required. The list of fields to be updated. Field names must be in snake case + * (e.g., "field_to_update"). Omitted fields will not be updated. To replace + * the entire entity, use one path with the string "*" to match all fields. + */ + // const updateMask = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callUpdateGoogleAdsLink() { + // Construct request + const request = { + updateMask, + }; + + // Run request + const response = await adminClient.updateGoogleAdsLink(request); + console.log(response); + } + + callUpdateGoogleAdsLink(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateGoogleAdsLink_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/analytics_admin_service.update_google_signals_settings.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_signals_settings.js new file mode 100644 index 0000000..85e7f51 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_signals_settings.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(googleSignalsSettings, updateMask) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateGoogleSignalsSettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The settings to update. + * The `name` field is used to identify the settings to be updated. + */ + // const googleSignalsSettings = {} + /** + * Required. The list of fields to be updated. Field names must be in snake case + * (e.g., "field_to_update"). Omitted fields will not be updated. To replace + * the entire entity, use one path with the string "*" to match all fields. + */ + // const updateMask = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callUpdateGoogleSignalsSettings() { + // Construct request + const request = { + googleSignalsSettings, + updateMask, + }; + + // Run request + const response = await adminClient.updateGoogleSignalsSettings(request); + console.log(response); + } + + callUpdateGoogleSignalsSettings(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateGoogleSignalsSettings_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/analytics_admin_service.update_measurement_protocol_secret.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_measurement_protocol_secret.js new file mode 100644 index 0000000..294e127 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_measurement_protocol_secret.js @@ -0,0 +1,62 @@ +// 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(measurementProtocolSecret) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateMeasurementProtocolSecret_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The measurement protocol secret to update. + */ + // const measurementProtocolSecret = {} + /** + * The list of fields to be updated. Omitted fields will not be updated. + */ + // const updateMask = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callUpdateMeasurementProtocolSecret() { + // Construct request + const request = { + measurementProtocolSecret, + }; + + // Run request + const response = await adminClient.updateMeasurementProtocolSecret(request); + console.log(response); + } + + callUpdateMeasurementProtocolSecret(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateMeasurementProtocolSecret_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/analytics_admin_service.update_property.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_property.js new file mode 100644 index 0000000..c4cbff7 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_property.js @@ -0,0 +1,67 @@ +// 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(property, updateMask) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateProperty_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The property to update. + * The property's `name` field is used to identify the property to be + * updated. + */ + // const property = {} + /** + * Required. The list of fields to be updated. Field names must be in snake case + * (e.g., "field_to_update"). Omitted fields will not be updated. To replace + * the entire entity, use one path with the string "*" to match all fields. + */ + // const updateMask = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callUpdateProperty() { + // Construct request + const request = { + property, + updateMask, + }; + + // Run request + const response = await adminClient.updateProperty(request); + console.log(response); + } + + callUpdateProperty(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateProperty_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/analytics_admin_service.update_user_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_user_link.js new file mode 100644 index 0000000..3c3a48a --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_user_link.js @@ -0,0 +1,58 @@ +// 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(userLink) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateUserLink_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The user link to update. + */ + // const userLink = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callUpdateUserLink() { + // Construct request + const request = { + userLink, + }; + + // Run request + const response = await adminClient.updateUserLink(request); + console.log(response); + } + + callUpdateUserLink(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateUserLink_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.admin.v1alpha.json b/owl-bot-staging/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.admin.v1alpha.json new file mode 100644 index 0000000..0f23bf0 --- /dev/null +++ b/owl-bot-staging/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.admin.v1alpha.json @@ -0,0 +1,3111 @@ +{ + "clientLibrary": { + "name": "nodejs-admin", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.analytics.admin.v1alpha", + "version": "v1alpha" + } + ] + }, + "snippets": [ + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAccount_async", + "title": "AnalyticsAdminService getAccount Sample", + "origin": "API_DEFINITION", + "description": " Lookup for a single Account.", + "canonical": true, + "file": "analytics_admin_service.get_account.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAccount", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetAccount", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.Account", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetAccount", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetAccount", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccounts_async", + "title": "AnalyticsAdminService listAccounts Sample", + "origin": "API_DEFINITION", + "description": " Returns all accounts accessible by the caller. Note that these accounts might not currently have GA4 properties. Soft-deleted (ie: \"trashed\") accounts are excluded by default. Returns an empty list if no relevant accounts are found.", + "canonical": true, + "file": "analytics_admin_service.list_accounts.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAccounts", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListAccounts", + "async": true, + "parameters": [ + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "show_deleted", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ListAccountsResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListAccounts", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListAccounts", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteAccount_async", + "title": "AnalyticsAdminService deleteAccount Sample", + "origin": "API_DEFINITION", + "description": " Marks target Account as soft-deleted (ie: \"trashed\") and returns it. This API does not have a method to restore soft-deleted accounts. However, they can be restored using the Trash Can UI. If the accounts are not restored before the expiration time, the account and all child resources (eg: Properties, GoogleAdsLinks, Streams, UserLinks) will be permanently purged. https://support.google.com/analytics/answer/6154772 Returns an error if the target is not found.", + "canonical": true, + "file": "analytics_admin_service.delete_account.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAccount", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteAccount", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "DeleteAccount", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteAccount", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAccount_async", + "title": "AnalyticsAdminService updateAccount Sample", + "origin": "API_DEFINITION", + "description": " Updates an account.", + "canonical": true, + "file": "analytics_admin_service.update_account.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAccount", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateAccount", + "async": true, + "parameters": [ + { + "name": "account", + "type": ".google.analytics.admin.v1alpha.Account" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1alpha.Account", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateAccount", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateAccount", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ProvisionAccountTicket_async", + "title": "AnalyticsAdminService provisionAccountTicket Sample", + "origin": "API_DEFINITION", + "description": " Requests a ticket for creating an account.", + "canonical": true, + "file": "analytics_admin_service.provision_account_ticket.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ProvisionAccountTicket", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ProvisionAccountTicket", + "async": true, + "parameters": [ + { + "name": "account", + "type": ".google.analytics.admin.v1alpha.Account" + }, + { + "name": "redirect_uri", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ProvisionAccountTicketResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ProvisionAccountTicket", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ProvisionAccountTicket", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccountSummaries_async", + "title": "AnalyticsAdminService listAccountSummaries Sample", + "origin": "API_DEFINITION", + "description": " Returns summaries of all accounts accessible by the caller.", + "canonical": true, + "file": "analytics_admin_service.list_account_summaries.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAccountSummaries", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListAccountSummaries", + "async": true, + "parameters": [ + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ListAccountSummariesResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListAccountSummaries", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListAccountSummaries", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetProperty_async", + "title": "AnalyticsAdminService getProperty Sample", + "origin": "API_DEFINITION", + "description": " Lookup for a single \"GA4\" Property.", + "canonical": true, + "file": "analytics_admin_service.get_property.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetProperty", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetProperty", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.Property", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetProperty", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetProperty", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListProperties_async", + "title": "AnalyticsAdminService listProperties Sample", + "origin": "API_DEFINITION", + "description": " Returns child Properties under the specified parent Account. Only \"GA4\" properties will be returned. Properties will be excluded if the caller does not have access. Soft-deleted (ie: \"trashed\") properties are excluded by default. Returns an empty list if no relevant properties are found.", + "canonical": true, + "file": "analytics_admin_service.list_properties.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 86, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListProperties", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListProperties", + "async": true, + "parameters": [ + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "show_deleted", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ListPropertiesResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListProperties", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListProperties", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateProperty_async", + "title": "AnalyticsAdminService createProperty Sample", + "origin": "API_DEFINITION", + "description": " Creates an \"GA4\" property with the specified location and attributes.", + "canonical": true, + "file": "analytics_admin_service.create_property.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateProperty", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateProperty", + "async": true, + "parameters": [ + { + "name": "property", + "type": ".google.analytics.admin.v1alpha.Property" + } + ], + "resultType": ".google.analytics.admin.v1alpha.Property", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateProperty", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateProperty", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteProperty_async", + "title": "AnalyticsAdminService deleteProperty Sample", + "origin": "API_DEFINITION", + "description": " Marks target Property as soft-deleted (ie: \"trashed\") and returns it. This API does not have a method to restore soft-deleted properties. However, they can be restored using the Trash Can UI. If the properties are not restored before the expiration time, the Property and all child resources (eg: GoogleAdsLinks, Streams, UserLinks) will be permanently purged. https://support.google.com/analytics/answer/6154772 Returns an error if the target is not found, or is not an GA4 Property.", + "canonical": true, + "file": "analytics_admin_service.delete_property.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteProperty", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteProperty", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.Property", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "DeleteProperty", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteProperty", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateProperty_async", + "title": "AnalyticsAdminService updateProperty Sample", + "origin": "API_DEFINITION", + "description": " Updates a property.", + "canonical": true, + "file": "analytics_admin_service.update_property.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateProperty", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateProperty", + "async": true, + "parameters": [ + { + "name": "property", + "type": ".google.analytics.admin.v1alpha.Property" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1alpha.Property", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateProperty", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateProperty", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetUserLink_async", + "title": "AnalyticsAdminService getUserLink Sample", + "origin": "API_DEFINITION", + "description": " Gets information about a user's link to an account or property.", + "canonical": true, + "file": "analytics_admin_service.get_user_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetUserLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetUserLink", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.UserLink", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetUserLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetUserLink", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchGetUserLinks_async", + "title": "AnalyticsAdminService batchGetUserLinks Sample", + "origin": "API_DEFINITION", + "description": " Gets information about multiple users' links to an account or property.", + "canonical": true, + "file": "analytics_admin_service.batch_get_user_links.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchGetUserLinks", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchGetUserLinks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "names", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.analytics.admin.v1alpha.BatchGetUserLinksResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "BatchGetUserLinks", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchGetUserLinks", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListUserLinks_async", + "title": "AnalyticsAdminService listUserLinks Sample", + "origin": "API_DEFINITION", + "description": " Lists all user links on an account or property.", + "canonical": true, + "file": "analytics_admin_service.list_user_links.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListUserLinks", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListUserLinks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ListUserLinksResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListUserLinks", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListUserLinks", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_AuditUserLinks_async", + "title": "AnalyticsAdminService auditUserLinks Sample", + "origin": "API_DEFINITION", + "description": " Lists all user links on an account or property, including implicit ones that come from effective permissions granted by groups or organization admin roles. If a returned user link does not have direct permissions, they cannot be removed from the account or property directly with the DeleteUserLink command. They have to be removed from the group/etc that gives them permissions, which is currently only usable/discoverable in the GA or GMP UIs.", + "canonical": true, + "file": "analytics_admin_service.audit_user_links.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AuditUserLinks", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.AuditUserLinks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.AuditUserLinksResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "AuditUserLinks", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.AuditUserLinks", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateUserLink_async", + "title": "AnalyticsAdminService createUserLink Sample", + "origin": "API_DEFINITION", + "description": " Creates a user link on an account or property. If the user with the specified email already has permissions on the account or property, then the user's existing permissions will be unioned with the permissions specified in the new UserLink.", + "canonical": true, + "file": "analytics_admin_service.create_user_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateUserLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateUserLink", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "notify_new_user", + "type": "TYPE_BOOL" + }, + { + "name": "user_link", + "type": ".google.analytics.admin.v1alpha.UserLink" + } + ], + "resultType": ".google.analytics.admin.v1alpha.UserLink", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateUserLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateUserLink", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchCreateUserLinks_async", + "title": "AnalyticsAdminService batchCreateUserLinks Sample", + "origin": "API_DEFINITION", + "description": " Creates information about multiple users' links to an account or property. This method is transactional. If any UserLink cannot be created, none of the UserLinks will be created.", + "canonical": true, + "file": "analytics_admin_service.batch_create_user_links.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchCreateUserLinks", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchCreateUserLinks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "notify_new_users", + "type": "TYPE_BOOL" + }, + { + "name": "requests", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.analytics.admin.v1alpha.BatchCreateUserLinksResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "BatchCreateUserLinks", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchCreateUserLinks", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateUserLink_async", + "title": "AnalyticsAdminService updateUserLink Sample", + "origin": "API_DEFINITION", + "description": " Updates a user link on an account or property.", + "canonical": true, + "file": "analytics_admin_service.update_user_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateUserLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateUserLink", + "async": true, + "parameters": [ + { + "name": "user_link", + "type": ".google.analytics.admin.v1alpha.UserLink" + } + ], + "resultType": ".google.analytics.admin.v1alpha.UserLink", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateUserLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateUserLink", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchUpdateUserLinks_async", + "title": "AnalyticsAdminService batchUpdateUserLinks Sample", + "origin": "API_DEFINITION", + "description": " Updates information about multiple users' links to an account or property.", + "canonical": true, + "file": "analytics_admin_service.batch_update_user_links.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchUpdateUserLinks", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchUpdateUserLinks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "requests", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.analytics.admin.v1alpha.BatchUpdateUserLinksResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "BatchUpdateUserLinks", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchUpdateUserLinks", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteUserLink_async", + "title": "AnalyticsAdminService deleteUserLink Sample", + "origin": "API_DEFINITION", + "description": " Deletes a user link on an account or property.", + "canonical": true, + "file": "analytics_admin_service.delete_user_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteUserLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteUserLink", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "DeleteUserLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteUserLink", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchDeleteUserLinks_async", + "title": "AnalyticsAdminService batchDeleteUserLinks Sample", + "origin": "API_DEFINITION", + "description": " Deletes information about multiple users' links to an account or property.", + "canonical": true, + "file": "analytics_admin_service.batch_delete_user_links.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchDeleteUserLinks", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchDeleteUserLinks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "requests", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "BatchDeleteUserLinks", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchDeleteUserLinks", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateFirebaseLink_async", + "title": "AnalyticsAdminService createFirebaseLink Sample", + "origin": "API_DEFINITION", + "description": " Creates a FirebaseLink. Properties can have at most one FirebaseLink.", + "canonical": true, + "file": "analytics_admin_service.create_firebase_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateFirebaseLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateFirebaseLink", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "firebase_link", + "type": ".google.analytics.admin.v1alpha.FirebaseLink" + } + ], + "resultType": ".google.analytics.admin.v1alpha.FirebaseLink", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateFirebaseLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateFirebaseLink", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteFirebaseLink_async", + "title": "AnalyticsAdminService deleteFirebaseLink Sample", + "origin": "API_DEFINITION", + "description": " Deletes a FirebaseLink on a property", + "canonical": true, + "file": "analytics_admin_service.delete_firebase_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteFirebaseLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteFirebaseLink", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "DeleteFirebaseLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteFirebaseLink", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListFirebaseLinks_async", + "title": "AnalyticsAdminService listFirebaseLinks Sample", + "origin": "API_DEFINITION", + "description": " Lists FirebaseLinks on a property. Properties can have at most one FirebaseLink.", + "canonical": true, + "file": "analytics_admin_service.list_firebase_links.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFirebaseLinks", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListFirebaseLinks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ListFirebaseLinksResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListFirebaseLinks", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListFirebaseLinks", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetGlobalSiteTag_async", + "title": "AnalyticsAdminService getGlobalSiteTag Sample", + "origin": "API_DEFINITION", + "description": " Returns the Site Tag for the specified web stream. Site Tags are immutable singletons.", + "canonical": true, + "file": "analytics_admin_service.get_global_site_tag.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGlobalSiteTag", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetGlobalSiteTag", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.GlobalSiteTag", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetGlobalSiteTag", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetGlobalSiteTag", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateGoogleAdsLink_async", + "title": "AnalyticsAdminService createGoogleAdsLink Sample", + "origin": "API_DEFINITION", + "description": " Creates a GoogleAdsLink.", + "canonical": true, + "file": "analytics_admin_service.create_google_ads_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateGoogleAdsLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateGoogleAdsLink", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "google_ads_link", + "type": ".google.analytics.admin.v1alpha.GoogleAdsLink" + } + ], + "resultType": ".google.analytics.admin.v1alpha.GoogleAdsLink", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateGoogleAdsLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateGoogleAdsLink", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateGoogleAdsLink_async", + "title": "AnalyticsAdminService updateGoogleAdsLink Sample", + "origin": "API_DEFINITION", + "description": " Updates a GoogleAdsLink on a property", + "canonical": true, + "file": "analytics_admin_service.update_google_ads_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateGoogleAdsLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateGoogleAdsLink", + "async": true, + "parameters": [ + { + "name": "google_ads_link", + "type": ".google.analytics.admin.v1alpha.GoogleAdsLink" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1alpha.GoogleAdsLink", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateGoogleAdsLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateGoogleAdsLink", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteGoogleAdsLink_async", + "title": "AnalyticsAdminService deleteGoogleAdsLink Sample", + "origin": "API_DEFINITION", + "description": " Deletes a GoogleAdsLink on a property", + "canonical": true, + "file": "analytics_admin_service.delete_google_ads_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteGoogleAdsLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteGoogleAdsLink", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "DeleteGoogleAdsLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteGoogleAdsLink", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListGoogleAdsLinks_async", + "title": "AnalyticsAdminService listGoogleAdsLinks Sample", + "origin": "API_DEFINITION", + "description": " Lists GoogleAdsLinks on a property.", + "canonical": true, + "file": "analytics_admin_service.list_google_ads_links.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListGoogleAdsLinks", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListGoogleAdsLinks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ListGoogleAdsLinksResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListGoogleAdsLinks", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListGoogleAdsLinks", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataSharingSettings_async", + "title": "AnalyticsAdminService getDataSharingSettings Sample", + "origin": "API_DEFINITION", + "description": " Get data sharing settings on an account. Data sharing settings are singletons.", + "canonical": true, + "file": "analytics_admin_service.get_data_sharing_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataSharingSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetDataSharingSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.DataSharingSettings", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetDataSharingSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetDataSharingSettings", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetMeasurementProtocolSecret_async", + "title": "AnalyticsAdminService getMeasurementProtocolSecret Sample", + "origin": "API_DEFINITION", + "description": " Lookup for a single \"GA4\" MeasurementProtocolSecret.", + "canonical": true, + "file": "analytics_admin_service.get_measurement_protocol_secret.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMeasurementProtocolSecret", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetMeasurementProtocolSecret", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.MeasurementProtocolSecret", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetMeasurementProtocolSecret", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetMeasurementProtocolSecret", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListMeasurementProtocolSecrets_async", + "title": "AnalyticsAdminService listMeasurementProtocolSecrets Sample", + "origin": "API_DEFINITION", + "description": " Returns child MeasurementProtocolSecrets under the specified parent Property.", + "canonical": true, + "file": "analytics_admin_service.list_measurement_protocol_secrets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListMeasurementProtocolSecrets", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListMeasurementProtocolSecrets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListMeasurementProtocolSecrets", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListMeasurementProtocolSecrets", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateMeasurementProtocolSecret_async", + "title": "AnalyticsAdminService createMeasurementProtocolSecret Sample", + "origin": "API_DEFINITION", + "description": " Creates a measurement protocol secret.", + "canonical": true, + "file": "analytics_admin_service.create_measurement_protocol_secret.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateMeasurementProtocolSecret", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateMeasurementProtocolSecret", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "measurement_protocol_secret", + "type": ".google.analytics.admin.v1alpha.MeasurementProtocolSecret" + } + ], + "resultType": ".google.analytics.admin.v1alpha.MeasurementProtocolSecret", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateMeasurementProtocolSecret", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateMeasurementProtocolSecret", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteMeasurementProtocolSecret_async", + "title": "AnalyticsAdminService deleteMeasurementProtocolSecret Sample", + "origin": "API_DEFINITION", + "description": " Deletes target MeasurementProtocolSecret.", + "canonical": true, + "file": "analytics_admin_service.delete_measurement_protocol_secret.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteMeasurementProtocolSecret", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteMeasurementProtocolSecret", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "DeleteMeasurementProtocolSecret", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteMeasurementProtocolSecret", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateMeasurementProtocolSecret_async", + "title": "AnalyticsAdminService updateMeasurementProtocolSecret Sample", + "origin": "API_DEFINITION", + "description": " Updates a measurement protocol secret.", + "canonical": true, + "file": "analytics_admin_service.update_measurement_protocol_secret.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateMeasurementProtocolSecret", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateMeasurementProtocolSecret", + "async": true, + "parameters": [ + { + "name": "measurement_protocol_secret", + "type": ".google.analytics.admin.v1alpha.MeasurementProtocolSecret" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1alpha.MeasurementProtocolSecret", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateMeasurementProtocolSecret", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateMeasurementProtocolSecret", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_AcknowledgeUserDataCollection_async", + "title": "AnalyticsAdminService acknowledgeUserDataCollection Sample", + "origin": "API_DEFINITION", + "description": " Acknowledges the terms of user data collection for the specified property. This acknowledgement must be completed (either in the Google Analytics UI or via this API) before MeasurementProtocolSecret resources may be created.", + "canonical": true, + "file": "analytics_admin_service.acknowledge_user_data_collection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AcknowledgeUserDataCollection", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.AcknowledgeUserDataCollection", + "async": true, + "parameters": [ + { + "name": "property", + "type": "TYPE_STRING" + }, + { + "name": "acknowledgement", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "AcknowledgeUserDataCollection", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.AcknowledgeUserDataCollection", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_SearchChangeHistoryEvents_async", + "title": "AnalyticsAdminService searchChangeHistoryEvents Sample", + "origin": "API_DEFINITION", + "description": " Searches through all changes to an account or its children given the specified set of filters.", + "canonical": true, + "file": "analytics_admin_service.search_change_history_events.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 93, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchChangeHistoryEvents", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.SearchChangeHistoryEvents", + "async": true, + "parameters": [ + { + "name": "account", + "type": "TYPE_STRING" + }, + { + "name": "property", + "type": "TYPE_STRING" + }, + { + "name": "resource_type", + "type": "TYPE_ENUM[]" + }, + { + "name": "action", + "type": "TYPE_ENUM[]" + }, + { + "name": "actor_email", + "type": "TYPE_STRING[]" + }, + { + "name": "earliest_change_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "latest_change_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.SearchChangeHistoryEventsResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "SearchChangeHistoryEvents", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.SearchChangeHistoryEvents", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetGoogleSignalsSettings_async", + "title": "AnalyticsAdminService getGoogleSignalsSettings Sample", + "origin": "API_DEFINITION", + "description": " Lookup for Google Signals settings for a property.", + "canonical": true, + "file": "analytics_admin_service.get_google_signals_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGoogleSignalsSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetGoogleSignalsSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.GoogleSignalsSettings", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetGoogleSignalsSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetGoogleSignalsSettings", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateGoogleSignalsSettings_async", + "title": "AnalyticsAdminService updateGoogleSignalsSettings Sample", + "origin": "API_DEFINITION", + "description": " Updates Google Signals settings for a property.", + "canonical": true, + "file": "analytics_admin_service.update_google_signals_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateGoogleSignalsSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateGoogleSignalsSettings", + "async": true, + "parameters": [ + { + "name": "google_signals_settings", + "type": ".google.analytics.admin.v1alpha.GoogleSignalsSettings" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1alpha.GoogleSignalsSettings", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateGoogleSignalsSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateGoogleSignalsSettings", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateConversionEvent_async", + "title": "AnalyticsAdminService createConversionEvent Sample", + "origin": "API_DEFINITION", + "description": " Creates a conversion event with the specified attributes.", + "canonical": true, + "file": "analytics_admin_service.create_conversion_event.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateConversionEvent", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateConversionEvent", + "async": true, + "parameters": [ + { + "name": "conversion_event", + "type": ".google.analytics.admin.v1alpha.ConversionEvent" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ConversionEvent", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateConversionEvent", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateConversionEvent", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetConversionEvent_async", + "title": "AnalyticsAdminService getConversionEvent Sample", + "origin": "API_DEFINITION", + "description": " Retrieve a single conversion event.", + "canonical": true, + "file": "analytics_admin_service.get_conversion_event.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConversionEvent", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetConversionEvent", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ConversionEvent", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetConversionEvent", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetConversionEvent", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteConversionEvent_async", + "title": "AnalyticsAdminService deleteConversionEvent Sample", + "origin": "API_DEFINITION", + "description": " Deletes a conversion event in a property.", + "canonical": true, + "file": "analytics_admin_service.delete_conversion_event.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteConversionEvent", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteConversionEvent", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "DeleteConversionEvent", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteConversionEvent", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListConversionEvents_async", + "title": "AnalyticsAdminService listConversionEvents Sample", + "origin": "API_DEFINITION", + "description": " Returns a list of conversion events in the specified parent property. Returns an empty list if no conversion events are found.", + "canonical": true, + "file": "analytics_admin_service.list_conversion_events.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListConversionEvents", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListConversionEvents", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ListConversionEventsResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListConversionEvents", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListConversionEvents", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDisplayVideo360AdvertiserLink_async", + "title": "AnalyticsAdminService getDisplayVideo360AdvertiserLink Sample", + "origin": "API_DEFINITION", + "description": " Look up a single DisplayVideo360AdvertiserLink", + "canonical": true, + "file": "analytics_admin_service.get_display_video360_advertiser_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDisplayVideo360AdvertiserLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetDisplayVideo360AdvertiserLink", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetDisplayVideo360AdvertiserLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetDisplayVideo360AdvertiserLink", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDisplayVideo360AdvertiserLinks_async", + "title": "AnalyticsAdminService listDisplayVideo360AdvertiserLinks Sample", + "origin": "API_DEFINITION", + "description": " Lists all DisplayVideo360AdvertiserLinks on a property.", + "canonical": true, + "file": "analytics_admin_service.list_display_video360_advertiser_links.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDisplayVideo360AdvertiserLinks", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListDisplayVideo360AdvertiserLinks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListDisplayVideo360AdvertiserLinks", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListDisplayVideo360AdvertiserLinks", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDisplayVideo360AdvertiserLink_async", + "title": "AnalyticsAdminService createDisplayVideo360AdvertiserLink Sample", + "origin": "API_DEFINITION", + "description": " Creates a DisplayVideo360AdvertiserLink. This can only be utilized by users who have proper authorization both on the Google Analytics property and on the Display & Video 360 advertiser. Users who do not have access to the Display & Video 360 advertiser should instead seek to create a DisplayVideo360LinkProposal.", + "canonical": true, + "file": "analytics_admin_service.create_display_video360_advertiser_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDisplayVideo360AdvertiserLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateDisplayVideo360AdvertiserLink", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "display_video_360_advertiser_link", + "type": ".google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink" + } + ], + "resultType": ".google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateDisplayVideo360AdvertiserLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateDisplayVideo360AdvertiserLink", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDisplayVideo360AdvertiserLink_async", + "title": "AnalyticsAdminService deleteDisplayVideo360AdvertiserLink Sample", + "origin": "API_DEFINITION", + "description": " Deletes a DisplayVideo360AdvertiserLink on a property.", + "canonical": true, + "file": "analytics_admin_service.delete_display_video360_advertiser_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDisplayVideo360AdvertiserLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteDisplayVideo360AdvertiserLink", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "DeleteDisplayVideo360AdvertiserLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteDisplayVideo360AdvertiserLink", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDisplayVideo360AdvertiserLink_async", + "title": "AnalyticsAdminService updateDisplayVideo360AdvertiserLink Sample", + "origin": "API_DEFINITION", + "description": " Updates a DisplayVideo360AdvertiserLink on a property.", + "canonical": true, + "file": "analytics_admin_service.update_display_video360_advertiser_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDisplayVideo360AdvertiserLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateDisplayVideo360AdvertiserLink", + "async": true, + "parameters": [ + { + "name": "display_video_360_advertiser_link", + "type": ".google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateDisplayVideo360AdvertiserLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateDisplayVideo360AdvertiserLink", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDisplayVideo360AdvertiserLinkProposal_async", + "title": "AnalyticsAdminService getDisplayVideo360AdvertiserLinkProposal Sample", + "origin": "API_DEFINITION", + "description": " Lookup for a single DisplayVideo360AdvertiserLinkProposal.", + "canonical": true, + "file": "analytics_admin_service.get_display_video360_advertiser_link_proposal.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDisplayVideo360AdvertiserLinkProposal", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetDisplayVideo360AdvertiserLinkProposal", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetDisplayVideo360AdvertiserLinkProposal", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetDisplayVideo360AdvertiserLinkProposal", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDisplayVideo360AdvertiserLinkProposals_async", + "title": "AnalyticsAdminService listDisplayVideo360AdvertiserLinkProposals Sample", + "origin": "API_DEFINITION", + "description": " Lists DisplayVideo360AdvertiserLinkProposals on a property.", + "canonical": true, + "file": "analytics_admin_service.list_display_video360_advertiser_link_proposals.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDisplayVideo360AdvertiserLinkProposals", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListDisplayVideo360AdvertiserLinkProposals", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListDisplayVideo360AdvertiserLinkProposals", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListDisplayVideo360AdvertiserLinkProposals", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDisplayVideo360AdvertiserLinkProposal_async", + "title": "AnalyticsAdminService createDisplayVideo360AdvertiserLinkProposal Sample", + "origin": "API_DEFINITION", + "description": " Creates a DisplayVideo360AdvertiserLinkProposal.", + "canonical": true, + "file": "analytics_admin_service.create_display_video360_advertiser_link_proposal.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDisplayVideo360AdvertiserLinkProposal", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateDisplayVideo360AdvertiserLinkProposal", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "display_video_360_advertiser_link_proposal", + "type": ".google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal" + } + ], + "resultType": ".google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateDisplayVideo360AdvertiserLinkProposal", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateDisplayVideo360AdvertiserLinkProposal", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDisplayVideo360AdvertiserLinkProposal_async", + "title": "AnalyticsAdminService deleteDisplayVideo360AdvertiserLinkProposal Sample", + "origin": "API_DEFINITION", + "description": " Deletes a DisplayVideo360AdvertiserLinkProposal on a property. This can only be used on cancelled proposals.", + "canonical": true, + "file": "analytics_admin_service.delete_display_video360_advertiser_link_proposal.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDisplayVideo360AdvertiserLinkProposal", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteDisplayVideo360AdvertiserLinkProposal", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "DeleteDisplayVideo360AdvertiserLinkProposal", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteDisplayVideo360AdvertiserLinkProposal", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ApproveDisplayVideo360AdvertiserLinkProposal_async", + "title": "AnalyticsAdminService approveDisplayVideo360AdvertiserLinkProposal Sample", + "origin": "API_DEFINITION", + "description": " Approves a DisplayVideo360AdvertiserLinkProposal. The DisplayVideo360AdvertiserLinkProposal will be deleted and a new DisplayVideo360AdvertiserLink will be created.", + "canonical": true, + "file": "analytics_admin_service.approve_display_video360_advertiser_link_proposal.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ApproveDisplayVideo360AdvertiserLinkProposal", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ApproveDisplayVideo360AdvertiserLinkProposal", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ApproveDisplayVideo360AdvertiserLinkProposal", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ApproveDisplayVideo360AdvertiserLinkProposal", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CancelDisplayVideo360AdvertiserLinkProposal_async", + "title": "AnalyticsAdminService cancelDisplayVideo360AdvertiserLinkProposal Sample", + "origin": "API_DEFINITION", + "description": " Cancels a DisplayVideo360AdvertiserLinkProposal. Cancelling can mean either: - Declining a proposal initiated from Display & Video 360 - Withdrawing a proposal initiated from Google Analytics After being cancelled, a proposal will eventually be deleted automatically.", + "canonical": true, + "file": "analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CancelDisplayVideo360AdvertiserLinkProposal", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CancelDisplayVideo360AdvertiserLinkProposal", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CancelDisplayVideo360AdvertiserLinkProposal", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CancelDisplayVideo360AdvertiserLinkProposal", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateCustomDimension_async", + "title": "AnalyticsAdminService createCustomDimension Sample", + "origin": "API_DEFINITION", + "description": " Creates a CustomDimension.", + "canonical": true, + "file": "analytics_admin_service.create_custom_dimension.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCustomDimension", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateCustomDimension", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "custom_dimension", + "type": ".google.analytics.admin.v1alpha.CustomDimension" + } + ], + "resultType": ".google.analytics.admin.v1alpha.CustomDimension", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateCustomDimension", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateCustomDimension", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateCustomDimension_async", + "title": "AnalyticsAdminService updateCustomDimension Sample", + "origin": "API_DEFINITION", + "description": " Updates a CustomDimension on a property.", + "canonical": true, + "file": "analytics_admin_service.update_custom_dimension.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCustomDimension", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateCustomDimension", + "async": true, + "parameters": [ + { + "name": "custom_dimension", + "type": ".google.analytics.admin.v1alpha.CustomDimension" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1alpha.CustomDimension", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateCustomDimension", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateCustomDimension", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListCustomDimensions_async", + "title": "AnalyticsAdminService listCustomDimensions Sample", + "origin": "API_DEFINITION", + "description": " Lists CustomDimensions on a property.", + "canonical": true, + "file": "analytics_admin_service.list_custom_dimensions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCustomDimensions", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListCustomDimensions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ListCustomDimensionsResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListCustomDimensions", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListCustomDimensions", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveCustomDimension_async", + "title": "AnalyticsAdminService archiveCustomDimension Sample", + "origin": "API_DEFINITION", + "description": " Archives a CustomDimension on a property.", + "canonical": true, + "file": "analytics_admin_service.archive_custom_dimension.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ArchiveCustomDimension", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ArchiveCustomDimension", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ArchiveCustomDimension", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ArchiveCustomDimension", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetCustomDimension_async", + "title": "AnalyticsAdminService getCustomDimension Sample", + "origin": "API_DEFINITION", + "description": " Lookup for a single CustomDimension.", + "canonical": true, + "file": "analytics_admin_service.get_custom_dimension.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCustomDimension", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetCustomDimension", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.CustomDimension", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetCustomDimension", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetCustomDimension", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateCustomMetric_async", + "title": "AnalyticsAdminService createCustomMetric Sample", + "origin": "API_DEFINITION", + "description": " Creates a CustomMetric.", + "canonical": true, + "file": "analytics_admin_service.create_custom_metric.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCustomMetric", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateCustomMetric", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "custom_metric", + "type": ".google.analytics.admin.v1alpha.CustomMetric" + } + ], + "resultType": ".google.analytics.admin.v1alpha.CustomMetric", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateCustomMetric", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateCustomMetric", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateCustomMetric_async", + "title": "AnalyticsAdminService updateCustomMetric Sample", + "origin": "API_DEFINITION", + "description": " Updates a CustomMetric on a property.", + "canonical": true, + "file": "analytics_admin_service.update_custom_metric.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCustomMetric", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateCustomMetric", + "async": true, + "parameters": [ + { + "name": "custom_metric", + "type": ".google.analytics.admin.v1alpha.CustomMetric" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1alpha.CustomMetric", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateCustomMetric", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateCustomMetric", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListCustomMetrics_async", + "title": "AnalyticsAdminService listCustomMetrics Sample", + "origin": "API_DEFINITION", + "description": " Lists CustomMetrics on a property.", + "canonical": true, + "file": "analytics_admin_service.list_custom_metrics.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCustomMetrics", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListCustomMetrics", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ListCustomMetricsResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListCustomMetrics", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListCustomMetrics", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveCustomMetric_async", + "title": "AnalyticsAdminService archiveCustomMetric Sample", + "origin": "API_DEFINITION", + "description": " Archives a CustomMetric on a property.", + "canonical": true, + "file": "analytics_admin_service.archive_custom_metric.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ArchiveCustomMetric", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ArchiveCustomMetric", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ArchiveCustomMetric", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ArchiveCustomMetric", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetCustomMetric_async", + "title": "AnalyticsAdminService getCustomMetric Sample", + "origin": "API_DEFINITION", + "description": " Lookup for a single CustomMetric.", + "canonical": true, + "file": "analytics_admin_service.get_custom_metric.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCustomMetric", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetCustomMetric", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.CustomMetric", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetCustomMetric", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetCustomMetric", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataRetentionSettings_async", + "title": "AnalyticsAdminService getDataRetentionSettings Sample", + "origin": "API_DEFINITION", + "description": " Returns the singleton data retention settings for this property.", + "canonical": true, + "file": "analytics_admin_service.get_data_retention_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataRetentionSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetDataRetentionSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.DataRetentionSettings", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetDataRetentionSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetDataRetentionSettings", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDataRetentionSettings_async", + "title": "AnalyticsAdminService updateDataRetentionSettings Sample", + "origin": "API_DEFINITION", + "description": " Updates the singleton data retention settings for this property.", + "canonical": true, + "file": "analytics_admin_service.update_data_retention_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDataRetentionSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateDataRetentionSettings", + "async": true, + "parameters": [ + { + "name": "data_retention_settings", + "type": ".google.analytics.admin.v1alpha.DataRetentionSettings" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1alpha.DataRetentionSettings", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateDataRetentionSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateDataRetentionSettings", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDataStream_async", + "title": "AnalyticsAdminService createDataStream Sample", + "origin": "API_DEFINITION", + "description": " Creates a DataStream.", + "canonical": true, + "file": "analytics_admin_service.create_data_stream.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDataStream", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateDataStream", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "data_stream", + "type": ".google.analytics.admin.v1alpha.DataStream" + } + ], + "resultType": ".google.analytics.admin.v1alpha.DataStream", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateDataStream", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateDataStream", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDataStream_async", + "title": "AnalyticsAdminService deleteDataStream Sample", + "origin": "API_DEFINITION", + "description": " Deletes a DataStream on a property.", + "canonical": true, + "file": "analytics_admin_service.delete_data_stream.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDataStream", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteDataStream", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "DeleteDataStream", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteDataStream", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDataStream_async", + "title": "AnalyticsAdminService updateDataStream Sample", + "origin": "API_DEFINITION", + "description": " Updates a DataStream on a property.", + "canonical": true, + "file": "analytics_admin_service.update_data_stream.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDataStream", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateDataStream", + "async": true, + "parameters": [ + { + "name": "data_stream", + "type": ".google.analytics.admin.v1alpha.DataStream" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1alpha.DataStream", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateDataStream", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateDataStream", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDataStreams_async", + "title": "AnalyticsAdminService listDataStreams Sample", + "origin": "API_DEFINITION", + "description": " Lists DataStreams on a property.", + "canonical": true, + "file": "analytics_admin_service.list_data_streams.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDataStreams", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListDataStreams", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ListDataStreamsResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListDataStreams", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListDataStreams", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataStream_async", + "title": "AnalyticsAdminService getDataStream Sample", + "origin": "API_DEFINITION", + "description": " Lookup for a single DataStream.", + "canonical": true, + "file": "analytics_admin_service.get_data_stream.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataStream", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetDataStream", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.DataStream", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetDataStream", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetDataStream", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/v1alpha/src/index.ts b/owl-bot-staging/v1alpha/src/index.ts new file mode 100644 index 0000000..793e105 --- /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 AnalyticsAdminServiceClient = v1alpha.AnalyticsAdminServiceClient; +type AnalyticsAdminServiceClient = v1alpha.AnalyticsAdminServiceClient; +export {v1alpha, AnalyticsAdminServiceClient}; +export default {v1alpha, AnalyticsAdminServiceClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_client.ts b/owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_client.ts new file mode 100644 index 0000000..30f6aea --- /dev/null +++ b/owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_client.ts @@ -0,0 +1,8074 @@ +// 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, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1alpha/analytics_admin_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './analytics_admin_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Service Interface for the Analytics Admin API (GA4). + * @class + * @memberof v1alpha + */ +export class AnalyticsAdminServiceClient { + 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}; + analyticsAdminServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AnalyticsAdminServiceClient. + * + * @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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AnalyticsAdminServiceClient; + 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 = { + accountPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}' + ), + accountSummaryPathTemplate: new this._gaxModule.PathTemplate( + 'accountSummaries/{account_summary}' + ), + accountUserLinkPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/userLinks/{user_link}' + ), + conversionEventPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/conversionEvents/{conversion_event}' + ), + customDimensionPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/customDimensions/{custom_dimension}' + ), + customMetricPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/customMetrics/{custom_metric}' + ), + dataRetentionSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/dataRetentionSettings' + ), + dataSharingSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/dataSharingSettings' + ), + dataStreamPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/dataStreams/{data_stream}' + ), + displayVideo360AdvertiserLinkPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/displayVideo360AdvertiserLinks/{display_video_360_advertiser_link}' + ), + displayVideo360AdvertiserLinkProposalPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/displayVideo360AdvertiserLinkProposals/{display_video_360_advertiser_link_proposal}' + ), + firebaseLinkPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/firebaseLinks/{firebase_link}' + ), + globalSiteTagPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/dataStreams/{data_stream}/globalSiteTag' + ), + googleAdsLinkPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/googleAdsLinks/{google_ads_link}' + ), + googleSignalsSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/googleSignalsSettings' + ), + measurementProtocolSecretPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/dataStreams/{data_stream}/measurementProtocolSecrets/{measurement_protocol_secret}' + ), + propertyPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}' + ), + propertyUserLinkPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/userLinks/{user_link}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listAccounts: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'accounts'), + listAccountSummaries: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'accountSummaries'), + listProperties: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'properties'), + listUserLinks: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'userLinks'), + auditUserLinks: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'userLinks'), + listFirebaseLinks: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'firebaseLinks'), + listGoogleAdsLinks: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'googleAdsLinks'), + listMeasurementProtocolSecrets: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'measurementProtocolSecrets'), + searchChangeHistoryEvents: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'changeHistoryEvents'), + listConversionEvents: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'conversionEvents'), + listDisplayVideo360AdvertiserLinks: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'displayVideo_360AdvertiserLinks'), + listDisplayVideo360AdvertiserLinkProposals: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'displayVideo_360AdvertiserLinkProposals'), + listCustomDimensions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'customDimensions'), + listCustomMetrics: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'customMetrics'), + listDataStreams: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dataStreams') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.analytics.admin.v1alpha.AnalyticsAdminService', 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.analyticsAdminServiceStub) { + return this.analyticsAdminServiceStub; + } + + // Put together the "service stub" for + // google.analytics.admin.v1alpha.AnalyticsAdminService. + this.analyticsAdminServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.analytics.admin.v1alpha.AnalyticsAdminService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.analytics.admin.v1alpha.AnalyticsAdminService, + 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 analyticsAdminServiceStubMethods = + ['getAccount', 'listAccounts', 'deleteAccount', 'updateAccount', 'provisionAccountTicket', 'listAccountSummaries', 'getProperty', 'listProperties', 'createProperty', 'deleteProperty', 'updateProperty', 'getUserLink', 'batchGetUserLinks', 'listUserLinks', 'auditUserLinks', 'createUserLink', 'batchCreateUserLinks', 'updateUserLink', 'batchUpdateUserLinks', 'deleteUserLink', 'batchDeleteUserLinks', 'createFirebaseLink', 'deleteFirebaseLink', 'listFirebaseLinks', 'getGlobalSiteTag', 'createGoogleAdsLink', 'updateGoogleAdsLink', 'deleteGoogleAdsLink', 'listGoogleAdsLinks', 'getDataSharingSettings', 'getMeasurementProtocolSecret', 'listMeasurementProtocolSecrets', 'createMeasurementProtocolSecret', 'deleteMeasurementProtocolSecret', 'updateMeasurementProtocolSecret', 'acknowledgeUserDataCollection', 'searchChangeHistoryEvents', 'getGoogleSignalsSettings', 'updateGoogleSignalsSettings', 'createConversionEvent', 'getConversionEvent', 'deleteConversionEvent', 'listConversionEvents', 'getDisplayVideo360AdvertiserLink', 'listDisplayVideo360AdvertiserLinks', 'createDisplayVideo360AdvertiserLink', 'deleteDisplayVideo360AdvertiserLink', 'updateDisplayVideo360AdvertiserLink', 'getDisplayVideo360AdvertiserLinkProposal', 'listDisplayVideo360AdvertiserLinkProposals', 'createDisplayVideo360AdvertiserLinkProposal', 'deleteDisplayVideo360AdvertiserLinkProposal', 'approveDisplayVideo360AdvertiserLinkProposal', 'cancelDisplayVideo360AdvertiserLinkProposal', 'createCustomDimension', 'updateCustomDimension', 'listCustomDimensions', 'archiveCustomDimension', 'getCustomDimension', 'createCustomMetric', 'updateCustomMetric', 'listCustomMetrics', 'archiveCustomMetric', 'getCustomMetric', 'getDataRetentionSettings', 'updateDataRetentionSettings', 'createDataStream', 'deleteDataStream', 'updateDataStream', 'listDataStreams', 'getDataStream']; + for (const methodName of analyticsAdminServiceStubMethods) { + const callPromise = this.analyticsAdminServiceStub.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 = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.analyticsAdminServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'analyticsadmin.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 'analyticsadmin.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.edit', + 'https://www.googleapis.com/auth/analytics.manage.users', + 'https://www.googleapis.com/auth/analytics.manage.users.readonly', + '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 -- + // ------------------- +/** + * Lookup for a single Account. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the account to lookup. + * Format: accounts/{account} + * Example: "accounts/100" + * @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 [Account]{@link google.analytics.admin.v1alpha.Account}. + * 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/analytics_admin_service.get_account.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAccount_async + */ + getAccount( + request?: protos.google.analytics.admin.v1alpha.IGetAccountRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IAccount, + protos.google.analytics.admin.v1alpha.IGetAccountRequest|undefined, {}|undefined + ]>; + getAccount( + request: protos.google.analytics.admin.v1alpha.IGetAccountRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAccount, + protos.google.analytics.admin.v1alpha.IGetAccountRequest|null|undefined, + {}|null|undefined>): void; + getAccount( + request: protos.google.analytics.admin.v1alpha.IGetAccountRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAccount, + protos.google.analytics.admin.v1alpha.IGetAccountRequest|null|undefined, + {}|null|undefined>): void; + getAccount( + request?: protos.google.analytics.admin.v1alpha.IGetAccountRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IAccount, + protos.google.analytics.admin.v1alpha.IGetAccountRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IAccount, + protos.google.analytics.admin.v1alpha.IGetAccountRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IAccount, + protos.google.analytics.admin.v1alpha.IGetAccountRequest|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.getAccount(request, options, callback); + } +/** + * Marks target Account as soft-deleted (ie: "trashed") and returns it. + * + * This API does not have a method to restore soft-deleted accounts. + * However, they can be restored using the Trash Can UI. + * + * If the accounts are not restored before the expiration time, the account + * and all child resources (eg: Properties, GoogleAdsLinks, Streams, + * UserLinks) will be permanently purged. + * https://support.google.com/analytics/answer/6154772 + * + * Returns an error if the target is not found. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Account to soft-delete. + * Format: accounts/{account} + * Example: "accounts/100" + * @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 [Empty]{@link google.protobuf.Empty}. + * 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/analytics_admin_service.delete_account.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteAccount_async + */ + deleteAccount( + request?: protos.google.analytics.admin.v1alpha.IDeleteAccountRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteAccountRequest|undefined, {}|undefined + ]>; + deleteAccount( + request: protos.google.analytics.admin.v1alpha.IDeleteAccountRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteAccountRequest|null|undefined, + {}|null|undefined>): void; + deleteAccount( + request: protos.google.analytics.admin.v1alpha.IDeleteAccountRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteAccountRequest|null|undefined, + {}|null|undefined>): void; + deleteAccount( + request?: protos.google.analytics.admin.v1alpha.IDeleteAccountRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteAccountRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteAccountRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteAccountRequest|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.deleteAccount(request, options, callback); + } +/** + * Updates an account. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.analytics.admin.v1alpha.Account} request.account + * Required. The account to update. + * The account's `name` field is used to identify the account. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to be updated. Field names must be in snake case + * (e.g., "field_to_update"). Omitted fields will not be updated. To replace + * the entire entity, use one path with the string "*" to match all fields. + * @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 [Account]{@link google.analytics.admin.v1alpha.Account}. + * 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/analytics_admin_service.update_account.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAccount_async + */ + updateAccount( + request?: protos.google.analytics.admin.v1alpha.IUpdateAccountRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IAccount, + protos.google.analytics.admin.v1alpha.IUpdateAccountRequest|undefined, {}|undefined + ]>; + updateAccount( + request: protos.google.analytics.admin.v1alpha.IUpdateAccountRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAccount, + protos.google.analytics.admin.v1alpha.IUpdateAccountRequest|null|undefined, + {}|null|undefined>): void; + updateAccount( + request: protos.google.analytics.admin.v1alpha.IUpdateAccountRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAccount, + protos.google.analytics.admin.v1alpha.IUpdateAccountRequest|null|undefined, + {}|null|undefined>): void; + updateAccount( + request?: protos.google.analytics.admin.v1alpha.IUpdateAccountRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IAccount, + protos.google.analytics.admin.v1alpha.IUpdateAccountRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IAccount, + protos.google.analytics.admin.v1alpha.IUpdateAccountRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IAccount, + protos.google.analytics.admin.v1alpha.IUpdateAccountRequest|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({ + 'account.name': request.account!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateAccount(request, options, callback); + } +/** + * Requests a ticket for creating an account. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.analytics.admin.v1alpha.Account} request.account + * The account to create. + * @param {string} request.redirectUri + * Redirect URI where the user will be sent after accepting Terms of Service. + * Must be configured in Developers Console as a Redirect URI + * @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 [ProvisionAccountTicketResponse]{@link google.analytics.admin.v1alpha.ProvisionAccountTicketResponse}. + * 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/analytics_admin_service.provision_account_ticket.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ProvisionAccountTicket_async + */ + provisionAccountTicket( + request?: protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IProvisionAccountTicketResponse, + protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest|undefined, {}|undefined + ]>; + provisionAccountTicket( + request: protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IProvisionAccountTicketResponse, + protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest|null|undefined, + {}|null|undefined>): void; + provisionAccountTicket( + request: protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IProvisionAccountTicketResponse, + protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest|null|undefined, + {}|null|undefined>): void; + provisionAccountTicket( + request?: protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IProvisionAccountTicketResponse, + protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IProvisionAccountTicketResponse, + protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IProvisionAccountTicketResponse, + protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest|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 || {}; + this.initialize(); + return this.innerApiCalls.provisionAccountTicket(request, options, callback); + } +/** + * Lookup for a single "GA4" Property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the property to lookup. + * Format: properties/{property_id} + * Example: "properties/1000" + * @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 [Property]{@link google.analytics.admin.v1alpha.Property}. + * 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/analytics_admin_service.get_property.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetProperty_async + */ + getProperty( + request?: protos.google.analytics.admin.v1alpha.IGetPropertyRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.IGetPropertyRequest|undefined, {}|undefined + ]>; + getProperty( + request: protos.google.analytics.admin.v1alpha.IGetPropertyRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.IGetPropertyRequest|null|undefined, + {}|null|undefined>): void; + getProperty( + request: protos.google.analytics.admin.v1alpha.IGetPropertyRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.IGetPropertyRequest|null|undefined, + {}|null|undefined>): void; + getProperty( + request?: protos.google.analytics.admin.v1alpha.IGetPropertyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.IGetPropertyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.IGetPropertyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.IGetPropertyRequest|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.getProperty(request, options, callback); + } +/** + * Creates an "GA4" property with the specified location and attributes. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.analytics.admin.v1alpha.Property} request.property + * Required. The property to create. + * Note: the supplied property must specify its parent. + * @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 [Property]{@link google.analytics.admin.v1alpha.Property}. + * 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/analytics_admin_service.create_property.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateProperty_async + */ + createProperty( + request?: protos.google.analytics.admin.v1alpha.ICreatePropertyRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.ICreatePropertyRequest|undefined, {}|undefined + ]>; + createProperty( + request: protos.google.analytics.admin.v1alpha.ICreatePropertyRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.ICreatePropertyRequest|null|undefined, + {}|null|undefined>): void; + createProperty( + request: protos.google.analytics.admin.v1alpha.ICreatePropertyRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.ICreatePropertyRequest|null|undefined, + {}|null|undefined>): void; + createProperty( + request?: protos.google.analytics.admin.v1alpha.ICreatePropertyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.ICreatePropertyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.ICreatePropertyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.ICreatePropertyRequest|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 || {}; + this.initialize(); + return this.innerApiCalls.createProperty(request, options, callback); + } +/** + * Marks target Property as soft-deleted (ie: "trashed") and returns it. + * + * This API does not have a method to restore soft-deleted properties. + * However, they can be restored using the Trash Can UI. + * + * If the properties are not restored before the expiration time, the Property + * and all child resources (eg: GoogleAdsLinks, Streams, UserLinks) + * will be permanently purged. + * https://support.google.com/analytics/answer/6154772 + * + * Returns an error if the target is not found, or is not an GA4 Property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Property to soft-delete. + * Format: properties/{property_id} + * Example: "properties/1000" + * @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 [Property]{@link google.analytics.admin.v1alpha.Property}. + * 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/analytics_admin_service.delete_property.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteProperty_async + */ + deleteProperty( + request?: protos.google.analytics.admin.v1alpha.IDeletePropertyRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.IDeletePropertyRequest|undefined, {}|undefined + ]>; + deleteProperty( + request: protos.google.analytics.admin.v1alpha.IDeletePropertyRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.IDeletePropertyRequest|null|undefined, + {}|null|undefined>): void; + deleteProperty( + request: protos.google.analytics.admin.v1alpha.IDeletePropertyRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.IDeletePropertyRequest|null|undefined, + {}|null|undefined>): void; + deleteProperty( + request?: protos.google.analytics.admin.v1alpha.IDeletePropertyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.IDeletePropertyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.IDeletePropertyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.IDeletePropertyRequest|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.deleteProperty(request, options, callback); + } +/** + * Updates a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.analytics.admin.v1alpha.Property} request.property + * Required. The property to update. + * The property's `name` field is used to identify the property to be + * updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to be updated. Field names must be in snake case + * (e.g., "field_to_update"). Omitted fields will not be updated. To replace + * the entire entity, use one path with the string "*" to match all fields. + * @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 [Property]{@link google.analytics.admin.v1alpha.Property}. + * 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/analytics_admin_service.update_property.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateProperty_async + */ + updateProperty( + request?: protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest|undefined, {}|undefined + ]>; + updateProperty( + request: protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest|null|undefined, + {}|null|undefined>): void; + updateProperty( + request: protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest|null|undefined, + {}|null|undefined>): void; + updateProperty( + request?: protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest|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.name': request.property!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateProperty(request, options, callback); + } +/** + * Gets information about a user's link to an account or property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Example format: accounts/1234/userLinks/5678 + * @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 [UserLink]{@link google.analytics.admin.v1alpha.UserLink}. + * 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/analytics_admin_service.get_user_link.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetUserLink_async + */ + getUserLink( + request?: protos.google.analytics.admin.v1alpha.IGetUserLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IUserLink, + protos.google.analytics.admin.v1alpha.IGetUserLinkRequest|undefined, {}|undefined + ]>; + getUserLink( + request: protos.google.analytics.admin.v1alpha.IGetUserLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IUserLink, + protos.google.analytics.admin.v1alpha.IGetUserLinkRequest|null|undefined, + {}|null|undefined>): void; + getUserLink( + request: protos.google.analytics.admin.v1alpha.IGetUserLinkRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IUserLink, + protos.google.analytics.admin.v1alpha.IGetUserLinkRequest|null|undefined, + {}|null|undefined>): void; + getUserLink( + request?: protos.google.analytics.admin.v1alpha.IGetUserLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IUserLink, + protos.google.analytics.admin.v1alpha.IGetUserLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IUserLink, + protos.google.analytics.admin.v1alpha.IGetUserLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IUserLink, + protos.google.analytics.admin.v1alpha.IGetUserLinkRequest|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.getUserLink(request, options, callback); + } +/** + * Gets information about multiple users' links to an account or property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The account or property that all user links in the request are + * for. The parent of all provided values for the 'names' field must match + * this field. + * Example format: accounts/1234 + * @param {string[]} request.names + * Required. The names of the user links to retrieve. + * A maximum of 1000 user links can be retrieved in a batch. + * Format: accounts/{accountId}/userLinks/{userLinkId} + * @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 [BatchGetUserLinksResponse]{@link google.analytics.admin.v1alpha.BatchGetUserLinksResponse}. + * 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/analytics_admin_service.batch_get_user_links.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchGetUserLinks_async + */ + batchGetUserLinks( + request?: protos.google.analytics.admin.v1alpha.IBatchGetUserLinksRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IBatchGetUserLinksResponse, + protos.google.analytics.admin.v1alpha.IBatchGetUserLinksRequest|undefined, {}|undefined + ]>; + batchGetUserLinks( + request: protos.google.analytics.admin.v1alpha.IBatchGetUserLinksRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IBatchGetUserLinksResponse, + protos.google.analytics.admin.v1alpha.IBatchGetUserLinksRequest|null|undefined, + {}|null|undefined>): void; + batchGetUserLinks( + request: protos.google.analytics.admin.v1alpha.IBatchGetUserLinksRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IBatchGetUserLinksResponse, + protos.google.analytics.admin.v1alpha.IBatchGetUserLinksRequest|null|undefined, + {}|null|undefined>): void; + batchGetUserLinks( + request?: protos.google.analytics.admin.v1alpha.IBatchGetUserLinksRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IBatchGetUserLinksResponse, + protos.google.analytics.admin.v1alpha.IBatchGetUserLinksRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IBatchGetUserLinksResponse, + protos.google.analytics.admin.v1alpha.IBatchGetUserLinksRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IBatchGetUserLinksResponse, + protos.google.analytics.admin.v1alpha.IBatchGetUserLinksRequest|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.batchGetUserLinks(request, options, callback); + } +/** + * Creates a user link on an account or property. + * + * If the user with the specified email already has permissions on the + * account or property, then the user's existing permissions will be unioned + * with the permissions specified in the new UserLink. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: accounts/1234 + * @param {boolean} [request.notifyNewUser] + * Optional. If set, then email the new user notifying them that they've been granted + * permissions to the resource. + * @param {google.analytics.admin.v1alpha.UserLink} request.userLink + * Required. The user link to create. + * @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 [UserLink]{@link google.analytics.admin.v1alpha.UserLink}. + * 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/analytics_admin_service.create_user_link.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateUserLink_async + */ + createUserLink( + request?: protos.google.analytics.admin.v1alpha.ICreateUserLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IUserLink, + protos.google.analytics.admin.v1alpha.ICreateUserLinkRequest|undefined, {}|undefined + ]>; + createUserLink( + request: protos.google.analytics.admin.v1alpha.ICreateUserLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IUserLink, + protos.google.analytics.admin.v1alpha.ICreateUserLinkRequest|null|undefined, + {}|null|undefined>): void; + createUserLink( + request: protos.google.analytics.admin.v1alpha.ICreateUserLinkRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IUserLink, + protos.google.analytics.admin.v1alpha.ICreateUserLinkRequest|null|undefined, + {}|null|undefined>): void; + createUserLink( + request?: protos.google.analytics.admin.v1alpha.ICreateUserLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IUserLink, + protos.google.analytics.admin.v1alpha.ICreateUserLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IUserLink, + protos.google.analytics.admin.v1alpha.ICreateUserLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IUserLink, + protos.google.analytics.admin.v1alpha.ICreateUserLinkRequest|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createUserLink(request, options, callback); + } +/** + * Creates information about multiple users' links to an account or property. + * + * This method is transactional. If any UserLink cannot be created, none of + * the UserLinks will be created. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The account or property that all user links in the request are for. + * This field is required. The parent field in the CreateUserLinkRequest + * messages must either be empty or match this field. + * Example format: accounts/1234 + * @param {boolean} [request.notifyNewUsers] + * Optional. If set, then email the new users notifying them that they've been granted + * permissions to the resource. Regardless of whether this is set or not, + * notify_new_user field inside each individual request is ignored. + * @param {number[]} request.requests + * Required. The requests specifying the user links to create. + * A maximum of 1000 user links can be created in a batch. + * @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 [BatchCreateUserLinksResponse]{@link google.analytics.admin.v1alpha.BatchCreateUserLinksResponse}. + * 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/analytics_admin_service.batch_create_user_links.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchCreateUserLinks_async + */ + batchCreateUserLinks( + request?: protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksResponse, + protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksRequest|undefined, {}|undefined + ]>; + batchCreateUserLinks( + request: protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksResponse, + protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksRequest|null|undefined, + {}|null|undefined>): void; + batchCreateUserLinks( + request: protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksResponse, + protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksRequest|null|undefined, + {}|null|undefined>): void; + batchCreateUserLinks( + request?: protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksResponse, + protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksResponse, + protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksResponse, + protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksRequest|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.batchCreateUserLinks(request, options, callback); + } +/** + * Updates a user link on an account or property. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.analytics.admin.v1alpha.UserLink} request.userLink + * Required. The user link to update. + * @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 [UserLink]{@link google.analytics.admin.v1alpha.UserLink}. + * 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/analytics_admin_service.update_user_link.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateUserLink_async + */ + updateUserLink( + request?: protos.google.analytics.admin.v1alpha.IUpdateUserLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IUserLink, + protos.google.analytics.admin.v1alpha.IUpdateUserLinkRequest|undefined, {}|undefined + ]>; + updateUserLink( + request: protos.google.analytics.admin.v1alpha.IUpdateUserLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IUserLink, + protos.google.analytics.admin.v1alpha.IUpdateUserLinkRequest|null|undefined, + {}|null|undefined>): void; + updateUserLink( + request: protos.google.analytics.admin.v1alpha.IUpdateUserLinkRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IUserLink, + protos.google.analytics.admin.v1alpha.IUpdateUserLinkRequest|null|undefined, + {}|null|undefined>): void; + updateUserLink( + request?: protos.google.analytics.admin.v1alpha.IUpdateUserLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IUserLink, + protos.google.analytics.admin.v1alpha.IUpdateUserLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IUserLink, + protos.google.analytics.admin.v1alpha.IUpdateUserLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IUserLink, + protos.google.analytics.admin.v1alpha.IUpdateUserLinkRequest|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({ + 'user_link.name': request.userLink!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateUserLink(request, options, callback); + } +/** + * Updates information about multiple users' links to an account or property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The account or property that all user links in the request are + * for. The parent field in the UpdateUserLinkRequest messages must either be + * empty or match this field. + * Example format: accounts/1234 + * @param {number[]} request.requests + * Required. The requests specifying the user links to update. + * A maximum of 1000 user links can be updated in a batch. + * @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 [BatchUpdateUserLinksResponse]{@link google.analytics.admin.v1alpha.BatchUpdateUserLinksResponse}. + * 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/analytics_admin_service.batch_update_user_links.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchUpdateUserLinks_async + */ + batchUpdateUserLinks( + request?: protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksResponse, + protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksRequest|undefined, {}|undefined + ]>; + batchUpdateUserLinks( + request: protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksResponse, + protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksRequest|null|undefined, + {}|null|undefined>): void; + batchUpdateUserLinks( + request: protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksResponse, + protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksRequest|null|undefined, + {}|null|undefined>): void; + batchUpdateUserLinks( + request?: protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksResponse, + protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksResponse, + protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksResponse, + protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksRequest|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.batchUpdateUserLinks(request, options, callback); + } +/** + * Deletes a user link on an account or property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Example format: accounts/1234/userLinks/5678 + * @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 [Empty]{@link google.protobuf.Empty}. + * 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/analytics_admin_service.delete_user_link.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteUserLink_async + */ + deleteUserLink( + request?: protos.google.analytics.admin.v1alpha.IDeleteUserLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteUserLinkRequest|undefined, {}|undefined + ]>; + deleteUserLink( + request: protos.google.analytics.admin.v1alpha.IDeleteUserLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteUserLinkRequest|null|undefined, + {}|null|undefined>): void; + deleteUserLink( + request: protos.google.analytics.admin.v1alpha.IDeleteUserLinkRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteUserLinkRequest|null|undefined, + {}|null|undefined>): void; + deleteUserLink( + request?: protos.google.analytics.admin.v1alpha.IDeleteUserLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteUserLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteUserLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteUserLinkRequest|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.deleteUserLink(request, options, callback); + } +/** + * Deletes information about multiple users' links to an account or property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The account or property that all user links in the request are + * for. The parent of all values for user link names to delete must match this + * field. + * Example format: accounts/1234 + * @param {number[]} request.requests + * Required. The requests specifying the user links to update. + * A maximum of 1000 user links can be updated in a batch. + * @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 [Empty]{@link google.protobuf.Empty}. + * 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/analytics_admin_service.batch_delete_user_links.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchDeleteUserLinks_async + */ + batchDeleteUserLinks( + request?: protos.google.analytics.admin.v1alpha.IBatchDeleteUserLinksRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IBatchDeleteUserLinksRequest|undefined, {}|undefined + ]>; + batchDeleteUserLinks( + request: protos.google.analytics.admin.v1alpha.IBatchDeleteUserLinksRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IBatchDeleteUserLinksRequest|null|undefined, + {}|null|undefined>): void; + batchDeleteUserLinks( + request: protos.google.analytics.admin.v1alpha.IBatchDeleteUserLinksRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IBatchDeleteUserLinksRequest|null|undefined, + {}|null|undefined>): void; + batchDeleteUserLinks( + request?: protos.google.analytics.admin.v1alpha.IBatchDeleteUserLinksRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IBatchDeleteUserLinksRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IBatchDeleteUserLinksRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IBatchDeleteUserLinksRequest|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.batchDeleteUserLinks(request, options, callback); + } +/** + * Creates a FirebaseLink. + * + * Properties can have at most one FirebaseLink. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Format: properties/{property_id} + * Example: properties/1234 + * @param {google.analytics.admin.v1alpha.FirebaseLink} request.firebaseLink + * Required. The Firebase link to create. + * @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 [FirebaseLink]{@link google.analytics.admin.v1alpha.FirebaseLink}. + * 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/analytics_admin_service.create_firebase_link.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateFirebaseLink_async + */ + createFirebaseLink( + request?: protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IFirebaseLink, + protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest|undefined, {}|undefined + ]>; + createFirebaseLink( + request: protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IFirebaseLink, + protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest|null|undefined, + {}|null|undefined>): void; + createFirebaseLink( + request: protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IFirebaseLink, + protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest|null|undefined, + {}|null|undefined>): void; + createFirebaseLink( + request?: protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IFirebaseLink, + protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IFirebaseLink, + protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IFirebaseLink, + protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createFirebaseLink(request, options, callback); + } +/** + * Deletes a FirebaseLink on a property + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Format: properties/{property_id}/firebaseLinks/{firebase_link_id} + * Example: properties/1234/firebaseLinks/5678 + * @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 [Empty]{@link google.protobuf.Empty}. + * 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/analytics_admin_service.delete_firebase_link.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteFirebaseLink_async + */ + deleteFirebaseLink( + request?: protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest|undefined, {}|undefined + ]>; + deleteFirebaseLink( + request: protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest|null|undefined, + {}|null|undefined>): void; + deleteFirebaseLink( + request: protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest|null|undefined, + {}|null|undefined>): void; + deleteFirebaseLink( + request?: protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest|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.deleteFirebaseLink(request, options, callback); + } +/** + * Returns the Site Tag for the specified web stream. + * Site Tags are immutable singletons. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the site tag to lookup. + * Note that site tags are singletons and do not have unique IDs. + * Format: properties/{property_id}/dataStreams/{stream_id}/globalSiteTag + * Example: "properties/123/dataStreams/456/globalSiteTag" + * @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 [GlobalSiteTag]{@link google.analytics.admin.v1alpha.GlobalSiteTag}. + * 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/analytics_admin_service.get_global_site_tag.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetGlobalSiteTag_async + */ + getGlobalSiteTag( + request?: protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IGlobalSiteTag, + protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest|undefined, {}|undefined + ]>; + getGlobalSiteTag( + request: protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IGlobalSiteTag, + protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest|null|undefined, + {}|null|undefined>): void; + getGlobalSiteTag( + request: protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IGlobalSiteTag, + protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest|null|undefined, + {}|null|undefined>): void; + getGlobalSiteTag( + request?: protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IGlobalSiteTag, + protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IGlobalSiteTag, + protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IGlobalSiteTag, + protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest|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.getGlobalSiteTag(request, options, callback); + } +/** + * Creates a GoogleAdsLink. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {google.analytics.admin.v1alpha.GoogleAdsLink} request.googleAdsLink + * Required. The GoogleAdsLink to create. + * @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 [GoogleAdsLink]{@link google.analytics.admin.v1alpha.GoogleAdsLink}. + * 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/analytics_admin_service.create_google_ads_link.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateGoogleAdsLink_async + */ + createGoogleAdsLink( + request?: protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IGoogleAdsLink, + protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest|undefined, {}|undefined + ]>; + createGoogleAdsLink( + request: protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IGoogleAdsLink, + protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>): void; + createGoogleAdsLink( + request: protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IGoogleAdsLink, + protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>): void; + createGoogleAdsLink( + request?: protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IGoogleAdsLink, + protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IGoogleAdsLink, + protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IGoogleAdsLink, + protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createGoogleAdsLink(request, options, callback); + } +/** + * Updates a GoogleAdsLink on a property + * + * @param {Object} request + * The request object that will be sent. + * @param {google.analytics.admin.v1alpha.GoogleAdsLink} request.googleAdsLink + * The GoogleAdsLink to update + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to be updated. Field names must be in snake case + * (e.g., "field_to_update"). Omitted fields will not be updated. To replace + * the entire entity, use one path with the string "*" to match all fields. + * @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 [GoogleAdsLink]{@link google.analytics.admin.v1alpha.GoogleAdsLink}. + * 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/analytics_admin_service.update_google_ads_link.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateGoogleAdsLink_async + */ + updateGoogleAdsLink( + request?: protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IGoogleAdsLink, + protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest|undefined, {}|undefined + ]>; + updateGoogleAdsLink( + request: protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IGoogleAdsLink, + protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>): void; + updateGoogleAdsLink( + request: protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IGoogleAdsLink, + protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>): void; + updateGoogleAdsLink( + request?: protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IGoogleAdsLink, + protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IGoogleAdsLink, + protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IGoogleAdsLink, + protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest|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({ + 'google_ads_link.name': request.googleAdsLink!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateGoogleAdsLink(request, options, callback); + } +/** + * Deletes a GoogleAdsLink on a property + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Example format: properties/1234/googleAdsLinks/5678 + * @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 [Empty]{@link google.protobuf.Empty}. + * 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/analytics_admin_service.delete_google_ads_link.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteGoogleAdsLink_async + */ + deleteGoogleAdsLink( + request?: protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest|undefined, {}|undefined + ]>; + deleteGoogleAdsLink( + request: protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>): void; + deleteGoogleAdsLink( + request: protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>): void; + deleteGoogleAdsLink( + request?: protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest|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.deleteGoogleAdsLink(request, options, callback); + } +/** + * Get data sharing settings on an account. + * Data sharing settings are singletons. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the settings to lookup. + * Format: accounts/{account}/dataSharingSettings + * Example: "accounts/1000/dataSharingSettings" + * @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 [DataSharingSettings]{@link google.analytics.admin.v1alpha.DataSharingSettings}. + * 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/analytics_admin_service.get_data_sharing_settings.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataSharingSettings_async + */ + getDataSharingSettings( + request?: protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IDataSharingSettings, + protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest|undefined, {}|undefined + ]>; + getDataSharingSettings( + request: protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDataSharingSettings, + protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest|null|undefined, + {}|null|undefined>): void; + getDataSharingSettings( + request: protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDataSharingSettings, + protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest|null|undefined, + {}|null|undefined>): void; + getDataSharingSettings( + request?: protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IDataSharingSettings, + protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IDataSharingSettings, + protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IDataSharingSettings, + protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest|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.getDataSharingSettings(request, options, callback); + } +/** + * Lookup for a single "GA4" MeasurementProtocolSecret. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the measurement protocol secret to lookup. + * Format: + * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret} + * @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 [MeasurementProtocolSecret]{@link google.analytics.admin.v1alpha.MeasurementProtocolSecret}. + * 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/analytics_admin_service.get_measurement_protocol_secret.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetMeasurementProtocolSecret_async + */ + getMeasurementProtocolSecret( + request?: protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest|undefined, {}|undefined + ]>; + getMeasurementProtocolSecret( + request: protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): void; + getMeasurementProtocolSecret( + request: protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): void; + getMeasurementProtocolSecret( + request?: protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest|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.getMeasurementProtocolSecret(request, options, callback); + } +/** + * Creates a measurement protocol secret. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this secret will be created. + * Format: properties/{property}/dataStreams/{dataStream} + * @param {google.analytics.admin.v1alpha.MeasurementProtocolSecret} request.measurementProtocolSecret + * Required. The measurement protocol secret to create. + * @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 [MeasurementProtocolSecret]{@link google.analytics.admin.v1alpha.MeasurementProtocolSecret}. + * 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/analytics_admin_service.create_measurement_protocol_secret.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateMeasurementProtocolSecret_async + */ + createMeasurementProtocolSecret( + request?: protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest|undefined, {}|undefined + ]>; + createMeasurementProtocolSecret( + request: protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): void; + createMeasurementProtocolSecret( + request: protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): void; + createMeasurementProtocolSecret( + request?: protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createMeasurementProtocolSecret(request, options, callback); + } +/** + * Deletes target MeasurementProtocolSecret. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the MeasurementProtocolSecret to delete. + * Format: + * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret} + * @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 [Empty]{@link google.protobuf.Empty}. + * 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/analytics_admin_service.delete_measurement_protocol_secret.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteMeasurementProtocolSecret_async + */ + deleteMeasurementProtocolSecret( + request?: protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest|undefined, {}|undefined + ]>; + deleteMeasurementProtocolSecret( + request: protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): void; + deleteMeasurementProtocolSecret( + request: protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): void; + deleteMeasurementProtocolSecret( + request?: protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest|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.deleteMeasurementProtocolSecret(request, options, callback); + } +/** + * Updates a measurement protocol secret. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.analytics.admin.v1alpha.MeasurementProtocolSecret} request.measurementProtocolSecret + * Required. The measurement protocol secret to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. Omitted fields will not be updated. + * @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 [MeasurementProtocolSecret]{@link google.analytics.admin.v1alpha.MeasurementProtocolSecret}. + * 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/analytics_admin_service.update_measurement_protocol_secret.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateMeasurementProtocolSecret_async + */ + updateMeasurementProtocolSecret( + request?: protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest|undefined, {}|undefined + ]>; + updateMeasurementProtocolSecret( + request: protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): void; + updateMeasurementProtocolSecret( + request: protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): void; + updateMeasurementProtocolSecret( + request?: protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest|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({ + 'measurement_protocol_secret.name': request.measurementProtocolSecret!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateMeasurementProtocolSecret(request, options, callback); + } +/** + * Acknowledges the terms of user data collection for the specified property. + * + * This acknowledgement must be completed (either in the Google Analytics UI + * or via this API) before MeasurementProtocolSecret resources may be created. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.property + * Required. The property for which to acknowledge user data collection. + * @param {string} request.acknowledgement + * Required. An acknowledgement that the caller of this method understands the terms + * of user data collection. + * + * This field must contain the exact value: + * "I acknowledge that I have the necessary privacy disclosures and rights + * from my end users for the collection and processing of their data, + * including the association of such data with the visitation information + * Google Analytics collects from my site and/or app property." + * @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 [AcknowledgeUserDataCollectionResponse]{@link google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionResponse}. + * 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/analytics_admin_service.acknowledge_user_data_collection.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_AcknowledgeUserDataCollection_async + */ + acknowledgeUserDataCollection( + request?: protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionResponse, + protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest|undefined, {}|undefined + ]>; + acknowledgeUserDataCollection( + request: protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionResponse, + protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest|null|undefined, + {}|null|undefined>): void; + acknowledgeUserDataCollection( + request: protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionResponse, + protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest|null|undefined, + {}|null|undefined>): void; + acknowledgeUserDataCollection( + request?: protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionResponse, + protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionResponse, + protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionResponse, + protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest|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.acknowledgeUserDataCollection(request, options, callback); + } +/** + * Lookup for Google Signals settings for a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the google signals settings to retrieve. + * Format: properties/{property}/googleSignalsSettings + * @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 [GoogleSignalsSettings]{@link google.analytics.admin.v1alpha.GoogleSignalsSettings}. + * 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/analytics_admin_service.get_google_signals_settings.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetGoogleSignalsSettings_async + */ + getGoogleSignalsSettings( + request?: protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, + protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest|undefined, {}|undefined + ]>; + getGoogleSignalsSettings( + request: protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, + protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest|null|undefined, + {}|null|undefined>): void; + getGoogleSignalsSettings( + request: protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, + protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest|null|undefined, + {}|null|undefined>): void; + getGoogleSignalsSettings( + request?: protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, + protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, + protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, + protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest|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.getGoogleSignalsSettings(request, options, callback); + } +/** + * Updates Google Signals settings for a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.analytics.admin.v1alpha.GoogleSignalsSettings} request.googleSignalsSettings + * Required. The settings to update. + * The `name` field is used to identify the settings to be updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to be updated. Field names must be in snake case + * (e.g., "field_to_update"). Omitted fields will not be updated. To replace + * the entire entity, use one path with the string "*" to match all fields. + * @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 [GoogleSignalsSettings]{@link google.analytics.admin.v1alpha.GoogleSignalsSettings}. + * 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/analytics_admin_service.update_google_signals_settings.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateGoogleSignalsSettings_async + */ + updateGoogleSignalsSettings( + request?: protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, + protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest|undefined, {}|undefined + ]>; + updateGoogleSignalsSettings( + request: protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, + protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest|null|undefined, + {}|null|undefined>): void; + updateGoogleSignalsSettings( + request: protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, + protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest|null|undefined, + {}|null|undefined>): void; + updateGoogleSignalsSettings( + request?: protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, + protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, + protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, + protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest|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({ + 'google_signals_settings.name': request.googleSignalsSettings!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateGoogleSignalsSettings(request, options, callback); + } +/** + * Creates a conversion event with the specified attributes. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.analytics.admin.v1alpha.ConversionEvent} request.conversionEvent + * Required. The conversion event to create. + * @param {string} request.parent + * Required. The resource name of the parent property where this conversion event will + * be created. Format: properties/123 + * @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 [ConversionEvent]{@link google.analytics.admin.v1alpha.ConversionEvent}. + * 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/analytics_admin_service.create_conversion_event.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateConversionEvent_async + */ + createConversionEvent( + request?: protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IConversionEvent, + protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest|undefined, {}|undefined + ]>; + createConversionEvent( + request: protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IConversionEvent, + protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest|null|undefined, + {}|null|undefined>): void; + createConversionEvent( + request: protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IConversionEvent, + protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest|null|undefined, + {}|null|undefined>): void; + createConversionEvent( + request?: protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IConversionEvent, + protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IConversionEvent, + protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IConversionEvent, + protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createConversionEvent(request, options, callback); + } +/** + * Retrieve a single conversion event. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the conversion event to retrieve. + * Format: properties/{property}/conversionEvents/{conversion_event} + * Example: "properties/123/conversionEvents/456" + * @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 [ConversionEvent]{@link google.analytics.admin.v1alpha.ConversionEvent}. + * 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/analytics_admin_service.get_conversion_event.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetConversionEvent_async + */ + getConversionEvent( + request?: protos.google.analytics.admin.v1alpha.IGetConversionEventRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IConversionEvent, + protos.google.analytics.admin.v1alpha.IGetConversionEventRequest|undefined, {}|undefined + ]>; + getConversionEvent( + request: protos.google.analytics.admin.v1alpha.IGetConversionEventRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IConversionEvent, + protos.google.analytics.admin.v1alpha.IGetConversionEventRequest|null|undefined, + {}|null|undefined>): void; + getConversionEvent( + request: protos.google.analytics.admin.v1alpha.IGetConversionEventRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IConversionEvent, + protos.google.analytics.admin.v1alpha.IGetConversionEventRequest|null|undefined, + {}|null|undefined>): void; + getConversionEvent( + request?: protos.google.analytics.admin.v1alpha.IGetConversionEventRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IConversionEvent, + protos.google.analytics.admin.v1alpha.IGetConversionEventRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IConversionEvent, + protos.google.analytics.admin.v1alpha.IGetConversionEventRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IConversionEvent, + protos.google.analytics.admin.v1alpha.IGetConversionEventRequest|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.getConversionEvent(request, options, callback); + } +/** + * Deletes a conversion event in a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the conversion event to delete. + * Format: properties/{property}/conversionEvents/{conversion_event} + * Example: "properties/123/conversionEvents/456" + * @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 [Empty]{@link google.protobuf.Empty}. + * 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/analytics_admin_service.delete_conversion_event.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteConversionEvent_async + */ + deleteConversionEvent( + request?: protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest|undefined, {}|undefined + ]>; + deleteConversionEvent( + request: protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest|null|undefined, + {}|null|undefined>): void; + deleteConversionEvent( + request: protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest|null|undefined, + {}|null|undefined>): void; + deleteConversionEvent( + request?: protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest|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.deleteConversionEvent(request, options, callback); + } +/** + * Look up a single DisplayVideo360AdvertiserLink + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the DisplayVideo360AdvertiserLink to get. + * Example format: properties/1234/displayVideo360AdvertiserLink/5678 + * @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 [DisplayVideo360AdvertiserLink]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink}. + * 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/analytics_admin_service.get_display_video360_advertiser_link.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDisplayVideo360AdvertiserLink_async + */ + getDisplayVideo360AdvertiserLink( + request?: protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest|undefined, {}|undefined + ]>; + getDisplayVideo360AdvertiserLink( + request: protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest|null|undefined, + {}|null|undefined>): void; + getDisplayVideo360AdvertiserLink( + request: protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest|null|undefined, + {}|null|undefined>): void; + getDisplayVideo360AdvertiserLink( + request?: protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest|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.getDisplayVideo360AdvertiserLink(request, options, callback); + } +/** + * Creates a DisplayVideo360AdvertiserLink. + * This can only be utilized by users who have proper authorization both on + * the Google Analytics property and on the Display & Video 360 advertiser. + * Users who do not have access to the Display & Video 360 advertiser should + * instead seek to create a DisplayVideo360LinkProposal. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink} request.displayVideo_360AdvertiserLink + * Required. The DisplayVideo360AdvertiserLink to create. + * @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 [DisplayVideo360AdvertiserLink]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink}. + * 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/analytics_admin_service.create_display_video360_advertiser_link.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDisplayVideo360AdvertiserLink_async + */ + createDisplayVideo360AdvertiserLink( + request?: protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest|undefined, {}|undefined + ]>; + createDisplayVideo360AdvertiserLink( + request: protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest|null|undefined, + {}|null|undefined>): void; + createDisplayVideo360AdvertiserLink( + request: protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest|null|undefined, + {}|null|undefined>): void; + createDisplayVideo360AdvertiserLink( + request?: protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createDisplayVideo360AdvertiserLink(request, options, callback); + } +/** + * Deletes a DisplayVideo360AdvertiserLink on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the DisplayVideo360AdvertiserLink to delete. + * Example format: properties/1234/displayVideo360AdvertiserLinks/5678 + * @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 [Empty]{@link google.protobuf.Empty}. + * 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/analytics_admin_service.delete_display_video360_advertiser_link.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDisplayVideo360AdvertiserLink_async + */ + deleteDisplayVideo360AdvertiserLink( + request?: protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest|undefined, {}|undefined + ]>; + deleteDisplayVideo360AdvertiserLink( + request: protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest|null|undefined, + {}|null|undefined>): void; + deleteDisplayVideo360AdvertiserLink( + request: protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest|null|undefined, + {}|null|undefined>): void; + deleteDisplayVideo360AdvertiserLink( + request?: protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest|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.deleteDisplayVideo360AdvertiserLink(request, options, callback); + } +/** + * Updates a DisplayVideo360AdvertiserLink on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink} request.displayVideo_360AdvertiserLink + * The DisplayVideo360AdvertiserLink to update + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to be updated. Omitted fields will not be updated. + * To replace the entire entity, use one path with the string "*" to match + * all fields. + * @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 [DisplayVideo360AdvertiserLink]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink}. + * 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/analytics_admin_service.update_display_video360_advertiser_link.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDisplayVideo360AdvertiserLink_async + */ + updateDisplayVideo360AdvertiserLink( + request?: protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest|undefined, {}|undefined + ]>; + updateDisplayVideo360AdvertiserLink( + request: protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest|null|undefined, + {}|null|undefined>): void; + updateDisplayVideo360AdvertiserLink( + request: protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest|null|undefined, + {}|null|undefined>): void; + updateDisplayVideo360AdvertiserLink( + request?: protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest|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({ + 'display_video_360_advertiser_link.name': request.displayVideo_360AdvertiserLink!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateDisplayVideo360AdvertiserLink(request, options, callback); + } +/** + * Lookup for a single DisplayVideo360AdvertiserLinkProposal. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the DisplayVideo360AdvertiserLinkProposal to get. + * Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 + * @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 [DisplayVideo360AdvertiserLinkProposal]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal}. + * 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/analytics_admin_service.get_display_video360_advertiser_link_proposal.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDisplayVideo360AdvertiserLinkProposal_async + */ + getDisplayVideo360AdvertiserLinkProposal( + request?: protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest|undefined, {}|undefined + ]>; + getDisplayVideo360AdvertiserLinkProposal( + request: protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, + {}|null|undefined>): void; + getDisplayVideo360AdvertiserLinkProposal( + request: protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, + {}|null|undefined>): void; + getDisplayVideo360AdvertiserLinkProposal( + request?: protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest|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.getDisplayVideo360AdvertiserLinkProposal(request, options, callback); + } +/** + * Creates a DisplayVideo360AdvertiserLinkProposal. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal} request.displayVideo_360AdvertiserLinkProposal + * Required. The DisplayVideo360AdvertiserLinkProposal to create. + * @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 [DisplayVideo360AdvertiserLinkProposal]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal}. + * 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/analytics_admin_service.create_display_video360_advertiser_link_proposal.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDisplayVideo360AdvertiserLinkProposal_async + */ + createDisplayVideo360AdvertiserLinkProposal( + request?: protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest|undefined, {}|undefined + ]>; + createDisplayVideo360AdvertiserLinkProposal( + request: protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, + {}|null|undefined>): void; + createDisplayVideo360AdvertiserLinkProposal( + request: protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, + {}|null|undefined>): void; + createDisplayVideo360AdvertiserLinkProposal( + request?: protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal(request, options, callback); + } +/** + * Deletes a DisplayVideo360AdvertiserLinkProposal on a property. + * This can only be used on cancelled proposals. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the DisplayVideo360AdvertiserLinkProposal to delete. + * Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 + * @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 [Empty]{@link google.protobuf.Empty}. + * 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/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDisplayVideo360AdvertiserLinkProposal_async + */ + deleteDisplayVideo360AdvertiserLinkProposal( + request?: protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest|undefined, {}|undefined + ]>; + deleteDisplayVideo360AdvertiserLinkProposal( + request: protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, + {}|null|undefined>): void; + deleteDisplayVideo360AdvertiserLinkProposal( + request: protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, + {}|null|undefined>): void; + deleteDisplayVideo360AdvertiserLinkProposal( + request?: protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest|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.deleteDisplayVideo360AdvertiserLinkProposal(request, options, callback); + } +/** + * Approves a DisplayVideo360AdvertiserLinkProposal. + * The DisplayVideo360AdvertiserLinkProposal will be deleted and a new + * DisplayVideo360AdvertiserLink will be created. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the DisplayVideo360AdvertiserLinkProposal to approve. + * Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 + * @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 [ApproveDisplayVideo360AdvertiserLinkProposalResponse]{@link google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalResponse}. + * 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/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ApproveDisplayVideo360AdvertiserLinkProposal_async + */ + approveDisplayVideo360AdvertiserLinkProposal( + request?: protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalResponse, + protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest|undefined, {}|undefined + ]>; + approveDisplayVideo360AdvertiserLinkProposal( + request: protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalResponse, + protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, + {}|null|undefined>): void; + approveDisplayVideo360AdvertiserLinkProposal( + request: protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalResponse, + protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, + {}|null|undefined>): void; + approveDisplayVideo360AdvertiserLinkProposal( + request?: protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalResponse, + protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalResponse, + protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalResponse, + protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest|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.approveDisplayVideo360AdvertiserLinkProposal(request, options, callback); + } +/** + * Cancels a DisplayVideo360AdvertiserLinkProposal. + * Cancelling can mean either: + * - Declining a proposal initiated from Display & Video 360 + * - Withdrawing a proposal initiated from Google Analytics + * After being cancelled, a proposal will eventually be deleted automatically. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the DisplayVideo360AdvertiserLinkProposal to cancel. + * Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 + * @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 [DisplayVideo360AdvertiserLinkProposal]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal}. + * 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/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CancelDisplayVideo360AdvertiserLinkProposal_async + */ + cancelDisplayVideo360AdvertiserLinkProposal( + request?: protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest|undefined, {}|undefined + ]>; + cancelDisplayVideo360AdvertiserLinkProposal( + request: protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, + {}|null|undefined>): void; + cancelDisplayVideo360AdvertiserLinkProposal( + request: protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, + {}|null|undefined>): void; + cancelDisplayVideo360AdvertiserLinkProposal( + request?: protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest|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.cancelDisplayVideo360AdvertiserLinkProposal(request, options, callback); + } +/** + * Creates a CustomDimension. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {google.analytics.admin.v1alpha.CustomDimension} request.customDimension + * Required. The CustomDimension to create. + * @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 [CustomDimension]{@link google.analytics.admin.v1alpha.CustomDimension}. + * 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/analytics_admin_service.create_custom_dimension.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateCustomDimension_async + */ + createCustomDimension( + request?: protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.ICustomDimension, + protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest|undefined, {}|undefined + ]>; + createCustomDimension( + request: protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.ICustomDimension, + protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest|null|undefined, + {}|null|undefined>): void; + createCustomDimension( + request: protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.ICustomDimension, + protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest|null|undefined, + {}|null|undefined>): void; + createCustomDimension( + request?: protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.ICustomDimension, + protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.ICustomDimension, + protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.ICustomDimension, + protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createCustomDimension(request, options, callback); + } +/** + * Updates a CustomDimension on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.analytics.admin.v1alpha.CustomDimension} request.customDimension + * The CustomDimension to update + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to be updated. Omitted fields will not be updated. + * To replace the entire entity, use one path with the string "*" to match + * all fields. + * @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 [CustomDimension]{@link google.analytics.admin.v1alpha.CustomDimension}. + * 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/analytics_admin_service.update_custom_dimension.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateCustomDimension_async + */ + updateCustomDimension( + request?: protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.ICustomDimension, + protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest|undefined, {}|undefined + ]>; + updateCustomDimension( + request: protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.ICustomDimension, + protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest|null|undefined, + {}|null|undefined>): void; + updateCustomDimension( + request: protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.ICustomDimension, + protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest|null|undefined, + {}|null|undefined>): void; + updateCustomDimension( + request?: protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.ICustomDimension, + protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.ICustomDimension, + protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.ICustomDimension, + protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest|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({ + 'custom_dimension.name': request.customDimension!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateCustomDimension(request, options, callback); + } +/** + * Archives a CustomDimension on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the CustomDimension to archive. + * Example format: properties/1234/customDimensions/5678 + * @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 [Empty]{@link google.protobuf.Empty}. + * 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/analytics_admin_service.archive_custom_dimension.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveCustomDimension_async + */ + archiveCustomDimension( + request?: protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest|undefined, {}|undefined + ]>; + archiveCustomDimension( + request: protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest|null|undefined, + {}|null|undefined>): void; + archiveCustomDimension( + request: protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest|null|undefined, + {}|null|undefined>): void; + archiveCustomDimension( + request?: protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest|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.archiveCustomDimension(request, options, callback); + } +/** + * Lookup for a single CustomDimension. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the CustomDimension to get. + * Example format: properties/1234/customDimensions/5678 + * @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 [CustomDimension]{@link google.analytics.admin.v1alpha.CustomDimension}. + * 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/analytics_admin_service.get_custom_dimension.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetCustomDimension_async + */ + getCustomDimension( + request?: protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.ICustomDimension, + protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest|undefined, {}|undefined + ]>; + getCustomDimension( + request: protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.ICustomDimension, + protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest|null|undefined, + {}|null|undefined>): void; + getCustomDimension( + request: protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.ICustomDimension, + protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest|null|undefined, + {}|null|undefined>): void; + getCustomDimension( + request?: protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.ICustomDimension, + protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.ICustomDimension, + protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.ICustomDimension, + protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest|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.getCustomDimension(request, options, callback); + } +/** + * Creates a CustomMetric. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {google.analytics.admin.v1alpha.CustomMetric} request.customMetric + * Required. The CustomMetric to create. + * @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 [CustomMetric]{@link google.analytics.admin.v1alpha.CustomMetric}. + * 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/analytics_admin_service.create_custom_metric.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateCustomMetric_async + */ + createCustomMetric( + request?: protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.ICustomMetric, + protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest|undefined, {}|undefined + ]>; + createCustomMetric( + request: protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.ICustomMetric, + protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest|null|undefined, + {}|null|undefined>): void; + createCustomMetric( + request: protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.ICustomMetric, + protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest|null|undefined, + {}|null|undefined>): void; + createCustomMetric( + request?: protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.ICustomMetric, + protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.ICustomMetric, + protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.ICustomMetric, + protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createCustomMetric(request, options, callback); + } +/** + * Updates a CustomMetric on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.analytics.admin.v1alpha.CustomMetric} request.customMetric + * The CustomMetric to update + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to be updated. Omitted fields will not be updated. + * To replace the entire entity, use one path with the string "*" to match + * all fields. + * @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 [CustomMetric]{@link google.analytics.admin.v1alpha.CustomMetric}. + * 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/analytics_admin_service.update_custom_metric.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateCustomMetric_async + */ + updateCustomMetric( + request?: protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.ICustomMetric, + protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest|undefined, {}|undefined + ]>; + updateCustomMetric( + request: protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.ICustomMetric, + protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest|null|undefined, + {}|null|undefined>): void; + updateCustomMetric( + request: protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.ICustomMetric, + protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest|null|undefined, + {}|null|undefined>): void; + updateCustomMetric( + request?: protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.ICustomMetric, + protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.ICustomMetric, + protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.ICustomMetric, + protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest|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({ + 'custom_metric.name': request.customMetric!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateCustomMetric(request, options, callback); + } +/** + * Archives a CustomMetric on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the CustomMetric to archive. + * Example format: properties/1234/customMetrics/5678 + * @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 [Empty]{@link google.protobuf.Empty}. + * 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/analytics_admin_service.archive_custom_metric.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveCustomMetric_async + */ + archiveCustomMetric( + request?: protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest|undefined, {}|undefined + ]>; + archiveCustomMetric( + request: protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest|null|undefined, + {}|null|undefined>): void; + archiveCustomMetric( + request: protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest|null|undefined, + {}|null|undefined>): void; + archiveCustomMetric( + request?: protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest|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.archiveCustomMetric(request, options, callback); + } +/** + * Lookup for a single CustomMetric. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the CustomMetric to get. + * Example format: properties/1234/customMetrics/5678 + * @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 [CustomMetric]{@link google.analytics.admin.v1alpha.CustomMetric}. + * 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/analytics_admin_service.get_custom_metric.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetCustomMetric_async + */ + getCustomMetric( + request?: protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.ICustomMetric, + protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest|undefined, {}|undefined + ]>; + getCustomMetric( + request: protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.ICustomMetric, + protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest|null|undefined, + {}|null|undefined>): void; + getCustomMetric( + request: protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.ICustomMetric, + protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest|null|undefined, + {}|null|undefined>): void; + getCustomMetric( + request?: protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.ICustomMetric, + protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.ICustomMetric, + protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.ICustomMetric, + protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest|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.getCustomMetric(request, options, callback); + } +/** + * Returns the singleton data retention settings for this property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the settings to lookup. + * Format: + * properties/{property}/dataRetentionSettings + * Example: "properties/1000/dataRetentionSettings" + * @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 [DataRetentionSettings]{@link google.analytics.admin.v1alpha.DataRetentionSettings}. + * 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/analytics_admin_service.get_data_retention_settings.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataRetentionSettings_async + */ + getDataRetentionSettings( + request?: protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IDataRetentionSettings, + protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest|undefined, {}|undefined + ]>; + getDataRetentionSettings( + request: protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDataRetentionSettings, + protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest|null|undefined, + {}|null|undefined>): void; + getDataRetentionSettings( + request: protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDataRetentionSettings, + protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest|null|undefined, + {}|null|undefined>): void; + getDataRetentionSettings( + request?: protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IDataRetentionSettings, + protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IDataRetentionSettings, + protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IDataRetentionSettings, + protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest|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.getDataRetentionSettings(request, options, callback); + } +/** + * Updates the singleton data retention settings for this property. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.analytics.admin.v1alpha.DataRetentionSettings} request.dataRetentionSettings + * Required. The settings to update. + * The `name` field is used to identify the settings to be updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to be updated. Field names must be in snake case + * (e.g., "field_to_update"). Omitted fields will not be updated. To replace + * the entire entity, use one path with the string "*" to match all fields. + * @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 [DataRetentionSettings]{@link google.analytics.admin.v1alpha.DataRetentionSettings}. + * 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/analytics_admin_service.update_data_retention_settings.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDataRetentionSettings_async + */ + updateDataRetentionSettings( + request?: protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IDataRetentionSettings, + protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest|undefined, {}|undefined + ]>; + updateDataRetentionSettings( + request: protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDataRetentionSettings, + protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest|null|undefined, + {}|null|undefined>): void; + updateDataRetentionSettings( + request: protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDataRetentionSettings, + protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest|null|undefined, + {}|null|undefined>): void; + updateDataRetentionSettings( + request?: protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IDataRetentionSettings, + protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IDataRetentionSettings, + protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IDataRetentionSettings, + protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest|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({ + 'data_retention_settings.name': request.dataRetentionSettings!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateDataRetentionSettings(request, options, callback); + } +/** + * Creates a DataStream. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {google.analytics.admin.v1alpha.DataStream} request.dataStream + * Required. The DataStream to create. + * @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 [DataStream]{@link google.analytics.admin.v1alpha.DataStream}. + * 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/analytics_admin_service.create_data_stream.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDataStream_async + */ + createDataStream( + request?: protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IDataStream, + protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest|undefined, {}|undefined + ]>; + createDataStream( + request: protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDataStream, + protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest|null|undefined, + {}|null|undefined>): void; + createDataStream( + request: protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDataStream, + protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest|null|undefined, + {}|null|undefined>): void; + createDataStream( + request?: protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IDataStream, + protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IDataStream, + protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IDataStream, + protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createDataStream(request, options, callback); + } +/** + * Deletes a DataStream on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the DataStream to delete. + * Example format: properties/1234/dataStreams/5678 + * @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 [Empty]{@link google.protobuf.Empty}. + * 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/analytics_admin_service.delete_data_stream.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDataStream_async + */ + deleteDataStream( + request?: protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest|undefined, {}|undefined + ]>; + deleteDataStream( + request: protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest|null|undefined, + {}|null|undefined>): void; + deleteDataStream( + request: protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest|null|undefined, + {}|null|undefined>): void; + deleteDataStream( + request?: protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest|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.deleteDataStream(request, options, callback); + } +/** + * Updates a DataStream on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.analytics.admin.v1alpha.DataStream} request.dataStream + * The DataStream to update + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to be updated. Omitted fields will not be updated. + * To replace the entire entity, use one path with the string "*" to match + * all fields. + * @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 [DataStream]{@link google.analytics.admin.v1alpha.DataStream}. + * 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/analytics_admin_service.update_data_stream.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDataStream_async + */ + updateDataStream( + request?: protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IDataStream, + protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest|undefined, {}|undefined + ]>; + updateDataStream( + request: protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDataStream, + protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest|null|undefined, + {}|null|undefined>): void; + updateDataStream( + request: protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDataStream, + protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest|null|undefined, + {}|null|undefined>): void; + updateDataStream( + request?: protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IDataStream, + protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IDataStream, + protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IDataStream, + protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest|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({ + 'data_stream.name': request.dataStream!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateDataStream(request, options, callback); + } +/** + * Lookup for a single DataStream. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the DataStream to get. + * Example format: properties/1234/dataStreams/5678 + * @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 [DataStream]{@link google.analytics.admin.v1alpha.DataStream}. + * 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/analytics_admin_service.get_data_stream.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataStream_async + */ + getDataStream( + request?: protos.google.analytics.admin.v1alpha.IGetDataStreamRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IDataStream, + protos.google.analytics.admin.v1alpha.IGetDataStreamRequest|undefined, {}|undefined + ]>; + getDataStream( + request: protos.google.analytics.admin.v1alpha.IGetDataStreamRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDataStream, + protos.google.analytics.admin.v1alpha.IGetDataStreamRequest|null|undefined, + {}|null|undefined>): void; + getDataStream( + request: protos.google.analytics.admin.v1alpha.IGetDataStreamRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IDataStream, + protos.google.analytics.admin.v1alpha.IGetDataStreamRequest|null|undefined, + {}|null|undefined>): void; + getDataStream( + request?: protos.google.analytics.admin.v1alpha.IGetDataStreamRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IDataStream, + protos.google.analytics.admin.v1alpha.IGetDataStreamRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IDataStream, + protos.google.analytics.admin.v1alpha.IGetDataStreamRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IDataStream, + protos.google.analytics.admin.v1alpha.IGetDataStreamRequest|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.getDataStream(request, options, callback); + } + + /** + * Returns all accounts accessible by the caller. + * + * Note that these accounts might not currently have GA4 properties. + * Soft-deleted (ie: "trashed") accounts are excluded by default. + * Returns an empty list if no relevant accounts are found. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.pageSize + * The maximum number of resources to return. The service may return + * fewer than this value, even if there are additional pages. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200; (higher values will be coerced to the maximum) + * @param {string} request.pageToken + * A page token, received from a previous `ListAccounts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccounts` must + * match the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether to include soft-deleted (ie: "trashed") Accounts in the + * results. Accounts can be inspected to determine whether they are deleted or + * not. + * @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 Array of [Account]{@link google.analytics.admin.v1alpha.Account}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAccountsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAccounts( + request?: protos.google.analytics.admin.v1alpha.IListAccountsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IAccount[], + protos.google.analytics.admin.v1alpha.IListAccountsRequest|null, + protos.google.analytics.admin.v1alpha.IListAccountsResponse + ]>; + listAccounts( + request: protos.google.analytics.admin.v1alpha.IListAccountsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListAccountsRequest, + protos.google.analytics.admin.v1alpha.IListAccountsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IAccount>): void; + listAccounts( + request: protos.google.analytics.admin.v1alpha.IListAccountsRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListAccountsRequest, + protos.google.analytics.admin.v1alpha.IListAccountsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IAccount>): void; + listAccounts( + request?: protos.google.analytics.admin.v1alpha.IListAccountsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1alpha.IListAccountsRequest, + protos.google.analytics.admin.v1alpha.IListAccountsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IAccount>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListAccountsRequest, + protos.google.analytics.admin.v1alpha.IListAccountsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IAccount>): + Promise<[ + protos.google.analytics.admin.v1alpha.IAccount[], + protos.google.analytics.admin.v1alpha.IListAccountsRequest|null, + protos.google.analytics.admin.v1alpha.IListAccountsResponse + ]>|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 || {}; + this.initialize(); + return this.innerApiCalls.listAccounts(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {number} request.pageSize + * The maximum number of resources to return. The service may return + * fewer than this value, even if there are additional pages. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200; (higher values will be coerced to the maximum) + * @param {string} request.pageToken + * A page token, received from a previous `ListAccounts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccounts` must + * match the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether to include soft-deleted (ie: "trashed") Accounts in the + * results. Accounts can be inspected to determine whether they are deleted or + * not. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Account]{@link google.analytics.admin.v1alpha.Account} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAccountsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAccountsStream( + request?: protos.google.analytics.admin.v1alpha.IListAccountsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listAccounts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAccounts.createStream( + this.innerApiCalls.listAccounts as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAccounts`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {number} request.pageSize + * The maximum number of resources to return. The service may return + * fewer than this value, even if there are additional pages. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200; (higher values will be coerced to the maximum) + * @param {string} request.pageToken + * A page token, received from a previous `ListAccounts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccounts` must + * match the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether to include soft-deleted (ie: "trashed") Accounts in the + * results. Accounts can be inspected to determine whether they are deleted or + * not. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Account]{@link google.analytics.admin.v1alpha.Account}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/analytics_admin_service.list_accounts.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccounts_async + */ + listAccountsAsync( + request?: protos.google.analytics.admin.v1alpha.IListAccountsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listAccounts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAccounts.asyncIterate( + this.innerApiCalls['listAccounts'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Returns summaries of all accounts accessible by the caller. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.pageSize + * The maximum number of AccountSummary resources to return. The service may + * return fewer than this value, even if there are additional pages. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200; (higher values will be coerced to the maximum) + * @param {string} request.pageToken + * A page token, received from a previous `ListAccountSummaries` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccountSummaries` + * must match the call that provided the page token. + * @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 Array of [AccountSummary]{@link google.analytics.admin.v1alpha.AccountSummary}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAccountSummariesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAccountSummaries( + request?: protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IAccountSummary[], + protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest|null, + protos.google.analytics.admin.v1alpha.IListAccountSummariesResponse + ]>; + listAccountSummaries( + request: protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest, + protos.google.analytics.admin.v1alpha.IListAccountSummariesResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IAccountSummary>): void; + listAccountSummaries( + request: protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest, + protos.google.analytics.admin.v1alpha.IListAccountSummariesResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IAccountSummary>): void; + listAccountSummaries( + request?: protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest, + protos.google.analytics.admin.v1alpha.IListAccountSummariesResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IAccountSummary>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest, + protos.google.analytics.admin.v1alpha.IListAccountSummariesResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IAccountSummary>): + Promise<[ + protos.google.analytics.admin.v1alpha.IAccountSummary[], + protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest|null, + protos.google.analytics.admin.v1alpha.IListAccountSummariesResponse + ]>|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 || {}; + this.initialize(); + return this.innerApiCalls.listAccountSummaries(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {number} request.pageSize + * The maximum number of AccountSummary resources to return. The service may + * return fewer than this value, even if there are additional pages. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200; (higher values will be coerced to the maximum) + * @param {string} request.pageToken + * A page token, received from a previous `ListAccountSummaries` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccountSummaries` + * must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [AccountSummary]{@link google.analytics.admin.v1alpha.AccountSummary} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAccountSummariesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAccountSummariesStream( + request?: protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listAccountSummaries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAccountSummaries.createStream( + this.innerApiCalls.listAccountSummaries as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAccountSummaries`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {number} request.pageSize + * The maximum number of AccountSummary resources to return. The service may + * return fewer than this value, even if there are additional pages. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200; (higher values will be coerced to the maximum) + * @param {string} request.pageToken + * A page token, received from a previous `ListAccountSummaries` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccountSummaries` + * must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [AccountSummary]{@link google.analytics.admin.v1alpha.AccountSummary}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/analytics_admin_service.list_account_summaries.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccountSummaries_async + */ + listAccountSummariesAsync( + request?: protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listAccountSummaries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAccountSummaries.asyncIterate( + this.innerApiCalls['listAccountSummaries'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Returns child Properties under the specified parent Account. + * + * Only "GA4" properties will be returned. + * Properties will be excluded if the caller does not have access. + * Soft-deleted (ie: "trashed") properties are excluded by default. + * Returns an empty list if no relevant properties are found. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * Required. An expression for filtering the results of the request. + * Fields eligible for filtering are: + * `parent:`(The resource name of the parent account/property) or + * `ancestor:`(The resource name of the parent account) or + * `firebase_project:`(The id or number of the linked firebase project). + * Some examples of filters: + * + * ``` + * | Filter | Description | + * |-----------------------------|-------------------------------------------| + * | parent:accounts/123 | The account with account id: 123. | + * | parent:properties/123 | The property with property id: 123. | + * | ancestor:accounts/123 | The account with account id: 123. | + * | firebase_project:project-id | The firebase project with id: project-id. | + * | firebase_project:123 | The firebase project with number: 123. | + * ``` + * @param {number} request.pageSize + * The maximum number of resources to return. The service may return + * fewer than this value, even if there are additional pages. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200; (higher values will be coerced to the maximum) + * @param {string} request.pageToken + * A page token, received from a previous `ListProperties` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListProperties` must + * match the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether to include soft-deleted (ie: "trashed") Properties in the + * results. Properties can be inspected to determine whether they are deleted + * or not. + * @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 Array of [Property]{@link google.analytics.admin.v1alpha.Property}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listPropertiesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listProperties( + request?: protos.google.analytics.admin.v1alpha.IListPropertiesRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IProperty[], + protos.google.analytics.admin.v1alpha.IListPropertiesRequest|null, + protos.google.analytics.admin.v1alpha.IListPropertiesResponse + ]>; + listProperties( + request: protos.google.analytics.admin.v1alpha.IListPropertiesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListPropertiesRequest, + protos.google.analytics.admin.v1alpha.IListPropertiesResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IProperty>): void; + listProperties( + request: protos.google.analytics.admin.v1alpha.IListPropertiesRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListPropertiesRequest, + protos.google.analytics.admin.v1alpha.IListPropertiesResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IProperty>): void; + listProperties( + request?: protos.google.analytics.admin.v1alpha.IListPropertiesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1alpha.IListPropertiesRequest, + protos.google.analytics.admin.v1alpha.IListPropertiesResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IProperty>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListPropertiesRequest, + protos.google.analytics.admin.v1alpha.IListPropertiesResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IProperty>): + Promise<[ + protos.google.analytics.admin.v1alpha.IProperty[], + protos.google.analytics.admin.v1alpha.IListPropertiesRequest|null, + protos.google.analytics.admin.v1alpha.IListPropertiesResponse + ]>|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 || {}; + this.initialize(); + return this.innerApiCalls.listProperties(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * Required. An expression for filtering the results of the request. + * Fields eligible for filtering are: + * `parent:`(The resource name of the parent account/property) or + * `ancestor:`(The resource name of the parent account) or + * `firebase_project:`(The id or number of the linked firebase project). + * Some examples of filters: + * + * ``` + * | Filter | Description | + * |-----------------------------|-------------------------------------------| + * | parent:accounts/123 | The account with account id: 123. | + * | parent:properties/123 | The property with property id: 123. | + * | ancestor:accounts/123 | The account with account id: 123. | + * | firebase_project:project-id | The firebase project with id: project-id. | + * | firebase_project:123 | The firebase project with number: 123. | + * ``` + * @param {number} request.pageSize + * The maximum number of resources to return. The service may return + * fewer than this value, even if there are additional pages. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200; (higher values will be coerced to the maximum) + * @param {string} request.pageToken + * A page token, received from a previous `ListProperties` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListProperties` must + * match the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether to include soft-deleted (ie: "trashed") Properties in the + * results. Properties can be inspected to determine whether they are deleted + * or not. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Property]{@link google.analytics.admin.v1alpha.Property} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listPropertiesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listPropertiesStream( + request?: protos.google.analytics.admin.v1alpha.IListPropertiesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listProperties']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listProperties.createStream( + this.innerApiCalls.listProperties as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listProperties`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * Required. An expression for filtering the results of the request. + * Fields eligible for filtering are: + * `parent:`(The resource name of the parent account/property) or + * `ancestor:`(The resource name of the parent account) or + * `firebase_project:`(The id or number of the linked firebase project). + * Some examples of filters: + * + * ``` + * | Filter | Description | + * |-----------------------------|-------------------------------------------| + * | parent:accounts/123 | The account with account id: 123. | + * | parent:properties/123 | The property with property id: 123. | + * | ancestor:accounts/123 | The account with account id: 123. | + * | firebase_project:project-id | The firebase project with id: project-id. | + * | firebase_project:123 | The firebase project with number: 123. | + * ``` + * @param {number} request.pageSize + * The maximum number of resources to return. The service may return + * fewer than this value, even if there are additional pages. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200; (higher values will be coerced to the maximum) + * @param {string} request.pageToken + * A page token, received from a previous `ListProperties` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListProperties` must + * match the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether to include soft-deleted (ie: "trashed") Properties in the + * results. Properties can be inspected to determine whether they are deleted + * or not. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Property]{@link google.analytics.admin.v1alpha.Property}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/analytics_admin_service.list_properties.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListProperties_async + */ + listPropertiesAsync( + request?: protos.google.analytics.admin.v1alpha.IListPropertiesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listProperties']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listProperties.asyncIterate( + this.innerApiCalls['listProperties'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists all user links on an account or property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: accounts/1234 + * @param {number} request.pageSize + * The maximum number of user links to return. + * The service may return fewer than this value. + * If unspecified, at most 200 user links will be returned. + * The maximum value is 500; values above 500 will be coerced to 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListUserLinks` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListUserLinks` must + * match the call that provided the page token. + * @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 Array of [UserLink]{@link google.analytics.admin.v1alpha.UserLink}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listUserLinksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listUserLinks( + request?: protos.google.analytics.admin.v1alpha.IListUserLinksRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IUserLink[], + protos.google.analytics.admin.v1alpha.IListUserLinksRequest|null, + protos.google.analytics.admin.v1alpha.IListUserLinksResponse + ]>; + listUserLinks( + request: protos.google.analytics.admin.v1alpha.IListUserLinksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListUserLinksRequest, + protos.google.analytics.admin.v1alpha.IListUserLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IUserLink>): void; + listUserLinks( + request: protos.google.analytics.admin.v1alpha.IListUserLinksRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListUserLinksRequest, + protos.google.analytics.admin.v1alpha.IListUserLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IUserLink>): void; + listUserLinks( + request?: protos.google.analytics.admin.v1alpha.IListUserLinksRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1alpha.IListUserLinksRequest, + protos.google.analytics.admin.v1alpha.IListUserLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IUserLink>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListUserLinksRequest, + protos.google.analytics.admin.v1alpha.IListUserLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IUserLink>): + Promise<[ + protos.google.analytics.admin.v1alpha.IUserLink[], + protos.google.analytics.admin.v1alpha.IListUserLinksRequest|null, + protos.google.analytics.admin.v1alpha.IListUserLinksResponse + ]>|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listUserLinks(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: accounts/1234 + * @param {number} request.pageSize + * The maximum number of user links to return. + * The service may return fewer than this value. + * If unspecified, at most 200 user links will be returned. + * The maximum value is 500; values above 500 will be coerced to 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListUserLinks` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListUserLinks` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [UserLink]{@link google.analytics.admin.v1alpha.UserLink} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listUserLinksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listUserLinksStream( + request?: protos.google.analytics.admin.v1alpha.IListUserLinksRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listUserLinks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUserLinks.createStream( + this.innerApiCalls.listUserLinks as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listUserLinks`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: accounts/1234 + * @param {number} request.pageSize + * The maximum number of user links to return. + * The service may return fewer than this value. + * If unspecified, at most 200 user links will be returned. + * The maximum value is 500; values above 500 will be coerced to 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListUserLinks` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListUserLinks` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [UserLink]{@link google.analytics.admin.v1alpha.UserLink}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/analytics_admin_service.list_user_links.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListUserLinks_async + */ + listUserLinksAsync( + request?: protos.google.analytics.admin.v1alpha.IListUserLinksRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listUserLinks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUserLinks.asyncIterate( + this.innerApiCalls['listUserLinks'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists all user links on an account or property, including implicit ones + * that come from effective permissions granted by groups or organization + * admin roles. + * + * If a returned user link does not have direct permissions, they cannot + * be removed from the account or property directly with the DeleteUserLink + * command. They have to be removed from the group/etc that gives them + * permissions, which is currently only usable/discoverable in the GA or GMP + * UIs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: accounts/1234 + * @param {number} request.pageSize + * The maximum number of user links to return. + * The service may return fewer than this value. + * If unspecified, at most 1000 user links will be returned. + * The maximum value is 5000; values above 5000 will be coerced to 5000. + * @param {string} request.pageToken + * A page token, received from a previous `AuditUserLinks` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `AuditUserLinks` must + * match the call that provided the page token. + * @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 Array of [AuditUserLink]{@link google.analytics.admin.v1alpha.AuditUserLink}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `auditUserLinksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + auditUserLinks( + request?: protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IAuditUserLink[], + protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest|null, + protos.google.analytics.admin.v1alpha.IAuditUserLinksResponse + ]>; + auditUserLinks( + request: protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest, + protos.google.analytics.admin.v1alpha.IAuditUserLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IAuditUserLink>): void; + auditUserLinks( + request: protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest, + protos.google.analytics.admin.v1alpha.IAuditUserLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IAuditUserLink>): void; + auditUserLinks( + request?: protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest, + protos.google.analytics.admin.v1alpha.IAuditUserLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IAuditUserLink>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest, + protos.google.analytics.admin.v1alpha.IAuditUserLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IAuditUserLink>): + Promise<[ + protos.google.analytics.admin.v1alpha.IAuditUserLink[], + protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest|null, + protos.google.analytics.admin.v1alpha.IAuditUserLinksResponse + ]>|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.auditUserLinks(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: accounts/1234 + * @param {number} request.pageSize + * The maximum number of user links to return. + * The service may return fewer than this value. + * If unspecified, at most 1000 user links will be returned. + * The maximum value is 5000; values above 5000 will be coerced to 5000. + * @param {string} request.pageToken + * A page token, received from a previous `AuditUserLinks` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `AuditUserLinks` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [AuditUserLink]{@link google.analytics.admin.v1alpha.AuditUserLink} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `auditUserLinksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + auditUserLinksStream( + request?: protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['auditUserLinks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.auditUserLinks.createStream( + this.innerApiCalls.auditUserLinks as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `auditUserLinks`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: accounts/1234 + * @param {number} request.pageSize + * The maximum number of user links to return. + * The service may return fewer than this value. + * If unspecified, at most 1000 user links will be returned. + * The maximum value is 5000; values above 5000 will be coerced to 5000. + * @param {string} request.pageToken + * A page token, received from a previous `AuditUserLinks` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `AuditUserLinks` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [AuditUserLink]{@link google.analytics.admin.v1alpha.AuditUserLink}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/analytics_admin_service.audit_user_links.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_AuditUserLinks_async + */ + auditUserLinksAsync( + request?: protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['auditUserLinks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.auditUserLinks.asyncIterate( + this.innerApiCalls['auditUserLinks'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists FirebaseLinks on a property. + * Properties can have at most one FirebaseLink. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Format: properties/{property_id} + * Example: properties/1234 + * @param {number} request.pageSize + * The maximum number of resources to return. The service may return + * fewer than this value, even if there are additional pages. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200; (higher values will be coerced to the maximum) + * @param {string} request.pageToken + * A page token, received from a previous `ListFirebaseLinks` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListProperties` must + * match the call that provided the page token. + * @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 Array of [FirebaseLink]{@link google.analytics.admin.v1alpha.FirebaseLink}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listFirebaseLinksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listFirebaseLinks( + request?: protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IFirebaseLink[], + protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest|null, + protos.google.analytics.admin.v1alpha.IListFirebaseLinksResponse + ]>; + listFirebaseLinks( + request: protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest, + protos.google.analytics.admin.v1alpha.IListFirebaseLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IFirebaseLink>): void; + listFirebaseLinks( + request: protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest, + protos.google.analytics.admin.v1alpha.IListFirebaseLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IFirebaseLink>): void; + listFirebaseLinks( + request?: protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest, + protos.google.analytics.admin.v1alpha.IListFirebaseLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IFirebaseLink>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest, + protos.google.analytics.admin.v1alpha.IListFirebaseLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IFirebaseLink>): + Promise<[ + protos.google.analytics.admin.v1alpha.IFirebaseLink[], + protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest|null, + protos.google.analytics.admin.v1alpha.IListFirebaseLinksResponse + ]>|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listFirebaseLinks(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Format: properties/{property_id} + * Example: properties/1234 + * @param {number} request.pageSize + * The maximum number of resources to return. The service may return + * fewer than this value, even if there are additional pages. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200; (higher values will be coerced to the maximum) + * @param {string} request.pageToken + * A page token, received from a previous `ListFirebaseLinks` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListProperties` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [FirebaseLink]{@link google.analytics.admin.v1alpha.FirebaseLink} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listFirebaseLinksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listFirebaseLinksStream( + request?: protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listFirebaseLinks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listFirebaseLinks.createStream( + this.innerApiCalls.listFirebaseLinks as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listFirebaseLinks`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Format: properties/{property_id} + * Example: properties/1234 + * @param {number} request.pageSize + * The maximum number of resources to return. The service may return + * fewer than this value, even if there are additional pages. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200; (higher values will be coerced to the maximum) + * @param {string} request.pageToken + * A page token, received from a previous `ListFirebaseLinks` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListProperties` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [FirebaseLink]{@link google.analytics.admin.v1alpha.FirebaseLink}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/analytics_admin_service.list_firebase_links.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListFirebaseLinks_async + */ + listFirebaseLinksAsync( + request?: protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listFirebaseLinks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listFirebaseLinks.asyncIterate( + this.innerApiCalls['listFirebaseLinks'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists GoogleAdsLinks on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + * @param {string} request.pageToken + * A page token, received from a previous `ListGoogleAdsLinks` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListGoogleAdsLinks` must + * match the call that provided the page token. + * @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 Array of [GoogleAdsLink]{@link google.analytics.admin.v1alpha.GoogleAdsLink}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listGoogleAdsLinksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listGoogleAdsLinks( + request?: protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IGoogleAdsLink[], + protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest|null, + protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksResponse + ]>; + listGoogleAdsLinks( + request: protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest, + protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IGoogleAdsLink>): void; + listGoogleAdsLinks( + request: protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest, + protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IGoogleAdsLink>): void; + listGoogleAdsLinks( + request?: protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest, + protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IGoogleAdsLink>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest, + protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IGoogleAdsLink>): + Promise<[ + protos.google.analytics.admin.v1alpha.IGoogleAdsLink[], + protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest|null, + protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksResponse + ]>|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listGoogleAdsLinks(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + * @param {string} request.pageToken + * A page token, received from a previous `ListGoogleAdsLinks` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListGoogleAdsLinks` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [GoogleAdsLink]{@link google.analytics.admin.v1alpha.GoogleAdsLink} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listGoogleAdsLinksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listGoogleAdsLinksStream( + request?: protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listGoogleAdsLinks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listGoogleAdsLinks.createStream( + this.innerApiCalls.listGoogleAdsLinks as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listGoogleAdsLinks`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + * @param {string} request.pageToken + * A page token, received from a previous `ListGoogleAdsLinks` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListGoogleAdsLinks` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [GoogleAdsLink]{@link google.analytics.admin.v1alpha.GoogleAdsLink}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/analytics_admin_service.list_google_ads_links.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListGoogleAdsLinks_async + */ + listGoogleAdsLinksAsync( + request?: protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listGoogleAdsLinks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listGoogleAdsLinks.asyncIterate( + this.innerApiCalls['listGoogleAdsLinks'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Returns child MeasurementProtocolSecrets under the specified parent + * Property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent stream. + * Format: + * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 10 resources will be returned. + * The maximum value is 10. Higher values will be coerced to the maximum. + * @param {string} request.pageToken + * A page token, received from a previous `ListMeasurementProtocolSecrets` + * call. Provide this to retrieve the subsequent page. When paginating, all + * other parameters provided to `ListMeasurementProtocolSecrets` must match + * the call that provided the page token. + * @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 Array of [MeasurementProtocolSecret]{@link google.analytics.admin.v1alpha.MeasurementProtocolSecret}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listMeasurementProtocolSecretsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listMeasurementProtocolSecrets( + request?: protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret[], + protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest|null, + protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsResponse + ]>; + listMeasurementProtocolSecrets( + request: protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest, + protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret>): void; + listMeasurementProtocolSecrets( + request: protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest, + protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret>): void; + listMeasurementProtocolSecrets( + request?: protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest, + protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest, + protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret>): + Promise<[ + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret[], + protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest|null, + protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsResponse + ]>|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listMeasurementProtocolSecrets(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent stream. + * Format: + * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 10 resources will be returned. + * The maximum value is 10. Higher values will be coerced to the maximum. + * @param {string} request.pageToken + * A page token, received from a previous `ListMeasurementProtocolSecrets` + * call. Provide this to retrieve the subsequent page. When paginating, all + * other parameters provided to `ListMeasurementProtocolSecrets` must match + * the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [MeasurementProtocolSecret]{@link google.analytics.admin.v1alpha.MeasurementProtocolSecret} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listMeasurementProtocolSecretsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listMeasurementProtocolSecretsStream( + request?: protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listMeasurementProtocolSecrets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMeasurementProtocolSecrets.createStream( + this.innerApiCalls.listMeasurementProtocolSecrets as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listMeasurementProtocolSecrets`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent stream. + * Format: + * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 10 resources will be returned. + * The maximum value is 10. Higher values will be coerced to the maximum. + * @param {string} request.pageToken + * A page token, received from a previous `ListMeasurementProtocolSecrets` + * call. Provide this to retrieve the subsequent page. When paginating, all + * other parameters provided to `ListMeasurementProtocolSecrets` must match + * the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [MeasurementProtocolSecret]{@link google.analytics.admin.v1alpha.MeasurementProtocolSecret}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/analytics_admin_service.list_measurement_protocol_secrets.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListMeasurementProtocolSecrets_async + */ + listMeasurementProtocolSecretsAsync( + request?: protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listMeasurementProtocolSecrets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMeasurementProtocolSecrets.asyncIterate( + this.innerApiCalls['listMeasurementProtocolSecrets'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Searches through all changes to an account or its children given the + * specified set of filters. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.account + * Required. The account resource for which to return change history resources. + * @param {string} [request.property] + * Optional. Resource name for a child property. If set, only return changes + * made to this property or its child resources. + * @param {number[]} [request.resourceType] + * Optional. If set, only return changes if they are for a resource that matches at + * least one of these types. + * @param {number[]} [request.action] + * Optional. If set, only return changes that match one or more of these types of + * actions. + * @param {string[]} [request.actorEmail] + * Optional. If set, only return changes if they are made by a user in this list. + * @param {google.protobuf.Timestamp} [request.earliestChangeTime] + * Optional. If set, only return changes made after this time (inclusive). + * @param {google.protobuf.Timestamp} [request.latestChangeTime] + * Optional. If set, only return changes made before this time (inclusive). + * @param {number} [request.pageSize] + * Optional. The maximum number of ChangeHistoryEvent items to return. + * The service may return fewer than this value, even if there are additional + * pages. If unspecified, at most 50 items will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `SearchChangeHistoryEvents` call. + * Provide this to retrieve the subsequent page. When paginating, all other + * parameters provided to `SearchChangeHistoryEvents` must match the call that + * provided the page token. + * @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 Array of [ChangeHistoryEvent]{@link google.analytics.admin.v1alpha.ChangeHistoryEvent}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `searchChangeHistoryEventsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchChangeHistoryEvents( + request?: protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IChangeHistoryEvent[], + protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest|null, + protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsResponse + ]>; + searchChangeHistoryEvents( + request: protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest, + protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IChangeHistoryEvent>): void; + searchChangeHistoryEvents( + request: protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest, + protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IChangeHistoryEvent>): void; + searchChangeHistoryEvents( + request?: protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest, + protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IChangeHistoryEvent>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest, + protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IChangeHistoryEvent>): + Promise<[ + protos.google.analytics.admin.v1alpha.IChangeHistoryEvent[], + protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest|null, + protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsResponse + ]>|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({ + 'account': request.account || '', + }); + this.initialize(); + return this.innerApiCalls.searchChangeHistoryEvents(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.account + * Required. The account resource for which to return change history resources. + * @param {string} [request.property] + * Optional. Resource name for a child property. If set, only return changes + * made to this property or its child resources. + * @param {number[]} [request.resourceType] + * Optional. If set, only return changes if they are for a resource that matches at + * least one of these types. + * @param {number[]} [request.action] + * Optional. If set, only return changes that match one or more of these types of + * actions. + * @param {string[]} [request.actorEmail] + * Optional. If set, only return changes if they are made by a user in this list. + * @param {google.protobuf.Timestamp} [request.earliestChangeTime] + * Optional. If set, only return changes made after this time (inclusive). + * @param {google.protobuf.Timestamp} [request.latestChangeTime] + * Optional. If set, only return changes made before this time (inclusive). + * @param {number} [request.pageSize] + * Optional. The maximum number of ChangeHistoryEvent items to return. + * The service may return fewer than this value, even if there are additional + * pages. If unspecified, at most 50 items will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `SearchChangeHistoryEvents` call. + * Provide this to retrieve the subsequent page. When paginating, all other + * parameters provided to `SearchChangeHistoryEvents` must match the call that + * provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [ChangeHistoryEvent]{@link google.analytics.admin.v1alpha.ChangeHistoryEvent} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `searchChangeHistoryEventsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchChangeHistoryEventsStream( + request?: protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'account': request.account || '', + }); + const defaultCallSettings = this._defaults['searchChangeHistoryEvents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchChangeHistoryEvents.createStream( + this.innerApiCalls.searchChangeHistoryEvents as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchChangeHistoryEvents`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.account + * Required. The account resource for which to return change history resources. + * @param {string} [request.property] + * Optional. Resource name for a child property. If set, only return changes + * made to this property or its child resources. + * @param {number[]} [request.resourceType] + * Optional. If set, only return changes if they are for a resource that matches at + * least one of these types. + * @param {number[]} [request.action] + * Optional. If set, only return changes that match one or more of these types of + * actions. + * @param {string[]} [request.actorEmail] + * Optional. If set, only return changes if they are made by a user in this list. + * @param {google.protobuf.Timestamp} [request.earliestChangeTime] + * Optional. If set, only return changes made after this time (inclusive). + * @param {google.protobuf.Timestamp} [request.latestChangeTime] + * Optional. If set, only return changes made before this time (inclusive). + * @param {number} [request.pageSize] + * Optional. The maximum number of ChangeHistoryEvent items to return. + * The service may return fewer than this value, even if there are additional + * pages. If unspecified, at most 50 items will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `SearchChangeHistoryEvents` call. + * Provide this to retrieve the subsequent page. When paginating, all other + * parameters provided to `SearchChangeHistoryEvents` must match the call that + * provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ChangeHistoryEvent]{@link google.analytics.admin.v1alpha.ChangeHistoryEvent}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/analytics_admin_service.search_change_history_events.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_SearchChangeHistoryEvents_async + */ + searchChangeHistoryEventsAsync( + request?: protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'account': request.account || '', + }); + const defaultCallSettings = this._defaults['searchChangeHistoryEvents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchChangeHistoryEvents.asyncIterate( + this.innerApiCalls['searchChangeHistoryEvents'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Returns a list of conversion events in the specified parent property. + * + * Returns an empty list if no conversion events are found. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent property. + * Example: 'properties/123' + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200; (higher values will be coerced to the maximum) + * @param {string} request.pageToken + * A page token, received from a previous `ListConversionEvents` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListConversionEvents` + * must match the call that provided the page token. + * @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 Array of [ConversionEvent]{@link google.analytics.admin.v1alpha.ConversionEvent}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listConversionEventsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listConversionEvents( + request?: protos.google.analytics.admin.v1alpha.IListConversionEventsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IConversionEvent[], + protos.google.analytics.admin.v1alpha.IListConversionEventsRequest|null, + protos.google.analytics.admin.v1alpha.IListConversionEventsResponse + ]>; + listConversionEvents( + request: protos.google.analytics.admin.v1alpha.IListConversionEventsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListConversionEventsRequest, + protos.google.analytics.admin.v1alpha.IListConversionEventsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IConversionEvent>): void; + listConversionEvents( + request: protos.google.analytics.admin.v1alpha.IListConversionEventsRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListConversionEventsRequest, + protos.google.analytics.admin.v1alpha.IListConversionEventsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IConversionEvent>): void; + listConversionEvents( + request?: protos.google.analytics.admin.v1alpha.IListConversionEventsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1alpha.IListConversionEventsRequest, + protos.google.analytics.admin.v1alpha.IListConversionEventsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IConversionEvent>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListConversionEventsRequest, + protos.google.analytics.admin.v1alpha.IListConversionEventsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IConversionEvent>): + Promise<[ + protos.google.analytics.admin.v1alpha.IConversionEvent[], + protos.google.analytics.admin.v1alpha.IListConversionEventsRequest|null, + protos.google.analytics.admin.v1alpha.IListConversionEventsResponse + ]>|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listConversionEvents(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent property. + * Example: 'properties/123' + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200; (higher values will be coerced to the maximum) + * @param {string} request.pageToken + * A page token, received from a previous `ListConversionEvents` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListConversionEvents` + * must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [ConversionEvent]{@link google.analytics.admin.v1alpha.ConversionEvent} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listConversionEventsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listConversionEventsStream( + request?: protos.google.analytics.admin.v1alpha.IListConversionEventsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listConversionEvents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConversionEvents.createStream( + this.innerApiCalls.listConversionEvents as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listConversionEvents`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent property. + * Example: 'properties/123' + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200; (higher values will be coerced to the maximum) + * @param {string} request.pageToken + * A page token, received from a previous `ListConversionEvents` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListConversionEvents` + * must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ConversionEvent]{@link google.analytics.admin.v1alpha.ConversionEvent}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/analytics_admin_service.list_conversion_events.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListConversionEvents_async + */ + listConversionEventsAsync( + request?: protos.google.analytics.admin.v1alpha.IListConversionEventsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listConversionEvents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConversionEvents.asyncIterate( + this.innerApiCalls['listConversionEvents'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists all DisplayVideo360AdvertiserLinks on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + * @param {string} request.pageToken + * A page token, received from a previous `ListDisplayVideo360AdvertiserLinks` + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListDisplayVideo360AdvertiserLinks` must match the call that provided the + * page token. + * @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 Array of [DisplayVideo360AdvertiserLink]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDisplayVideo360AdvertiserLinksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDisplayVideo360AdvertiserLinks( + request?: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink[], + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest|null, + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksResponse + ]>; + listDisplayVideo360AdvertiserLinks( + request: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest, + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink>): void; + listDisplayVideo360AdvertiserLinks( + request: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest, + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink>): void; + listDisplayVideo360AdvertiserLinks( + request?: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest, + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest, + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink>): + Promise<[ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink[], + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest|null, + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksResponse + ]>|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listDisplayVideo360AdvertiserLinks(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + * @param {string} request.pageToken + * A page token, received from a previous `ListDisplayVideo360AdvertiserLinks` + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListDisplayVideo360AdvertiserLinks` must match the call that provided the + * page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [DisplayVideo360AdvertiserLink]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDisplayVideo360AdvertiserLinksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDisplayVideo360AdvertiserLinksStream( + request?: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listDisplayVideo360AdvertiserLinks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDisplayVideo360AdvertiserLinks.createStream( + this.innerApiCalls.listDisplayVideo360AdvertiserLinks as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDisplayVideo360AdvertiserLinks`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + * @param {string} request.pageToken + * A page token, received from a previous `ListDisplayVideo360AdvertiserLinks` + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListDisplayVideo360AdvertiserLinks` must match the call that provided the + * page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [DisplayVideo360AdvertiserLink]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_links.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDisplayVideo360AdvertiserLinks_async + */ + listDisplayVideo360AdvertiserLinksAsync( + request?: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listDisplayVideo360AdvertiserLinks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDisplayVideo360AdvertiserLinks.asyncIterate( + this.innerApiCalls['listDisplayVideo360AdvertiserLinks'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists DisplayVideo360AdvertiserLinkProposals on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + * @param {string} request.pageToken + * A page token, received from a previous + * `ListDisplayVideo360AdvertiserLinkProposals` call. Provide this to retrieve + * the subsequent page. + * + * When paginating, all other parameters provided to + * `ListDisplayVideo360AdvertiserLinkProposals` must match the call that + * provided the page token. + * @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 Array of [DisplayVideo360AdvertiserLinkProposal]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDisplayVideo360AdvertiserLinkProposalsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDisplayVideo360AdvertiserLinkProposals( + request?: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal[], + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest|null, + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsResponse + ]>; + listDisplayVideo360AdvertiserLinkProposals( + request: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest, + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal>): void; + listDisplayVideo360AdvertiserLinkProposals( + request: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest, + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal>): void; + listDisplayVideo360AdvertiserLinkProposals( + request?: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest, + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest, + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal>): + Promise<[ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal[], + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest|null, + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsResponse + ]>|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + * @param {string} request.pageToken + * A page token, received from a previous + * `ListDisplayVideo360AdvertiserLinkProposals` call. Provide this to retrieve + * the subsequent page. + * + * When paginating, all other parameters provided to + * `ListDisplayVideo360AdvertiserLinkProposals` must match the call that + * provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [DisplayVideo360AdvertiserLinkProposal]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDisplayVideo360AdvertiserLinkProposalsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDisplayVideo360AdvertiserLinkProposalsStream( + request?: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listDisplayVideo360AdvertiserLinkProposals']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.createStream( + this.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDisplayVideo360AdvertiserLinkProposals`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + * @param {string} request.pageToken + * A page token, received from a previous + * `ListDisplayVideo360AdvertiserLinkProposals` call. Provide this to retrieve + * the subsequent page. + * + * When paginating, all other parameters provided to + * `ListDisplayVideo360AdvertiserLinkProposals` must match the call that + * provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [DisplayVideo360AdvertiserLinkProposal]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_link_proposals.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDisplayVideo360AdvertiserLinkProposals_async + */ + listDisplayVideo360AdvertiserLinkProposalsAsync( + request?: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listDisplayVideo360AdvertiserLinkProposals']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.asyncIterate( + this.innerApiCalls['listDisplayVideo360AdvertiserLinkProposals'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists CustomDimensions on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + * @param {string} request.pageToken + * A page token, received from a previous `ListCustomDimensions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCustomDimensions` + * must match the call that provided the page token. + * @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 Array of [CustomDimension]{@link google.analytics.admin.v1alpha.CustomDimension}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCustomDimensionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCustomDimensions( + request?: protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.ICustomDimension[], + protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest|null, + protos.google.analytics.admin.v1alpha.IListCustomDimensionsResponse + ]>; + listCustomDimensions( + request: protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest, + protos.google.analytics.admin.v1alpha.IListCustomDimensionsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.ICustomDimension>): void; + listCustomDimensions( + request: protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest, + protos.google.analytics.admin.v1alpha.IListCustomDimensionsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.ICustomDimension>): void; + listCustomDimensions( + request?: protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest, + protos.google.analytics.admin.v1alpha.IListCustomDimensionsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.ICustomDimension>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest, + protos.google.analytics.admin.v1alpha.IListCustomDimensionsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.ICustomDimension>): + Promise<[ + protos.google.analytics.admin.v1alpha.ICustomDimension[], + protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest|null, + protos.google.analytics.admin.v1alpha.IListCustomDimensionsResponse + ]>|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listCustomDimensions(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + * @param {string} request.pageToken + * A page token, received from a previous `ListCustomDimensions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCustomDimensions` + * must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [CustomDimension]{@link google.analytics.admin.v1alpha.CustomDimension} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCustomDimensionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCustomDimensionsStream( + request?: protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listCustomDimensions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCustomDimensions.createStream( + this.innerApiCalls.listCustomDimensions as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listCustomDimensions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + * @param {string} request.pageToken + * A page token, received from a previous `ListCustomDimensions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCustomDimensions` + * must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [CustomDimension]{@link google.analytics.admin.v1alpha.CustomDimension}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/analytics_admin_service.list_custom_dimensions.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListCustomDimensions_async + */ + listCustomDimensionsAsync( + request?: protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listCustomDimensions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCustomDimensions.asyncIterate( + this.innerApiCalls['listCustomDimensions'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists CustomMetrics on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + * @param {string} request.pageToken + * A page token, received from a previous `ListCustomMetrics` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCustomMetrics` must + * match the call that provided the page token. + * @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 Array of [CustomMetric]{@link google.analytics.admin.v1alpha.CustomMetric}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCustomMetricsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCustomMetrics( + request?: protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.ICustomMetric[], + protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest|null, + protos.google.analytics.admin.v1alpha.IListCustomMetricsResponse + ]>; + listCustomMetrics( + request: protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest, + protos.google.analytics.admin.v1alpha.IListCustomMetricsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.ICustomMetric>): void; + listCustomMetrics( + request: protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest, + protos.google.analytics.admin.v1alpha.IListCustomMetricsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.ICustomMetric>): void; + listCustomMetrics( + request?: protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest, + protos.google.analytics.admin.v1alpha.IListCustomMetricsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.ICustomMetric>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest, + protos.google.analytics.admin.v1alpha.IListCustomMetricsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.ICustomMetric>): + Promise<[ + protos.google.analytics.admin.v1alpha.ICustomMetric[], + protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest|null, + protos.google.analytics.admin.v1alpha.IListCustomMetricsResponse + ]>|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listCustomMetrics(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + * @param {string} request.pageToken + * A page token, received from a previous `ListCustomMetrics` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCustomMetrics` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [CustomMetric]{@link google.analytics.admin.v1alpha.CustomMetric} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCustomMetricsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCustomMetricsStream( + request?: protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listCustomMetrics']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCustomMetrics.createStream( + this.innerApiCalls.listCustomMetrics as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listCustomMetrics`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + * @param {string} request.pageToken + * A page token, received from a previous `ListCustomMetrics` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCustomMetrics` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [CustomMetric]{@link google.analytics.admin.v1alpha.CustomMetric}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/analytics_admin_service.list_custom_metrics.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListCustomMetrics_async + */ + listCustomMetricsAsync( + request?: protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listCustomMetrics']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCustomMetrics.asyncIterate( + this.innerApiCalls['listCustomMetrics'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists DataStreams on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + * @param {string} request.pageToken + * A page token, received from a previous `ListDataStreams` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDataStreams` must + * match the call that provided the page token. + * @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 Array of [DataStream]{@link google.analytics.admin.v1alpha.DataStream}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDataStreamsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDataStreams( + request?: protos.google.analytics.admin.v1alpha.IListDataStreamsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IDataStream[], + protos.google.analytics.admin.v1alpha.IListDataStreamsRequest|null, + protos.google.analytics.admin.v1alpha.IListDataStreamsResponse + ]>; + listDataStreams( + request: protos.google.analytics.admin.v1alpha.IListDataStreamsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListDataStreamsRequest, + protos.google.analytics.admin.v1alpha.IListDataStreamsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IDataStream>): void; + listDataStreams( + request: protos.google.analytics.admin.v1alpha.IListDataStreamsRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListDataStreamsRequest, + protos.google.analytics.admin.v1alpha.IListDataStreamsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IDataStream>): void; + listDataStreams( + request?: protos.google.analytics.admin.v1alpha.IListDataStreamsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1alpha.IListDataStreamsRequest, + protos.google.analytics.admin.v1alpha.IListDataStreamsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IDataStream>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListDataStreamsRequest, + protos.google.analytics.admin.v1alpha.IListDataStreamsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IDataStream>): + Promise<[ + protos.google.analytics.admin.v1alpha.IDataStream[], + protos.google.analytics.admin.v1alpha.IListDataStreamsRequest|null, + protos.google.analytics.admin.v1alpha.IListDataStreamsResponse + ]>|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({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listDataStreams(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + * @param {string} request.pageToken + * A page token, received from a previous `ListDataStreams` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDataStreams` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [DataStream]{@link google.analytics.admin.v1alpha.DataStream} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDataStreamsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDataStreamsStream( + request?: protos.google.analytics.admin.v1alpha.IListDataStreamsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listDataStreams']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataStreams.createStream( + this.innerApiCalls.listDataStreams as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDataStreams`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {number} request.pageSize + * The maximum number of resources to return. + * If unspecified, at most 50 resources will be returned. + * The maximum value is 200 (higher values will be coerced to the maximum). + * @param {string} request.pageToken + * A page token, received from a previous `ListDataStreams` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDataStreams` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [DataStream]{@link google.analytics.admin.v1alpha.DataStream}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/analytics_admin_service.list_data_streams.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDataStreams_async + */ + listDataStreamsAsync( + request?: protos.google.analytics.admin.v1alpha.IListDataStreamsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listDataStreams']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataStreams.asyncIterate( + this.innerApiCalls['listDataStreams'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified account resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + accountPath(account:string) { + return this.pathTemplates.accountPathTemplate.render({ + account: account, + }); + } + + /** + * Parse the account from Account resource. + * + * @param {string} accountName + * A fully-qualified path representing Account resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAccountName(accountName: string) { + return this.pathTemplates.accountPathTemplate.match(accountName).account; + } + + /** + * Return a fully-qualified accountSummary resource name string. + * + * @param {string} account_summary + * @returns {string} Resource name string. + */ + accountSummaryPath(accountSummary:string) { + return this.pathTemplates.accountSummaryPathTemplate.render({ + account_summary: accountSummary, + }); + } + + /** + * Parse the account_summary from AccountSummary resource. + * + * @param {string} accountSummaryName + * A fully-qualified path representing AccountSummary resource. + * @returns {string} A string representing the account_summary. + */ + matchAccountSummaryFromAccountSummaryName(accountSummaryName: string) { + return this.pathTemplates.accountSummaryPathTemplate.match(accountSummaryName).account_summary; + } + + /** + * Return a fully-qualified accountUserLink resource name string. + * + * @param {string} account + * @param {string} user_link + * @returns {string} Resource name string. + */ + accountUserLinkPath(account:string,userLink:string) { + return this.pathTemplates.accountUserLinkPathTemplate.render({ + account: account, + user_link: userLink, + }); + } + + /** + * Parse the account from AccountUserLink resource. + * + * @param {string} accountUserLinkName + * A fully-qualified path representing account_user_link resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAccountUserLinkName(accountUserLinkName: string) { + return this.pathTemplates.accountUserLinkPathTemplate.match(accountUserLinkName).account; + } + + /** + * Parse the user_link from AccountUserLink resource. + * + * @param {string} accountUserLinkName + * A fully-qualified path representing account_user_link resource. + * @returns {string} A string representing the user_link. + */ + matchUserLinkFromAccountUserLinkName(accountUserLinkName: string) { + return this.pathTemplates.accountUserLinkPathTemplate.match(accountUserLinkName).user_link; + } + + /** + * Return a fully-qualified conversionEvent resource name string. + * + * @param {string} property + * @param {string} conversion_event + * @returns {string} Resource name string. + */ + conversionEventPath(property:string,conversionEvent:string) { + return this.pathTemplates.conversionEventPathTemplate.render({ + property: property, + conversion_event: conversionEvent, + }); + } + + /** + * Parse the property from ConversionEvent resource. + * + * @param {string} conversionEventName + * A fully-qualified path representing ConversionEvent resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromConversionEventName(conversionEventName: string) { + return this.pathTemplates.conversionEventPathTemplate.match(conversionEventName).property; + } + + /** + * Parse the conversion_event from ConversionEvent resource. + * + * @param {string} conversionEventName + * A fully-qualified path representing ConversionEvent resource. + * @returns {string} A string representing the conversion_event. + */ + matchConversionEventFromConversionEventName(conversionEventName: string) { + return this.pathTemplates.conversionEventPathTemplate.match(conversionEventName).conversion_event; + } + + /** + * Return a fully-qualified customDimension resource name string. + * + * @param {string} property + * @param {string} custom_dimension + * @returns {string} Resource name string. + */ + customDimensionPath(property:string,customDimension:string) { + return this.pathTemplates.customDimensionPathTemplate.render({ + property: property, + custom_dimension: customDimension, + }); + } + + /** + * Parse the property from CustomDimension resource. + * + * @param {string} customDimensionName + * A fully-qualified path representing CustomDimension resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromCustomDimensionName(customDimensionName: string) { + return this.pathTemplates.customDimensionPathTemplate.match(customDimensionName).property; + } + + /** + * Parse the custom_dimension from CustomDimension resource. + * + * @param {string} customDimensionName + * A fully-qualified path representing CustomDimension resource. + * @returns {string} A string representing the custom_dimension. + */ + matchCustomDimensionFromCustomDimensionName(customDimensionName: string) { + return this.pathTemplates.customDimensionPathTemplate.match(customDimensionName).custom_dimension; + } + + /** + * Return a fully-qualified customMetric resource name string. + * + * @param {string} property + * @param {string} custom_metric + * @returns {string} Resource name string. + */ + customMetricPath(property:string,customMetric:string) { + return this.pathTemplates.customMetricPathTemplate.render({ + property: property, + custom_metric: customMetric, + }); + } + + /** + * Parse the property from CustomMetric resource. + * + * @param {string} customMetricName + * A fully-qualified path representing CustomMetric resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromCustomMetricName(customMetricName: string) { + return this.pathTemplates.customMetricPathTemplate.match(customMetricName).property; + } + + /** + * Parse the custom_metric from CustomMetric resource. + * + * @param {string} customMetricName + * A fully-qualified path representing CustomMetric resource. + * @returns {string} A string representing the custom_metric. + */ + matchCustomMetricFromCustomMetricName(customMetricName: string) { + return this.pathTemplates.customMetricPathTemplate.match(customMetricName).custom_metric; + } + + /** + * Return a fully-qualified dataRetentionSettings resource name string. + * + * @param {string} property + * @returns {string} Resource name string. + */ + dataRetentionSettingsPath(property:string) { + return this.pathTemplates.dataRetentionSettingsPathTemplate.render({ + property: property, + }); + } + + /** + * Parse the property from DataRetentionSettings resource. + * + * @param {string} dataRetentionSettingsName + * A fully-qualified path representing DataRetentionSettings resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromDataRetentionSettingsName(dataRetentionSettingsName: string) { + return this.pathTemplates.dataRetentionSettingsPathTemplate.match(dataRetentionSettingsName).property; + } + + /** + * Return a fully-qualified dataSharingSettings resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + dataSharingSettingsPath(account:string) { + return this.pathTemplates.dataSharingSettingsPathTemplate.render({ + account: account, + }); + } + + /** + * Parse the account from DataSharingSettings resource. + * + * @param {string} dataSharingSettingsName + * A fully-qualified path representing DataSharingSettings resource. + * @returns {string} A string representing the account. + */ + matchAccountFromDataSharingSettingsName(dataSharingSettingsName: string) { + return this.pathTemplates.dataSharingSettingsPathTemplate.match(dataSharingSettingsName).account; + } + + /** + * Return a fully-qualified dataStream resource name string. + * + * @param {string} property + * @param {string} data_stream + * @returns {string} Resource name string. + */ + dataStreamPath(property:string,dataStream:string) { + return this.pathTemplates.dataStreamPathTemplate.render({ + property: property, + data_stream: dataStream, + }); + } + + /** + * Parse the property from DataStream resource. + * + * @param {string} dataStreamName + * A fully-qualified path representing DataStream resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromDataStreamName(dataStreamName: string) { + return this.pathTemplates.dataStreamPathTemplate.match(dataStreamName).property; + } + + /** + * Parse the data_stream from DataStream resource. + * + * @param {string} dataStreamName + * A fully-qualified path representing DataStream resource. + * @returns {string} A string representing the data_stream. + */ + matchDataStreamFromDataStreamName(dataStreamName: string) { + return this.pathTemplates.dataStreamPathTemplate.match(dataStreamName).data_stream; + } + + /** + * Return a fully-qualified displayVideo360AdvertiserLink resource name string. + * + * @param {string} property + * @returns {string} Resource name string. + */ + displayVideo360AdvertiserLinkPath(property:string) { + return this.pathTemplates.displayVideo360AdvertiserLinkPathTemplate.render({ + property: property, + }); + } + + /** + * Parse the property from DisplayVideo360AdvertiserLink resource. + * + * @param {string} displayVideo360AdvertiserLinkName + * A fully-qualified path representing DisplayVideo360AdvertiserLink resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromDisplayVideo360AdvertiserLinkName(displayVideo360AdvertiserLinkName: string) { + return this.pathTemplates.displayVideo360AdvertiserLinkPathTemplate.match(displayVideo360AdvertiserLinkName).property; + } + + /** + * Return a fully-qualified displayVideo360AdvertiserLinkProposal resource name string. + * + * @param {string} property + * @returns {string} Resource name string. + */ + displayVideo360AdvertiserLinkProposalPath(property:string) { + return this.pathTemplates.displayVideo360AdvertiserLinkProposalPathTemplate.render({ + property: property, + }); + } + + /** + * Parse the property from DisplayVideo360AdvertiserLinkProposal resource. + * + * @param {string} displayVideo360AdvertiserLinkProposalName + * A fully-qualified path representing DisplayVideo360AdvertiserLinkProposal resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromDisplayVideo360AdvertiserLinkProposalName(displayVideo360AdvertiserLinkProposalName: string) { + return this.pathTemplates.displayVideo360AdvertiserLinkProposalPathTemplate.match(displayVideo360AdvertiserLinkProposalName).property; + } + + /** + * Return a fully-qualified firebaseLink resource name string. + * + * @param {string} property + * @param {string} firebase_link + * @returns {string} Resource name string. + */ + firebaseLinkPath(property:string,firebaseLink:string) { + return this.pathTemplates.firebaseLinkPathTemplate.render({ + property: property, + firebase_link: firebaseLink, + }); + } + + /** + * Parse the property from FirebaseLink resource. + * + * @param {string} firebaseLinkName + * A fully-qualified path representing FirebaseLink resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromFirebaseLinkName(firebaseLinkName: string) { + return this.pathTemplates.firebaseLinkPathTemplate.match(firebaseLinkName).property; + } + + /** + * Parse the firebase_link from FirebaseLink resource. + * + * @param {string} firebaseLinkName + * A fully-qualified path representing FirebaseLink resource. + * @returns {string} A string representing the firebase_link. + */ + matchFirebaseLinkFromFirebaseLinkName(firebaseLinkName: string) { + return this.pathTemplates.firebaseLinkPathTemplate.match(firebaseLinkName).firebase_link; + } + + /** + * Return a fully-qualified globalSiteTag resource name string. + * + * @param {string} property + * @param {string} data_stream + * @returns {string} Resource name string. + */ + globalSiteTagPath(property:string,dataStream:string) { + return this.pathTemplates.globalSiteTagPathTemplate.render({ + property: property, + data_stream: dataStream, + }); + } + + /** + * Parse the property from GlobalSiteTag resource. + * + * @param {string} globalSiteTagName + * A fully-qualified path representing GlobalSiteTag resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromGlobalSiteTagName(globalSiteTagName: string) { + return this.pathTemplates.globalSiteTagPathTemplate.match(globalSiteTagName).property; + } + + /** + * Parse the data_stream from GlobalSiteTag resource. + * + * @param {string} globalSiteTagName + * A fully-qualified path representing GlobalSiteTag resource. + * @returns {string} A string representing the data_stream. + */ + matchDataStreamFromGlobalSiteTagName(globalSiteTagName: string) { + return this.pathTemplates.globalSiteTagPathTemplate.match(globalSiteTagName).data_stream; + } + + /** + * Return a fully-qualified googleAdsLink resource name string. + * + * @param {string} property + * @param {string} google_ads_link + * @returns {string} Resource name string. + */ + googleAdsLinkPath(property:string,googleAdsLink:string) { + return this.pathTemplates.googleAdsLinkPathTemplate.render({ + property: property, + google_ads_link: googleAdsLink, + }); + } + + /** + * Parse the property from GoogleAdsLink resource. + * + * @param {string} googleAdsLinkName + * A fully-qualified path representing GoogleAdsLink resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromGoogleAdsLinkName(googleAdsLinkName: string) { + return this.pathTemplates.googleAdsLinkPathTemplate.match(googleAdsLinkName).property; + } + + /** + * Parse the google_ads_link from GoogleAdsLink resource. + * + * @param {string} googleAdsLinkName + * A fully-qualified path representing GoogleAdsLink resource. + * @returns {string} A string representing the google_ads_link. + */ + matchGoogleAdsLinkFromGoogleAdsLinkName(googleAdsLinkName: string) { + return this.pathTemplates.googleAdsLinkPathTemplate.match(googleAdsLinkName).google_ads_link; + } + + /** + * Return a fully-qualified googleSignalsSettings resource name string. + * + * @param {string} property + * @returns {string} Resource name string. + */ + googleSignalsSettingsPath(property:string) { + return this.pathTemplates.googleSignalsSettingsPathTemplate.render({ + property: property, + }); + } + + /** + * Parse the property from GoogleSignalsSettings resource. + * + * @param {string} googleSignalsSettingsName + * A fully-qualified path representing GoogleSignalsSettings resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromGoogleSignalsSettingsName(googleSignalsSettingsName: string) { + return this.pathTemplates.googleSignalsSettingsPathTemplate.match(googleSignalsSettingsName).property; + } + + /** + * Return a fully-qualified measurementProtocolSecret resource name string. + * + * @param {string} property + * @param {string} data_stream + * @param {string} measurement_protocol_secret + * @returns {string} Resource name string. + */ + measurementProtocolSecretPath(property:string,dataStream:string,measurementProtocolSecret:string) { + return this.pathTemplates.measurementProtocolSecretPathTemplate.render({ + property: property, + data_stream: dataStream, + measurement_protocol_secret: measurementProtocolSecret, + }); + } + + /** + * Parse the property from MeasurementProtocolSecret resource. + * + * @param {string} measurementProtocolSecretName + * A fully-qualified path representing MeasurementProtocolSecret resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromMeasurementProtocolSecretName(measurementProtocolSecretName: string) { + return this.pathTemplates.measurementProtocolSecretPathTemplate.match(measurementProtocolSecretName).property; + } + + /** + * Parse the data_stream from MeasurementProtocolSecret resource. + * + * @param {string} measurementProtocolSecretName + * A fully-qualified path representing MeasurementProtocolSecret resource. + * @returns {string} A string representing the data_stream. + */ + matchDataStreamFromMeasurementProtocolSecretName(measurementProtocolSecretName: string) { + return this.pathTemplates.measurementProtocolSecretPathTemplate.match(measurementProtocolSecretName).data_stream; + } + + /** + * Parse the measurement_protocol_secret from MeasurementProtocolSecret resource. + * + * @param {string} measurementProtocolSecretName + * A fully-qualified path representing MeasurementProtocolSecret resource. + * @returns {string} A string representing the measurement_protocol_secret. + */ + matchMeasurementProtocolSecretFromMeasurementProtocolSecretName(measurementProtocolSecretName: string) { + return this.pathTemplates.measurementProtocolSecretPathTemplate.match(measurementProtocolSecretName).measurement_protocol_secret; + } + + /** + * Return a fully-qualified property resource name string. + * + * @param {string} property + * @returns {string} Resource name string. + */ + propertyPath(property:string) { + return this.pathTemplates.propertyPathTemplate.render({ + property: property, + }); + } + + /** + * Parse the property from Property resource. + * + * @param {string} propertyName + * A fully-qualified path representing Property resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromPropertyName(propertyName: string) { + return this.pathTemplates.propertyPathTemplate.match(propertyName).property; + } + + /** + * Return a fully-qualified propertyUserLink resource name string. + * + * @param {string} property + * @param {string} user_link + * @returns {string} Resource name string. + */ + propertyUserLinkPath(property:string,userLink:string) { + return this.pathTemplates.propertyUserLinkPathTemplate.render({ + property: property, + user_link: userLink, + }); + } + + /** + * Parse the property from PropertyUserLink resource. + * + * @param {string} propertyUserLinkName + * A fully-qualified path representing property_user_link resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromPropertyUserLinkName(propertyUserLinkName: string) { + return this.pathTemplates.propertyUserLinkPathTemplate.match(propertyUserLinkName).property; + } + + /** + * Parse the user_link from PropertyUserLink resource. + * + * @param {string} propertyUserLinkName + * A fully-qualified path representing property_user_link resource. + * @returns {string} A string representing the user_link. + */ + matchUserLinkFromPropertyUserLinkName(propertyUserLinkName: string) { + return this.pathTemplates.propertyUserLinkPathTemplate.match(propertyUserLinkName).user_link; + } + + /** + * 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.analyticsAdminServiceStub && !this._terminated) { + return this.analyticsAdminServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_client_config.json b/owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_client_config.json new file mode 100644 index 0000000..24e060d --- /dev/null +++ b/owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_client_config.json @@ -0,0 +1,394 @@ +{ + "interfaces": { + "google.analytics.admin.v1alpha.AnalyticsAdminService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unknown_unavailable": [ + "UNKNOWN", + "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 + }, + "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": { + "GetAccount": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListAccounts": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "DeleteAccount": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateAccount": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ProvisionAccountTicket": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListAccountSummaries": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetProperty": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListProperties": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateProperty": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "DeleteProperty": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateProperty": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetUserLink": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "BatchGetUserLinks": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListUserLinks": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "AuditUserLinks": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateUserLink": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "BatchCreateUserLinks": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateUserLink": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "BatchUpdateUserLinks": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "DeleteUserLink": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "BatchDeleteUserLinks": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateFirebaseLink": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "DeleteFirebaseLink": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListFirebaseLinks": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetGlobalSiteTag": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateGoogleAdsLink": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateGoogleAdsLink": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "DeleteGoogleAdsLink": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListGoogleAdsLinks": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetDataSharingSettings": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetMeasurementProtocolSecret": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListMeasurementProtocolSecrets": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateMeasurementProtocolSecret": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "DeleteMeasurementProtocolSecret": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateMeasurementProtocolSecret": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "AcknowledgeUserDataCollection": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "SearchChangeHistoryEvents": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetGoogleSignalsSettings": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateGoogleSignalsSettings": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateConversionEvent": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetConversionEvent": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "DeleteConversionEvent": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListConversionEvents": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetDisplayVideo360AdvertiserLink": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListDisplayVideo360AdvertiserLinks": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateDisplayVideo360AdvertiserLink": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "DeleteDisplayVideo360AdvertiserLink": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateDisplayVideo360AdvertiserLink": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetDisplayVideo360AdvertiserLinkProposal": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListDisplayVideo360AdvertiserLinkProposals": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateDisplayVideo360AdvertiserLinkProposal": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "DeleteDisplayVideo360AdvertiserLinkProposal": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ApproveDisplayVideo360AdvertiserLinkProposal": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CancelDisplayVideo360AdvertiserLinkProposal": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateCustomDimension": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateCustomDimension": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListCustomDimensions": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ArchiveCustomDimension": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetCustomDimension": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateCustomMetric": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateCustomMetric": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListCustomMetrics": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ArchiveCustomMetric": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetCustomMetric": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetDataRetentionSettings": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateDataRetentionSettings": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateDataStream": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "DeleteDataStream": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateDataStream": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListDataStreams": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetDataStream": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + } + } + } + } +} diff --git a/owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_proto_list.json b/owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_proto_list.json new file mode 100644 index 0000000..731e0f1 --- /dev/null +++ b/owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/analytics/admin/v1alpha/analytics_admin.proto", + "../../protos/google/analytics/admin/v1alpha/resources.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 0000000..11e2655 --- /dev/null +++ b/owl-bot-staging/v1alpha/src/v1alpha/gapic_metadata.json @@ -0,0 +1,793 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.analytics.admin.v1alpha", + "libraryPackage": "@google-analytics/admin", + "services": { + "AnalyticsAdminService": { + "clients": { + "grpc": { + "libraryClient": "AnalyticsAdminServiceClient", + "rpcs": { + "GetAccount": { + "methods": [ + "getAccount" + ] + }, + "DeleteAccount": { + "methods": [ + "deleteAccount" + ] + }, + "UpdateAccount": { + "methods": [ + "updateAccount" + ] + }, + "ProvisionAccountTicket": { + "methods": [ + "provisionAccountTicket" + ] + }, + "GetProperty": { + "methods": [ + "getProperty" + ] + }, + "CreateProperty": { + "methods": [ + "createProperty" + ] + }, + "DeleteProperty": { + "methods": [ + "deleteProperty" + ] + }, + "UpdateProperty": { + "methods": [ + "updateProperty" + ] + }, + "GetUserLink": { + "methods": [ + "getUserLink" + ] + }, + "BatchGetUserLinks": { + "methods": [ + "batchGetUserLinks" + ] + }, + "CreateUserLink": { + "methods": [ + "createUserLink" + ] + }, + "BatchCreateUserLinks": { + "methods": [ + "batchCreateUserLinks" + ] + }, + "UpdateUserLink": { + "methods": [ + "updateUserLink" + ] + }, + "BatchUpdateUserLinks": { + "methods": [ + "batchUpdateUserLinks" + ] + }, + "DeleteUserLink": { + "methods": [ + "deleteUserLink" + ] + }, + "BatchDeleteUserLinks": { + "methods": [ + "batchDeleteUserLinks" + ] + }, + "CreateFirebaseLink": { + "methods": [ + "createFirebaseLink" + ] + }, + "DeleteFirebaseLink": { + "methods": [ + "deleteFirebaseLink" + ] + }, + "GetGlobalSiteTag": { + "methods": [ + "getGlobalSiteTag" + ] + }, + "CreateGoogleAdsLink": { + "methods": [ + "createGoogleAdsLink" + ] + }, + "UpdateGoogleAdsLink": { + "methods": [ + "updateGoogleAdsLink" + ] + }, + "DeleteGoogleAdsLink": { + "methods": [ + "deleteGoogleAdsLink" + ] + }, + "GetDataSharingSettings": { + "methods": [ + "getDataSharingSettings" + ] + }, + "GetMeasurementProtocolSecret": { + "methods": [ + "getMeasurementProtocolSecret" + ] + }, + "CreateMeasurementProtocolSecret": { + "methods": [ + "createMeasurementProtocolSecret" + ] + }, + "DeleteMeasurementProtocolSecret": { + "methods": [ + "deleteMeasurementProtocolSecret" + ] + }, + "UpdateMeasurementProtocolSecret": { + "methods": [ + "updateMeasurementProtocolSecret" + ] + }, + "AcknowledgeUserDataCollection": { + "methods": [ + "acknowledgeUserDataCollection" + ] + }, + "GetGoogleSignalsSettings": { + "methods": [ + "getGoogleSignalsSettings" + ] + }, + "UpdateGoogleSignalsSettings": { + "methods": [ + "updateGoogleSignalsSettings" + ] + }, + "CreateConversionEvent": { + "methods": [ + "createConversionEvent" + ] + }, + "GetConversionEvent": { + "methods": [ + "getConversionEvent" + ] + }, + "DeleteConversionEvent": { + "methods": [ + "deleteConversionEvent" + ] + }, + "GetDisplayVideo360AdvertiserLink": { + "methods": [ + "getDisplayVideo360AdvertiserLink" + ] + }, + "CreateDisplayVideo360AdvertiserLink": { + "methods": [ + "createDisplayVideo360AdvertiserLink" + ] + }, + "DeleteDisplayVideo360AdvertiserLink": { + "methods": [ + "deleteDisplayVideo360AdvertiserLink" + ] + }, + "UpdateDisplayVideo360AdvertiserLink": { + "methods": [ + "updateDisplayVideo360AdvertiserLink" + ] + }, + "GetDisplayVideo360AdvertiserLinkProposal": { + "methods": [ + "getDisplayVideo360AdvertiserLinkProposal" + ] + }, + "CreateDisplayVideo360AdvertiserLinkProposal": { + "methods": [ + "createDisplayVideo360AdvertiserLinkProposal" + ] + }, + "DeleteDisplayVideo360AdvertiserLinkProposal": { + "methods": [ + "deleteDisplayVideo360AdvertiserLinkProposal" + ] + }, + "ApproveDisplayVideo360AdvertiserLinkProposal": { + "methods": [ + "approveDisplayVideo360AdvertiserLinkProposal" + ] + }, + "CancelDisplayVideo360AdvertiserLinkProposal": { + "methods": [ + "cancelDisplayVideo360AdvertiserLinkProposal" + ] + }, + "CreateCustomDimension": { + "methods": [ + "createCustomDimension" + ] + }, + "UpdateCustomDimension": { + "methods": [ + "updateCustomDimension" + ] + }, + "ArchiveCustomDimension": { + "methods": [ + "archiveCustomDimension" + ] + }, + "GetCustomDimension": { + "methods": [ + "getCustomDimension" + ] + }, + "CreateCustomMetric": { + "methods": [ + "createCustomMetric" + ] + }, + "UpdateCustomMetric": { + "methods": [ + "updateCustomMetric" + ] + }, + "ArchiveCustomMetric": { + "methods": [ + "archiveCustomMetric" + ] + }, + "GetCustomMetric": { + "methods": [ + "getCustomMetric" + ] + }, + "GetDataRetentionSettings": { + "methods": [ + "getDataRetentionSettings" + ] + }, + "UpdateDataRetentionSettings": { + "methods": [ + "updateDataRetentionSettings" + ] + }, + "CreateDataStream": { + "methods": [ + "createDataStream" + ] + }, + "DeleteDataStream": { + "methods": [ + "deleteDataStream" + ] + }, + "UpdateDataStream": { + "methods": [ + "updateDataStream" + ] + }, + "GetDataStream": { + "methods": [ + "getDataStream" + ] + }, + "ListAccounts": { + "methods": [ + "listAccounts", + "listAccountsStream", + "listAccountsAsync" + ] + }, + "ListAccountSummaries": { + "methods": [ + "listAccountSummaries", + "listAccountSummariesStream", + "listAccountSummariesAsync" + ] + }, + "ListProperties": { + "methods": [ + "listProperties", + "listPropertiesStream", + "listPropertiesAsync" + ] + }, + "ListUserLinks": { + "methods": [ + "listUserLinks", + "listUserLinksStream", + "listUserLinksAsync" + ] + }, + "AuditUserLinks": { + "methods": [ + "auditUserLinks", + "auditUserLinksStream", + "auditUserLinksAsync" + ] + }, + "ListFirebaseLinks": { + "methods": [ + "listFirebaseLinks", + "listFirebaseLinksStream", + "listFirebaseLinksAsync" + ] + }, + "ListGoogleAdsLinks": { + "methods": [ + "listGoogleAdsLinks", + "listGoogleAdsLinksStream", + "listGoogleAdsLinksAsync" + ] + }, + "ListMeasurementProtocolSecrets": { + "methods": [ + "listMeasurementProtocolSecrets", + "listMeasurementProtocolSecretsStream", + "listMeasurementProtocolSecretsAsync" + ] + }, + "SearchChangeHistoryEvents": { + "methods": [ + "searchChangeHistoryEvents", + "searchChangeHistoryEventsStream", + "searchChangeHistoryEventsAsync" + ] + }, + "ListConversionEvents": { + "methods": [ + "listConversionEvents", + "listConversionEventsStream", + "listConversionEventsAsync" + ] + }, + "ListDisplayVideo360AdvertiserLinks": { + "methods": [ + "listDisplayVideo360AdvertiserLinks", + "listDisplayVideo360AdvertiserLinksStream", + "listDisplayVideo360AdvertiserLinksAsync" + ] + }, + "ListDisplayVideo360AdvertiserLinkProposals": { + "methods": [ + "listDisplayVideo360AdvertiserLinkProposals", + "listDisplayVideo360AdvertiserLinkProposalsStream", + "listDisplayVideo360AdvertiserLinkProposalsAsync" + ] + }, + "ListCustomDimensions": { + "methods": [ + "listCustomDimensions", + "listCustomDimensionsStream", + "listCustomDimensionsAsync" + ] + }, + "ListCustomMetrics": { + "methods": [ + "listCustomMetrics", + "listCustomMetricsStream", + "listCustomMetricsAsync" + ] + }, + "ListDataStreams": { + "methods": [ + "listDataStreams", + "listDataStreamsStream", + "listDataStreamsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AnalyticsAdminServiceClient", + "rpcs": { + "GetAccount": { + "methods": [ + "getAccount" + ] + }, + "DeleteAccount": { + "methods": [ + "deleteAccount" + ] + }, + "UpdateAccount": { + "methods": [ + "updateAccount" + ] + }, + "ProvisionAccountTicket": { + "methods": [ + "provisionAccountTicket" + ] + }, + "GetProperty": { + "methods": [ + "getProperty" + ] + }, + "CreateProperty": { + "methods": [ + "createProperty" + ] + }, + "DeleteProperty": { + "methods": [ + "deleteProperty" + ] + }, + "UpdateProperty": { + "methods": [ + "updateProperty" + ] + }, + "GetUserLink": { + "methods": [ + "getUserLink" + ] + }, + "BatchGetUserLinks": { + "methods": [ + "batchGetUserLinks" + ] + }, + "CreateUserLink": { + "methods": [ + "createUserLink" + ] + }, + "BatchCreateUserLinks": { + "methods": [ + "batchCreateUserLinks" + ] + }, + "UpdateUserLink": { + "methods": [ + "updateUserLink" + ] + }, + "BatchUpdateUserLinks": { + "methods": [ + "batchUpdateUserLinks" + ] + }, + "DeleteUserLink": { + "methods": [ + "deleteUserLink" + ] + }, + "BatchDeleteUserLinks": { + "methods": [ + "batchDeleteUserLinks" + ] + }, + "CreateFirebaseLink": { + "methods": [ + "createFirebaseLink" + ] + }, + "DeleteFirebaseLink": { + "methods": [ + "deleteFirebaseLink" + ] + }, + "GetGlobalSiteTag": { + "methods": [ + "getGlobalSiteTag" + ] + }, + "CreateGoogleAdsLink": { + "methods": [ + "createGoogleAdsLink" + ] + }, + "UpdateGoogleAdsLink": { + "methods": [ + "updateGoogleAdsLink" + ] + }, + "DeleteGoogleAdsLink": { + "methods": [ + "deleteGoogleAdsLink" + ] + }, + "GetDataSharingSettings": { + "methods": [ + "getDataSharingSettings" + ] + }, + "GetMeasurementProtocolSecret": { + "methods": [ + "getMeasurementProtocolSecret" + ] + }, + "CreateMeasurementProtocolSecret": { + "methods": [ + "createMeasurementProtocolSecret" + ] + }, + "DeleteMeasurementProtocolSecret": { + "methods": [ + "deleteMeasurementProtocolSecret" + ] + }, + "UpdateMeasurementProtocolSecret": { + "methods": [ + "updateMeasurementProtocolSecret" + ] + }, + "AcknowledgeUserDataCollection": { + "methods": [ + "acknowledgeUserDataCollection" + ] + }, + "GetGoogleSignalsSettings": { + "methods": [ + "getGoogleSignalsSettings" + ] + }, + "UpdateGoogleSignalsSettings": { + "methods": [ + "updateGoogleSignalsSettings" + ] + }, + "CreateConversionEvent": { + "methods": [ + "createConversionEvent" + ] + }, + "GetConversionEvent": { + "methods": [ + "getConversionEvent" + ] + }, + "DeleteConversionEvent": { + "methods": [ + "deleteConversionEvent" + ] + }, + "GetDisplayVideo360AdvertiserLink": { + "methods": [ + "getDisplayVideo360AdvertiserLink" + ] + }, + "CreateDisplayVideo360AdvertiserLink": { + "methods": [ + "createDisplayVideo360AdvertiserLink" + ] + }, + "DeleteDisplayVideo360AdvertiserLink": { + "methods": [ + "deleteDisplayVideo360AdvertiserLink" + ] + }, + "UpdateDisplayVideo360AdvertiserLink": { + "methods": [ + "updateDisplayVideo360AdvertiserLink" + ] + }, + "GetDisplayVideo360AdvertiserLinkProposal": { + "methods": [ + "getDisplayVideo360AdvertiserLinkProposal" + ] + }, + "CreateDisplayVideo360AdvertiserLinkProposal": { + "methods": [ + "createDisplayVideo360AdvertiserLinkProposal" + ] + }, + "DeleteDisplayVideo360AdvertiserLinkProposal": { + "methods": [ + "deleteDisplayVideo360AdvertiserLinkProposal" + ] + }, + "ApproveDisplayVideo360AdvertiserLinkProposal": { + "methods": [ + "approveDisplayVideo360AdvertiserLinkProposal" + ] + }, + "CancelDisplayVideo360AdvertiserLinkProposal": { + "methods": [ + "cancelDisplayVideo360AdvertiserLinkProposal" + ] + }, + "CreateCustomDimension": { + "methods": [ + "createCustomDimension" + ] + }, + "UpdateCustomDimension": { + "methods": [ + "updateCustomDimension" + ] + }, + "ArchiveCustomDimension": { + "methods": [ + "archiveCustomDimension" + ] + }, + "GetCustomDimension": { + "methods": [ + "getCustomDimension" + ] + }, + "CreateCustomMetric": { + "methods": [ + "createCustomMetric" + ] + }, + "UpdateCustomMetric": { + "methods": [ + "updateCustomMetric" + ] + }, + "ArchiveCustomMetric": { + "methods": [ + "archiveCustomMetric" + ] + }, + "GetCustomMetric": { + "methods": [ + "getCustomMetric" + ] + }, + "GetDataRetentionSettings": { + "methods": [ + "getDataRetentionSettings" + ] + }, + "UpdateDataRetentionSettings": { + "methods": [ + "updateDataRetentionSettings" + ] + }, + "CreateDataStream": { + "methods": [ + "createDataStream" + ] + }, + "DeleteDataStream": { + "methods": [ + "deleteDataStream" + ] + }, + "UpdateDataStream": { + "methods": [ + "updateDataStream" + ] + }, + "GetDataStream": { + "methods": [ + "getDataStream" + ] + }, + "ListAccounts": { + "methods": [ + "listAccounts", + "listAccountsStream", + "listAccountsAsync" + ] + }, + "ListAccountSummaries": { + "methods": [ + "listAccountSummaries", + "listAccountSummariesStream", + "listAccountSummariesAsync" + ] + }, + "ListProperties": { + "methods": [ + "listProperties", + "listPropertiesStream", + "listPropertiesAsync" + ] + }, + "ListUserLinks": { + "methods": [ + "listUserLinks", + "listUserLinksStream", + "listUserLinksAsync" + ] + }, + "AuditUserLinks": { + "methods": [ + "auditUserLinks", + "auditUserLinksStream", + "auditUserLinksAsync" + ] + }, + "ListFirebaseLinks": { + "methods": [ + "listFirebaseLinks", + "listFirebaseLinksStream", + "listFirebaseLinksAsync" + ] + }, + "ListGoogleAdsLinks": { + "methods": [ + "listGoogleAdsLinks", + "listGoogleAdsLinksStream", + "listGoogleAdsLinksAsync" + ] + }, + "ListMeasurementProtocolSecrets": { + "methods": [ + "listMeasurementProtocolSecrets", + "listMeasurementProtocolSecretsStream", + "listMeasurementProtocolSecretsAsync" + ] + }, + "SearchChangeHistoryEvents": { + "methods": [ + "searchChangeHistoryEvents", + "searchChangeHistoryEventsStream", + "searchChangeHistoryEventsAsync" + ] + }, + "ListConversionEvents": { + "methods": [ + "listConversionEvents", + "listConversionEventsStream", + "listConversionEventsAsync" + ] + }, + "ListDisplayVideo360AdvertiserLinks": { + "methods": [ + "listDisplayVideo360AdvertiserLinks", + "listDisplayVideo360AdvertiserLinksStream", + "listDisplayVideo360AdvertiserLinksAsync" + ] + }, + "ListDisplayVideo360AdvertiserLinkProposals": { + "methods": [ + "listDisplayVideo360AdvertiserLinkProposals", + "listDisplayVideo360AdvertiserLinkProposalsStream", + "listDisplayVideo360AdvertiserLinkProposalsAsync" + ] + }, + "ListCustomDimensions": { + "methods": [ + "listCustomDimensions", + "listCustomDimensionsStream", + "listCustomDimensionsAsync" + ] + }, + "ListCustomMetrics": { + "methods": [ + "listCustomMetrics", + "listCustomMetricsStream", + "listCustomMetricsAsync" + ] + }, + "ListDataStreams": { + "methods": [ + "listDataStreams", + "listDataStreamsStream", + "listDataStreamsAsync" + ] + } + } + } + } + } + } +} 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 0000000..6836b1c --- /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 {AnalyticsAdminServiceClient} from './analytics_admin_service_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 0000000..763ea5c --- /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 admin = require('@google-analytics/admin'); + +function main() { + const analyticsAdminServiceClient = new admin.AnalyticsAdminServiceClient(); +} + +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 0000000..6815309 --- /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 {AnalyticsAdminServiceClient} from '@google-analytics/admin'; + +// check that the client class type name can be used +function doStuffWithAnalyticsAdminServiceClient(client: AnalyticsAdminServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const analyticsAdminServiceClient = new AnalyticsAdminServiceClient(); + doStuffWithAnalyticsAdminServiceClient(analyticsAdminServiceClient); +} + +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 0000000..8ec4522 --- /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_analytics_admin_service_v1alpha.ts b/owl-bot-staging/v1alpha/test/gapic_analytics_admin_service_v1alpha.ts new file mode 100644 index 0000000..bdfc71f --- /dev/null +++ b/owl-bot-staging/v1alpha/test/gapic_analytics_admin_service_v1alpha.ts @@ -0,0 +1,9428 @@ +// 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 analyticsadminserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +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); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1alpha.AnalyticsAdminServiceClient', () => { + it('has servicePath', () => { + const servicePath = analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.analyticsAdminServiceStub, undefined); + await client.initialize(); + assert(client.analyticsAdminServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.analyticsAdminServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.analyticsAdminServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + 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 analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + 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('getAccount', () => { + it('invokes getAccount without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetAccountRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()); + client.innerApiCalls.getAccount = stubSimpleCall(expectedResponse); + const [response] = await client.getAccount(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getAccount as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getAccount without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetAccountRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()); + client.innerApiCalls.getAccount = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAccount( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAccount|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getAccount as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getAccount with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetAccountRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getAccount = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAccount(request), expectedError); + assert((client.innerApiCalls.getAccount as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getAccount with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetAccountRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAccount(request), expectedError); + }); + }); + + describe('deleteAccount', () => { + it('invokes deleteAccount without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteAccountRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteAccount = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAccount(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteAccount as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteAccount without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteAccountRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteAccount = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAccount( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteAccount as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteAccount with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteAccountRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAccount = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteAccount(request), expectedError); + assert((client.innerApiCalls.deleteAccount as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteAccount with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteAccountRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteAccount(request), expectedError); + }); + }); + + describe('updateAccount', () => { + it('invokes updateAccount without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateAccountRequest()); + request.account = {}; + request.account.name = ''; + const expectedHeaderRequestParams = "account.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()); + client.innerApiCalls.updateAccount = stubSimpleCall(expectedResponse); + const [response] = await client.updateAccount(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateAccount as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateAccount without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateAccountRequest()); + request.account = {}; + request.account.name = ''; + const expectedHeaderRequestParams = "account.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()); + client.innerApiCalls.updateAccount = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAccount( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAccount|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateAccount as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateAccount with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateAccountRequest()); + request.account = {}; + request.account.name = ''; + const expectedHeaderRequestParams = "account.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAccount = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateAccount(request), expectedError); + assert((client.innerApiCalls.updateAccount as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateAccount with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateAccountRequest()); + request.account = {}; + request.account.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateAccount(request), expectedError); + }); + }); + + describe('provisionAccountTicket', () => { + it('invokes provisionAccountTicket without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ProvisionAccountTicketRequest()); + const expectedOptions = {otherArgs: {headers: {}}};; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ProvisionAccountTicketResponse()); + client.innerApiCalls.provisionAccountTicket = stubSimpleCall(expectedResponse); + const [response] = await client.provisionAccountTicket(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.provisionAccountTicket as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes provisionAccountTicket without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ProvisionAccountTicketRequest()); + const expectedOptions = {otherArgs: {headers: {}}};; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ProvisionAccountTicketResponse()); + client.innerApiCalls.provisionAccountTicket = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.provisionAccountTicket( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IProvisionAccountTicketResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.provisionAccountTicket as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes provisionAccountTicket with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ProvisionAccountTicketRequest()); + const expectedOptions = {otherArgs: {headers: {}}};; + const expectedError = new Error('expected'); + client.innerApiCalls.provisionAccountTicket = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.provisionAccountTicket(request), expectedError); + assert((client.innerApiCalls.provisionAccountTicket as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes provisionAccountTicket with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ProvisionAccountTicketRequest()); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.provisionAccountTicket(request), expectedError); + }); + }); + + describe('getProperty', () => { + it('invokes getProperty without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetPropertyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()); + client.innerApiCalls.getProperty = stubSimpleCall(expectedResponse); + const [response] = await client.getProperty(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getProperty as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getProperty without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetPropertyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()); + client.innerApiCalls.getProperty = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getProperty( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IProperty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getProperty as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getProperty with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetPropertyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getProperty = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getProperty(request), expectedError); + assert((client.innerApiCalls.getProperty as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getProperty with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetPropertyRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getProperty(request), expectedError); + }); + }); + + describe('createProperty', () => { + it('invokes createProperty without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreatePropertyRequest()); + const expectedOptions = {otherArgs: {headers: {}}};; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()); + client.innerApiCalls.createProperty = stubSimpleCall(expectedResponse); + const [response] = await client.createProperty(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createProperty as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createProperty without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreatePropertyRequest()); + const expectedOptions = {otherArgs: {headers: {}}};; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()); + client.innerApiCalls.createProperty = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createProperty( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IProperty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createProperty as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createProperty with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreatePropertyRequest()); + const expectedOptions = {otherArgs: {headers: {}}};; + const expectedError = new Error('expected'); + client.innerApiCalls.createProperty = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createProperty(request), expectedError); + assert((client.innerApiCalls.createProperty as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createProperty with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreatePropertyRequest()); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createProperty(request), expectedError); + }); + }); + + describe('deleteProperty', () => { + it('invokes deleteProperty without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeletePropertyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()); + client.innerApiCalls.deleteProperty = stubSimpleCall(expectedResponse); + const [response] = await client.deleteProperty(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteProperty as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteProperty without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeletePropertyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()); + client.innerApiCalls.deleteProperty = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteProperty( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IProperty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteProperty as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteProperty with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeletePropertyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteProperty = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteProperty(request), expectedError); + assert((client.innerApiCalls.deleteProperty as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteProperty with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeletePropertyRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteProperty(request), expectedError); + }); + }); + + describe('updateProperty', () => { + it('invokes updateProperty without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdatePropertyRequest()); + request.property = {}; + request.property.name = ''; + const expectedHeaderRequestParams = "property.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()); + client.innerApiCalls.updateProperty = stubSimpleCall(expectedResponse); + const [response] = await client.updateProperty(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateProperty as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateProperty without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdatePropertyRequest()); + request.property = {}; + request.property.name = ''; + const expectedHeaderRequestParams = "property.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()); + client.innerApiCalls.updateProperty = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateProperty( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IProperty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateProperty as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateProperty with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdatePropertyRequest()); + request.property = {}; + request.property.name = ''; + const expectedHeaderRequestParams = "property.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateProperty = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateProperty(request), expectedError); + assert((client.innerApiCalls.updateProperty as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateProperty with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdatePropertyRequest()); + request.property = {}; + request.property.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateProperty(request), expectedError); + }); + }); + + describe('getUserLink', () => { + it('invokes getUserLink without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetUserLinkRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()); + client.innerApiCalls.getUserLink = stubSimpleCall(expectedResponse); + const [response] = await client.getUserLink(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getUserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getUserLink without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetUserLinkRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()); + client.innerApiCalls.getUserLink = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getUserLink( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IUserLink|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getUserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getUserLink with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetUserLinkRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getUserLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getUserLink(request), expectedError); + assert((client.innerApiCalls.getUserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getUserLink with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetUserLinkRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getUserLink(request), expectedError); + }); + }); + + describe('batchGetUserLinks', () => { + it('invokes batchGetUserLinks without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchGetUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchGetUserLinksResponse()); + client.innerApiCalls.batchGetUserLinks = stubSimpleCall(expectedResponse); + const [response] = await client.batchGetUserLinks(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchGetUserLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchGetUserLinks without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchGetUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchGetUserLinksResponse()); + client.innerApiCalls.batchGetUserLinks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchGetUserLinks( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IBatchGetUserLinksResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchGetUserLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes batchGetUserLinks with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchGetUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchGetUserLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchGetUserLinks(request), expectedError); + assert((client.innerApiCalls.batchGetUserLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchGetUserLinks with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchGetUserLinksRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchGetUserLinks(request), expectedError); + }); + }); + + describe('createUserLink', () => { + it('invokes createUserLink without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateUserLinkRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()); + client.innerApiCalls.createUserLink = stubSimpleCall(expectedResponse); + const [response] = await client.createUserLink(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createUserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createUserLink without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateUserLinkRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()); + client.innerApiCalls.createUserLink = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createUserLink( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IUserLink|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createUserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createUserLink with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateUserLinkRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createUserLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createUserLink(request), expectedError); + assert((client.innerApiCalls.createUserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createUserLink with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateUserLinkRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createUserLink(request), expectedError); + }); + }); + + describe('batchCreateUserLinks', () => { + it('invokes batchCreateUserLinks without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchCreateUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchCreateUserLinksResponse()); + client.innerApiCalls.batchCreateUserLinks = stubSimpleCall(expectedResponse); + const [response] = await client.batchCreateUserLinks(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchCreateUserLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchCreateUserLinks without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchCreateUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchCreateUserLinksResponse()); + client.innerApiCalls.batchCreateUserLinks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchCreateUserLinks( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchCreateUserLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes batchCreateUserLinks with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchCreateUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateUserLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchCreateUserLinks(request), expectedError); + assert((client.innerApiCalls.batchCreateUserLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchCreateUserLinks with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchCreateUserLinksRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchCreateUserLinks(request), expectedError); + }); + }); + + describe('updateUserLink', () => { + it('invokes updateUserLink without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateUserLinkRequest()); + request.userLink = {}; + request.userLink.name = ''; + const expectedHeaderRequestParams = "user_link.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()); + client.innerApiCalls.updateUserLink = stubSimpleCall(expectedResponse); + const [response] = await client.updateUserLink(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateUserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateUserLink without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateUserLinkRequest()); + request.userLink = {}; + request.userLink.name = ''; + const expectedHeaderRequestParams = "user_link.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()); + client.innerApiCalls.updateUserLink = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateUserLink( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IUserLink|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateUserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateUserLink with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateUserLinkRequest()); + request.userLink = {}; + request.userLink.name = ''; + const expectedHeaderRequestParams = "user_link.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateUserLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateUserLink(request), expectedError); + assert((client.innerApiCalls.updateUserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateUserLink with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateUserLinkRequest()); + request.userLink = {}; + request.userLink.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateUserLink(request), expectedError); + }); + }); + + describe('batchUpdateUserLinks', () => { + it('invokes batchUpdateUserLinks without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchUpdateUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchUpdateUserLinksResponse()); + client.innerApiCalls.batchUpdateUserLinks = stubSimpleCall(expectedResponse); + const [response] = await client.batchUpdateUserLinks(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchUpdateUserLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchUpdateUserLinks without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchUpdateUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchUpdateUserLinksResponse()); + client.innerApiCalls.batchUpdateUserLinks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchUpdateUserLinks( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchUpdateUserLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes batchUpdateUserLinks with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchUpdateUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchUpdateUserLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchUpdateUserLinks(request), expectedError); + assert((client.innerApiCalls.batchUpdateUserLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchUpdateUserLinks with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchUpdateUserLinksRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchUpdateUserLinks(request), expectedError); + }); + }); + + describe('deleteUserLink', () => { + it('invokes deleteUserLink without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteUserLinkRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteUserLink = stubSimpleCall(expectedResponse); + const [response] = await client.deleteUserLink(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteUserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteUserLink without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteUserLinkRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteUserLink = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteUserLink( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteUserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteUserLink with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteUserLinkRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteUserLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteUserLink(request), expectedError); + assert((client.innerApiCalls.deleteUserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteUserLink with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteUserLinkRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteUserLink(request), expectedError); + }); + }); + + describe('batchDeleteUserLinks', () => { + it('invokes batchDeleteUserLinks without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchDeleteUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.batchDeleteUserLinks = stubSimpleCall(expectedResponse); + const [response] = await client.batchDeleteUserLinks(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchDeleteUserLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchDeleteUserLinks without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchDeleteUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.batchDeleteUserLinks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchDeleteUserLinks( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchDeleteUserLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes batchDeleteUserLinks with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchDeleteUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchDeleteUserLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchDeleteUserLinks(request), expectedError); + assert((client.innerApiCalls.batchDeleteUserLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchDeleteUserLinks with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchDeleteUserLinksRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchDeleteUserLinks(request), expectedError); + }); + }); + + describe('createFirebaseLink', () => { + it('invokes createFirebaseLink without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateFirebaseLinkRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()); + client.innerApiCalls.createFirebaseLink = stubSimpleCall(expectedResponse); + const [response] = await client.createFirebaseLink(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createFirebaseLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createFirebaseLink without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateFirebaseLinkRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()); + client.innerApiCalls.createFirebaseLink = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createFirebaseLink( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IFirebaseLink|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createFirebaseLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createFirebaseLink with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateFirebaseLinkRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createFirebaseLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createFirebaseLink(request), expectedError); + assert((client.innerApiCalls.createFirebaseLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createFirebaseLink with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateFirebaseLinkRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createFirebaseLink(request), expectedError); + }); + }); + + describe('deleteFirebaseLink', () => { + it('invokes deleteFirebaseLink without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteFirebaseLinkRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteFirebaseLink = stubSimpleCall(expectedResponse); + const [response] = await client.deleteFirebaseLink(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteFirebaseLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteFirebaseLink without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteFirebaseLinkRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteFirebaseLink = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteFirebaseLink( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteFirebaseLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteFirebaseLink with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteFirebaseLinkRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFirebaseLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteFirebaseLink(request), expectedError); + assert((client.innerApiCalls.deleteFirebaseLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteFirebaseLink with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteFirebaseLinkRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteFirebaseLink(request), expectedError); + }); + }); + + describe('getGlobalSiteTag', () => { + it('invokes getGlobalSiteTag without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetGlobalSiteTagRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GlobalSiteTag()); + client.innerApiCalls.getGlobalSiteTag = stubSimpleCall(expectedResponse); + const [response] = await client.getGlobalSiteTag(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getGlobalSiteTag as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getGlobalSiteTag without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetGlobalSiteTagRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GlobalSiteTag()); + client.innerApiCalls.getGlobalSiteTag = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGlobalSiteTag( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IGlobalSiteTag|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getGlobalSiteTag as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getGlobalSiteTag with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetGlobalSiteTagRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getGlobalSiteTag = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getGlobalSiteTag(request), expectedError); + assert((client.innerApiCalls.getGlobalSiteTag as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getGlobalSiteTag with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetGlobalSiteTagRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getGlobalSiteTag(request), expectedError); + }); + }); + + describe('createGoogleAdsLink', () => { + it('invokes createGoogleAdsLink without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateGoogleAdsLinkRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()); + client.innerApiCalls.createGoogleAdsLink = stubSimpleCall(expectedResponse); + const [response] = await client.createGoogleAdsLink(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createGoogleAdsLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createGoogleAdsLink without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateGoogleAdsLinkRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()); + client.innerApiCalls.createGoogleAdsLink = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createGoogleAdsLink( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IGoogleAdsLink|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createGoogleAdsLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createGoogleAdsLink with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateGoogleAdsLinkRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGoogleAdsLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createGoogleAdsLink(request), expectedError); + assert((client.innerApiCalls.createGoogleAdsLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createGoogleAdsLink with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateGoogleAdsLinkRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createGoogleAdsLink(request), expectedError); + }); + }); + + describe('updateGoogleAdsLink', () => { + it('invokes updateGoogleAdsLink without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateGoogleAdsLinkRequest()); + request.googleAdsLink = {}; + request.googleAdsLink.name = ''; + const expectedHeaderRequestParams = "google_ads_link.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()); + client.innerApiCalls.updateGoogleAdsLink = stubSimpleCall(expectedResponse); + const [response] = await client.updateGoogleAdsLink(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateGoogleAdsLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateGoogleAdsLink without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateGoogleAdsLinkRequest()); + request.googleAdsLink = {}; + request.googleAdsLink.name = ''; + const expectedHeaderRequestParams = "google_ads_link.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()); + client.innerApiCalls.updateGoogleAdsLink = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateGoogleAdsLink( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IGoogleAdsLink|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateGoogleAdsLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateGoogleAdsLink with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateGoogleAdsLinkRequest()); + request.googleAdsLink = {}; + request.googleAdsLink.name = ''; + const expectedHeaderRequestParams = "google_ads_link.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGoogleAdsLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateGoogleAdsLink(request), expectedError); + assert((client.innerApiCalls.updateGoogleAdsLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateGoogleAdsLink with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateGoogleAdsLinkRequest()); + request.googleAdsLink = {}; + request.googleAdsLink.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateGoogleAdsLink(request), expectedError); + }); + }); + + describe('deleteGoogleAdsLink', () => { + it('invokes deleteGoogleAdsLink without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteGoogleAdsLinkRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteGoogleAdsLink = stubSimpleCall(expectedResponse); + const [response] = await client.deleteGoogleAdsLink(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteGoogleAdsLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteGoogleAdsLink without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteGoogleAdsLinkRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteGoogleAdsLink = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteGoogleAdsLink( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteGoogleAdsLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteGoogleAdsLink with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteGoogleAdsLinkRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGoogleAdsLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteGoogleAdsLink(request), expectedError); + assert((client.innerApiCalls.deleteGoogleAdsLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteGoogleAdsLink with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteGoogleAdsLinkRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteGoogleAdsLink(request), expectedError); + }); + }); + + describe('getDataSharingSettings', () => { + it('invokes getDataSharingSettings without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataSharingSettingsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataSharingSettings()); + client.innerApiCalls.getDataSharingSettings = stubSimpleCall(expectedResponse); + const [response] = await client.getDataSharingSettings(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDataSharingSettings as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDataSharingSettings without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataSharingSettingsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataSharingSettings()); + client.innerApiCalls.getDataSharingSettings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataSharingSettings( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDataSharingSettings|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDataSharingSettings as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getDataSharingSettings with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataSharingSettingsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataSharingSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDataSharingSettings(request), expectedError); + assert((client.innerApiCalls.getDataSharingSettings as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDataSharingSettings with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataSharingSettingsRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDataSharingSettings(request), expectedError); + }); + }); + + describe('getMeasurementProtocolSecret', () => { + it('invokes getMeasurementProtocolSecret without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetMeasurementProtocolSecretRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()); + client.innerApiCalls.getMeasurementProtocolSecret = stubSimpleCall(expectedResponse); + const [response] = await client.getMeasurementProtocolSecret(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getMeasurementProtocolSecret without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetMeasurementProtocolSecretRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()); + client.innerApiCalls.getMeasurementProtocolSecret = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMeasurementProtocolSecret( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getMeasurementProtocolSecret with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetMeasurementProtocolSecretRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMeasurementProtocolSecret(request), expectedError); + assert((client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getMeasurementProtocolSecret with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetMeasurementProtocolSecretRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getMeasurementProtocolSecret(request), expectedError); + }); + }); + + describe('createMeasurementProtocolSecret', () => { + it('invokes createMeasurementProtocolSecret without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateMeasurementProtocolSecretRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()); + client.innerApiCalls.createMeasurementProtocolSecret = stubSimpleCall(expectedResponse); + const [response] = await client.createMeasurementProtocolSecret(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createMeasurementProtocolSecret without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateMeasurementProtocolSecretRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()); + client.innerApiCalls.createMeasurementProtocolSecret = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createMeasurementProtocolSecret( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createMeasurementProtocolSecret with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateMeasurementProtocolSecretRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createMeasurementProtocolSecret(request), expectedError); + assert((client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createMeasurementProtocolSecret with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateMeasurementProtocolSecretRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createMeasurementProtocolSecret(request), expectedError); + }); + }); + + describe('deleteMeasurementProtocolSecret', () => { + it('invokes deleteMeasurementProtocolSecret without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteMeasurementProtocolSecretRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteMeasurementProtocolSecret = stubSimpleCall(expectedResponse); + const [response] = await client.deleteMeasurementProtocolSecret(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteMeasurementProtocolSecret without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteMeasurementProtocolSecretRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteMeasurementProtocolSecret = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteMeasurementProtocolSecret( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteMeasurementProtocolSecret with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteMeasurementProtocolSecretRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteMeasurementProtocolSecret(request), expectedError); + assert((client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteMeasurementProtocolSecret with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteMeasurementProtocolSecretRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteMeasurementProtocolSecret(request), expectedError); + }); + }); + + describe('updateMeasurementProtocolSecret', () => { + it('invokes updateMeasurementProtocolSecret without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateMeasurementProtocolSecretRequest()); + request.measurementProtocolSecret = {}; + request.measurementProtocolSecret.name = ''; + const expectedHeaderRequestParams = "measurement_protocol_secret.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()); + client.innerApiCalls.updateMeasurementProtocolSecret = stubSimpleCall(expectedResponse); + const [response] = await client.updateMeasurementProtocolSecret(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateMeasurementProtocolSecret without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateMeasurementProtocolSecretRequest()); + request.measurementProtocolSecret = {}; + request.measurementProtocolSecret.name = ''; + const expectedHeaderRequestParams = "measurement_protocol_secret.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()); + client.innerApiCalls.updateMeasurementProtocolSecret = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateMeasurementProtocolSecret( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateMeasurementProtocolSecret with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateMeasurementProtocolSecretRequest()); + request.measurementProtocolSecret = {}; + request.measurementProtocolSecret.name = ''; + const expectedHeaderRequestParams = "measurement_protocol_secret.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateMeasurementProtocolSecret(request), expectedError); + assert((client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateMeasurementProtocolSecret with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateMeasurementProtocolSecretRequest()); + request.measurementProtocolSecret = {}; + request.measurementProtocolSecret.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateMeasurementProtocolSecret(request), expectedError); + }); + }); + + describe('acknowledgeUserDataCollection', () => { + it('invokes acknowledgeUserDataCollection without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionResponse()); + client.innerApiCalls.acknowledgeUserDataCollection = stubSimpleCall(expectedResponse); + const [response] = await client.acknowledgeUserDataCollection(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes acknowledgeUserDataCollection without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionResponse()); + client.innerApiCalls.acknowledgeUserDataCollection = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.acknowledgeUserDataCollection( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes acknowledgeUserDataCollection with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionRequest()); + request.property = ''; + const expectedHeaderRequestParams = "property="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.acknowledgeUserDataCollection = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.acknowledgeUserDataCollection(request), expectedError); + assert((client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes acknowledgeUserDataCollection with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionRequest()); + request.property = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.acknowledgeUserDataCollection(request), expectedError); + }); + }); + + describe('getGoogleSignalsSettings', () => { + it('invokes getGoogleSignalsSettings without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetGoogleSignalsSettingsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleSignalsSettings()); + client.innerApiCalls.getGoogleSignalsSettings = stubSimpleCall(expectedResponse); + const [response] = await client.getGoogleSignalsSettings(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getGoogleSignalsSettings as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getGoogleSignalsSettings without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetGoogleSignalsSettingsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleSignalsSettings()); + client.innerApiCalls.getGoogleSignalsSettings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGoogleSignalsSettings( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getGoogleSignalsSettings as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getGoogleSignalsSettings with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetGoogleSignalsSettingsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getGoogleSignalsSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getGoogleSignalsSettings(request), expectedError); + assert((client.innerApiCalls.getGoogleSignalsSettings as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getGoogleSignalsSettings with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetGoogleSignalsSettingsRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getGoogleSignalsSettings(request), expectedError); + }); + }); + + describe('updateGoogleSignalsSettings', () => { + it('invokes updateGoogleSignalsSettings without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateGoogleSignalsSettingsRequest()); + request.googleSignalsSettings = {}; + request.googleSignalsSettings.name = ''; + const expectedHeaderRequestParams = "google_signals_settings.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleSignalsSettings()); + client.innerApiCalls.updateGoogleSignalsSettings = stubSimpleCall(expectedResponse); + const [response] = await client.updateGoogleSignalsSettings(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateGoogleSignalsSettings as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateGoogleSignalsSettings without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateGoogleSignalsSettingsRequest()); + request.googleSignalsSettings = {}; + request.googleSignalsSettings.name = ''; + const expectedHeaderRequestParams = "google_signals_settings.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleSignalsSettings()); + client.innerApiCalls.updateGoogleSignalsSettings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateGoogleSignalsSettings( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateGoogleSignalsSettings as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateGoogleSignalsSettings with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateGoogleSignalsSettingsRequest()); + request.googleSignalsSettings = {}; + request.googleSignalsSettings.name = ''; + const expectedHeaderRequestParams = "google_signals_settings.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGoogleSignalsSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateGoogleSignalsSettings(request), expectedError); + assert((client.innerApiCalls.updateGoogleSignalsSettings as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateGoogleSignalsSettings with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateGoogleSignalsSettingsRequest()); + request.googleSignalsSettings = {}; + request.googleSignalsSettings.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateGoogleSignalsSettings(request), expectedError); + }); + }); + + describe('createConversionEvent', () => { + it('invokes createConversionEvent without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateConversionEventRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()); + client.innerApiCalls.createConversionEvent = stubSimpleCall(expectedResponse); + const [response] = await client.createConversionEvent(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createConversionEvent as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createConversionEvent without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateConversionEventRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()); + client.innerApiCalls.createConversionEvent = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createConversionEvent( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IConversionEvent|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createConversionEvent as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createConversionEvent with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateConversionEventRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createConversionEvent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createConversionEvent(request), expectedError); + assert((client.innerApiCalls.createConversionEvent as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createConversionEvent with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateConversionEventRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createConversionEvent(request), expectedError); + }); + }); + + describe('getConversionEvent', () => { + it('invokes getConversionEvent without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetConversionEventRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()); + client.innerApiCalls.getConversionEvent = stubSimpleCall(expectedResponse); + const [response] = await client.getConversionEvent(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getConversionEvent as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getConversionEvent without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetConversionEventRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()); + client.innerApiCalls.getConversionEvent = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConversionEvent( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IConversionEvent|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getConversionEvent as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getConversionEvent with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetConversionEventRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getConversionEvent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getConversionEvent(request), expectedError); + assert((client.innerApiCalls.getConversionEvent as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getConversionEvent with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetConversionEventRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getConversionEvent(request), expectedError); + }); + }); + + describe('deleteConversionEvent', () => { + it('invokes deleteConversionEvent without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteConversionEventRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteConversionEvent = stubSimpleCall(expectedResponse); + const [response] = await client.deleteConversionEvent(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteConversionEvent as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteConversionEvent without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteConversionEventRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteConversionEvent = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteConversionEvent( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteConversionEvent as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteConversionEvent with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteConversionEventRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConversionEvent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteConversionEvent(request), expectedError); + assert((client.innerApiCalls.deleteConversionEvent as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteConversionEvent with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteConversionEventRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteConversionEvent(request), expectedError); + }); + }); + + describe('getDisplayVideo360AdvertiserLink', () => { + it('invokes getDisplayVideo360AdvertiserLink without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()); + client.innerApiCalls.getDisplayVideo360AdvertiserLink = stubSimpleCall(expectedResponse); + const [response] = await client.getDisplayVideo360AdvertiserLink(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDisplayVideo360AdvertiserLink without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()); + client.innerApiCalls.getDisplayVideo360AdvertiserLink = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDisplayVideo360AdvertiserLink( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getDisplayVideo360AdvertiserLink with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getDisplayVideo360AdvertiserLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDisplayVideo360AdvertiserLink(request), expectedError); + assert((client.innerApiCalls.getDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDisplayVideo360AdvertiserLink with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDisplayVideo360AdvertiserLink(request), expectedError); + }); + }); + + describe('createDisplayVideo360AdvertiserLink', () => { + it('invokes createDisplayVideo360AdvertiserLink without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()); + client.innerApiCalls.createDisplayVideo360AdvertiserLink = stubSimpleCall(expectedResponse); + const [response] = await client.createDisplayVideo360AdvertiserLink(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createDisplayVideo360AdvertiserLink without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()); + client.innerApiCalls.createDisplayVideo360AdvertiserLink = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDisplayVideo360AdvertiserLink( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createDisplayVideo360AdvertiserLink with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createDisplayVideo360AdvertiserLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDisplayVideo360AdvertiserLink(request), expectedError); + assert((client.innerApiCalls.createDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createDisplayVideo360AdvertiserLink with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createDisplayVideo360AdvertiserLink(request), expectedError); + }); + }); + + describe('deleteDisplayVideo360AdvertiserLink', () => { + it('invokes deleteDisplayVideo360AdvertiserLink without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteDisplayVideo360AdvertiserLink = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDisplayVideo360AdvertiserLink(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteDisplayVideo360AdvertiserLink without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteDisplayVideo360AdvertiserLink = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDisplayVideo360AdvertiserLink( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteDisplayVideo360AdvertiserLink with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDisplayVideo360AdvertiserLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteDisplayVideo360AdvertiserLink(request), expectedError); + assert((client.innerApiCalls.deleteDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteDisplayVideo360AdvertiserLink with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteDisplayVideo360AdvertiserLink(request), expectedError); + }); + }); + + describe('updateDisplayVideo360AdvertiserLink', () => { + it('invokes updateDisplayVideo360AdvertiserLink without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDisplayVideo360AdvertiserLinkRequest()); + request.displayVideo_360AdvertiserLink = {}; + request.displayVideo_360AdvertiserLink.name = ''; + const expectedHeaderRequestParams = "display_video_360_advertiser_link.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()); + client.innerApiCalls.updateDisplayVideo360AdvertiserLink = stubSimpleCall(expectedResponse); + const [response] = await client.updateDisplayVideo360AdvertiserLink(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateDisplayVideo360AdvertiserLink without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDisplayVideo360AdvertiserLinkRequest()); + request.displayVideo_360AdvertiserLink = {}; + request.displayVideo_360AdvertiserLink.name = ''; + const expectedHeaderRequestParams = "display_video_360_advertiser_link.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()); + client.innerApiCalls.updateDisplayVideo360AdvertiserLink = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDisplayVideo360AdvertiserLink( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateDisplayVideo360AdvertiserLink with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDisplayVideo360AdvertiserLinkRequest()); + request.displayVideo_360AdvertiserLink = {}; + request.displayVideo_360AdvertiserLink.name = ''; + const expectedHeaderRequestParams = "display_video_360_advertiser_link.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDisplayVideo360AdvertiserLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDisplayVideo360AdvertiserLink(request), expectedError); + assert((client.innerApiCalls.updateDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateDisplayVideo360AdvertiserLink with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDisplayVideo360AdvertiserLinkRequest()); + request.displayVideo_360AdvertiserLink = {}; + request.displayVideo_360AdvertiserLink.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateDisplayVideo360AdvertiserLink(request), expectedError); + }); + }); + + describe('getDisplayVideo360AdvertiserLinkProposal', () => { + it('invokes getDisplayVideo360AdvertiserLinkProposal without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkProposalRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()); + client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(expectedResponse); + const [response] = await client.getDisplayVideo360AdvertiserLinkProposal(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDisplayVideo360AdvertiserLinkProposal without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkProposalRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()); + client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDisplayVideo360AdvertiserLinkProposal( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getDisplayVideo360AdvertiserLinkProposal with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkProposalRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDisplayVideo360AdvertiserLinkProposal(request), expectedError); + assert((client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDisplayVideo360AdvertiserLinkProposal with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkProposalRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDisplayVideo360AdvertiserLinkProposal(request), expectedError); + }); + }); + + describe('createDisplayVideo360AdvertiserLinkProposal', () => { + it('invokes createDisplayVideo360AdvertiserLinkProposal without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkProposalRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()); + client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(expectedResponse); + const [response] = await client.createDisplayVideo360AdvertiserLinkProposal(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createDisplayVideo360AdvertiserLinkProposal without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkProposalRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()); + client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDisplayVideo360AdvertiserLinkProposal( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createDisplayVideo360AdvertiserLinkProposal with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkProposalRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDisplayVideo360AdvertiserLinkProposal(request), expectedError); + assert((client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createDisplayVideo360AdvertiserLinkProposal with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkProposalRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createDisplayVideo360AdvertiserLinkProposal(request), expectedError); + }); + }); + + describe('deleteDisplayVideo360AdvertiserLinkProposal', () => { + it('invokes deleteDisplayVideo360AdvertiserLinkProposal without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkProposalRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDisplayVideo360AdvertiserLinkProposal(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteDisplayVideo360AdvertiserLinkProposal without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkProposalRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDisplayVideo360AdvertiserLinkProposal( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteDisplayVideo360AdvertiserLinkProposal with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkProposalRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteDisplayVideo360AdvertiserLinkProposal(request), expectedError); + assert((client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteDisplayVideo360AdvertiserLinkProposal with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkProposalRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteDisplayVideo360AdvertiserLinkProposal(request), expectedError); + }); + }); + + describe('approveDisplayVideo360AdvertiserLinkProposal', () => { + it('invokes approveDisplayVideo360AdvertiserLinkProposal without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalResponse()); + client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(expectedResponse); + const [response] = await client.approveDisplayVideo360AdvertiserLinkProposal(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes approveDisplayVideo360AdvertiserLinkProposal without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalResponse()); + client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.approveDisplayVideo360AdvertiserLinkProposal( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes approveDisplayVideo360AdvertiserLinkProposal with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.approveDisplayVideo360AdvertiserLinkProposal(request), expectedError); + assert((client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes approveDisplayVideo360AdvertiserLinkProposal with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.approveDisplayVideo360AdvertiserLinkProposal(request), expectedError); + }); + }); + + describe('cancelDisplayVideo360AdvertiserLinkProposal', () => { + it('invokes cancelDisplayVideo360AdvertiserLinkProposal without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CancelDisplayVideo360AdvertiserLinkProposalRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()); + client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(expectedResponse); + const [response] = await client.cancelDisplayVideo360AdvertiserLinkProposal(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelDisplayVideo360AdvertiserLinkProposal without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CancelDisplayVideo360AdvertiserLinkProposalRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()); + client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelDisplayVideo360AdvertiserLinkProposal( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes cancelDisplayVideo360AdvertiserLinkProposal with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CancelDisplayVideo360AdvertiserLinkProposalRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelDisplayVideo360AdvertiserLinkProposal(request), expectedError); + assert((client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelDisplayVideo360AdvertiserLinkProposal with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CancelDisplayVideo360AdvertiserLinkProposalRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelDisplayVideo360AdvertiserLinkProposal(request), expectedError); + }); + }); + + describe('createCustomDimension', () => { + it('invokes createCustomDimension without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateCustomDimensionRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()); + client.innerApiCalls.createCustomDimension = stubSimpleCall(expectedResponse); + const [response] = await client.createCustomDimension(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createCustomDimension as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createCustomDimension without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateCustomDimensionRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()); + client.innerApiCalls.createCustomDimension = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCustomDimension( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ICustomDimension|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createCustomDimension as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createCustomDimension with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateCustomDimensionRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createCustomDimension = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCustomDimension(request), expectedError); + assert((client.innerApiCalls.createCustomDimension as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createCustomDimension with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateCustomDimensionRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createCustomDimension(request), expectedError); + }); + }); + + describe('updateCustomDimension', () => { + it('invokes updateCustomDimension without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateCustomDimensionRequest()); + request.customDimension = {}; + request.customDimension.name = ''; + const expectedHeaderRequestParams = "custom_dimension.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()); + client.innerApiCalls.updateCustomDimension = stubSimpleCall(expectedResponse); + const [response] = await client.updateCustomDimension(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateCustomDimension as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateCustomDimension without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateCustomDimensionRequest()); + request.customDimension = {}; + request.customDimension.name = ''; + const expectedHeaderRequestParams = "custom_dimension.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()); + client.innerApiCalls.updateCustomDimension = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCustomDimension( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ICustomDimension|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateCustomDimension as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateCustomDimension with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateCustomDimensionRequest()); + request.customDimension = {}; + request.customDimension.name = ''; + const expectedHeaderRequestParams = "custom_dimension.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCustomDimension = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateCustomDimension(request), expectedError); + assert((client.innerApiCalls.updateCustomDimension as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateCustomDimension with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateCustomDimensionRequest()); + request.customDimension = {}; + request.customDimension.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateCustomDimension(request), expectedError); + }); + }); + + describe('archiveCustomDimension', () => { + it('invokes archiveCustomDimension without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ArchiveCustomDimensionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.archiveCustomDimension = stubSimpleCall(expectedResponse); + const [response] = await client.archiveCustomDimension(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.archiveCustomDimension as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes archiveCustomDimension without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ArchiveCustomDimensionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.archiveCustomDimension = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.archiveCustomDimension( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.archiveCustomDimension as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes archiveCustomDimension with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ArchiveCustomDimensionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.archiveCustomDimension = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.archiveCustomDimension(request), expectedError); + assert((client.innerApiCalls.archiveCustomDimension as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes archiveCustomDimension with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ArchiveCustomDimensionRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.archiveCustomDimension(request), expectedError); + }); + }); + + describe('getCustomDimension', () => { + it('invokes getCustomDimension without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetCustomDimensionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()); + client.innerApiCalls.getCustomDimension = stubSimpleCall(expectedResponse); + const [response] = await client.getCustomDimension(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getCustomDimension as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getCustomDimension without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetCustomDimensionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()); + client.innerApiCalls.getCustomDimension = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCustomDimension( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ICustomDimension|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getCustomDimension as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getCustomDimension with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetCustomDimensionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getCustomDimension = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCustomDimension(request), expectedError); + assert((client.innerApiCalls.getCustomDimension as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getCustomDimension with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetCustomDimensionRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCustomDimension(request), expectedError); + }); + }); + + describe('createCustomMetric', () => { + it('invokes createCustomMetric without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateCustomMetricRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()); + client.innerApiCalls.createCustomMetric = stubSimpleCall(expectedResponse); + const [response] = await client.createCustomMetric(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createCustomMetric as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createCustomMetric without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateCustomMetricRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()); + client.innerApiCalls.createCustomMetric = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCustomMetric( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ICustomMetric|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createCustomMetric as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createCustomMetric with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateCustomMetricRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createCustomMetric = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCustomMetric(request), expectedError); + assert((client.innerApiCalls.createCustomMetric as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createCustomMetric with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateCustomMetricRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createCustomMetric(request), expectedError); + }); + }); + + describe('updateCustomMetric', () => { + it('invokes updateCustomMetric without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateCustomMetricRequest()); + request.customMetric = {}; + request.customMetric.name = ''; + const expectedHeaderRequestParams = "custom_metric.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()); + client.innerApiCalls.updateCustomMetric = stubSimpleCall(expectedResponse); + const [response] = await client.updateCustomMetric(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateCustomMetric as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateCustomMetric without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateCustomMetricRequest()); + request.customMetric = {}; + request.customMetric.name = ''; + const expectedHeaderRequestParams = "custom_metric.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()); + client.innerApiCalls.updateCustomMetric = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCustomMetric( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ICustomMetric|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateCustomMetric as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateCustomMetric with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateCustomMetricRequest()); + request.customMetric = {}; + request.customMetric.name = ''; + const expectedHeaderRequestParams = "custom_metric.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCustomMetric = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateCustomMetric(request), expectedError); + assert((client.innerApiCalls.updateCustomMetric as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateCustomMetric with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateCustomMetricRequest()); + request.customMetric = {}; + request.customMetric.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateCustomMetric(request), expectedError); + }); + }); + + describe('archiveCustomMetric', () => { + it('invokes archiveCustomMetric without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ArchiveCustomMetricRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.archiveCustomMetric = stubSimpleCall(expectedResponse); + const [response] = await client.archiveCustomMetric(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.archiveCustomMetric as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes archiveCustomMetric without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ArchiveCustomMetricRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.archiveCustomMetric = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.archiveCustomMetric( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.archiveCustomMetric as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes archiveCustomMetric with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ArchiveCustomMetricRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.archiveCustomMetric = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.archiveCustomMetric(request), expectedError); + assert((client.innerApiCalls.archiveCustomMetric as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes archiveCustomMetric with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ArchiveCustomMetricRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.archiveCustomMetric(request), expectedError); + }); + }); + + describe('getCustomMetric', () => { + it('invokes getCustomMetric without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetCustomMetricRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()); + client.innerApiCalls.getCustomMetric = stubSimpleCall(expectedResponse); + const [response] = await client.getCustomMetric(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getCustomMetric as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getCustomMetric without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetCustomMetricRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()); + client.innerApiCalls.getCustomMetric = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCustomMetric( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ICustomMetric|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getCustomMetric as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getCustomMetric with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetCustomMetricRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getCustomMetric = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCustomMetric(request), expectedError); + assert((client.innerApiCalls.getCustomMetric as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getCustomMetric with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetCustomMetricRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCustomMetric(request), expectedError); + }); + }); + + describe('getDataRetentionSettings', () => { + it('invokes getDataRetentionSettings without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataRetentionSettingsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataRetentionSettings()); + client.innerApiCalls.getDataRetentionSettings = stubSimpleCall(expectedResponse); + const [response] = await client.getDataRetentionSettings(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDataRetentionSettings as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDataRetentionSettings without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataRetentionSettingsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataRetentionSettings()); + client.innerApiCalls.getDataRetentionSettings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataRetentionSettings( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDataRetentionSettings|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDataRetentionSettings as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getDataRetentionSettings with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataRetentionSettingsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataRetentionSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDataRetentionSettings(request), expectedError); + assert((client.innerApiCalls.getDataRetentionSettings as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDataRetentionSettings with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataRetentionSettingsRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDataRetentionSettings(request), expectedError); + }); + }); + + describe('updateDataRetentionSettings', () => { + it('invokes updateDataRetentionSettings without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDataRetentionSettingsRequest()); + request.dataRetentionSettings = {}; + request.dataRetentionSettings.name = ''; + const expectedHeaderRequestParams = "data_retention_settings.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataRetentionSettings()); + client.innerApiCalls.updateDataRetentionSettings = stubSimpleCall(expectedResponse); + const [response] = await client.updateDataRetentionSettings(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateDataRetentionSettings as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateDataRetentionSettings without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDataRetentionSettingsRequest()); + request.dataRetentionSettings = {}; + request.dataRetentionSettings.name = ''; + const expectedHeaderRequestParams = "data_retention_settings.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataRetentionSettings()); + client.innerApiCalls.updateDataRetentionSettings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDataRetentionSettings( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDataRetentionSettings|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateDataRetentionSettings as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateDataRetentionSettings with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDataRetentionSettingsRequest()); + request.dataRetentionSettings = {}; + request.dataRetentionSettings.name = ''; + const expectedHeaderRequestParams = "data_retention_settings.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataRetentionSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDataRetentionSettings(request), expectedError); + assert((client.innerApiCalls.updateDataRetentionSettings as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateDataRetentionSettings with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDataRetentionSettingsRequest()); + request.dataRetentionSettings = {}; + request.dataRetentionSettings.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateDataRetentionSettings(request), expectedError); + }); + }); + + describe('createDataStream', () => { + it('invokes createDataStream without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDataStreamRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()); + client.innerApiCalls.createDataStream = stubSimpleCall(expectedResponse); + const [response] = await client.createDataStream(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createDataStream as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createDataStream without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDataStreamRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()); + client.innerApiCalls.createDataStream = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDataStream( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDataStream|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createDataStream as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createDataStream with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDataStreamRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataStream = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDataStream(request), expectedError); + assert((client.innerApiCalls.createDataStream as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createDataStream with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDataStreamRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createDataStream(request), expectedError); + }); + }); + + describe('deleteDataStream', () => { + it('invokes deleteDataStream without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDataStreamRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteDataStream = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDataStream(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteDataStream as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteDataStream without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDataStreamRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteDataStream = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDataStream( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteDataStream as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteDataStream with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDataStreamRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataStream = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteDataStream(request), expectedError); + assert((client.innerApiCalls.deleteDataStream as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteDataStream with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDataStreamRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteDataStream(request), expectedError); + }); + }); + + describe('updateDataStream', () => { + it('invokes updateDataStream without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDataStreamRequest()); + request.dataStream = {}; + request.dataStream.name = ''; + const expectedHeaderRequestParams = "data_stream.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()); + client.innerApiCalls.updateDataStream = stubSimpleCall(expectedResponse); + const [response] = await client.updateDataStream(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateDataStream as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateDataStream without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDataStreamRequest()); + request.dataStream = {}; + request.dataStream.name = ''; + const expectedHeaderRequestParams = "data_stream.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()); + client.innerApiCalls.updateDataStream = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDataStream( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDataStream|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateDataStream as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateDataStream with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDataStreamRequest()); + request.dataStream = {}; + request.dataStream.name = ''; + const expectedHeaderRequestParams = "data_stream.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataStream = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDataStream(request), expectedError); + assert((client.innerApiCalls.updateDataStream as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateDataStream with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDataStreamRequest()); + request.dataStream = {}; + request.dataStream.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateDataStream(request), expectedError); + }); + }); + + describe('getDataStream', () => { + it('invokes getDataStream without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataStreamRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()); + client.innerApiCalls.getDataStream = stubSimpleCall(expectedResponse); + const [response] = await client.getDataStream(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDataStream as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDataStream without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataStreamRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()); + client.innerApiCalls.getDataStream = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataStream( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDataStream|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDataStream as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getDataStream with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataStreamRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataStream = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDataStream(request), expectedError); + assert((client.innerApiCalls.getDataStream as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDataStream with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataStreamRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDataStream(request), expectedError); + }); + }); + + describe('listAccounts', () => { + it('invokes listAccounts without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountsRequest()); + const expectedOptions = {otherArgs: {headers: {}}};; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), + ]; + client.innerApiCalls.listAccounts = stubSimpleCall(expectedResponse); + const [response] = await client.listAccounts(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listAccounts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listAccounts without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountsRequest()); + const expectedOptions = {otherArgs: {headers: {}}};; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), + ]; + client.innerApiCalls.listAccounts = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAccounts( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAccount[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listAccounts as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listAccounts with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountsRequest()); + const expectedOptions = {otherArgs: {headers: {}}};; + const expectedError = new Error('expected'); + client.innerApiCalls.listAccounts = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAccounts(request), expectedError); + assert((client.innerApiCalls.listAccounts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listAccountsStream without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountsRequest()); + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), + ]; + client.descriptors.page.listAccounts.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAccountsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.Account[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.Account) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listAccounts.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAccounts, request)); + }); + + it('invokes listAccountsStream with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountsRequest()); + const expectedError = new Error('expected'); + client.descriptors.page.listAccounts.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAccountsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.Account[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.Account) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAccounts.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAccounts, request)); + }); + + it('uses async iteration with listAccounts without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountsRequest()); + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), + ]; + client.descriptors.page.listAccounts.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1alpha.IAccount[] = []; + const iterable = client.listAccountsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAccounts.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + + it('uses async iteration with listAccounts with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountsRequest());const expectedError = new Error('expected'); + client.descriptors.page.listAccounts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAccountsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.analytics.admin.v1alpha.IAccount[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAccounts.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('listAccountSummaries', () => { + it('invokes listAccountSummaries without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountSummariesRequest()); + const expectedOptions = {otherArgs: {headers: {}}};; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), + ]; + client.innerApiCalls.listAccountSummaries = stubSimpleCall(expectedResponse); + const [response] = await client.listAccountSummaries(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listAccountSummaries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listAccountSummaries without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountSummariesRequest()); + const expectedOptions = {otherArgs: {headers: {}}};; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), + ]; + client.innerApiCalls.listAccountSummaries = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAccountSummaries( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAccountSummary[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listAccountSummaries as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listAccountSummaries with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountSummariesRequest()); + const expectedOptions = {otherArgs: {headers: {}}};; + const expectedError = new Error('expected'); + client.innerApiCalls.listAccountSummaries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAccountSummaries(request), expectedError); + assert((client.innerApiCalls.listAccountSummaries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listAccountSummariesStream without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountSummariesRequest()); + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), + ]; + client.descriptors.page.listAccountSummaries.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAccountSummariesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.AccountSummary[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.AccountSummary) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listAccountSummaries.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAccountSummaries, request)); + }); + + it('invokes listAccountSummariesStream with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountSummariesRequest()); + const expectedError = new Error('expected'); + client.descriptors.page.listAccountSummaries.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAccountSummariesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.AccountSummary[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.AccountSummary) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAccountSummaries.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAccountSummaries, request)); + }); + + it('uses async iteration with listAccountSummaries without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountSummariesRequest()); + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), + ]; + client.descriptors.page.listAccountSummaries.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1alpha.IAccountSummary[] = []; + const iterable = client.listAccountSummariesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAccountSummaries.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + + it('uses async iteration with listAccountSummaries with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountSummariesRequest());const expectedError = new Error('expected'); + client.descriptors.page.listAccountSummaries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAccountSummariesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.analytics.admin.v1alpha.IAccountSummary[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAccountSummaries.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('listProperties', () => { + it('invokes listProperties without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListPropertiesRequest()); + const expectedOptions = {otherArgs: {headers: {}}};; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), + ]; + client.innerApiCalls.listProperties = stubSimpleCall(expectedResponse); + const [response] = await client.listProperties(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listProperties as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listProperties without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListPropertiesRequest()); + const expectedOptions = {otherArgs: {headers: {}}};; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), + ]; + client.innerApiCalls.listProperties = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listProperties( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IProperty[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listProperties as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listProperties with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListPropertiesRequest()); + const expectedOptions = {otherArgs: {headers: {}}};; + const expectedError = new Error('expected'); + client.innerApiCalls.listProperties = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listProperties(request), expectedError); + assert((client.innerApiCalls.listProperties as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listPropertiesStream without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListPropertiesRequest()); + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), + ]; + client.descriptors.page.listProperties.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listPropertiesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.Property[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.Property) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listProperties.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listProperties, request)); + }); + + it('invokes listPropertiesStream with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListPropertiesRequest()); + const expectedError = new Error('expected'); + client.descriptors.page.listProperties.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listPropertiesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.Property[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.Property) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listProperties.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listProperties, request)); + }); + + it('uses async iteration with listProperties without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListPropertiesRequest()); + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), + ]; + client.descriptors.page.listProperties.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1alpha.IProperty[] = []; + const iterable = client.listPropertiesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listProperties.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + + it('uses async iteration with listProperties with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListPropertiesRequest());const expectedError = new Error('expected'); + client.descriptors.page.listProperties.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPropertiesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.analytics.admin.v1alpha.IProperty[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listProperties.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('listUserLinks', () => { + it('invokes listUserLinks without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), + ]; + client.innerApiCalls.listUserLinks = stubSimpleCall(expectedResponse); + const [response] = await client.listUserLinks(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listUserLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listUserLinks without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), + ]; + client.innerApiCalls.listUserLinks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listUserLinks( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IUserLink[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listUserLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listUserLinks with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listUserLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listUserLinks(request), expectedError); + assert((client.innerApiCalls.listUserLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listUserLinksStream without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), + ]; + client.descriptors.page.listUserLinks.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listUserLinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.UserLink[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.UserLink) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listUserLinks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUserLinks, request)); + assert.strictEqual( + (client.descriptors.page.listUserLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listUserLinksStream with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listUserLinks.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listUserLinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.UserLink[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.UserLink) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listUserLinks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUserLinks, request)); + assert.strictEqual( + (client.descriptors.page.listUserLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listUserLinks without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), + ]; + client.descriptors.page.listUserLinks.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1alpha.IUserLink[] = []; + const iterable = client.listUserLinksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listUserLinks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listUserLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listUserLinks with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listUserLinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listUserLinksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.analytics.admin.v1alpha.IUserLink[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listUserLinks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listUserLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('auditUserLinks', () => { + it('invokes auditUserLinks without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), + ]; + client.innerApiCalls.auditUserLinks = stubSimpleCall(expectedResponse); + const [response] = await client.auditUserLinks(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.auditUserLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes auditUserLinks without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), + ]; + client.innerApiCalls.auditUserLinks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.auditUserLinks( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAuditUserLink[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.auditUserLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes auditUserLinks with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.auditUserLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.auditUserLinks(request), expectedError); + assert((client.innerApiCalls.auditUserLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes auditUserLinksStream without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), + ]; + client.descriptors.page.auditUserLinks.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.auditUserLinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.AuditUserLink[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.AuditUserLink) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.auditUserLinks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.auditUserLinks, request)); + assert.strictEqual( + (client.descriptors.page.auditUserLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes auditUserLinksStream with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.auditUserLinks.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.auditUserLinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.AuditUserLink[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.AuditUserLink) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.auditUserLinks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.auditUserLinks, request)); + assert.strictEqual( + (client.descriptors.page.auditUserLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with auditUserLinks without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), + ]; + client.descriptors.page.auditUserLinks.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1alpha.IAuditUserLink[] = []; + const iterable = client.auditUserLinksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.auditUserLinks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.auditUserLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with auditUserLinks with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.auditUserLinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.auditUserLinksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.analytics.admin.v1alpha.IAuditUserLink[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.auditUserLinks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.auditUserLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listFirebaseLinks', () => { + it('invokes listFirebaseLinks without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListFirebaseLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), + ]; + client.innerApiCalls.listFirebaseLinks = stubSimpleCall(expectedResponse); + const [response] = await client.listFirebaseLinks(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listFirebaseLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listFirebaseLinks without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListFirebaseLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), + ]; + client.innerApiCalls.listFirebaseLinks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFirebaseLinks( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IFirebaseLink[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listFirebaseLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listFirebaseLinks with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListFirebaseLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listFirebaseLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listFirebaseLinks(request), expectedError); + assert((client.innerApiCalls.listFirebaseLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listFirebaseLinksStream without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListFirebaseLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), + ]; + client.descriptors.page.listFirebaseLinks.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listFirebaseLinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.FirebaseLink[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.FirebaseLink) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listFirebaseLinks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listFirebaseLinks, request)); + assert.strictEqual( + (client.descriptors.page.listFirebaseLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listFirebaseLinksStream with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListFirebaseLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listFirebaseLinks.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listFirebaseLinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.FirebaseLink[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.FirebaseLink) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listFirebaseLinks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listFirebaseLinks, request)); + assert.strictEqual( + (client.descriptors.page.listFirebaseLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listFirebaseLinks without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListFirebaseLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), + ]; + client.descriptors.page.listFirebaseLinks.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1alpha.IFirebaseLink[] = []; + const iterable = client.listFirebaseLinksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listFirebaseLinks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listFirebaseLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listFirebaseLinks with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListFirebaseLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listFirebaseLinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listFirebaseLinksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.analytics.admin.v1alpha.IFirebaseLink[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listFirebaseLinks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listFirebaseLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listGoogleAdsLinks', () => { + it('invokes listGoogleAdsLinks without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), + ]; + client.innerApiCalls.listGoogleAdsLinks = stubSimpleCall(expectedResponse); + const [response] = await client.listGoogleAdsLinks(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listGoogleAdsLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listGoogleAdsLinks without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), + ]; + client.innerApiCalls.listGoogleAdsLinks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listGoogleAdsLinks( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IGoogleAdsLink[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listGoogleAdsLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listGoogleAdsLinks with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listGoogleAdsLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listGoogleAdsLinks(request), expectedError); + assert((client.innerApiCalls.listGoogleAdsLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listGoogleAdsLinksStream without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), + ]; + client.descriptors.page.listGoogleAdsLinks.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listGoogleAdsLinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.GoogleAdsLink[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.GoogleAdsLink) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listGoogleAdsLinks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listGoogleAdsLinks, request)); + assert.strictEqual( + (client.descriptors.page.listGoogleAdsLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listGoogleAdsLinksStream with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listGoogleAdsLinks.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listGoogleAdsLinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.GoogleAdsLink[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.GoogleAdsLink) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listGoogleAdsLinks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listGoogleAdsLinks, request)); + assert.strictEqual( + (client.descriptors.page.listGoogleAdsLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listGoogleAdsLinks without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), + ]; + client.descriptors.page.listGoogleAdsLinks.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1alpha.IGoogleAdsLink[] = []; + const iterable = client.listGoogleAdsLinksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listGoogleAdsLinks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listGoogleAdsLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listGoogleAdsLinks with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listGoogleAdsLinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listGoogleAdsLinksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.analytics.admin.v1alpha.IGoogleAdsLink[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listGoogleAdsLinks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listGoogleAdsLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listMeasurementProtocolSecrets', () => { + it('invokes listMeasurementProtocolSecrets without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), + ]; + client.innerApiCalls.listMeasurementProtocolSecrets = stubSimpleCall(expectedResponse); + const [response] = await client.listMeasurementProtocolSecrets(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listMeasurementProtocolSecrets without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), + ]; + client.innerApiCalls.listMeasurementProtocolSecrets = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMeasurementProtocolSecrets( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listMeasurementProtocolSecrets with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listMeasurementProtocolSecrets = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listMeasurementProtocolSecrets(request), expectedError); + assert((client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listMeasurementProtocolSecretsStream without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), + ]; + client.descriptors.page.listMeasurementProtocolSecrets.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listMeasurementProtocolSecretsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listMeasurementProtocolSecrets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMeasurementProtocolSecrets, request)); + assert.strictEqual( + (client.descriptors.page.listMeasurementProtocolSecrets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listMeasurementProtocolSecretsStream with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listMeasurementProtocolSecrets.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listMeasurementProtocolSecretsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listMeasurementProtocolSecrets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMeasurementProtocolSecrets, request)); + assert.strictEqual( + (client.descriptors.page.listMeasurementProtocolSecrets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listMeasurementProtocolSecrets without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), + ]; + client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret[] = []; + const iterable = client.listMeasurementProtocolSecretsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listMeasurementProtocolSecrets with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listMeasurementProtocolSecretsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('searchChangeHistoryEvents', () => { + it('invokes searchChangeHistoryEvents without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest()); + request.account = ''; + const expectedHeaderRequestParams = "account="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), + ]; + client.innerApiCalls.searchChangeHistoryEvents = stubSimpleCall(expectedResponse); + const [response] = await client.searchChangeHistoryEvents(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.searchChangeHistoryEvents as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes searchChangeHistoryEvents without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest()); + request.account = ''; + const expectedHeaderRequestParams = "account="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), + ]; + client.innerApiCalls.searchChangeHistoryEvents = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchChangeHistoryEvents( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IChangeHistoryEvent[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.searchChangeHistoryEvents as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes searchChangeHistoryEvents with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest()); + request.account = ''; + const expectedHeaderRequestParams = "account="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.searchChangeHistoryEvents = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchChangeHistoryEvents(request), expectedError); + assert((client.innerApiCalls.searchChangeHistoryEvents as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes searchChangeHistoryEventsStream without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest()); + request.account = ''; + const expectedHeaderRequestParams = "account="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), + ]; + client.descriptors.page.searchChangeHistoryEvents.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchChangeHistoryEventsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.ChangeHistoryEvent[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.ChangeHistoryEvent) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.searchChangeHistoryEvents.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchChangeHistoryEvents, request)); + assert.strictEqual( + (client.descriptors.page.searchChangeHistoryEvents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes searchChangeHistoryEventsStream with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest()); + request.account = ''; + const expectedHeaderRequestParams = "account="; + const expectedError = new Error('expected'); + client.descriptors.page.searchChangeHistoryEvents.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchChangeHistoryEventsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.ChangeHistoryEvent[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.ChangeHistoryEvent) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchChangeHistoryEvents.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchChangeHistoryEvents, request)); + assert.strictEqual( + (client.descriptors.page.searchChangeHistoryEvents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchChangeHistoryEvents without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest()); + request.account = ''; + const expectedHeaderRequestParams = "account="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), + ]; + client.descriptors.page.searchChangeHistoryEvents.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1alpha.IChangeHistoryEvent[] = []; + const iterable = client.searchChangeHistoryEventsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchChangeHistoryEvents.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.searchChangeHistoryEvents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchChangeHistoryEvents with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest()); + request.account = ''; + const expectedHeaderRequestParams = "account=";const expectedError = new Error('expected'); + client.descriptors.page.searchChangeHistoryEvents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchChangeHistoryEventsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.analytics.admin.v1alpha.IChangeHistoryEvent[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchChangeHistoryEvents.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.searchChangeHistoryEvents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listConversionEvents', () => { + it('invokes listConversionEvents without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListConversionEventsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), + ]; + client.innerApiCalls.listConversionEvents = stubSimpleCall(expectedResponse); + const [response] = await client.listConversionEvents(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listConversionEvents as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listConversionEvents without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListConversionEventsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), + ]; + client.innerApiCalls.listConversionEvents = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listConversionEvents( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IConversionEvent[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listConversionEvents as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listConversionEvents with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListConversionEventsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listConversionEvents = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listConversionEvents(request), expectedError); + assert((client.innerApiCalls.listConversionEvents as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listConversionEventsStream without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListConversionEventsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), + ]; + client.descriptors.page.listConversionEvents.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listConversionEventsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.ConversionEvent[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.ConversionEvent) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listConversionEvents.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listConversionEvents, request)); + assert.strictEqual( + (client.descriptors.page.listConversionEvents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listConversionEventsStream with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListConversionEventsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listConversionEvents.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listConversionEventsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.ConversionEvent[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.ConversionEvent) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listConversionEvents.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listConversionEvents, request)); + assert.strictEqual( + (client.descriptors.page.listConversionEvents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listConversionEvents without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListConversionEventsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), + ]; + client.descriptors.page.listConversionEvents.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1alpha.IConversionEvent[] = []; + const iterable = client.listConversionEventsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listConversionEvents.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listConversionEvents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listConversionEvents with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListConversionEventsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listConversionEvents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listConversionEventsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.analytics.admin.v1alpha.IConversionEvent[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listConversionEvents.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listConversionEvents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listDisplayVideo360AdvertiserLinks', () => { + it('invokes listDisplayVideo360AdvertiserLinks without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), + ]; + client.innerApiCalls.listDisplayVideo360AdvertiserLinks = stubSimpleCall(expectedResponse); + const [response] = await client.listDisplayVideo360AdvertiserLinks(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDisplayVideo360AdvertiserLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDisplayVideo360AdvertiserLinks without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), + ]; + client.innerApiCalls.listDisplayVideo360AdvertiserLinks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDisplayVideo360AdvertiserLinks( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDisplayVideo360AdvertiserLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listDisplayVideo360AdvertiserLinks with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listDisplayVideo360AdvertiserLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDisplayVideo360AdvertiserLinks(request), expectedError); + assert((client.innerApiCalls.listDisplayVideo360AdvertiserLinks as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDisplayVideo360AdvertiserLinksStream without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), + ]; + client.descriptors.page.listDisplayVideo360AdvertiserLinks.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDisplayVideo360AdvertiserLinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listDisplayVideo360AdvertiserLinks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDisplayVideo360AdvertiserLinks, request)); + assert.strictEqual( + (client.descriptors.page.listDisplayVideo360AdvertiserLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listDisplayVideo360AdvertiserLinksStream with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listDisplayVideo360AdvertiserLinks.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDisplayVideo360AdvertiserLinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDisplayVideo360AdvertiserLinks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDisplayVideo360AdvertiserLinks, request)); + assert.strictEqual( + (client.descriptors.page.listDisplayVideo360AdvertiserLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDisplayVideo360AdvertiserLinks without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), + ]; + client.descriptors.page.listDisplayVideo360AdvertiserLinks.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink[] = []; + const iterable = client.listDisplayVideo360AdvertiserLinksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDisplayVideo360AdvertiserLinks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDisplayVideo360AdvertiserLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDisplayVideo360AdvertiserLinks with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listDisplayVideo360AdvertiserLinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDisplayVideo360AdvertiserLinksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDisplayVideo360AdvertiserLinks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDisplayVideo360AdvertiserLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listDisplayVideo360AdvertiserLinkProposals', () => { + it('invokes listDisplayVideo360AdvertiserLinkProposals without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), + ]; + client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals = stubSimpleCall(expectedResponse); + const [response] = await client.listDisplayVideo360AdvertiserLinkProposals(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDisplayVideo360AdvertiserLinkProposals without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), + ]; + client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDisplayVideo360AdvertiserLinkProposals( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listDisplayVideo360AdvertiserLinkProposals with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDisplayVideo360AdvertiserLinkProposals(request), expectedError); + assert((client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDisplayVideo360AdvertiserLinkProposalsStream without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), + ]; + client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDisplayVideo360AdvertiserLinkProposalsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals, request)); + assert.strictEqual( + (client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listDisplayVideo360AdvertiserLinkProposalsStream with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDisplayVideo360AdvertiserLinkProposalsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals, request)); + assert.strictEqual( + (client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDisplayVideo360AdvertiserLinkProposals without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), + ]; + client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal[] = []; + const iterable = client.listDisplayVideo360AdvertiserLinkProposalsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDisplayVideo360AdvertiserLinkProposals with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDisplayVideo360AdvertiserLinkProposalsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listCustomDimensions', () => { + it('invokes listCustomDimensions without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomDimensionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), + ]; + client.innerApiCalls.listCustomDimensions = stubSimpleCall(expectedResponse); + const [response] = await client.listCustomDimensions(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listCustomDimensions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listCustomDimensions without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomDimensionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), + ]; + client.innerApiCalls.listCustomDimensions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCustomDimensions( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ICustomDimension[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listCustomDimensions as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listCustomDimensions with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomDimensionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listCustomDimensions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listCustomDimensions(request), expectedError); + assert((client.innerApiCalls.listCustomDimensions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listCustomDimensionsStream without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomDimensionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), + ]; + client.descriptors.page.listCustomDimensions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listCustomDimensionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.CustomDimension[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.CustomDimension) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listCustomDimensions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCustomDimensions, request)); + assert.strictEqual( + (client.descriptors.page.listCustomDimensions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listCustomDimensionsStream with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomDimensionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listCustomDimensions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listCustomDimensionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.CustomDimension[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.CustomDimension) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listCustomDimensions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCustomDimensions, request)); + assert.strictEqual( + (client.descriptors.page.listCustomDimensions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listCustomDimensions without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomDimensionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), + ]; + client.descriptors.page.listCustomDimensions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1alpha.ICustomDimension[] = []; + const iterable = client.listCustomDimensionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCustomDimensions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listCustomDimensions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listCustomDimensions with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomDimensionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listCustomDimensions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCustomDimensionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.analytics.admin.v1alpha.ICustomDimension[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCustomDimensions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listCustomDimensions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listCustomMetrics', () => { + it('invokes listCustomMetrics without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomMetricsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), + ]; + client.innerApiCalls.listCustomMetrics = stubSimpleCall(expectedResponse); + const [response] = await client.listCustomMetrics(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listCustomMetrics as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listCustomMetrics without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomMetricsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), + ]; + client.innerApiCalls.listCustomMetrics = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCustomMetrics( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ICustomMetric[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listCustomMetrics as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listCustomMetrics with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomMetricsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listCustomMetrics = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listCustomMetrics(request), expectedError); + assert((client.innerApiCalls.listCustomMetrics as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listCustomMetricsStream without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomMetricsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), + ]; + client.descriptors.page.listCustomMetrics.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listCustomMetricsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.CustomMetric[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.CustomMetric) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listCustomMetrics.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCustomMetrics, request)); + assert.strictEqual( + (client.descriptors.page.listCustomMetrics.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listCustomMetricsStream with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomMetricsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listCustomMetrics.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listCustomMetricsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.CustomMetric[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.CustomMetric) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listCustomMetrics.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCustomMetrics, request)); + assert.strictEqual( + (client.descriptors.page.listCustomMetrics.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listCustomMetrics without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomMetricsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), + ]; + client.descriptors.page.listCustomMetrics.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1alpha.ICustomMetric[] = []; + const iterable = client.listCustomMetricsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCustomMetrics.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listCustomMetrics.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listCustomMetrics with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomMetricsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listCustomMetrics.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCustomMetricsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.analytics.admin.v1alpha.ICustomMetric[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCustomMetrics.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listCustomMetrics.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listDataStreams', () => { + it('invokes listDataStreams without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDataStreamsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), + ]; + client.innerApiCalls.listDataStreams = stubSimpleCall(expectedResponse); + const [response] = await client.listDataStreams(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDataStreams as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDataStreams without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDataStreamsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), + ]; + client.innerApiCalls.listDataStreams = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDataStreams( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDataStream[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDataStreams as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listDataStreams with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDataStreamsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataStreams = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDataStreams(request), expectedError); + assert((client.innerApiCalls.listDataStreams as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDataStreamsStream without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDataStreamsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), + ]; + client.descriptors.page.listDataStreams.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDataStreamsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.DataStream[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.DataStream) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listDataStreams.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDataStreams, request)); + assert.strictEqual( + (client.descriptors.page.listDataStreams.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listDataStreamsStream with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDataStreamsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listDataStreams.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDataStreamsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.DataStream[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.DataStream) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDataStreams.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDataStreams, request)); + assert.strictEqual( + (client.descriptors.page.listDataStreams.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDataStreams without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDataStreamsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), + ]; + client.descriptors.page.listDataStreams.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1alpha.IDataStream[] = []; + const iterable = client.listDataStreamsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDataStreams.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDataStreams.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDataStreams with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDataStreamsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listDataStreams.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDataStreamsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.analytics.admin.v1alpha.IDataStream[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDataStreams.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDataStreams.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('account', () => { + const fakePath = "/rendered/path/account"; + const expectedParameters = { + account: "accountValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.accountPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.accountPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('accountPath', () => { + const result = client.accountPath("accountValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.accountPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountFromAccountName', () => { + const result = client.matchAccountFromAccountName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.accountPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('accountSummary', () => { + const fakePath = "/rendered/path/accountSummary"; + const expectedParameters = { + account_summary: "accountSummaryValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.accountSummaryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.accountSummaryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('accountSummaryPath', () => { + const result = client.accountSummaryPath("accountSummaryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.accountSummaryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountSummaryFromAccountSummaryName', () => { + const result = client.matchAccountSummaryFromAccountSummaryName(fakePath); + assert.strictEqual(result, "accountSummaryValue"); + assert((client.pathTemplates.accountSummaryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('accountUserLink', () => { + const fakePath = "/rendered/path/accountUserLink"; + const expectedParameters = { + account: "accountValue", + user_link: "userLinkValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.accountUserLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.accountUserLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('accountUserLinkPath', () => { + const result = client.accountUserLinkPath("accountValue", "userLinkValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.accountUserLinkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountFromAccountUserLinkName', () => { + const result = client.matchAccountFromAccountUserLinkName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.accountUserLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserLinkFromAccountUserLinkName', () => { + const result = client.matchUserLinkFromAccountUserLinkName(fakePath); + assert.strictEqual(result, "userLinkValue"); + assert((client.pathTemplates.accountUserLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('conversionEvent', () => { + const fakePath = "/rendered/path/conversionEvent"; + const expectedParameters = { + property: "propertyValue", + conversion_event: "conversionEventValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.conversionEventPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.conversionEventPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('conversionEventPath', () => { + const result = client.conversionEventPath("propertyValue", "conversionEventValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.conversionEventPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromConversionEventName', () => { + const result = client.matchPropertyFromConversionEventName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.conversionEventPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchConversionEventFromConversionEventName', () => { + const result = client.matchConversionEventFromConversionEventName(fakePath); + assert.strictEqual(result, "conversionEventValue"); + assert((client.pathTemplates.conversionEventPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customDimension', () => { + const fakePath = "/rendered/path/customDimension"; + const expectedParameters = { + property: "propertyValue", + custom_dimension: "customDimensionValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customDimensionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customDimensionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customDimensionPath', () => { + const result = client.customDimensionPath("propertyValue", "customDimensionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customDimensionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromCustomDimensionName', () => { + const result = client.matchPropertyFromCustomDimensionName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.customDimensionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomDimensionFromCustomDimensionName', () => { + const result = client.matchCustomDimensionFromCustomDimensionName(fakePath); + assert.strictEqual(result, "customDimensionValue"); + assert((client.pathTemplates.customDimensionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customMetric', () => { + const fakePath = "/rendered/path/customMetric"; + const expectedParameters = { + property: "propertyValue", + custom_metric: "customMetricValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customMetricPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customMetricPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customMetricPath', () => { + const result = client.customMetricPath("propertyValue", "customMetricValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customMetricPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromCustomMetricName', () => { + const result = client.matchPropertyFromCustomMetricName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.customMetricPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomMetricFromCustomMetricName', () => { + const result = client.matchCustomMetricFromCustomMetricName(fakePath); + assert.strictEqual(result, "customMetricValue"); + assert((client.pathTemplates.customMetricPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataRetentionSettings', () => { + const fakePath = "/rendered/path/dataRetentionSettings"; + const expectedParameters = { + property: "propertyValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataRetentionSettingsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataRetentionSettingsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataRetentionSettingsPath', () => { + const result = client.dataRetentionSettingsPath("propertyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataRetentionSettingsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromDataRetentionSettingsName', () => { + const result = client.matchPropertyFromDataRetentionSettingsName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.dataRetentionSettingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataSharingSettings', () => { + const fakePath = "/rendered/path/dataSharingSettings"; + const expectedParameters = { + account: "accountValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataSharingSettingsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataSharingSettingsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataSharingSettingsPath', () => { + const result = client.dataSharingSettingsPath("accountValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataSharingSettingsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountFromDataSharingSettingsName', () => { + const result = client.matchAccountFromDataSharingSettingsName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.dataSharingSettingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataStream', () => { + const fakePath = "/rendered/path/dataStream"; + const expectedParameters = { + property: "propertyValue", + data_stream: "dataStreamValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataStreamPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataStreamPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataStreamPath', () => { + const result = client.dataStreamPath("propertyValue", "dataStreamValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataStreamPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromDataStreamName', () => { + const result = client.matchPropertyFromDataStreamName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.dataStreamPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataStreamFromDataStreamName', () => { + const result = client.matchDataStreamFromDataStreamName(fakePath); + assert.strictEqual(result, "dataStreamValue"); + assert((client.pathTemplates.dataStreamPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('displayVideo360AdvertiserLink', () => { + const fakePath = "/rendered/path/displayVideo360AdvertiserLink"; + const expectedParameters = { + property: "propertyValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.displayVideo360AdvertiserLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.displayVideo360AdvertiserLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('displayVideo360AdvertiserLinkPath', () => { + const result = client.displayVideo360AdvertiserLinkPath("propertyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.displayVideo360AdvertiserLinkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromDisplayVideo360AdvertiserLinkName', () => { + const result = client.matchPropertyFromDisplayVideo360AdvertiserLinkName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.displayVideo360AdvertiserLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('displayVideo360AdvertiserLinkProposal', () => { + const fakePath = "/rendered/path/displayVideo360AdvertiserLinkProposal"; + const expectedParameters = { + property: "propertyValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.displayVideo360AdvertiserLinkProposalPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.displayVideo360AdvertiserLinkProposalPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('displayVideo360AdvertiserLinkProposalPath', () => { + const result = client.displayVideo360AdvertiserLinkProposalPath("propertyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.displayVideo360AdvertiserLinkProposalPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromDisplayVideo360AdvertiserLinkProposalName', () => { + const result = client.matchPropertyFromDisplayVideo360AdvertiserLinkProposalName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.displayVideo360AdvertiserLinkProposalPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('firebaseLink', () => { + const fakePath = "/rendered/path/firebaseLink"; + const expectedParameters = { + property: "propertyValue", + firebase_link: "firebaseLinkValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.firebaseLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.firebaseLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('firebaseLinkPath', () => { + const result = client.firebaseLinkPath("propertyValue", "firebaseLinkValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.firebaseLinkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromFirebaseLinkName', () => { + const result = client.matchPropertyFromFirebaseLinkName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.firebaseLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirebaseLinkFromFirebaseLinkName', () => { + const result = client.matchFirebaseLinkFromFirebaseLinkName(fakePath); + assert.strictEqual(result, "firebaseLinkValue"); + assert((client.pathTemplates.firebaseLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('globalSiteTag', () => { + const fakePath = "/rendered/path/globalSiteTag"; + const expectedParameters = { + property: "propertyValue", + data_stream: "dataStreamValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.globalSiteTagPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.globalSiteTagPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('globalSiteTagPath', () => { + const result = client.globalSiteTagPath("propertyValue", "dataStreamValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.globalSiteTagPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromGlobalSiteTagName', () => { + const result = client.matchPropertyFromGlobalSiteTagName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.globalSiteTagPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataStreamFromGlobalSiteTagName', () => { + const result = client.matchDataStreamFromGlobalSiteTagName(fakePath); + assert.strictEqual(result, "dataStreamValue"); + assert((client.pathTemplates.globalSiteTagPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('googleAdsLink', () => { + const fakePath = "/rendered/path/googleAdsLink"; + const expectedParameters = { + property: "propertyValue", + google_ads_link: "googleAdsLinkValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.googleAdsLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.googleAdsLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('googleAdsLinkPath', () => { + const result = client.googleAdsLinkPath("propertyValue", "googleAdsLinkValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.googleAdsLinkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromGoogleAdsLinkName', () => { + const result = client.matchPropertyFromGoogleAdsLinkName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.googleAdsLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGoogleAdsLinkFromGoogleAdsLinkName', () => { + const result = client.matchGoogleAdsLinkFromGoogleAdsLinkName(fakePath); + assert.strictEqual(result, "googleAdsLinkValue"); + assert((client.pathTemplates.googleAdsLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('googleSignalsSettings', () => { + const fakePath = "/rendered/path/googleSignalsSettings"; + const expectedParameters = { + property: "propertyValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.googleSignalsSettingsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.googleSignalsSettingsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('googleSignalsSettingsPath', () => { + const result = client.googleSignalsSettingsPath("propertyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.googleSignalsSettingsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromGoogleSignalsSettingsName', () => { + const result = client.matchPropertyFromGoogleSignalsSettingsName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.googleSignalsSettingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('measurementProtocolSecret', () => { + const fakePath = "/rendered/path/measurementProtocolSecret"; + const expectedParameters = { + property: "propertyValue", + data_stream: "dataStreamValue", + measurement_protocol_secret: "measurementProtocolSecretValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.measurementProtocolSecretPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.measurementProtocolSecretPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('measurementProtocolSecretPath', () => { + const result = client.measurementProtocolSecretPath("propertyValue", "dataStreamValue", "measurementProtocolSecretValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.measurementProtocolSecretPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromMeasurementProtocolSecretName', () => { + const result = client.matchPropertyFromMeasurementProtocolSecretName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.measurementProtocolSecretPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataStreamFromMeasurementProtocolSecretName', () => { + const result = client.matchDataStreamFromMeasurementProtocolSecretName(fakePath); + assert.strictEqual(result, "dataStreamValue"); + assert((client.pathTemplates.measurementProtocolSecretPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMeasurementProtocolSecretFromMeasurementProtocolSecretName', () => { + const result = client.matchMeasurementProtocolSecretFromMeasurementProtocolSecretName(fakePath); + assert.strictEqual(result, "measurementProtocolSecretValue"); + assert((client.pathTemplates.measurementProtocolSecretPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('property', () => { + const fakePath = "/rendered/path/property"; + const expectedParameters = { + property: "propertyValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.propertyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.propertyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('propertyPath', () => { + const result = client.propertyPath("propertyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.propertyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromPropertyName', () => { + const result = client.matchPropertyFromPropertyName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.propertyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('propertyUserLink', () => { + const fakePath = "/rendered/path/propertyUserLink"; + const expectedParameters = { + property: "propertyValue", + user_link: "userLinkValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.propertyUserLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.propertyUserLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('propertyUserLinkPath', () => { + const result = client.propertyUserLinkPath("propertyValue", "userLinkValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.propertyUserLinkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromPropertyUserLinkName', () => { + const result = client.matchPropertyFromPropertyUserLinkName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.propertyUserLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserLinkFromPropertyUserLinkName', () => { + const result = client.matchUserLinkFromPropertyUserLinkName(fakePath); + assert.strictEqual(result, "userLinkValue"); + assert((client.pathTemplates.propertyUserLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1alpha/tsconfig.json b/owl-bot-staging/v1alpha/tsconfig.json new file mode 100644 index 0000000..c78f1c8 --- /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 0000000..0e336a8 --- /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: 'AnalyticsAdminService', + filename: './analytics-admin-service.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 d895f41e7ecefb814a304023080b4e87d3b74c67 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 24 Jun 2022 11:15:35 +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 - .../admin/v1alpha/analytics_admin.proto | 2041 ---- .../analytics/admin/v1alpha/resources.proto | 1161 -- ...ervice.acknowledge_user_data_collection.js | 69 - ...splay_video360_advertiser_link_proposal.js | 59 - ..._admin_service.archive_custom_dimension.js | 59 - ...ics_admin_service.archive_custom_metric.js | 59 - ...nalytics_admin_service.audit_user_links.js | 74 - ...s_admin_service.batch_create_user_links.js | 73 - ...s_admin_service.batch_delete_user_links.js | 67 - ...tics_admin_service.batch_get_user_links.js | 68 - ...s_admin_service.batch_update_user_links.js | 67 - ...splay_video360_advertiser_link_proposal.js | 59 - ...s_admin_service.create_conversion_event.js | 64 - ...s_admin_service.create_custom_dimension.js | 63 - ...tics_admin_service.create_custom_metric.js | 63 - ...lytics_admin_service.create_data_stream.js | 63 - ...create_display_video360_advertiser_link.js | 63 - ...splay_video360_advertiser_link_proposal.js | 63 - ...tics_admin_service.create_firebase_link.js | 64 - ...cs_admin_service.create_google_ads_link.js | 63 - ...vice.create_measurement_protocol_secret.js | 64 - ...analytics_admin_service.create_property.js | 59 - ...nalytics_admin_service.create_user_link.js | 68 - .../analytics_admin_service.delete_account.js | 60 - ...s_admin_service.delete_conversion_event.js | 60 - ...lytics_admin_service.delete_data_stream.js | 59 - ...delete_display_video360_advertiser_link.js | 59 - ...splay_video360_advertiser_link_proposal.js | 59 - ...tics_admin_service.delete_firebase_link.js | 59 - ...cs_admin_service.delete_google_ads_link.js | 58 - ...vice.delete_measurement_protocol_secret.js | 60 - ...analytics_admin_service.delete_property.js | 60 - ...nalytics_admin_service.delete_user_link.js | 58 - .../analytics_admin_service.get_account.js | 60 - ...tics_admin_service.get_conversion_event.js | 60 - ...tics_admin_service.get_custom_dimension.js | 59 - ...alytics_admin_service.get_custom_metric.js | 59 - ...min_service.get_data_retention_settings.js | 61 - ...admin_service.get_data_sharing_settings.js | 60 - ...analytics_admin_service.get_data_stream.js | 59 - ...ce.get_display_video360_advertiser_link.js | 59 - ...splay_video360_advertiser_link_proposal.js | 59 - ...ytics_admin_service.get_global_site_tag.js | 61 - ...min_service.get_google_signals_settings.js | 59 - ...service.get_measurement_protocol_secret.js | 60 - .../analytics_admin_service.get_property.js | 60 - .../analytics_admin_service.get_user_link.js | 58 - ...cs_admin_service.list_account_summaries.js | 69 - .../analytics_admin_service.list_accounts.js | 75 - ...cs_admin_service.list_conversion_events.js | 74 - ...cs_admin_service.list_custom_dimensions.js | 73 - ...ytics_admin_service.list_custom_metrics.js | 73 - ...alytics_admin_service.list_data_streams.js | 73 - ...play_video360_advertiser_link_proposals.js | 75 - ....list_display_video360_advertiser_links.js | 74 - ...ytics_admin_service.list_firebase_links.js | 75 - ...ics_admin_service.list_google_ads_links.js | 73 - ...rvice.list_measurement_protocol_secrets.js | 75 - ...analytics_admin_service.list_properties.js | 94 - ...analytics_admin_service.list_user_links.js | 74 - ..._admin_service.provision_account_ticket.js | 62 - ...in_service.search_change_history_events.js | 101 - .../analytics_admin_service.update_account.js | 66 - ...s_admin_service.update_custom_dimension.js | 64 - ...tics_admin_service.update_custom_metric.js | 64 - ..._service.update_data_retention_settings.js | 66 - ...lytics_admin_service.update_data_stream.js | 64 - ...update_display_video360_advertiser_link.js | 64 - ...cs_admin_service.update_google_ads_link.js | 64 - ..._service.update_google_signals_settings.js | 66 - ...vice.update_measurement_protocol_secret.js | 62 - ...analytics_admin_service.update_property.js | 67 - ...nalytics_admin_service.update_user_link.js | 58 - ...tadata.google.analytics.admin.v1alpha.json | 3111 ------ owl-bot-staging/v1alpha/src/index.ts | 25 - .../v1alpha/analytics_admin_service_client.ts | 8074 -------------- ...analytics_admin_service_client_config.json | 394 - .../analytics_admin_service_proto_list.json | 4 - .../v1alpha/src/v1alpha/gapic_metadata.json | 793 -- 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_analytics_admin_service_v1alpha.ts | 9428 ----------------- owl-bot-staging/v1alpha/tsconfig.json | 19 - owl-bot-staging/v1alpha/webpack.config.js | 64 - src/v1alpha/analytics_admin_service_client.ts | 11 +- 96 files changed, 5 insertions(+), 30084 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/admin/v1alpha/analytics_admin.proto delete mode 100644 owl-bot-staging/v1alpha/protos/google/analytics/admin/v1alpha/resources.proto delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.acknowledge_user_data_collection.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_dimension.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_metric.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.audit_user_links.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_user_links.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_user_links.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_user_links.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_user_links.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_conversion_event.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_dimension.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_metric.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_data_stream.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link_proposal.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_firebase_link.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_google_ads_link.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_measurement_protocol_secret.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_property.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_user_link.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_account.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_conversion_event.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_data_stream.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_firebase_link.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_google_ads_link.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_measurement_protocol_secret.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_property.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_user_link.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_account.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_conversion_event.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_dimension.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_metric.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_retention_settings.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_sharing_settings.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_stream.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link_proposal.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_global_site_tag.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_google_signals_settings.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_measurement_protocol_secret.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_property.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_user_link.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_account_summaries.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_accounts.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_conversion_events.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_dimensions.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_metrics.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_data_streams.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_link_proposals.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_links.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_firebase_links.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_google_ads_links.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_measurement_protocol_secrets.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_properties.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_user_links.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.provision_account_ticket.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.search_change_history_events.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_account.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_dimension.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_metric.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_retention_settings.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_stream.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_display_video360_advertiser_link.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_ads_link.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_signals_settings.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_measurement_protocol_secret.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_property.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_user_link.js delete mode 100644 owl-bot-staging/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.admin.v1alpha.json delete mode 100644 owl-bot-staging/v1alpha/src/index.ts delete mode 100644 owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_client.ts delete mode 100644 owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_client_config.json delete mode 100644 owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_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_analytics_admin_service_v1alpha.ts delete mode 100644 owl-bot-staging/v1alpha/tsconfig.json delete mode 100644 owl-bot-staging/v1alpha/webpack.config.js diff --git a/owl-bot-staging/v1alpha/.eslintignore b/owl-bot-staging/v1alpha/.eslintignore deleted file mode 100644 index cfc348e..0000000 --- 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 7821534..0000000 --- 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 5d32b23..0000000 --- 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 59f18fd..0000000 --- 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-analytics/admin', - 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 481c522..0000000 --- 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 494e147..0000000 --- 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 5d45b74..0000000 --- a/owl-bot-staging/v1alpha/README.md +++ /dev/null @@ -1 +0,0 @@ -Admin: 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 befd23c..0000000 --- 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 425a16e..0000000 --- a/owl-bot-staging/v1alpha/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-analytics/admin", - "version": "0.1.0", - "description": "Admin client for Node.js", - "repository": "googleapis/nodejs-admin", - "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 admin", - "admin", - "analytics admin service" - ], - "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": "^3.1.1" - }, - "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": ">=v12" - } -} diff --git a/owl-bot-staging/v1alpha/protos/google/analytics/admin/v1alpha/analytics_admin.proto b/owl-bot-staging/v1alpha/protos/google/analytics/admin/v1alpha/analytics_admin.proto deleted file mode 100644 index 00fe854..0000000 --- a/owl-bot-staging/v1alpha/protos/google/analytics/admin/v1alpha/analytics_admin.proto +++ /dev/null @@ -1,2041 +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.admin.v1alpha; - -import "google/analytics/admin/v1alpha/resources.proto"; -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/analytics/admin/v1alpha;admin"; -option java_multiple_files = true; -option java_outer_classname = "AnalyticsAdminProto"; -option java_package = "com.google.analytics.admin.v1alpha"; - -// Service Interface for the Analytics Admin API (GA4). -service AnalyticsAdminService { - option (google.api.default_host) = "analyticsadmin.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/analytics.edit," - "https://www.googleapis.com/auth/analytics.manage.users," - "https://www.googleapis.com/auth/analytics.manage.users.readonly," - "https://www.googleapis.com/auth/analytics.readonly"; - - // Lookup for a single Account. - rpc GetAccount(GetAccountRequest) returns (Account) { - option (google.api.http) = { - get: "/v1alpha/{name=accounts/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Returns all accounts accessible by the caller. - // - // Note that these accounts might not currently have GA4 properties. - // Soft-deleted (ie: "trashed") accounts are excluded by default. - // Returns an empty list if no relevant accounts are found. - rpc ListAccounts(ListAccountsRequest) returns (ListAccountsResponse) { - option (google.api.http) = { - get: "/v1alpha/accounts" - }; - } - - // Marks target Account as soft-deleted (ie: "trashed") and returns it. - // - // This API does not have a method to restore soft-deleted accounts. - // However, they can be restored using the Trash Can UI. - // - // If the accounts are not restored before the expiration time, the account - // and all child resources (eg: Properties, GoogleAdsLinks, Streams, - // UserLinks) will be permanently purged. - // https://support.google.com/analytics/answer/6154772 - // - // Returns an error if the target is not found. - rpc DeleteAccount(DeleteAccountRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1alpha/{name=accounts/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates an account. - rpc UpdateAccount(UpdateAccountRequest) returns (Account) { - option (google.api.http) = { - patch: "/v1alpha/{account.name=accounts/*}" - body: "account" - }; - option (google.api.method_signature) = "account,update_mask"; - } - - // Requests a ticket for creating an account. - rpc ProvisionAccountTicket(ProvisionAccountTicketRequest) returns (ProvisionAccountTicketResponse) { - option (google.api.http) = { - post: "/v1alpha/accounts:provisionAccountTicket" - body: "*" - }; - } - - // Returns summaries of all accounts accessible by the caller. - rpc ListAccountSummaries(ListAccountSummariesRequest) returns (ListAccountSummariesResponse) { - option (google.api.http) = { - get: "/v1alpha/accountSummaries" - }; - } - - // Lookup for a single "GA4" Property. - rpc GetProperty(GetPropertyRequest) returns (Property) { - option (google.api.http) = { - get: "/v1alpha/{name=properties/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Returns child Properties under the specified parent Account. - // - // Only "GA4" properties will be returned. - // Properties will be excluded if the caller does not have access. - // Soft-deleted (ie: "trashed") properties are excluded by default. - // Returns an empty list if no relevant properties are found. - rpc ListProperties(ListPropertiesRequest) returns (ListPropertiesResponse) { - option (google.api.http) = { - get: "/v1alpha/properties" - }; - } - - // Creates an "GA4" property with the specified location and attributes. - rpc CreateProperty(CreatePropertyRequest) returns (Property) { - option (google.api.http) = { - post: "/v1alpha/properties" - body: "property" - }; - option (google.api.method_signature) = "property"; - } - - // Marks target Property as soft-deleted (ie: "trashed") and returns it. - // - // This API does not have a method to restore soft-deleted properties. - // However, they can be restored using the Trash Can UI. - // - // If the properties are not restored before the expiration time, the Property - // and all child resources (eg: GoogleAdsLinks, Streams, UserLinks) - // will be permanently purged. - // https://support.google.com/analytics/answer/6154772 - // - // Returns an error if the target is not found, or is not an GA4 Property. - rpc DeleteProperty(DeletePropertyRequest) returns (Property) { - option (google.api.http) = { - delete: "/v1alpha/{name=properties/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a property. - rpc UpdateProperty(UpdatePropertyRequest) returns (Property) { - option (google.api.http) = { - patch: "/v1alpha/{property.name=properties/*}" - body: "property" - }; - option (google.api.method_signature) = "property,update_mask"; - } - - // Gets information about a user's link to an account or property. - rpc GetUserLink(GetUserLinkRequest) returns (UserLink) { - option (google.api.http) = { - get: "/v1alpha/{name=accounts/*/userLinks/*}" - additional_bindings { - get: "/v1alpha/{name=properties/*/userLinks/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Gets information about multiple users' links to an account or property. - rpc BatchGetUserLinks(BatchGetUserLinksRequest) returns (BatchGetUserLinksResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=accounts/*}/userLinks:batchGet" - additional_bindings { - get: "/v1alpha/{parent=properties/*}/userLinks:batchGet" - } - }; - } - - // Lists all user links on an account or property. - rpc ListUserLinks(ListUserLinksRequest) returns (ListUserLinksResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=accounts/*}/userLinks" - additional_bindings { - get: "/v1alpha/{parent=properties/*}/userLinks" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Lists all user links on an account or property, including implicit ones - // that come from effective permissions granted by groups or organization - // admin roles. - // - // If a returned user link does not have direct permissions, they cannot - // be removed from the account or property directly with the DeleteUserLink - // command. They have to be removed from the group/etc that gives them - // permissions, which is currently only usable/discoverable in the GA or GMP - // UIs. - rpc AuditUserLinks(AuditUserLinksRequest) returns (AuditUserLinksResponse) { - option (google.api.http) = { - post: "/v1alpha/{parent=accounts/*}/userLinks:audit" - body: "*" - additional_bindings { - post: "/v1alpha/{parent=properties/*}/userLinks:audit" - body: "*" - } - }; - } - - // Creates a user link on an account or property. - // - // If the user with the specified email already has permissions on the - // account or property, then the user's existing permissions will be unioned - // with the permissions specified in the new UserLink. - rpc CreateUserLink(CreateUserLinkRequest) returns (UserLink) { - option (google.api.http) = { - post: "/v1alpha/{parent=accounts/*}/userLinks" - body: "user_link" - additional_bindings { - post: "/v1alpha/{parent=properties/*}/userLinks" - body: "user_link" - } - }; - option (google.api.method_signature) = "parent,user_link"; - } - - // Creates information about multiple users' links to an account or property. - // - // This method is transactional. If any UserLink cannot be created, none of - // the UserLinks will be created. - rpc BatchCreateUserLinks(BatchCreateUserLinksRequest) returns (BatchCreateUserLinksResponse) { - option (google.api.http) = { - post: "/v1alpha/{parent=accounts/*}/userLinks:batchCreate" - body: "*" - additional_bindings { - post: "/v1alpha/{parent=properties/*}/userLinks:batchCreate" - body: "*" - } - }; - } - - // Updates a user link on an account or property. - rpc UpdateUserLink(UpdateUserLinkRequest) returns (UserLink) { - option (google.api.http) = { - patch: "/v1alpha/{user_link.name=accounts/*/userLinks/*}" - body: "user_link" - additional_bindings { - patch: "/v1alpha/{user_link.name=properties/*/userLinks/*}" - body: "user_link" - } - }; - option (google.api.method_signature) = "user_link"; - } - - // Updates information about multiple users' links to an account or property. - rpc BatchUpdateUserLinks(BatchUpdateUserLinksRequest) returns (BatchUpdateUserLinksResponse) { - option (google.api.http) = { - post: "/v1alpha/{parent=accounts/*}/userLinks:batchUpdate" - body: "*" - additional_bindings { - post: "/v1alpha/{parent=properties/*}/userLinks:batchUpdate" - body: "*" - } - }; - } - - // Deletes a user link on an account or property. - rpc DeleteUserLink(DeleteUserLinkRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1alpha/{name=accounts/*/userLinks/*}" - additional_bindings { - delete: "/v1alpha/{name=properties/*/userLinks/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Deletes information about multiple users' links to an account or property. - rpc BatchDeleteUserLinks(BatchDeleteUserLinksRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1alpha/{parent=accounts/*}/userLinks:batchDelete" - body: "*" - additional_bindings { - post: "/v1alpha/{parent=properties/*}/userLinks:batchDelete" - body: "*" - } - }; - } - - // Creates a FirebaseLink. - // - // Properties can have at most one FirebaseLink. - rpc CreateFirebaseLink(CreateFirebaseLinkRequest) returns (FirebaseLink) { - option (google.api.http) = { - post: "/v1alpha/{parent=properties/*}/firebaseLinks" - body: "firebase_link" - }; - option (google.api.method_signature) = "parent,firebase_link"; - } - - // Deletes a FirebaseLink on a property - rpc DeleteFirebaseLink(DeleteFirebaseLinkRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1alpha/{name=properties/*/firebaseLinks/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists FirebaseLinks on a property. - // Properties can have at most one FirebaseLink. - rpc ListFirebaseLinks(ListFirebaseLinksRequest) returns (ListFirebaseLinksResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=properties/*}/firebaseLinks" - }; - option (google.api.method_signature) = "parent"; - } - - // Returns the Site Tag for the specified web stream. - // Site Tags are immutable singletons. - rpc GetGlobalSiteTag(GetGlobalSiteTagRequest) returns (GlobalSiteTag) { - option (google.api.http) = { - get: "/v1alpha/{name=properties/*/dataStreams/*/globalSiteTag}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a GoogleAdsLink. - rpc CreateGoogleAdsLink(CreateGoogleAdsLinkRequest) returns (GoogleAdsLink) { - option (google.api.http) = { - post: "/v1alpha/{parent=properties/*}/googleAdsLinks" - body: "google_ads_link" - }; - option (google.api.method_signature) = "parent,google_ads_link"; - } - - // Updates a GoogleAdsLink on a property - rpc UpdateGoogleAdsLink(UpdateGoogleAdsLinkRequest) returns (GoogleAdsLink) { - option (google.api.http) = { - patch: "/v1alpha/{google_ads_link.name=properties/*/googleAdsLinks/*}" - body: "google_ads_link" - }; - option (google.api.method_signature) = "google_ads_link,update_mask"; - } - - // Deletes a GoogleAdsLink on a property - rpc DeleteGoogleAdsLink(DeleteGoogleAdsLinkRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1alpha/{name=properties/*/googleAdsLinks/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists GoogleAdsLinks on a property. - rpc ListGoogleAdsLinks(ListGoogleAdsLinksRequest) returns (ListGoogleAdsLinksResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=properties/*}/googleAdsLinks" - }; - option (google.api.method_signature) = "parent"; - } - - // Get data sharing settings on an account. - // Data sharing settings are singletons. - rpc GetDataSharingSettings(GetDataSharingSettingsRequest) returns (DataSharingSettings) { - option (google.api.http) = { - get: "/v1alpha/{name=accounts/*/dataSharingSettings}" - }; - option (google.api.method_signature) = "name"; - } - - // Lookup for a single "GA4" MeasurementProtocolSecret. - rpc GetMeasurementProtocolSecret(GetMeasurementProtocolSecretRequest) returns (MeasurementProtocolSecret) { - option (google.api.http) = { - get: "/v1alpha/{name=properties/*/dataStreams/*/measurementProtocolSecrets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Returns child MeasurementProtocolSecrets under the specified parent - // Property. - rpc ListMeasurementProtocolSecrets(ListMeasurementProtocolSecretsRequest) returns (ListMeasurementProtocolSecretsResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=properties/*/dataStreams/*}/measurementProtocolSecrets" - }; - option (google.api.method_signature) = "parent"; - } - - // Creates a measurement protocol secret. - rpc CreateMeasurementProtocolSecret(CreateMeasurementProtocolSecretRequest) returns (MeasurementProtocolSecret) { - option (google.api.http) = { - post: "/v1alpha/{parent=properties/*/dataStreams/*}/measurementProtocolSecrets" - body: "measurement_protocol_secret" - }; - option (google.api.method_signature) = "parent,measurement_protocol_secret"; - } - - // Deletes target MeasurementProtocolSecret. - rpc DeleteMeasurementProtocolSecret(DeleteMeasurementProtocolSecretRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1alpha/{name=properties/*/dataStreams/*/measurementProtocolSecrets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a measurement protocol secret. - rpc UpdateMeasurementProtocolSecret(UpdateMeasurementProtocolSecretRequest) returns (MeasurementProtocolSecret) { - option (google.api.http) = { - patch: "/v1alpha/{measurement_protocol_secret.name=properties/*/dataStreams/*/measurementProtocolSecrets/*}" - body: "measurement_protocol_secret" - }; - option (google.api.method_signature) = "measurement_protocol_secret,update_mask"; - } - - // Acknowledges the terms of user data collection for the specified property. - // - // This acknowledgement must be completed (either in the Google Analytics UI - // or via this API) before MeasurementProtocolSecret resources may be created. - rpc AcknowledgeUserDataCollection(AcknowledgeUserDataCollectionRequest) returns (AcknowledgeUserDataCollectionResponse) { - option (google.api.http) = { - post: "/v1alpha/{property=properties/*}:acknowledgeUserDataCollection" - body: "*" - }; - } - - // Searches through all changes to an account or its children given the - // specified set of filters. - rpc SearchChangeHistoryEvents(SearchChangeHistoryEventsRequest) returns (SearchChangeHistoryEventsResponse) { - option (google.api.http) = { - post: "/v1alpha/{account=accounts/*}:searchChangeHistoryEvents" - body: "*" - }; - } - - // Lookup for Google Signals settings for a property. - rpc GetGoogleSignalsSettings(GetGoogleSignalsSettingsRequest) returns (GoogleSignalsSettings) { - option (google.api.http) = { - get: "/v1alpha/{name=properties/*/googleSignalsSettings}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates Google Signals settings for a property. - rpc UpdateGoogleSignalsSettings(UpdateGoogleSignalsSettingsRequest) returns (GoogleSignalsSettings) { - option (google.api.http) = { - patch: "/v1alpha/{google_signals_settings.name=properties/*/googleSignalsSettings}" - body: "google_signals_settings" - }; - option (google.api.method_signature) = "google_signals_settings,update_mask"; - } - - // Creates a conversion event with the specified attributes. - rpc CreateConversionEvent(CreateConversionEventRequest) returns (ConversionEvent) { - option (google.api.http) = { - post: "/v1alpha/{parent=properties/*}/conversionEvents" - body: "conversion_event" - }; - option (google.api.method_signature) = "parent,conversion_event"; - } - - // Retrieve a single conversion event. - rpc GetConversionEvent(GetConversionEventRequest) returns (ConversionEvent) { - option (google.api.http) = { - get: "/v1alpha/{name=properties/*/conversionEvents/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Deletes a conversion event in a property. - rpc DeleteConversionEvent(DeleteConversionEventRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1alpha/{name=properties/*/conversionEvents/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Returns a list of conversion events in the specified parent property. - // - // Returns an empty list if no conversion events are found. - rpc ListConversionEvents(ListConversionEventsRequest) returns (ListConversionEventsResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=properties/*}/conversionEvents" - }; - option (google.api.method_signature) = "parent"; - } - - // Look up a single DisplayVideo360AdvertiserLink - rpc GetDisplayVideo360AdvertiserLink(GetDisplayVideo360AdvertiserLinkRequest) returns (DisplayVideo360AdvertiserLink) { - option (google.api.http) = { - get: "/v1alpha/{name=properties/*/displayVideo360AdvertiserLinks/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists all DisplayVideo360AdvertiserLinks on a property. - rpc ListDisplayVideo360AdvertiserLinks(ListDisplayVideo360AdvertiserLinksRequest) returns (ListDisplayVideo360AdvertiserLinksResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=properties/*}/displayVideo360AdvertiserLinks" - }; - option (google.api.method_signature) = "parent"; - } - - // Creates a DisplayVideo360AdvertiserLink. - // This can only be utilized by users who have proper authorization both on - // the Google Analytics property and on the Display & Video 360 advertiser. - // Users who do not have access to the Display & Video 360 advertiser should - // instead seek to create a DisplayVideo360LinkProposal. - rpc CreateDisplayVideo360AdvertiserLink(CreateDisplayVideo360AdvertiserLinkRequest) returns (DisplayVideo360AdvertiserLink) { - option (google.api.http) = { - post: "/v1alpha/{parent=properties/*}/displayVideo360AdvertiserLinks" - body: "display_video_360_advertiser_link" - }; - option (google.api.method_signature) = "parent,display_video_360_advertiser_link"; - } - - // Deletes a DisplayVideo360AdvertiserLink on a property. - rpc DeleteDisplayVideo360AdvertiserLink(DeleteDisplayVideo360AdvertiserLinkRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1alpha/{name=properties/*/displayVideo360AdvertiserLinks/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a DisplayVideo360AdvertiserLink on a property. - rpc UpdateDisplayVideo360AdvertiserLink(UpdateDisplayVideo360AdvertiserLinkRequest) returns (DisplayVideo360AdvertiserLink) { - option (google.api.http) = { - patch: "/v1alpha/{display_video_360_advertiser_link.name=properties/*/displayVideo360AdvertiserLinks/*}" - body: "display_video_360_advertiser_link" - }; - option (google.api.method_signature) = "display_video_360_advertiser_link,update_mask"; - } - - // Lookup for a single DisplayVideo360AdvertiserLinkProposal. - rpc GetDisplayVideo360AdvertiserLinkProposal(GetDisplayVideo360AdvertiserLinkProposalRequest) returns (DisplayVideo360AdvertiserLinkProposal) { - option (google.api.http) = { - get: "/v1alpha/{name=properties/*/displayVideo360AdvertiserLinkProposals/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists DisplayVideo360AdvertiserLinkProposals on a property. - rpc ListDisplayVideo360AdvertiserLinkProposals(ListDisplayVideo360AdvertiserLinkProposalsRequest) returns (ListDisplayVideo360AdvertiserLinkProposalsResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=properties/*}/displayVideo360AdvertiserLinkProposals" - }; - option (google.api.method_signature) = "parent"; - } - - // Creates a DisplayVideo360AdvertiserLinkProposal. - rpc CreateDisplayVideo360AdvertiserLinkProposal(CreateDisplayVideo360AdvertiserLinkProposalRequest) returns (DisplayVideo360AdvertiserLinkProposal) { - option (google.api.http) = { - post: "/v1alpha/{parent=properties/*}/displayVideo360AdvertiserLinkProposals" - body: "display_video_360_advertiser_link_proposal" - }; - option (google.api.method_signature) = "parent,display_video_360_advertiser_link_proposal"; - } - - // Deletes a DisplayVideo360AdvertiserLinkProposal on a property. - // This can only be used on cancelled proposals. - rpc DeleteDisplayVideo360AdvertiserLinkProposal(DeleteDisplayVideo360AdvertiserLinkProposalRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1alpha/{name=properties/*/displayVideo360AdvertiserLinkProposals/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Approves a DisplayVideo360AdvertiserLinkProposal. - // The DisplayVideo360AdvertiserLinkProposal will be deleted and a new - // DisplayVideo360AdvertiserLink will be created. - rpc ApproveDisplayVideo360AdvertiserLinkProposal(ApproveDisplayVideo360AdvertiserLinkProposalRequest) returns (ApproveDisplayVideo360AdvertiserLinkProposalResponse) { - option (google.api.http) = { - post: "/v1alpha/{name=properties/*/displayVideo360AdvertiserLinkProposals/*}:approve" - body: "*" - }; - } - - // Cancels a DisplayVideo360AdvertiserLinkProposal. - // Cancelling can mean either: - // - Declining a proposal initiated from Display & Video 360 - // - Withdrawing a proposal initiated from Google Analytics - // After being cancelled, a proposal will eventually be deleted automatically. - rpc CancelDisplayVideo360AdvertiserLinkProposal(CancelDisplayVideo360AdvertiserLinkProposalRequest) returns (DisplayVideo360AdvertiserLinkProposal) { - option (google.api.http) = { - post: "/v1alpha/{name=properties/*/displayVideo360AdvertiserLinkProposals/*}:cancel" - body: "*" - }; - } - - // Creates a CustomDimension. - rpc CreateCustomDimension(CreateCustomDimensionRequest) returns (CustomDimension) { - option (google.api.http) = { - post: "/v1alpha/{parent=properties/*}/customDimensions" - body: "custom_dimension" - }; - option (google.api.method_signature) = "parent,custom_dimension"; - } - - // Updates a CustomDimension on a property. - rpc UpdateCustomDimension(UpdateCustomDimensionRequest) returns (CustomDimension) { - option (google.api.http) = { - patch: "/v1alpha/{custom_dimension.name=properties/*/customDimensions/*}" - body: "custom_dimension" - }; - option (google.api.method_signature) = "custom_dimension,update_mask"; - } - - // Lists CustomDimensions on a property. - rpc ListCustomDimensions(ListCustomDimensionsRequest) returns (ListCustomDimensionsResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=properties/*}/customDimensions" - }; - option (google.api.method_signature) = "parent"; - } - - // Archives a CustomDimension on a property. - rpc ArchiveCustomDimension(ArchiveCustomDimensionRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1alpha/{name=properties/*/customDimensions/*}:archive" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Lookup for a single CustomDimension. - rpc GetCustomDimension(GetCustomDimensionRequest) returns (CustomDimension) { - option (google.api.http) = { - get: "/v1alpha/{name=properties/*/customDimensions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a CustomMetric. - rpc CreateCustomMetric(CreateCustomMetricRequest) returns (CustomMetric) { - option (google.api.http) = { - post: "/v1alpha/{parent=properties/*}/customMetrics" - body: "custom_metric" - }; - option (google.api.method_signature) = "parent,custom_metric"; - } - - // Updates a CustomMetric on a property. - rpc UpdateCustomMetric(UpdateCustomMetricRequest) returns (CustomMetric) { - option (google.api.http) = { - patch: "/v1alpha/{custom_metric.name=properties/*/customMetrics/*}" - body: "custom_metric" - }; - option (google.api.method_signature) = "custom_metric,update_mask"; - } - - // Lists CustomMetrics on a property. - rpc ListCustomMetrics(ListCustomMetricsRequest) returns (ListCustomMetricsResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=properties/*}/customMetrics" - }; - option (google.api.method_signature) = "parent"; - } - - // Archives a CustomMetric on a property. - rpc ArchiveCustomMetric(ArchiveCustomMetricRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1alpha/{name=properties/*/customMetrics/*}:archive" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Lookup for a single CustomMetric. - rpc GetCustomMetric(GetCustomMetricRequest) returns (CustomMetric) { - option (google.api.http) = { - get: "/v1alpha/{name=properties/*/customMetrics/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Returns the singleton data retention settings for this property. - rpc GetDataRetentionSettings(GetDataRetentionSettingsRequest) returns (DataRetentionSettings) { - option (google.api.http) = { - get: "/v1alpha/{name=properties/*/dataRetentionSettings}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates the singleton data retention settings for this property. - rpc UpdateDataRetentionSettings(UpdateDataRetentionSettingsRequest) returns (DataRetentionSettings) { - option (google.api.http) = { - patch: "/v1alpha/{data_retention_settings.name=properties/*/dataRetentionSettings}" - body: "data_retention_settings" - }; - option (google.api.method_signature) = "data_retention_settings,update_mask"; - } - - // Creates a DataStream. - rpc CreateDataStream(CreateDataStreamRequest) returns (DataStream) { - option (google.api.http) = { - post: "/v1alpha/{parent=properties/*}/dataStreams" - body: "data_stream" - }; - option (google.api.method_signature) = "parent,data_stream"; - } - - // Deletes a DataStream on a property. - rpc DeleteDataStream(DeleteDataStreamRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1alpha/{name=properties/*/dataStreams/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a DataStream on a property. - rpc UpdateDataStream(UpdateDataStreamRequest) returns (DataStream) { - option (google.api.http) = { - patch: "/v1alpha/{data_stream.name=properties/*/dataStreams/*}" - body: "data_stream" - }; - option (google.api.method_signature) = "data_stream,update_mask"; - } - - // Lists DataStreams on a property. - rpc ListDataStreams(ListDataStreamsRequest) returns (ListDataStreamsResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=properties/*}/dataStreams" - }; - option (google.api.method_signature) = "parent"; - } - - // Lookup for a single DataStream. - rpc GetDataStream(GetDataStreamRequest) returns (DataStream) { - option (google.api.http) = { - get: "/v1alpha/{name=properties/*/dataStreams/*}" - }; - option (google.api.method_signature) = "name"; - } -} - -// Request message for GetAccount RPC. -message GetAccountRequest { - // Required. The name of the account to lookup. - // Format: accounts/{account} - // Example: "accounts/100" - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/Account" - } - ]; -} - -// Request message for ListAccounts RPC. -message ListAccountsRequest { - // The maximum number of resources to return. The service may return - // fewer than this value, even if there are additional pages. - // If unspecified, at most 50 resources will be returned. - // The maximum value is 200; (higher values will be coerced to the maximum) - int32 page_size = 1; - - // A page token, received from a previous `ListAccounts` call. - // Provide this to retrieve the subsequent page. - // When paginating, all other parameters provided to `ListAccounts` must - // match the call that provided the page token. - string page_token = 2; - - // Whether to include soft-deleted (ie: "trashed") Accounts in the - // results. Accounts can be inspected to determine whether they are deleted or - // not. - bool show_deleted = 3; -} - -// Request message for ListAccounts RPC. -message ListAccountsResponse { - // Results that were accessible to the caller. - repeated Account accounts = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for DeleteAccount RPC. -message DeleteAccountRequest { - // Required. The name of the Account to soft-delete. - // Format: accounts/{account} - // Example: "accounts/100" - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/Account" - } - ]; -} - -// Request message for UpdateAccount RPC. -message UpdateAccountRequest { - // Required. The account to update. - // The account's `name` field is used to identify the account. - Account account = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The list of fields to be updated. Field names must be in snake case - // (e.g., "field_to_update"). Omitted fields will not be updated. To replace - // the entire entity, use one path with the string "*" to match all fields. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for ProvisionAccountTicket RPC. -message ProvisionAccountTicketRequest { - // The account to create. - Account account = 1; - - // Redirect URI where the user will be sent after accepting Terms of Service. - // Must be configured in Developers Console as a Redirect URI - string redirect_uri = 2; -} - -// Response message for ProvisionAccountTicket RPC. -message ProvisionAccountTicketResponse { - // The param to be passed in the ToS link. - string account_ticket_id = 1; -} - -// Request message for GetProperty RPC. -message GetPropertyRequest { - // Required. The name of the property to lookup. - // Format: properties/{property_id} - // Example: "properties/1000" - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/Property" - } - ]; -} - -// Request message for ListProperties RPC. -message ListPropertiesRequest { - // Required. An expression for filtering the results of the request. - // Fields eligible for filtering are: - // `parent:`(The resource name of the parent account/property) or - // `ancestor:`(The resource name of the parent account) or - // `firebase_project:`(The id or number of the linked firebase project). - // Some examples of filters: - // - // ``` - // | Filter | Description | - // |-----------------------------|-------------------------------------------| - // | parent:accounts/123 | The account with account id: 123. | - // | parent:properties/123 | The property with property id: 123. | - // | ancestor:accounts/123 | The account with account id: 123. | - // | firebase_project:project-id | The firebase project with id: project-id. | - // | firebase_project:123 | The firebase project with number: 123. | - // ``` - string filter = 1 [(google.api.field_behavior) = REQUIRED]; - - // The maximum number of resources to return. The service may return - // fewer than this value, even if there are additional pages. - // If unspecified, at most 50 resources will be returned. - // The maximum value is 200; (higher values will be coerced to the maximum) - int32 page_size = 2; - - // A page token, received from a previous `ListProperties` call. - // Provide this to retrieve the subsequent page. - // When paginating, all other parameters provided to `ListProperties` must - // match the call that provided the page token. - string page_token = 3; - - // Whether to include soft-deleted (ie: "trashed") Properties in the - // results. Properties can be inspected to determine whether they are deleted - // or not. - bool show_deleted = 4; -} - -// Response message for ListProperties RPC. -message ListPropertiesResponse { - // Results that matched the filter criteria and were accessible to the caller. - repeated Property properties = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for UpdateProperty RPC. -message UpdatePropertyRequest { - // Required. The property to update. - // The property's `name` field is used to identify the property to be - // updated. - Property property = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The list of fields to be updated. Field names must be in snake case - // (e.g., "field_to_update"). Omitted fields will not be updated. To replace - // the entire entity, use one path with the string "*" to match all fields. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for CreateProperty RPC. -message CreatePropertyRequest { - // Required. The property to create. - // Note: the supplied property must specify its parent. - Property property = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for DeleteProperty RPC. -message DeletePropertyRequest { - // Required. The name of the Property to soft-delete. - // Format: properties/{property_id} - // Example: "properties/1000" - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/Property" - } - ]; -} - -// Request message for GetUserLink RPC. -message GetUserLinkRequest { - // Required. Example format: accounts/1234/userLinks/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/UserLink" - } - ]; -} - -// Request message for BatchGetUserLinks RPC. -message BatchGetUserLinksRequest { - // Required. The account or property that all user links in the request are - // for. The parent of all provided values for the 'names' field must match - // this field. - // Example format: accounts/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/UserLink" - } - ]; - - // Required. The names of the user links to retrieve. - // A maximum of 1000 user links can be retrieved in a batch. - // Format: accounts/{accountId}/userLinks/{userLinkId} - repeated string names = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/UserLink" - } - ]; -} - -// Response message for BatchGetUserLinks RPC. -message BatchGetUserLinksResponse { - // The requested user links. - repeated UserLink user_links = 1; -} - -// Request message for ListUserLinks RPC. -message ListUserLinksRequest { - // Required. Example format: accounts/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/UserLink" - } - ]; - - // The maximum number of user links to return. - // The service may return fewer than this value. - // If unspecified, at most 200 user links will be returned. - // The maximum value is 500; values above 500 will be coerced to 500. - int32 page_size = 2; - - // A page token, received from a previous `ListUserLinks` call. - // Provide this to retrieve the subsequent page. - // When paginating, all other parameters provided to `ListUserLinks` must - // match the call that provided the page token. - string page_token = 3; -} - -// Response message for ListUserLinks RPC. -message ListUserLinksResponse { - // List of UserLinks. These will be ordered stably, but in an arbitrary order. - repeated UserLink user_links = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for AuditUserLinks RPC. -message AuditUserLinksRequest { - // Required. Example format: accounts/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/UserLink" - } - ]; - - // The maximum number of user links to return. - // The service may return fewer than this value. - // If unspecified, at most 1000 user links will be returned. - // The maximum value is 5000; values above 5000 will be coerced to 5000. - int32 page_size = 2; - - // A page token, received from a previous `AuditUserLinks` call. - // Provide this to retrieve the subsequent page. - // When paginating, all other parameters provided to `AuditUserLinks` must - // match the call that provided the page token. - string page_token = 3; -} - -// Response message for AuditUserLinks RPC. -message AuditUserLinksResponse { - // List of AuditUserLinks. These will be ordered stably, but in an arbitrary - // order. - repeated AuditUserLink user_links = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for CreateUserLink RPC. -// -// Users can have multiple email addresses associated with their Google -// account, and one of these email addresses is the "primary" email address. -// Any of the email addresses associated with a Google account may be used -// for a new UserLink, but the returned UserLink will always contain the -// "primary" email address. As a result, the input and output email address -// for this request may differ. -message CreateUserLinkRequest { - // Required. Example format: accounts/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/UserLink" - } - ]; - - // Optional. If set, then email the new user notifying them that they've been granted - // permissions to the resource. - bool notify_new_user = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The user link to create. - UserLink user_link = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for BatchCreateUserLinks RPC. -message BatchCreateUserLinksRequest { - // Required. The account or property that all user links in the request are for. - // This field is required. The parent field in the CreateUserLinkRequest - // messages must either be empty or match this field. - // Example format: accounts/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/UserLink" - } - ]; - - // Optional. If set, then email the new users notifying them that they've been granted - // permissions to the resource. Regardless of whether this is set or not, - // notify_new_user field inside each individual request is ignored. - bool notify_new_users = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The requests specifying the user links to create. - // A maximum of 1000 user links can be created in a batch. - repeated CreateUserLinkRequest requests = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for BatchCreateUserLinks RPC. -message BatchCreateUserLinksResponse { - // The user links created. - repeated UserLink user_links = 1; -} - -// Request message for UpdateUserLink RPC. -message UpdateUserLinkRequest { - // Required. The user link to update. - UserLink user_link = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for BatchUpdateUserLinks RPC. -message BatchUpdateUserLinksRequest { - // Required. The account or property that all user links in the request are - // for. The parent field in the UpdateUserLinkRequest messages must either be - // empty or match this field. - // Example format: accounts/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/UserLink" - } - ]; - - // Required. The requests specifying the user links to update. - // A maximum of 1000 user links can be updated in a batch. - repeated UpdateUserLinkRequest requests = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for BatchUpdateUserLinks RPC. -message BatchUpdateUserLinksResponse { - // The user links updated. - repeated UserLink user_links = 1; -} - -// Request message for DeleteUserLink RPC. -message DeleteUserLinkRequest { - // Required. Example format: accounts/1234/userLinks/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/UserLink" - } - ]; -} - -// Request message for BatchDeleteUserLinks RPC. -message BatchDeleteUserLinksRequest { - // Required. The account or property that all user links in the request are - // for. The parent of all values for user link names to delete must match this - // field. - // Example format: accounts/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/UserLink" - } - ]; - - // Required. The requests specifying the user links to update. - // A maximum of 1000 user links can be updated in a batch. - repeated DeleteUserLinkRequest requests = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for CreateFirebaseLink RPC -message CreateFirebaseLinkRequest { - // Required. Format: properties/{property_id} - // Example: properties/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/FirebaseLink" - } - ]; - - // Required. The Firebase link to create. - FirebaseLink firebase_link = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for DeleteFirebaseLink RPC -message DeleteFirebaseLinkRequest { - // Required. Format: properties/{property_id}/firebaseLinks/{firebase_link_id} - // Example: properties/1234/firebaseLinks/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/FirebaseLink" - } - ]; -} - -// Request message for ListFirebaseLinks RPC -message ListFirebaseLinksRequest { - // Required. Format: properties/{property_id} - // Example: properties/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/FirebaseLink" - } - ]; - - // The maximum number of resources to return. The service may return - // fewer than this value, even if there are additional pages. - // If unspecified, at most 50 resources will be returned. - // The maximum value is 200; (higher values will be coerced to the maximum) - int32 page_size = 2; - - // A page token, received from a previous `ListFirebaseLinks` call. - // Provide this to retrieve the subsequent page. - // When paginating, all other parameters provided to `ListProperties` must - // match the call that provided the page token. - string page_token = 3; -} - -// Response message for ListFirebaseLinks RPC -message ListFirebaseLinksResponse { - // List of FirebaseLinks. This will have at most one value. - repeated FirebaseLink firebase_links = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - // Currently, Google Analytics supports only one FirebaseLink per property, - // so this will never be populated. - string next_page_token = 2; -} - -// Request message for GetGlobalSiteTag RPC. -message GetGlobalSiteTagRequest { - // Required. The name of the site tag to lookup. - // Note that site tags are singletons and do not have unique IDs. - // Format: properties/{property_id}/dataStreams/{stream_id}/globalSiteTag - // Example: "properties/123/dataStreams/456/globalSiteTag" - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/GlobalSiteTag" - } - ]; -} - -// Request message for CreateGoogleAdsLink RPC -message CreateGoogleAdsLinkRequest { - // Required. Example format: properties/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/GoogleAdsLink" - } - ]; - - // Required. The GoogleAdsLink to create. - GoogleAdsLink google_ads_link = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for UpdateGoogleAdsLink RPC -message UpdateGoogleAdsLinkRequest { - // The GoogleAdsLink to update - GoogleAdsLink google_ads_link = 1; - - // Required. The list of fields to be updated. Field names must be in snake case - // (e.g., "field_to_update"). Omitted fields will not be updated. To replace - // the entire entity, use one path with the string "*" to match all fields. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for DeleteGoogleAdsLink RPC. -message DeleteGoogleAdsLinkRequest { - // Required. Example format: properties/1234/googleAdsLinks/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/GoogleAdsLink" - } - ]; -} - -// Request message for ListGoogleAdsLinks RPC. -message ListGoogleAdsLinksRequest { - // Required. Example format: properties/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/GoogleAdsLink" - } - ]; - - // The maximum number of resources to return. - // If unspecified, at most 50 resources will be returned. - // The maximum value is 200 (higher values will be coerced to the maximum). - int32 page_size = 2; - - // A page token, received from a previous `ListGoogleAdsLinks` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListGoogleAdsLinks` must - // match the call that provided the page token. - string page_token = 3; -} - -// Response message for ListGoogleAdsLinks RPC. -message ListGoogleAdsLinksResponse { - // List of GoogleAdsLinks. - repeated GoogleAdsLink google_ads_links = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for GetDataSharingSettings RPC. -message GetDataSharingSettingsRequest { - // Required. The name of the settings to lookup. - // Format: accounts/{account}/dataSharingSettings - // Example: "accounts/1000/dataSharingSettings" - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/DataSharingSettings" - } - ]; -} - -// Request message for ListAccountSummaries RPC. -message ListAccountSummariesRequest { - // The maximum number of AccountSummary resources to return. The service may - // return fewer than this value, even if there are additional pages. - // If unspecified, at most 50 resources will be returned. - // The maximum value is 200; (higher values will be coerced to the maximum) - int32 page_size = 1; - - // A page token, received from a previous `ListAccountSummaries` call. - // Provide this to retrieve the subsequent page. - // When paginating, all other parameters provided to `ListAccountSummaries` - // must match the call that provided the page token. - string page_token = 2; -} - -// Response message for ListAccountSummaries RPC. -message ListAccountSummariesResponse { - // Account summaries of all accounts the caller has access to. - repeated AccountSummary account_summaries = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for AcknowledgeUserDataCollection RPC. -message AcknowledgeUserDataCollectionRequest { - // Required. The property for which to acknowledge user data collection. - string property = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/Property" - } - ]; - - // Required. An acknowledgement that the caller of this method understands the terms - // of user data collection. - // - // This field must contain the exact value: - // "I acknowledge that I have the necessary privacy disclosures and rights - // from my end users for the collection and processing of their data, - // including the association of such data with the visitation information - // Google Analytics collects from my site and/or app property." - string acknowledgement = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for AcknowledgeUserDataCollection RPC. -message AcknowledgeUserDataCollectionResponse { - -} - -// Request message for SearchChangeHistoryEvents RPC. -message SearchChangeHistoryEventsRequest { - // Required. The account resource for which to return change history resources. - string account = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/Account" - } - ]; - - // Optional. Resource name for a child property. If set, only return changes - // made to this property or its child resources. - string property = 2 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/Property" - } - ]; - - // Optional. If set, only return changes if they are for a resource that matches at - // least one of these types. - repeated ChangeHistoryResourceType resource_type = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, only return changes that match one or more of these types of - // actions. - repeated ActionType action = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, only return changes if they are made by a user in this list. - repeated string actor_email = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, only return changes made after this time (inclusive). - google.protobuf.Timestamp earliest_change_time = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, only return changes made before this time (inclusive). - google.protobuf.Timestamp latest_change_time = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum number of ChangeHistoryEvent items to return. - // The service may return fewer than this value, even if there are additional - // pages. If unspecified, at most 50 items will be returned. - // The maximum value is 200 (higher values will be coerced to the maximum). - int32 page_size = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous `SearchChangeHistoryEvents` call. - // Provide this to retrieve the subsequent page. When paginating, all other - // parameters provided to `SearchChangeHistoryEvents` must match the call that - // provided the page token. - string page_token = 9 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for SearchAccounts RPC. -message SearchChangeHistoryEventsResponse { - // Results that were accessible to the caller. - repeated ChangeHistoryEvent change_history_events = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for GetMeasurementProtocolSecret RPC. -message GetMeasurementProtocolSecretRequest { - // Required. The name of the measurement protocol secret to lookup. - // Format: - // properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/MeasurementProtocolSecret" - } - ]; -} - -// Request message for CreateMeasurementProtocolSecret RPC -message CreateMeasurementProtocolSecretRequest { - // Required. The parent resource where this secret will be created. - // Format: properties/{property}/dataStreams/{dataStream} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/MeasurementProtocolSecret" - } - ]; - - // Required. The measurement protocol secret to create. - MeasurementProtocolSecret measurement_protocol_secret = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for DeleteMeasurementProtocolSecret RPC -message DeleteMeasurementProtocolSecretRequest { - // Required. The name of the MeasurementProtocolSecret to delete. - // Format: - // properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/MeasurementProtocolSecret" - } - ]; -} - -// Request message for UpdateMeasurementProtocolSecret RPC -message UpdateMeasurementProtocolSecretRequest { - // Required. The measurement protocol secret to update. - MeasurementProtocolSecret measurement_protocol_secret = 1 [(google.api.field_behavior) = REQUIRED]; - - // The list of fields to be updated. Omitted fields will not be updated. - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for ListMeasurementProtocolSecret RPC -message ListMeasurementProtocolSecretsRequest { - // Required. The resource name of the parent stream. - // Format: - // properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/MeasurementProtocolSecret" - } - ]; - - // The maximum number of resources to return. - // If unspecified, at most 10 resources will be returned. - // The maximum value is 10. Higher values will be coerced to the maximum. - int32 page_size = 2; - - // A page token, received from a previous `ListMeasurementProtocolSecrets` - // call. Provide this to retrieve the subsequent page. When paginating, all - // other parameters provided to `ListMeasurementProtocolSecrets` must match - // the call that provided the page token. - string page_token = 3; -} - -// Response message for ListMeasurementProtocolSecret RPC -message ListMeasurementProtocolSecretsResponse { - // A list of secrets for the parent stream specified in the request. - repeated MeasurementProtocolSecret measurement_protocol_secrets = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for GetGoogleSignalsSettings RPC -message GetGoogleSignalsSettingsRequest { - // Required. The name of the google signals settings to retrieve. - // Format: properties/{property}/googleSignalsSettings - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/GoogleSignalsSettings" - } - ]; -} - -// Request message for UpdateGoogleSignalsSettings RPC -message UpdateGoogleSignalsSettingsRequest { - // Required. The settings to update. - // The `name` field is used to identify the settings to be updated. - GoogleSignalsSettings google_signals_settings = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The list of fields to be updated. Field names must be in snake case - // (e.g., "field_to_update"). Omitted fields will not be updated. To replace - // the entire entity, use one path with the string "*" to match all fields. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for CreateConversionEvent RPC -message CreateConversionEventRequest { - // Required. The conversion event to create. - ConversionEvent conversion_event = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource name of the parent property where this conversion event will - // be created. Format: properties/123 - string parent = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/ConversionEvent" - } - ]; -} - -// Request message for GetConversionEvent RPC -message GetConversionEventRequest { - // Required. The resource name of the conversion event to retrieve. - // Format: properties/{property}/conversionEvents/{conversion_event} - // Example: "properties/123/conversionEvents/456" - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/ConversionEvent" - } - ]; -} - -// Request message for DeleteConversionEvent RPC -message DeleteConversionEventRequest { - // Required. The resource name of the conversion event to delete. - // Format: properties/{property}/conversionEvents/{conversion_event} - // Example: "properties/123/conversionEvents/456" - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/ConversionEvent" - } - ]; -} - -// Request message for ListConversionEvents RPC -message ListConversionEventsRequest { - // Required. The resource name of the parent property. - // Example: 'properties/123' - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/ConversionEvent" - } - ]; - - // The maximum number of resources to return. - // If unspecified, at most 50 resources will be returned. - // The maximum value is 200; (higher values will be coerced to the maximum) - int32 page_size = 2; - - // A page token, received from a previous `ListConversionEvents` call. - // Provide this to retrieve the subsequent page. - // When paginating, all other parameters provided to `ListConversionEvents` - // must match the call that provided the page token. - string page_token = 3; -} - -// Response message for ListConversionEvents RPC. -message ListConversionEventsResponse { - // The requested conversion events - repeated ConversionEvent conversion_events = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for GetDisplayVideo360AdvertiserLink RPC. -message GetDisplayVideo360AdvertiserLinkRequest { - // Required. The name of the DisplayVideo360AdvertiserLink to get. - // Example format: properties/1234/displayVideo360AdvertiserLink/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLink" - } - ]; -} - -// Request message for ListDisplayVideo360AdvertiserLinks RPC. -message ListDisplayVideo360AdvertiserLinksRequest { - // Required. Example format: properties/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLink" - } - ]; - - // The maximum number of resources to return. - // If unspecified, at most 50 resources will be returned. - // The maximum value is 200 (higher values will be coerced to the maximum). - int32 page_size = 2; - - // A page token, received from a previous `ListDisplayVideo360AdvertiserLinks` - // call. Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // `ListDisplayVideo360AdvertiserLinks` must match the call that provided the - // page token. - string page_token = 3; -} - -// Response message for ListDisplayVideo360AdvertiserLinks RPC. -message ListDisplayVideo360AdvertiserLinksResponse { - // List of DisplayVideo360AdvertiserLinks. - repeated DisplayVideo360AdvertiserLink display_video_360_advertiser_links = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for CreateDisplayVideo360AdvertiserLink RPC. -message CreateDisplayVideo360AdvertiserLinkRequest { - // Required. Example format: properties/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLink" - } - ]; - - // Required. The DisplayVideo360AdvertiserLink to create. - DisplayVideo360AdvertiserLink display_video_360_advertiser_link = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for DeleteDisplayVideo360AdvertiserLink RPC. -message DeleteDisplayVideo360AdvertiserLinkRequest { - // Required. The name of the DisplayVideo360AdvertiserLink to delete. - // Example format: properties/1234/displayVideo360AdvertiserLinks/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLink" - } - ]; -} - -// Request message for UpdateDisplayVideo360AdvertiserLink RPC. -message UpdateDisplayVideo360AdvertiserLinkRequest { - // The DisplayVideo360AdvertiserLink to update - DisplayVideo360AdvertiserLink display_video_360_advertiser_link = 1; - - // Required. The list of fields to be updated. Omitted fields will not be updated. - // To replace the entire entity, use one path with the string "*" to match - // all fields. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for GetDisplayVideo360AdvertiserLinkProposal RPC. -message GetDisplayVideo360AdvertiserLinkProposalRequest { - // Required. The name of the DisplayVideo360AdvertiserLinkProposal to get. - // Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLinkProposal" - } - ]; -} - -// Request message for ListDisplayVideo360AdvertiserLinkProposals RPC. -message ListDisplayVideo360AdvertiserLinkProposalsRequest { - // Required. Example format: properties/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLinkProposal" - } - ]; - - // The maximum number of resources to return. - // If unspecified, at most 50 resources will be returned. - // The maximum value is 200 (higher values will be coerced to the maximum). - int32 page_size = 2; - - // A page token, received from a previous - // `ListDisplayVideo360AdvertiserLinkProposals` call. Provide this to retrieve - // the subsequent page. - // - // When paginating, all other parameters provided to - // `ListDisplayVideo360AdvertiserLinkProposals` must match the call that - // provided the page token. - string page_token = 3; -} - -// Response message for ListDisplayVideo360AdvertiserLinkProposals RPC. -message ListDisplayVideo360AdvertiserLinkProposalsResponse { - // List of DisplayVideo360AdvertiserLinkProposals. - repeated DisplayVideo360AdvertiserLinkProposal display_video_360_advertiser_link_proposals = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for CreateDisplayVideo360AdvertiserLinkProposal RPC. -message CreateDisplayVideo360AdvertiserLinkProposalRequest { - // Required. Example format: properties/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLinkProposal" - } - ]; - - // Required. The DisplayVideo360AdvertiserLinkProposal to create. - DisplayVideo360AdvertiserLinkProposal display_video_360_advertiser_link_proposal = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for DeleteDisplayVideo360AdvertiserLinkProposal RPC. -message DeleteDisplayVideo360AdvertiserLinkProposalRequest { - // Required. The name of the DisplayVideo360AdvertiserLinkProposal to delete. - // Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLinkProposal" - } - ]; -} - -// Request message for ApproveDisplayVideo360AdvertiserLinkProposal RPC. -message ApproveDisplayVideo360AdvertiserLinkProposalRequest { - // Required. The name of the DisplayVideo360AdvertiserLinkProposal to approve. - // Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLinkProposal" - } - ]; -} - -// Response message for ApproveDisplayVideo360AdvertiserLinkProposal RPC. -message ApproveDisplayVideo360AdvertiserLinkProposalResponse { - // The DisplayVideo360AdvertiserLink created as a result of approving the - // proposal. - DisplayVideo360AdvertiserLink display_video_360_advertiser_link = 1; -} - -// Request message for CancelDisplayVideo360AdvertiserLinkProposal RPC. -message CancelDisplayVideo360AdvertiserLinkProposalRequest { - // Required. The name of the DisplayVideo360AdvertiserLinkProposal to cancel. - // Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLinkProposal" - } - ]; -} - -// Request message for CreateCustomDimension RPC. -message CreateCustomDimensionRequest { - // Required. Example format: properties/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/CustomDimension" - } - ]; - - // Required. The CustomDimension to create. - CustomDimension custom_dimension = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for UpdateCustomDimension RPC. -message UpdateCustomDimensionRequest { - // The CustomDimension to update - CustomDimension custom_dimension = 1; - - // Required. The list of fields to be updated. Omitted fields will not be updated. - // To replace the entire entity, use one path with the string "*" to match - // all fields. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for ListCustomDimensions RPC. -message ListCustomDimensionsRequest { - // Required. Example format: properties/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/CustomDimension" - } - ]; - - // The maximum number of resources to return. - // If unspecified, at most 50 resources will be returned. - // The maximum value is 200 (higher values will be coerced to the maximum). - int32 page_size = 2; - - // A page token, received from a previous `ListCustomDimensions` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListCustomDimensions` - // must match the call that provided the page token. - string page_token = 3; -} - -// Response message for ListCustomDimensions RPC. -message ListCustomDimensionsResponse { - // List of CustomDimensions. - repeated CustomDimension custom_dimensions = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for ArchiveCustomDimension RPC. -message ArchiveCustomDimensionRequest { - // Required. The name of the CustomDimension to archive. - // Example format: properties/1234/customDimensions/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/CustomDimension" - } - ]; -} - -// Request message for GetCustomDimension RPC. -message GetCustomDimensionRequest { - // Required. The name of the CustomDimension to get. - // Example format: properties/1234/customDimensions/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/CustomDimension" - } - ]; -} - -// Request message for CreateCustomMetric RPC. -message CreateCustomMetricRequest { - // Required. Example format: properties/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/CustomMetric" - } - ]; - - // Required. The CustomMetric to create. - CustomMetric custom_metric = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for UpdateCustomMetric RPC. -message UpdateCustomMetricRequest { - // The CustomMetric to update - CustomMetric custom_metric = 1; - - // Required. The list of fields to be updated. Omitted fields will not be updated. - // To replace the entire entity, use one path with the string "*" to match - // all fields. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for ListCustomMetrics RPC. -message ListCustomMetricsRequest { - // Required. Example format: properties/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/CustomMetric" - } - ]; - - // The maximum number of resources to return. - // If unspecified, at most 50 resources will be returned. - // The maximum value is 200 (higher values will be coerced to the maximum). - int32 page_size = 2; - - // A page token, received from a previous `ListCustomMetrics` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListCustomMetrics` must - // match the call that provided the page token. - string page_token = 3; -} - -// Response message for ListCustomMetrics RPC. -message ListCustomMetricsResponse { - // List of CustomMetrics. - repeated CustomMetric custom_metrics = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for ArchiveCustomMetric RPC. -message ArchiveCustomMetricRequest { - // Required. The name of the CustomMetric to archive. - // Example format: properties/1234/customMetrics/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/CustomMetric" - } - ]; -} - -// Request message for GetCustomMetric RPC. -message GetCustomMetricRequest { - // Required. The name of the CustomMetric to get. - // Example format: properties/1234/customMetrics/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/CustomMetric" - } - ]; -} - -// Request message for GetDataRetentionSettings RPC. -message GetDataRetentionSettingsRequest { - // Required. The name of the settings to lookup. - // Format: - // properties/{property}/dataRetentionSettings - // Example: "properties/1000/dataRetentionSettings" - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/DataRetentionSettings" - } - ]; -} - -// Request message for UpdateDataRetentionSettings RPC. -message UpdateDataRetentionSettingsRequest { - // Required. The settings to update. - // The `name` field is used to identify the settings to be updated. - DataRetentionSettings data_retention_settings = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The list of fields to be updated. Field names must be in snake case - // (e.g., "field_to_update"). Omitted fields will not be updated. To replace - // the entire entity, use one path with the string "*" to match all fields. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for CreateDataStream RPC. -message CreateDataStreamRequest { - // Required. Example format: properties/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/DataStream" - } - ]; - - // Required. The DataStream to create. - DataStream data_stream = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for DeleteDataStream RPC. -message DeleteDataStreamRequest { - // Required. The name of the DataStream to delete. - // Example format: properties/1234/dataStreams/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/DataStream" - } - ]; -} - -// Request message for UpdateDataStream RPC. -message UpdateDataStreamRequest { - // The DataStream to update - DataStream data_stream = 1; - - // Required. The list of fields to be updated. Omitted fields will not be updated. - // To replace the entire entity, use one path with the string "*" to match - // all fields. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for ListDataStreams RPC. -message ListDataStreamsRequest { - // Required. Example format: properties/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/DataStream" - } - ]; - - // The maximum number of resources to return. - // If unspecified, at most 50 resources will be returned. - // The maximum value is 200 (higher values will be coerced to the maximum). - int32 page_size = 2; - - // A page token, received from a previous `ListDataStreams` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListDataStreams` must - // match the call that provided the page token. - string page_token = 3; -} - -// Response message for ListDataStreams RPC. -message ListDataStreamsResponse { - // List of DataStreams. - repeated DataStream data_streams = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for GetDataStream RPC. -message GetDataStreamRequest { - // Required. The name of the DataStream to get. - // Example format: properties/1234/dataStreams/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/DataStream" - } - ]; -} diff --git a/owl-bot-staging/v1alpha/protos/google/analytics/admin/v1alpha/resources.proto b/owl-bot-staging/v1alpha/protos/google/analytics/admin/v1alpha/resources.proto deleted file mode 100644 index d441d10..0000000 --- a/owl-bot-staging/v1alpha/protos/google/analytics/admin/v1alpha/resources.proto +++ /dev/null @@ -1,1161 +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.admin.v1alpha; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; - -option go_package = "google.golang.org/genproto/googleapis/analytics/admin/v1alpha;admin"; -option java_multiple_files = true; -option java_outer_classname = "ResourcesProto"; -option java_package = "com.google.analytics.admin.v1alpha"; - -// The category selected for this property, used for industry benchmarking. -enum IndustryCategory { - // Industry category unspecified - INDUSTRY_CATEGORY_UNSPECIFIED = 0; - - // Automotive - AUTOMOTIVE = 1; - - // Business and industrial markets - BUSINESS_AND_INDUSTRIAL_MARKETS = 2; - - // Finance - FINANCE = 3; - - // Healthcare - HEALTHCARE = 4; - - // Technology - TECHNOLOGY = 5; - - // Travel - TRAVEL = 6; - - // Other - OTHER = 7; - - // Arts and entertainment - ARTS_AND_ENTERTAINMENT = 8; - - // Beauty and fitness - BEAUTY_AND_FITNESS = 9; - - // Books and literature - BOOKS_AND_LITERATURE = 10; - - // Food and drink - FOOD_AND_DRINK = 11; - - // Games - GAMES = 12; - - // Hobbies and leisure - HOBBIES_AND_LEISURE = 13; - - // Home and garden - HOME_AND_GARDEN = 14; - - // Internet and telecom - INTERNET_AND_TELECOM = 15; - - // Law and government - LAW_AND_GOVERNMENT = 16; - - // News - NEWS = 17; - - // Online communities - ONLINE_COMMUNITIES = 18; - - // People and society - PEOPLE_AND_SOCIETY = 19; - - // Pets and animals - PETS_AND_ANIMALS = 20; - - // Real estate - REAL_ESTATE = 21; - - // Reference - REFERENCE = 22; - - // Science - SCIENCE = 23; - - // Sports - SPORTS = 24; - - // Jobs and education - JOBS_AND_EDUCATION = 25; - - // Shopping - SHOPPING = 26; -} - -// Various levels of service for Google Analytics. -enum ServiceLevel { - // Service level not specified or invalid. - SERVICE_LEVEL_UNSPECIFIED = 0; - - // The standard version of Google Analytics. - GOOGLE_ANALYTICS_STANDARD = 1; - - // The paid, premium version of Google Analytics. - GOOGLE_ANALYTICS_360 = 2; -} - -// Different kinds of actors that can make changes to Google Analytics -// resources. -enum ActorType { - // Unknown or unspecified actor type. - ACTOR_TYPE_UNSPECIFIED = 0; - - // Changes made by the user specified in actor_email. - USER = 1; - - // Changes made by the Google Analytics system. - SYSTEM = 2; - - // Changes made by Google Analytics support team staff. - SUPPORT = 3; -} - -// Types of actions that may change a resource. -enum ActionType { - // Action type unknown or not specified. - ACTION_TYPE_UNSPECIFIED = 0; - - // Resource was created in this change. - CREATED = 1; - - // Resource was updated in this change. - UPDATED = 2; - - // Resource was deleted in this change. - DELETED = 3; -} - -// Types of resources whose changes may be returned from change history. -enum ChangeHistoryResourceType { - // Resource type unknown or not specified. - CHANGE_HISTORY_RESOURCE_TYPE_UNSPECIFIED = 0; - - // Account resource - ACCOUNT = 1; - - // Property resource - PROPERTY = 2; - - // FirebaseLink resource - FIREBASE_LINK = 6; - - // GoogleAdsLink resource - GOOGLE_ADS_LINK = 7; - - // GoogleSignalsSettings resource - GOOGLE_SIGNALS_SETTINGS = 8; - - // ConversionEvent resource - CONVERSION_EVENT = 9; - - // MeasurementProtocolSecret resource - MEASUREMENT_PROTOCOL_SECRET = 10; - - // CustomDimension resource - CUSTOM_DIMENSION = 11; - - // CustomMetric resource - CUSTOM_METRIC = 12; - - // DataRetentionSettings resource - DATA_RETENTION_SETTINGS = 13; - - // DisplayVideo360AdvertiserLink resource - DISPLAY_VIDEO_360_ADVERTISER_LINK = 14; - - // DisplayVideo360AdvertiserLinkProposal resource - DISPLAY_VIDEO_360_ADVERTISER_LINK_PROPOSAL = 15; - - // DataStream resource - DATA_STREAM = 18; -} - -// Status of the Google Signals settings (i.e., whether this feature has been -// enabled for the property). -enum GoogleSignalsState { - // Google Signals status defaults to GOOGLE_SIGNALS_STATE_UNSPECIFIED to - // represent that the user has not made an explicit choice. - GOOGLE_SIGNALS_STATE_UNSPECIFIED = 0; - - // Google Signals is enabled. - GOOGLE_SIGNALS_ENABLED = 1; - - // Google Signals is disabled. - GOOGLE_SIGNALS_DISABLED = 2; -} - -// Consent field of the Google Signals settings (i.e., whether the user has -// consented to the Google Signals terms of service.) -enum GoogleSignalsConsent { - // Google Signals consent value defaults to - // GOOGLE_SIGNALS_CONSENT_UNSPECIFIED. This will be treated as - // GOOGLE_SIGNALS_CONSENT_NOT_CONSENTED. - GOOGLE_SIGNALS_CONSENT_UNSPECIFIED = 0; - - // Terms of service have been accepted - GOOGLE_SIGNALS_CONSENT_CONSENTED = 2; - - // Terms of service have not been accepted - GOOGLE_SIGNALS_CONSENT_NOT_CONSENTED = 1; -} - -// An indication of which product the user initiated a link proposal from. -enum LinkProposalInitiatingProduct { - // Unspecified product. - LINK_PROPOSAL_INITIATING_PRODUCT_UNSPECIFIED = 0; - - // This proposal was created by a user from Google Analytics. - GOOGLE_ANALYTICS = 1; - - // This proposal was created by a user from a linked product (not Google - // Analytics). - LINKED_PRODUCT = 2; -} - -// The state of a link proposal resource. -enum LinkProposalState { - // Unspecified state - LINK_PROPOSAL_STATE_UNSPECIFIED = 0; - - // This proposal is awaiting review from a Google Analytics user. This - // proposal will automatically expire after some time. - AWAITING_REVIEW_FROM_GOOGLE_ANALYTICS = 1; - - // This proposal is awaiting review from a user of a linked product. This - // proposal will automatically expire after some time. - AWAITING_REVIEW_FROM_LINKED_PRODUCT = 2; - - // This proposal has been withdrawn by an admin on the initiating product. - // This proposal will be automatically deleted after some time. - WITHDRAWN = 3; - - // This proposal has been declined by an admin on the receiving product. This - // proposal will be automatically deleted after some time. - DECLINED = 4; - - // This proposal expired due to lack of response from an admin on the - // receiving product. This proposal will be automatically deleted after some - // time. - EXPIRED = 5; - - // This proposal has become obsolete because a link was directly created to - // the same external product resource that this proposal specifies. This - // proposal will be automatically deleted after some time. - OBSOLETE = 6; -} - -// A resource message representing a Google Analytics account. -message Account { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/Account" - pattern: "accounts/{account}" - }; - - // Output only. Resource name of this account. - // Format: accounts/{account} - // Example: "accounts/100" - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when this account was originally created. - google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when account payload fields were last updated. - google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Human-readable display name for this account. - string display_name = 4 [(google.api.field_behavior) = REQUIRED]; - - // Country of business. Must be a Unicode CLDR region code. - string region_code = 5; - - // Output only. Indicates whether this Account is soft-deleted or not. Deleted - // accounts are excluded from List results unless specifically requested. - bool deleted = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A resource message representing a Google Analytics GA4 property. -message Property { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/Property" - pattern: "properties/{property}" - }; - - // Output only. Resource name of this property. - // Format: properties/{property_id} - // Example: "properties/1000" - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the entity was originally created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when entity payload fields were last updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. Resource name of this property's logical parent. - // - // Note: The Property-Moving UI can be used to change the parent. - // Format: accounts/{account} - // Example: "accounts/100" - string parent = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // Required. Human-readable display name for this property. - // - // The max allowed display name length is 100 UTF-16 code units. - string display_name = 5 [(google.api.field_behavior) = REQUIRED]; - - // Industry associated with this property - // Example: AUTOMOTIVE, FOOD_AND_DRINK - IndustryCategory industry_category = 6; - - // Required. Reporting Time Zone, used as the day boundary for reports, regardless of - // where the data originates. If the time zone honors DST, Analytics will - // automatically adjust for the changes. - // - // NOTE: Changing the time zone only affects data going forward, and is not - // applied retroactively. - // - // Format: https://www.iana.org/time-zones - // Example: "America/Los_Angeles" - string time_zone = 7 [(google.api.field_behavior) = REQUIRED]; - - // The currency type used in reports involving monetary values. - // - // - // Format: https://en.wikipedia.org/wiki/ISO_4217 - // Examples: "USD", "EUR", "JPY" - string currency_code = 8; - - // Output only. The Google Analytics service level that applies to this property. - ServiceLevel service_level = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If set, the time at which this property was trashed. If not set, then this - // property is not currently in the trash can. - google.protobuf.Timestamp delete_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If set, the time at which this trashed property will be permanently - // deleted. If not set, then this property is not currently in the trash can - // and is not slated to be deleted. - google.protobuf.Timestamp expire_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. The resource name of the parent account - // Format: accounts/{account_id} - // Example: "accounts/123" - string account = 13 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/Account" - } - ]; -} - -// A resource message representing a data stream. -message DataStream { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/DataStream" - pattern: "properties/{property}/dataStreams/{data_stream}" - }; - - // Data specific to web streams. - message WebStreamData { - // Output only. Analytics "Measurement ID", without the "G-" prefix. - // Example: "G-1A2BCD345E" would just be "1A2BCD345E" - string measurement_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. ID of the corresponding web app in Firebase, if any. - // This ID can change if the web app is deleted and recreated. - string firebase_app_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. Domain name of the web app being measured, or empty. - // Example: "http://www.google.com", "https://www.google.com" - string default_uri = 3 [(google.api.field_behavior) = IMMUTABLE]; - } - - // Data specific to Android app streams. - message AndroidAppStreamData { - // Output only. ID of the corresponding Android app in Firebase, if any. - // This ID can change if the Android app is deleted and recreated. - string firebase_app_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. The package name for the app being measured. - // Example: "com.example.myandroidapp" - string package_name = 2 [(google.api.field_behavior) = IMMUTABLE]; - } - - // Data specific to iOS app streams. - message IosAppStreamData { - // Output only. ID of the corresponding iOS app in Firebase, if any. - // This ID can change if the iOS app is deleted and recreated. - string firebase_app_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Immutable. The Apple App Store Bundle ID for the app - // Example: "com.example.myiosapp" - string bundle_id = 2 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.field_behavior) = REQUIRED - ]; - } - - // The type of the data stream. - enum DataStreamType { - // Type unknown or not specified. - DATA_STREAM_TYPE_UNSPECIFIED = 0; - - // Web data stream. - WEB_DATA_STREAM = 1; - - // Android app data stream. - ANDROID_APP_DATA_STREAM = 2; - - // iOS app data stream. - IOS_APP_DATA_STREAM = 3; - } - - // Data for specific data stream types. The message that will be - // set corresponds to the type of this stream. - oneof stream_data { - // Data specific to web streams. Must be populated if type is - // WEB_DATA_STREAM. - WebStreamData web_stream_data = 6; - - // Data specific to Android app streams. Must be populated if type is - // ANDROID_APP_DATA_STREAM. - AndroidAppStreamData android_app_stream_data = 7; - - // Data specific to iOS app streams. Must be populated if type is - // IOS_APP_DATA_STREAM. - IosAppStreamData ios_app_stream_data = 8; - } - - // Output only. Resource name of this Data Stream. - // Format: properties/{property_id}/dataStreams/{stream_id} - // Example: "properties/1000/dataStreams/2000" - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Immutable. The type of this DataStream resource. - DataStreamType type = 2 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.field_behavior) = REQUIRED - ]; - - // Human-readable display name for the Data Stream. - // - // Required for web data streams. - // - // The max allowed display name length is 255 UTF-16 code units. - string display_name = 3; - - // Output only. Time when this stream was originally created. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when stream payload fields were last updated. - google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A resource message representing a user's permissions on an Account or -// Property resource. -message UserLink { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/UserLink" - pattern: "accounts/{account}/userLinks/{user_link}" - pattern: "properties/{property}/userLinks/{user_link}" - }; - - // Output only. Example format: properties/1234/userLinks/5678 - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. Email address of the user to link - string email_address = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // Roles directly assigned to this user for this account or property. - // - // Valid values: - // predefinedRoles/viewer - // predefinedRoles/analyst - // predefinedRoles/editor - // predefinedRoles/admin - // predefinedRoles/no-cost-data - // predefinedRoles/no-revenue-data - // - // Excludes roles that are inherited from a higher-level entity, group, - // or organization admin role. - // - // A UserLink that is updated to have an empty list of direct_roles will be - // deleted. - repeated string direct_roles = 3; -} - -// Read-only resource used to summarize a principal's effective roles. -message AuditUserLink { - // Example format: properties/1234/userLinks/5678 - string name = 1; - - // Email address of the linked user - string email_address = 2; - - // Roles directly assigned to this user for this entity. - // - // Format: predefinedRoles/viewer - // - // Excludes roles that are inherited from an account (if this is for a - // property), group, or organization admin role. - repeated string direct_roles = 3; - - // Union of all permissions a user has at this account or property (includes - // direct permissions, group-inherited permissions, etc.). - // - // Format: predefinedRoles/viewer - repeated string effective_roles = 4; -} - -// A link between a GA4 property and a Firebase project. -message FirebaseLink { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/FirebaseLink" - pattern: "properties/{property}/firebaseLinks/{firebase_link}" - }; - - // Output only. Example format: properties/1234/firebaseLinks/5678 - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. Firebase project resource name. When creating a FirebaseLink, you may - // provide this resource name using either a project number or project ID. - // Once this resource has been created, returned FirebaseLinks will always - // have a project_name that contains a project number. - // - // Format: 'projects/{project number}' - // Example: 'projects/1234' - string project = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. Time when this FirebaseLink was originally created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Read-only resource with the tag for sending data from a website to a -// DataStream. Only present for web DataStream resources. -message GlobalSiteTag { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/GlobalSiteTag" - pattern: "properties/{property}/dataStreams/{data_stream}/globalSiteTag" - }; - - // Output only. Resource name for this GlobalSiteTag resource. - // Format: properties/{property_id}/dataStreams/{stream_id}/globalSiteTag - // Example: "properties/123/dataStreams/456/globalSiteTag" - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. JavaScript code snippet to be pasted as the first item into the head tag of - // every webpage to measure. - string snippet = 2 [(google.api.field_behavior) = IMMUTABLE]; -} - -// A link between a GA4 property and a Google Ads account. -message GoogleAdsLink { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/GoogleAdsLink" - pattern: "properties/{property}/googleAdsLinks/{google_ads_link}" - }; - - // Output only. Format: properties/{propertyId}/googleAdsLinks/{googleAdsLinkId} - // - // Note: googleAdsLinkId is not the Google Ads customer ID. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. Google Ads customer ID. - string customer_id = 3 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. If true, this link is for a Google Ads manager account. - bool can_manage_clients = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Enable personalized advertising features with this integration. - // Automatically publish my Google Analytics audience lists and Google - // Analytics remarketing events/parameters to the linked Google Ads account. - // If this field is not set on create/update, it will be defaulted to true. - google.protobuf.BoolValue ads_personalization_enabled = 5; - - // Output only. Time when this link was originally created. - google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when this link was last updated. - google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Email address of the user that created the link. - // An empty string will be returned if the email address can't be retrieved. - string creator_email_address = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A resource message representing data sharing settings of a Google Analytics -// account. -message DataSharingSettings { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/DataSharingSettings" - pattern: "accounts/{account}/dataSharingSettings" - }; - - // Output only. Resource name. - // Format: accounts/{account}/dataSharingSettings - // Example: "accounts/1000/dataSharingSettings" - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Allows Google support to access the data in order to help troubleshoot - // issues. - bool sharing_with_google_support_enabled = 2; - - // Allows Google sales teams that are assigned to the customer to access the - // data in order to suggest configuration changes to improve results. - // Sales team restrictions still apply when enabled. - bool sharing_with_google_assigned_sales_enabled = 3; - - // Allows any of Google sales to access the data in order to suggest - // configuration changes to improve results. - bool sharing_with_google_any_sales_enabled = 4; - - // Allows Google to use the data to improve other Google products or services. - bool sharing_with_google_products_enabled = 5; - - // Allows Google to share the data anonymously in aggregate form with others. - bool sharing_with_others_enabled = 6; -} - -// A virtual resource representing an overview of an account and -// all its child GA4 properties. -message AccountSummary { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/AccountSummary" - pattern: "accountSummaries/{account_summary}" - }; - - // Resource name for this account summary. - // Format: accountSummaries/{account_id} - // Example: "accountSummaries/1000" - string name = 1; - - // Resource name of account referred to by this account summary - // Format: accounts/{account_id} - // Example: "accounts/1000" - string account = 2 [(google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/Account" - }]; - - // Display name for the account referred to in this account summary. - string display_name = 3; - - // List of summaries for child accounts of this account. - repeated PropertySummary property_summaries = 4; -} - -// A virtual resource representing metadata for a GA4 property. -message PropertySummary { - // Resource name of property referred to by this property summary - // Format: properties/{property_id} - // Example: "properties/1000" - string property = 1 [(google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/Property" - }]; - - // Display name for the property referred to in this property summary. - string display_name = 2; -} - -// A secret value used for sending hits to Measurement Protocol. -message MeasurementProtocolSecret { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/MeasurementProtocolSecret" - pattern: "properties/{property}/dataStreams/{data_stream}/measurementProtocolSecrets/{measurement_protocol_secret}" - }; - - // Output only. Resource name of this secret. This secret may be a child of any type of - // stream. - // Format: - // properties/{property}/webDataStreams/{webDataStream}/measurementProtocolSecrets/{measurementProtocolSecret} - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Human-readable display name for this secret. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The measurement protocol secret value. Pass this value to the api_secret - // field of the Measurement Protocol API when sending hits to this - // secret's parent property. - string secret_value = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A set of changes within a Google Analytics account or its child properties -// that resulted from the same cause. Common causes would be updates made in the -// Google Analytics UI, changes from customer support, or automatic Google -// Analytics system changes. -message ChangeHistoryEvent { - // ID of this change history event. This ID is unique across Google Analytics. - string id = 1; - - // Time when change was made. - google.protobuf.Timestamp change_time = 2; - - // The type of actor that made this change. - ActorType actor_type = 3; - - // Email address of the Google account that made the change. This will be a - // valid email address if the actor field is set to USER, and empty otherwise. - // Google accounts that have been deleted will cause an error. - string user_actor_email = 4; - - // If true, then the list of changes returned was filtered, and does not - // represent all changes that occurred in this event. - bool changes_filtered = 5; - - // A list of changes made in this change history event that fit the filters - // specified in SearchChangeHistoryEventsRequest. - repeated ChangeHistoryChange changes = 6; -} - -// A description of a change to a single Google Analytics resource. -message ChangeHistoryChange { - // A snapshot of a resource as before or after the result of a change in - // change history. - message ChangeHistoryResource { - oneof resource { - // A snapshot of an Account resource in change history. - Account account = 1; - - // A snapshot of a Property resource in change history. - Property property = 2; - - // A snapshot of a FirebaseLink resource in change history. - FirebaseLink firebase_link = 6; - - // A snapshot of a GoogleAdsLink resource in change history. - GoogleAdsLink google_ads_link = 7; - - // A snapshot of a GoogleSignalsSettings resource in change history. - GoogleSignalsSettings google_signals_settings = 8; - - // A snapshot of a DisplayVideo360AdvertiserLink resource in change - // history. - DisplayVideo360AdvertiserLink display_video_360_advertiser_link = 9; - - // A snapshot of a DisplayVideo360AdvertiserLinkProposal resource in - // change history. - DisplayVideo360AdvertiserLinkProposal display_video_360_advertiser_link_proposal = 10; - - // A snapshot of a ConversionEvent resource in change history. - ConversionEvent conversion_event = 11; - - // A snapshot of a MeasurementProtocolSecret resource in change history. - MeasurementProtocolSecret measurement_protocol_secret = 12; - - // A snapshot of a CustomDimension resource in change history. - CustomDimension custom_dimension = 13; - - // A snapshot of a CustomMetric resource in change history. - CustomMetric custom_metric = 14; - - // A snapshot of a data retention settings resource in change history. - DataRetentionSettings data_retention_settings = 15; - - // A snapshot of a DataStream resource in change history. - DataStream data_stream = 18; - } - } - - // Resource name of the resource whose changes are described by this entry. - string resource = 1; - - // The type of action that changed this resource. - ActionType action = 2; - - // Resource contents from before the change was made. If this resource was - // created in this change, this field will be missing. - ChangeHistoryResource resource_before_change = 3; - - // Resource contents from after the change was made. If this resource was - // deleted in this change, this field will be missing. - ChangeHistoryResource resource_after_change = 4; -} - -// A link between a GA4 property and a Display & Video 360 advertiser. -message DisplayVideo360AdvertiserLink { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLink" - pattern: "properties/{property}/displayVideo360AdvertiserLinks/{display_video_360_advertiser_link}" - }; - - // Output only. The resource name for this DisplayVideo360AdvertiserLink resource. - // Format: properties/{propertyId}/displayVideo360AdvertiserLinks/{linkId} - // - // Note: linkId is not the Display & Video 360 Advertiser ID - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. The Display & Video 360 Advertiser's advertiser ID. - string advertiser_id = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. The display name of the Display & Video 360 Advertiser. - string advertiser_display_name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Enables personalized advertising features with this integration. - // If this field is not set on create/update, it will be defaulted to true. - google.protobuf.BoolValue ads_personalization_enabled = 4; - - // Immutable. Enables the import of campaign data from Display & Video 360 into the GA4 - // property. After link creation, this can only be updated from the Display & - // Video 360 product. - // If this field is not set on create, it will be defaulted to true. - google.protobuf.BoolValue campaign_data_sharing_enabled = 5 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. Enables the import of cost data from Display & Video 360 into the GA4 - // property. This can only be enabled if campaign_data_sharing_enabled is - // enabled. After link creation, this can only be updated from the Display & - // Video 360 product. - // If this field is not set on create, it will be defaulted to true. - google.protobuf.BoolValue cost_data_sharing_enabled = 6 [(google.api.field_behavior) = IMMUTABLE]; -} - -// A proposal for a link between a GA4 property and a Display & Video 360 -// advertiser. -// -// A proposal is converted to a DisplayVideo360AdvertiserLink once approved. -// Google Analytics admins approve inbound proposals while Display & Video 360 -// admins approve outbound proposals. -message DisplayVideo360AdvertiserLinkProposal { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLinkProposal" - pattern: "properties/{property}/displayVideo360AdvertiserLinkProposals/{display_video_360_advertiser_link_proposal}" - }; - - // Output only. The resource name for this DisplayVideo360AdvertiserLinkProposal resource. - // Format: - // properties/{propertyId}/displayVideo360AdvertiserLinkProposals/{proposalId} - // - // Note: proposalId is not the Display & Video 360 Advertiser ID - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. The Display & Video 360 Advertiser's advertiser ID. - string advertiser_id = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. The status information for this link proposal. - LinkProposalStatusDetails link_proposal_status_details = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The display name of the Display & Video Advertiser. - // Only populated for proposals that originated from Display & Video 360. - string advertiser_display_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Input only. On a proposal being sent to Display & Video 360, this field must be set to - // the email address of an admin on the target advertiser. This is used to - // verify that the Google Analytics admin is aware of at least one admin on - // the Display & Video 360 Advertiser. This does not restrict approval of the - // proposal to a single user. Any admin on the Display & Video 360 Advertiser - // may approve the proposal. - string validation_email = 5 [(google.api.field_behavior) = INPUT_ONLY]; - - // Immutable. Enables personalized advertising features with this integration. - // If this field is not set on create, it will be defaulted to true. - google.protobuf.BoolValue ads_personalization_enabled = 6 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. Enables the import of campaign data from Display & Video 360. - // If this field is not set on create, it will be defaulted to true. - google.protobuf.BoolValue campaign_data_sharing_enabled = 7 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. Enables the import of cost data from Display & Video 360. - // This can only be enabled if campaign_data_sharing_enabled is enabled. - // If this field is not set on create, it will be defaulted to true. - google.protobuf.BoolValue cost_data_sharing_enabled = 8 [(google.api.field_behavior) = IMMUTABLE]; -} - -// Status information for a link proposal. -message LinkProposalStatusDetails { - // Output only. The source of this proposal. - LinkProposalInitiatingProduct link_proposal_initiating_product = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The email address of the user that proposed this linkage. - string requestor_email = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The state of this proposal. - LinkProposalState link_proposal_state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A conversion event in a Google Analytics property. -message ConversionEvent { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/ConversionEvent" - pattern: "properties/{property}/conversionEvents/{conversion_event}" - }; - - // Output only. Resource name of this conversion event. - // Format: properties/{property}/conversionEvents/{conversion_event} - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. The event name for this conversion event. - // Examples: 'click', 'purchase' - string event_name = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. Time when this conversion event was created in the property. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If set, this event can currently be deleted via DeleteConversionEvent. - bool deletable = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If set to true, this conversion event refers to a custom event. If set to - // false, this conversion event refers to a default event in GA. Default - // events typically have special meaning in GA. Default events are usually - // created for you by the GA system, but in some cases can be created by - // property admins. Custom events count towards the maximum number of - // custom conversion events that may be created per property. - bool custom = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Settings values for Google Signals. This is a singleton resource. -message GoogleSignalsSettings { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/GoogleSignalsSettings" - pattern: "properties/{property}/googleSignalsSettings" - }; - - // Output only. Resource name of this setting. - // Format: properties/{property_id}/googleSignalsSettings - // Example: "properties/1000/googleSignalsSettings" - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Status of this setting. - GoogleSignalsState state = 3; - - // Output only. Terms of Service acceptance. - GoogleSignalsConsent consent = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A definition for a CustomDimension. -message CustomDimension { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/CustomDimension" - pattern: "properties/{property}/customDimensions/{custom_dimension}" - }; - - // Valid values for the scope of this dimension. - enum DimensionScope { - // Scope unknown or not specified. - DIMENSION_SCOPE_UNSPECIFIED = 0; - - // Dimension scoped to an event. - EVENT = 1; - - // Dimension scoped to a user. - USER = 2; - } - - // Output only. Resource name for this CustomDimension resource. - // Format: properties/{property}/customDimensions/{customDimension} - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Immutable. Tagging parameter name for this custom dimension. - // - // If this is a user-scoped dimension, then this is the user property name. - // If this is an event-scoped dimension, then this is the event parameter - // name. - // - // May only contain alphanumeric and underscore characters, starting with a - // letter. Max length of 24 characters for user-scoped dimensions, 40 - // characters for event-scoped dimensions. - string parameter_name = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Required. Display name for this custom dimension as shown in the Analytics UI. - // Max length of 82 characters, alphanumeric plus space and underscore - // starting with a letter. Legacy system-generated display names may contain - // square brackets, but updates to this field will never permit square - // brackets. - string display_name = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Description for this custom dimension. Max length of 150 characters. - string description = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Required. Immutable. The scope of this dimension. - DimensionScope scope = 5 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. If set to true, sets this dimension as NPA and excludes it from ads - // personalization. - // - // This is currently only supported by user-scoped custom dimensions. - bool disallow_ads_personalization = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// A definition for a custom metric. -message CustomMetric { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/CustomMetric" - pattern: "properties/{property}/customMetrics/{custom_metric}" - }; - - // Possible types of representing the custom metric's value. - // - // Currency representation may change in the future, requiring a breaking API - // change. - enum MeasurementUnit { - // MeasurementUnit unspecified or missing. - MEASUREMENT_UNIT_UNSPECIFIED = 0; - - // This metric uses default units. - STANDARD = 1; - - // This metric measures a currency. - CURRENCY = 2; - - // This metric measures feet. - FEET = 3; - - // This metric measures meters. - METERS = 4; - - // This metric measures kilometers. - KILOMETERS = 5; - - // This metric measures miles. - MILES = 6; - - // This metric measures milliseconds. - MILLISECONDS = 7; - - // This metric measures seconds. - SECONDS = 8; - - // This metric measures minutes. - MINUTES = 9; - - // This metric measures hours. - HOURS = 10; - } - - // The scope of this metric. - enum MetricScope { - // Scope unknown or not specified. - METRIC_SCOPE_UNSPECIFIED = 0; - - // Metric scoped to an event. - EVENT = 1; - } - - // Labels that mark the data in this custom metric as data that should be - // restricted to specific users. - enum RestrictedMetricType { - // Type unknown or unspecified. - RESTRICTED_METRIC_TYPE_UNSPECIFIED = 0; - - // Metric reports cost data. - COST_DATA = 1; - - // Metric reports revenue data. - REVENUE_DATA = 2; - } - - // Output only. Resource name for this CustomMetric resource. - // Format: properties/{property}/customMetrics/{customMetric} - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Immutable. Tagging name for this custom metric. - // - // If this is an event-scoped metric, then this is the event parameter - // name. - // - // May only contain alphanumeric and underscore charactes, starting with a - // letter. Max length of 40 characters for event-scoped metrics. - string parameter_name = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Required. Display name for this custom metric as shown in the Analytics UI. - // Max length of 82 characters, alphanumeric plus space and underscore - // starting with a letter. Legacy system-generated display names may contain - // square brackets, but updates to this field will never permit square - // brackets. - string display_name = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Description for this custom dimension. - // Max length of 150 characters. - string description = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The type for the custom metric's value. - MeasurementUnit measurement_unit = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. Immutable. The scope of this custom metric. - MetricScope scope = 6 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. Types of restricted data that this metric may contain. Required for metrics - // with CURRENCY measurement unit. Must be empty for metrics with a - // non-CURRENCY measurement unit. - repeated RestrictedMetricType restricted_metric_type = 8 [(google.api.field_behavior) = OPTIONAL]; -} - -// Settings values for data retention. This is a singleton resource. -message DataRetentionSettings { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/DataRetentionSettings" - pattern: "properties/{property}/dataRetentionSettings" - }; - - // Valid values for the data retention duration. - enum RetentionDuration { - // Data retention time duration is not specified. - RETENTION_DURATION_UNSPECIFIED = 0; - - // The data retention time duration is 2 months. - TWO_MONTHS = 1; - - // The data retention time duration is 14 months. - FOURTEEN_MONTHS = 3; - - // The data retention time duration is 26 months. - // Available to 360 properties only. - TWENTY_SIX_MONTHS = 4; - - // The data retention time duration is 38 months. - // Available to 360 properties only. - THIRTY_EIGHT_MONTHS = 5; - - // The data retention time duration is 50 months. - // Available to 360 properties only. - FIFTY_MONTHS = 6; - } - - // Output only. Resource name for this DataRetentionSetting resource. - // Format: properties/{property}/dataRetentionSettings - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The length of time that event-level data is retained. - RetentionDuration event_data_retention = 2; - - // If true, reset the retention period for the user identifier with every - // event from that user. - bool reset_user_data_on_new_activity = 3; -} diff --git a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.acknowledge_user_data_collection.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.acknowledge_user_data_collection.js deleted file mode 100644 index 5bcfc38..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.acknowledge_user_data_collection.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(property, acknowledgement) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_AcknowledgeUserDataCollection_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The property for which to acknowledge user data collection. - */ - // const property = 'abc123' - /** - * Required. An acknowledgement that the caller of this method understands the terms - * of user data collection. - * This field must contain the exact value: - * "I acknowledge that I have the necessary privacy disclosures and rights - * from my end users for the collection and processing of their data, - * including the association of such data with the visitation information - * Google Analytics collects from my site and/or app property." - */ - // const acknowledgement = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callAcknowledgeUserDataCollection() { - // Construct request - const request = { - property, - acknowledgement, - }; - - // Run request - const response = await adminClient.acknowledgeUserDataCollection(request); - console.log(response); - } - - callAcknowledgeUserDataCollection(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_AcknowledgeUserDataCollection_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/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js deleted file mode 100644 index 1f691a3..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js +++ /dev/null @@ -1,59 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_ApproveDisplayVideo360AdvertiserLinkProposal_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the DisplayVideo360AdvertiserLinkProposal to approve. - * Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callApproveDisplayVideo360AdvertiserLinkProposal() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.approveDisplayVideo360AdvertiserLinkProposal(request); - console.log(response); - } - - callApproveDisplayVideo360AdvertiserLinkProposal(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ApproveDisplayVideo360AdvertiserLinkProposal_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/analytics_admin_service.archive_custom_dimension.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_dimension.js deleted file mode 100644 index 48be3a7..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_dimension.js +++ /dev/null @@ -1,59 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveCustomDimension_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the CustomDimension to archive. - * Example format: properties/1234/customDimensions/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callArchiveCustomDimension() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.archiveCustomDimension(request); - console.log(response); - } - - callArchiveCustomDimension(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveCustomDimension_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/analytics_admin_service.archive_custom_metric.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_metric.js deleted file mode 100644 index 5afad70..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_metric.js +++ /dev/null @@ -1,59 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveCustomMetric_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the CustomMetric to archive. - * Example format: properties/1234/customMetrics/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callArchiveCustomMetric() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.archiveCustomMetric(request); - console.log(response); - } - - callArchiveCustomMetric(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveCustomMetric_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/analytics_admin_service.audit_user_links.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.audit_user_links.js deleted file mode 100644 index 14e86fb..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.audit_user_links.js +++ /dev/null @@ -1,74 +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(parent) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_AuditUserLinks_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: accounts/1234 - */ - // const parent = 'abc123' - /** - * The maximum number of user links to return. - * The service may return fewer than this value. - * If unspecified, at most 1000 user links will be returned. - * The maximum value is 5000; values above 5000 will be coerced to 5000. - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `AuditUserLinks` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `AuditUserLinks` must - * match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callAuditUserLinks() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await adminClient.auditUserLinksAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callAuditUserLinks(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_AuditUserLinks_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/analytics_admin_service.batch_create_user_links.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_user_links.js deleted file mode 100644 index cf09400..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_user_links.js +++ /dev/null @@ -1,73 +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(parent, requests) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchCreateUserLinks_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The account or property that all user links in the request are for. - * This field is required. The parent field in the CreateUserLinkRequest - * messages must either be empty or match this field. - * Example format: accounts/1234 - */ - // const parent = 'abc123' - /** - * Optional. If set, then email the new users notifying them that they've been granted - * permissions to the resource. Regardless of whether this is set or not, - * notify_new_user field inside each individual request is ignored. - */ - // const notifyNewUsers = true - /** - * Required. The requests specifying the user links to create. - * A maximum of 1000 user links can be created in a batch. - */ - // const requests = 1234 - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callBatchCreateUserLinks() { - // Construct request - const request = { - parent, - requests, - }; - - // Run request - const response = await adminClient.batchCreateUserLinks(request); - console.log(response); - } - - callBatchCreateUserLinks(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchCreateUserLinks_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/analytics_admin_service.batch_delete_user_links.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_user_links.js deleted file mode 100644 index 9e6d2d6..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_user_links.js +++ /dev/null @@ -1,67 +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(parent, requests) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchDeleteUserLinks_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The account or property that all user links in the request are - * for. The parent of all values for user link names to delete must match this - * field. - * Example format: accounts/1234 - */ - // const parent = 'abc123' - /** - * Required. The requests specifying the user links to update. - * A maximum of 1000 user links can be updated in a batch. - */ - // const requests = 1234 - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callBatchDeleteUserLinks() { - // Construct request - const request = { - parent, - requests, - }; - - // Run request - const response = await adminClient.batchDeleteUserLinks(request); - console.log(response); - } - - callBatchDeleteUserLinks(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchDeleteUserLinks_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/analytics_admin_service.batch_get_user_links.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_user_links.js deleted file mode 100644 index b43c877..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_user_links.js +++ /dev/null @@ -1,68 +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(parent, names) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchGetUserLinks_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The account or property that all user links in the request are - * for. The parent of all provided values for the 'names' field must match - * this field. - * Example format: accounts/1234 - */ - // const parent = 'abc123' - /** - * Required. The names of the user links to retrieve. - * A maximum of 1000 user links can be retrieved in a batch. - * Format: accounts/{accountId}/userLinks/{userLinkId} - */ - // const names = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callBatchGetUserLinks() { - // Construct request - const request = { - parent, - names, - }; - - // Run request - const response = await adminClient.batchGetUserLinks(request); - console.log(response); - } - - callBatchGetUserLinks(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchGetUserLinks_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/analytics_admin_service.batch_update_user_links.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_user_links.js deleted file mode 100644 index b3e8d49..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_user_links.js +++ /dev/null @@ -1,67 +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(parent, requests) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchUpdateUserLinks_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The account or property that all user links in the request are - * for. The parent field in the UpdateUserLinkRequest messages must either be - * empty or match this field. - * Example format: accounts/1234 - */ - // const parent = 'abc123' - /** - * Required. The requests specifying the user links to update. - * A maximum of 1000 user links can be updated in a batch. - */ - // const requests = 1234 - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callBatchUpdateUserLinks() { - // Construct request - const request = { - parent, - requests, - }; - - // Run request - const response = await adminClient.batchUpdateUserLinks(request); - console.log(response); - } - - callBatchUpdateUserLinks(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchUpdateUserLinks_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/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js deleted file mode 100644 index 9003bf7..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js +++ /dev/null @@ -1,59 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_CancelDisplayVideo360AdvertiserLinkProposal_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the DisplayVideo360AdvertiserLinkProposal to cancel. - * Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callCancelDisplayVideo360AdvertiserLinkProposal() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.cancelDisplayVideo360AdvertiserLinkProposal(request); - console.log(response); - } - - callCancelDisplayVideo360AdvertiserLinkProposal(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CancelDisplayVideo360AdvertiserLinkProposal_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/analytics_admin_service.create_conversion_event.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_conversion_event.js deleted file mode 100644 index 4e29bae..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_conversion_event.js +++ /dev/null @@ -1,64 +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(conversionEvent, parent) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateConversionEvent_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The conversion event to create. - */ - // const conversionEvent = {} - /** - * Required. The resource name of the parent property where this conversion event will - * be created. Format: properties/123 - */ - // const parent = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callCreateConversionEvent() { - // Construct request - const request = { - conversionEvent, - parent, - }; - - // Run request - const response = await adminClient.createConversionEvent(request); - console.log(response); - } - - callCreateConversionEvent(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateConversionEvent_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/analytics_admin_service.create_custom_dimension.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_dimension.js deleted file mode 100644 index 015b39d..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_dimension.js +++ /dev/null @@ -1,63 +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(parent, customDimension) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateCustomDimension_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: properties/1234 - */ - // const parent = 'abc123' - /** - * Required. The CustomDimension to create. - */ - // const customDimension = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callCreateCustomDimension() { - // Construct request - const request = { - parent, - customDimension, - }; - - // Run request - const response = await adminClient.createCustomDimension(request); - console.log(response); - } - - callCreateCustomDimension(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateCustomDimension_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/analytics_admin_service.create_custom_metric.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_metric.js deleted file mode 100644 index 896c7ca..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_metric.js +++ /dev/null @@ -1,63 +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(parent, customMetric) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateCustomMetric_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: properties/1234 - */ - // const parent = 'abc123' - /** - * Required. The CustomMetric to create. - */ - // const customMetric = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callCreateCustomMetric() { - // Construct request - const request = { - parent, - customMetric, - }; - - // Run request - const response = await adminClient.createCustomMetric(request); - console.log(response); - } - - callCreateCustomMetric(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateCustomMetric_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/analytics_admin_service.create_data_stream.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_data_stream.js deleted file mode 100644 index 447c77a..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_data_stream.js +++ /dev/null @@ -1,63 +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(parent, dataStream) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDataStream_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: properties/1234 - */ - // const parent = 'abc123' - /** - * Required. The DataStream to create. - */ - // const dataStream = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callCreateDataStream() { - // Construct request - const request = { - parent, - dataStream, - }; - - // Run request - const response = await adminClient.createDataStream(request); - console.log(response); - } - - callCreateDataStream(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDataStream_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/analytics_admin_service.create_display_video360_advertiser_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link.js deleted file mode 100644 index fc9ecfc..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link.js +++ /dev/null @@ -1,63 +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(parent, displayVideo_360AdvertiserLink) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDisplayVideo360AdvertiserLink_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: properties/1234 - */ - // const parent = 'abc123' - /** - * Required. The DisplayVideo360AdvertiserLink to create. - */ - // const displayVideo_360AdvertiserLink = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callCreateDisplayVideo360AdvertiserLink() { - // Construct request - const request = { - parent, - displayVideo_360AdvertiserLink, - }; - - // Run request - const response = await adminClient.createDisplayVideo360AdvertiserLink(request); - console.log(response); - } - - callCreateDisplayVideo360AdvertiserLink(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDisplayVideo360AdvertiserLink_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/analytics_admin_service.create_display_video360_advertiser_link_proposal.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link_proposal.js deleted file mode 100644 index 9815ab9..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link_proposal.js +++ /dev/null @@ -1,63 +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(parent, displayVideo_360AdvertiserLinkProposal) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDisplayVideo360AdvertiserLinkProposal_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: properties/1234 - */ - // const parent = 'abc123' - /** - * Required. The DisplayVideo360AdvertiserLinkProposal to create. - */ - // const displayVideo_360AdvertiserLinkProposal = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callCreateDisplayVideo360AdvertiserLinkProposal() { - // Construct request - const request = { - parent, - displayVideo_360AdvertiserLinkProposal, - }; - - // Run request - const response = await adminClient.createDisplayVideo360AdvertiserLinkProposal(request); - console.log(response); - } - - callCreateDisplayVideo360AdvertiserLinkProposal(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDisplayVideo360AdvertiserLinkProposal_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/analytics_admin_service.create_firebase_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_firebase_link.js deleted file mode 100644 index 2022590..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_firebase_link.js +++ /dev/null @@ -1,64 +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(parent, firebaseLink) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateFirebaseLink_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Format: properties/{property_id} - * Example: properties/1234 - */ - // const parent = 'abc123' - /** - * Required. The Firebase link to create. - */ - // const firebaseLink = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callCreateFirebaseLink() { - // Construct request - const request = { - parent, - firebaseLink, - }; - - // Run request - const response = await adminClient.createFirebaseLink(request); - console.log(response); - } - - callCreateFirebaseLink(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateFirebaseLink_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/analytics_admin_service.create_google_ads_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_google_ads_link.js deleted file mode 100644 index fc6c764..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_google_ads_link.js +++ /dev/null @@ -1,63 +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(parent, googleAdsLink) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateGoogleAdsLink_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: properties/1234 - */ - // const parent = 'abc123' - /** - * Required. The GoogleAdsLink to create. - */ - // const googleAdsLink = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callCreateGoogleAdsLink() { - // Construct request - const request = { - parent, - googleAdsLink, - }; - - // Run request - const response = await adminClient.createGoogleAdsLink(request); - console.log(response); - } - - callCreateGoogleAdsLink(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateGoogleAdsLink_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/analytics_admin_service.create_measurement_protocol_secret.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_measurement_protocol_secret.js deleted file mode 100644 index 0eaa5d7..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_measurement_protocol_secret.js +++ /dev/null @@ -1,64 +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(parent, measurementProtocolSecret) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateMeasurementProtocolSecret_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource where this secret will be created. - * Format: properties/{property}/dataStreams/{dataStream} - */ - // const parent = 'abc123' - /** - * Required. The measurement protocol secret to create. - */ - // const measurementProtocolSecret = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callCreateMeasurementProtocolSecret() { - // Construct request - const request = { - parent, - measurementProtocolSecret, - }; - - // Run request - const response = await adminClient.createMeasurementProtocolSecret(request); - console.log(response); - } - - callCreateMeasurementProtocolSecret(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateMeasurementProtocolSecret_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/analytics_admin_service.create_property.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_property.js deleted file mode 100644 index 37a2653..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_property.js +++ /dev/null @@ -1,59 +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(property) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateProperty_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The property to create. - * Note: the supplied property must specify its parent. - */ - // const property = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callCreateProperty() { - // Construct request - const request = { - property, - }; - - // Run request - const response = await adminClient.createProperty(request); - console.log(response); - } - - callCreateProperty(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateProperty_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/analytics_admin_service.create_user_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_user_link.js deleted file mode 100644 index 7f10712..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_user_link.js +++ /dev/null @@ -1,68 +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(parent, userLink) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateUserLink_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: accounts/1234 - */ - // const parent = 'abc123' - /** - * Optional. If set, then email the new user notifying them that they've been granted - * permissions to the resource. - */ - // const notifyNewUser = true - /** - * Required. The user link to create. - */ - // const userLink = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callCreateUserLink() { - // Construct request - const request = { - parent, - userLink, - }; - - // Run request - const response = await adminClient.createUserLink(request); - console.log(response); - } - - callCreateUserLink(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateUserLink_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/analytics_admin_service.delete_account.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_account.js deleted file mode 100644 index 0881043..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_account.js +++ /dev/null @@ -1,60 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteAccount_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the Account to soft-delete. - * Format: accounts/{account} - * Example: "accounts/100" - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callDeleteAccount() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.deleteAccount(request); - console.log(response); - } - - callDeleteAccount(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteAccount_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/analytics_admin_service.delete_conversion_event.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_conversion_event.js deleted file mode 100644 index 4d82df8..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_conversion_event.js +++ /dev/null @@ -1,60 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteConversionEvent_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the conversion event to delete. - * Format: properties/{property}/conversionEvents/{conversion_event} - * Example: "properties/123/conversionEvents/456" - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callDeleteConversionEvent() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.deleteConversionEvent(request); - console.log(response); - } - - callDeleteConversionEvent(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteConversionEvent_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/analytics_admin_service.delete_data_stream.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_data_stream.js deleted file mode 100644 index 9ee9e2e..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_data_stream.js +++ /dev/null @@ -1,59 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDataStream_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the DataStream to delete. - * Example format: properties/1234/dataStreams/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callDeleteDataStream() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.deleteDataStream(request); - console.log(response); - } - - callDeleteDataStream(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDataStream_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/analytics_admin_service.delete_display_video360_advertiser_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link.js deleted file mode 100644 index 6709f70..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link.js +++ /dev/null @@ -1,59 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDisplayVideo360AdvertiserLink_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the DisplayVideo360AdvertiserLink to delete. - * Example format: properties/1234/displayVideo360AdvertiserLinks/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callDeleteDisplayVideo360AdvertiserLink() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.deleteDisplayVideo360AdvertiserLink(request); - console.log(response); - } - - callDeleteDisplayVideo360AdvertiserLink(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDisplayVideo360AdvertiserLink_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/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js deleted file mode 100644 index 49e71c4..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js +++ /dev/null @@ -1,59 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDisplayVideo360AdvertiserLinkProposal_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the DisplayVideo360AdvertiserLinkProposal to delete. - * Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callDeleteDisplayVideo360AdvertiserLinkProposal() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.deleteDisplayVideo360AdvertiserLinkProposal(request); - console.log(response); - } - - callDeleteDisplayVideo360AdvertiserLinkProposal(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDisplayVideo360AdvertiserLinkProposal_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/analytics_admin_service.delete_firebase_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_firebase_link.js deleted file mode 100644 index fa775a8..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_firebase_link.js +++ /dev/null @@ -1,59 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteFirebaseLink_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Format: properties/{property_id}/firebaseLinks/{firebase_link_id} - * Example: properties/1234/firebaseLinks/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callDeleteFirebaseLink() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.deleteFirebaseLink(request); - console.log(response); - } - - callDeleteFirebaseLink(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteFirebaseLink_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/analytics_admin_service.delete_google_ads_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_google_ads_link.js deleted file mode 100644 index 7e48599..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_google_ads_link.js +++ /dev/null @@ -1,58 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteGoogleAdsLink_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: properties/1234/googleAdsLinks/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callDeleteGoogleAdsLink() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.deleteGoogleAdsLink(request); - console.log(response); - } - - callDeleteGoogleAdsLink(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteGoogleAdsLink_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/analytics_admin_service.delete_measurement_protocol_secret.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_measurement_protocol_secret.js deleted file mode 100644 index 6bb0eab..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_measurement_protocol_secret.js +++ /dev/null @@ -1,60 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteMeasurementProtocolSecret_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the MeasurementProtocolSecret to delete. - * Format: - * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret} - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callDeleteMeasurementProtocolSecret() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.deleteMeasurementProtocolSecret(request); - console.log(response); - } - - callDeleteMeasurementProtocolSecret(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteMeasurementProtocolSecret_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/analytics_admin_service.delete_property.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_property.js deleted file mode 100644 index a013f3d..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_property.js +++ /dev/null @@ -1,60 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteProperty_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the Property to soft-delete. - * Format: properties/{property_id} - * Example: "properties/1000" - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callDeleteProperty() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.deleteProperty(request); - console.log(response); - } - - callDeleteProperty(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteProperty_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/analytics_admin_service.delete_user_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_user_link.js deleted file mode 100644 index c8e6197..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_user_link.js +++ /dev/null @@ -1,58 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteUserLink_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: accounts/1234/userLinks/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callDeleteUserLink() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.deleteUserLink(request); - console.log(response); - } - - callDeleteUserLink(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteUserLink_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/analytics_admin_service.get_account.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_account.js deleted file mode 100644 index a8d2bd2..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_account.js +++ /dev/null @@ -1,60 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAccount_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the account to lookup. - * Format: accounts/{account} - * Example: "accounts/100" - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callGetAccount() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getAccount(request); - console.log(response); - } - - callGetAccount(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAccount_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/analytics_admin_service.get_conversion_event.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_conversion_event.js deleted file mode 100644 index 8eaf6d1..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_conversion_event.js +++ /dev/null @@ -1,60 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetConversionEvent_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the conversion event to retrieve. - * Format: properties/{property}/conversionEvents/{conversion_event} - * Example: "properties/123/conversionEvents/456" - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callGetConversionEvent() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getConversionEvent(request); - console.log(response); - } - - callGetConversionEvent(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetConversionEvent_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/analytics_admin_service.get_custom_dimension.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_dimension.js deleted file mode 100644 index cf71366..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_dimension.js +++ /dev/null @@ -1,59 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetCustomDimension_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the CustomDimension to get. - * Example format: properties/1234/customDimensions/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callGetCustomDimension() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getCustomDimension(request); - console.log(response); - } - - callGetCustomDimension(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetCustomDimension_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/analytics_admin_service.get_custom_metric.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_metric.js deleted file mode 100644 index 3ee1ce9..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_metric.js +++ /dev/null @@ -1,59 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetCustomMetric_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the CustomMetric to get. - * Example format: properties/1234/customMetrics/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callGetCustomMetric() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getCustomMetric(request); - console.log(response); - } - - callGetCustomMetric(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetCustomMetric_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/analytics_admin_service.get_data_retention_settings.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_retention_settings.js deleted file mode 100644 index 7a73434..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_retention_settings.js +++ /dev/null @@ -1,61 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataRetentionSettings_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the settings to lookup. - * Format: - * properties/{property}/dataRetentionSettings - * Example: "properties/1000/dataRetentionSettings" - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callGetDataRetentionSettings() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getDataRetentionSettings(request); - console.log(response); - } - - callGetDataRetentionSettings(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataRetentionSettings_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/analytics_admin_service.get_data_sharing_settings.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_sharing_settings.js deleted file mode 100644 index 651593e..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_sharing_settings.js +++ /dev/null @@ -1,60 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataSharingSettings_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the settings to lookup. - * Format: accounts/{account}/dataSharingSettings - * Example: "accounts/1000/dataSharingSettings" - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callGetDataSharingSettings() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getDataSharingSettings(request); - console.log(response); - } - - callGetDataSharingSettings(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataSharingSettings_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/analytics_admin_service.get_data_stream.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_stream.js deleted file mode 100644 index 9e94747..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_stream.js +++ /dev/null @@ -1,59 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataStream_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the DataStream to get. - * Example format: properties/1234/dataStreams/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callGetDataStream() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getDataStream(request); - console.log(response); - } - - callGetDataStream(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataStream_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/analytics_admin_service.get_display_video360_advertiser_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link.js deleted file mode 100644 index fede533..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link.js +++ /dev/null @@ -1,59 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDisplayVideo360AdvertiserLink_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the DisplayVideo360AdvertiserLink to get. - * Example format: properties/1234/displayVideo360AdvertiserLink/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callGetDisplayVideo360AdvertiserLink() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getDisplayVideo360AdvertiserLink(request); - console.log(response); - } - - callGetDisplayVideo360AdvertiserLink(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDisplayVideo360AdvertiserLink_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/analytics_admin_service.get_display_video360_advertiser_link_proposal.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link_proposal.js deleted file mode 100644 index b13181c..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link_proposal.js +++ /dev/null @@ -1,59 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDisplayVideo360AdvertiserLinkProposal_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the DisplayVideo360AdvertiserLinkProposal to get. - * Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callGetDisplayVideo360AdvertiserLinkProposal() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getDisplayVideo360AdvertiserLinkProposal(request); - console.log(response); - } - - callGetDisplayVideo360AdvertiserLinkProposal(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDisplayVideo360AdvertiserLinkProposal_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/analytics_admin_service.get_global_site_tag.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_global_site_tag.js deleted file mode 100644 index 159694c..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_global_site_tag.js +++ /dev/null @@ -1,61 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetGlobalSiteTag_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the site tag to lookup. - * Note that site tags are singletons and do not have unique IDs. - * Format: properties/{property_id}/dataStreams/{stream_id}/globalSiteTag - * Example: "properties/123/dataStreams/456/globalSiteTag" - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callGetGlobalSiteTag() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getGlobalSiteTag(request); - console.log(response); - } - - callGetGlobalSiteTag(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetGlobalSiteTag_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/analytics_admin_service.get_google_signals_settings.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_google_signals_settings.js deleted file mode 100644 index 6843a1c..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_google_signals_settings.js +++ /dev/null @@ -1,59 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetGoogleSignalsSettings_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the google signals settings to retrieve. - * Format: properties/{property}/googleSignalsSettings - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callGetGoogleSignalsSettings() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getGoogleSignalsSettings(request); - console.log(response); - } - - callGetGoogleSignalsSettings(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetGoogleSignalsSettings_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/analytics_admin_service.get_measurement_protocol_secret.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_measurement_protocol_secret.js deleted file mode 100644 index c8fd3d4..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_measurement_protocol_secret.js +++ /dev/null @@ -1,60 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetMeasurementProtocolSecret_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the measurement protocol secret to lookup. - * Format: - * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret} - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callGetMeasurementProtocolSecret() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getMeasurementProtocolSecret(request); - console.log(response); - } - - callGetMeasurementProtocolSecret(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetMeasurementProtocolSecret_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/analytics_admin_service.get_property.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_property.js deleted file mode 100644 index 789def7..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_property.js +++ /dev/null @@ -1,60 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetProperty_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the property to lookup. - * Format: properties/{property_id} - * Example: "properties/1000" - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callGetProperty() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getProperty(request); - console.log(response); - } - - callGetProperty(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetProperty_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/analytics_admin_service.get_user_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_user_link.js deleted file mode 100644 index 9fedb79..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_user_link.js +++ /dev/null @@ -1,58 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetUserLink_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: accounts/1234/userLinks/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callGetUserLink() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getUserLink(request); - console.log(response); - } - - callGetUserLink(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetUserLink_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/analytics_admin_service.list_account_summaries.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_account_summaries.js deleted file mode 100644 index 98d74df..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_account_summaries.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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccountSummaries_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The maximum number of AccountSummary resources to return. The service may - * return fewer than this value, even if there are additional pages. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200; (higher values will be coerced to the maximum) - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListAccountSummaries` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListAccountSummaries` - * must match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callListAccountSummaries() { - // Construct request - const request = { - }; - - // Run request - const iterable = await adminClient.listAccountSummariesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListAccountSummaries(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccountSummaries_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/analytics_admin_service.list_accounts.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_accounts.js deleted file mode 100644 index a31cb17..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_accounts.js +++ /dev/null @@ -1,75 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccounts_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The maximum number of resources to return. The service may return - * fewer than this value, even if there are additional pages. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200; (higher values will be coerced to the maximum) - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListAccounts` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListAccounts` must - * match the call that provided the page token. - */ - // const pageToken = 'abc123' - /** - * Whether to include soft-deleted (ie: "trashed") Accounts in the - * results. Accounts can be inspected to determine whether they are deleted or - * not. - */ - // const showDeleted = true - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callListAccounts() { - // Construct request - const request = { - }; - - // Run request - const iterable = await adminClient.listAccountsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListAccounts(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccounts_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/analytics_admin_service.list_conversion_events.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_conversion_events.js deleted file mode 100644 index c5e1b27..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_conversion_events.js +++ /dev/null @@ -1,74 +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(parent) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListConversionEvents_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the parent property. - * Example: 'properties/123' - */ - // const parent = 'abc123' - /** - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200; (higher values will be coerced to the maximum) - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListConversionEvents` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListConversionEvents` - * must match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callListConversionEvents() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await adminClient.listConversionEventsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListConversionEvents(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListConversionEvents_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/analytics_admin_service.list_custom_dimensions.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_dimensions.js deleted file mode 100644 index fc6cd93..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_dimensions.js +++ /dev/null @@ -1,73 +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(parent) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListCustomDimensions_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: properties/1234 - */ - // const parent = 'abc123' - /** - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListCustomDimensions` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListCustomDimensions` - * must match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callListCustomDimensions() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await adminClient.listCustomDimensionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListCustomDimensions(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListCustomDimensions_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/analytics_admin_service.list_custom_metrics.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_metrics.js deleted file mode 100644 index 84b2067..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_metrics.js +++ /dev/null @@ -1,73 +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(parent) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListCustomMetrics_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: properties/1234 - */ - // const parent = 'abc123' - /** - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListCustomMetrics` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListCustomMetrics` must - * match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callListCustomMetrics() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await adminClient.listCustomMetricsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListCustomMetrics(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListCustomMetrics_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/analytics_admin_service.list_data_streams.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_data_streams.js deleted file mode 100644 index 76d3d10..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_data_streams.js +++ /dev/null @@ -1,73 +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(parent) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDataStreams_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: properties/1234 - */ - // const parent = 'abc123' - /** - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListDataStreams` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListDataStreams` must - * match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callListDataStreams() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await adminClient.listDataStreamsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListDataStreams(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDataStreams_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/analytics_admin_service.list_display_video360_advertiser_link_proposals.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_link_proposals.js deleted file mode 100644 index 2ed63f6..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_link_proposals.js +++ /dev/null @@ -1,75 +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(parent) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDisplayVideo360AdvertiserLinkProposals_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: properties/1234 - */ - // const parent = 'abc123' - /** - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - */ - // const pageSize = 1234 - /** - * A page token, received from a previous - * `ListDisplayVideo360AdvertiserLinkProposals` call. Provide this to retrieve - * the subsequent page. - * When paginating, all other parameters provided to - * `ListDisplayVideo360AdvertiserLinkProposals` must match the call that - * provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callListDisplayVideo360AdvertiserLinkProposals() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await adminClient.listDisplayVideo360AdvertiserLinkProposalsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListDisplayVideo360AdvertiserLinkProposals(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDisplayVideo360AdvertiserLinkProposals_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/analytics_admin_service.list_display_video360_advertiser_links.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_links.js deleted file mode 100644 index 1363794..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_links.js +++ /dev/null @@ -1,74 +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(parent) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDisplayVideo360AdvertiserLinks_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: properties/1234 - */ - // const parent = 'abc123' - /** - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListDisplayVideo360AdvertiserLinks` - * call. Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * `ListDisplayVideo360AdvertiserLinks` must match the call that provided the - * page token. - */ - // const pageToken = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callListDisplayVideo360AdvertiserLinks() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await adminClient.listDisplayVideo360AdvertiserLinksAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListDisplayVideo360AdvertiserLinks(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDisplayVideo360AdvertiserLinks_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/analytics_admin_service.list_firebase_links.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_firebase_links.js deleted file mode 100644 index 07fb24d..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_firebase_links.js +++ /dev/null @@ -1,75 +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(parent) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListFirebaseLinks_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Format: properties/{property_id} - * Example: properties/1234 - */ - // const parent = 'abc123' - /** - * The maximum number of resources to return. The service may return - * fewer than this value, even if there are additional pages. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200; (higher values will be coerced to the maximum) - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListFirebaseLinks` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListProperties` must - * match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callListFirebaseLinks() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await adminClient.listFirebaseLinksAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListFirebaseLinks(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListFirebaseLinks_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/analytics_admin_service.list_google_ads_links.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_google_ads_links.js deleted file mode 100644 index 96b093b..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_google_ads_links.js +++ /dev/null @@ -1,73 +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(parent) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListGoogleAdsLinks_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: properties/1234 - */ - // const parent = 'abc123' - /** - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListGoogleAdsLinks` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListGoogleAdsLinks` must - * match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callListGoogleAdsLinks() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await adminClient.listGoogleAdsLinksAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListGoogleAdsLinks(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListGoogleAdsLinks_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/analytics_admin_service.list_measurement_protocol_secrets.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_measurement_protocol_secrets.js deleted file mode 100644 index 60896d4..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_measurement_protocol_secrets.js +++ /dev/null @@ -1,75 +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(parent) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListMeasurementProtocolSecrets_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the parent stream. - * Format: - * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets - */ - // const parent = 'abc123' - /** - * The maximum number of resources to return. - * If unspecified, at most 10 resources will be returned. - * The maximum value is 10. Higher values will be coerced to the maximum. - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListMeasurementProtocolSecrets` - * call. Provide this to retrieve the subsequent page. When paginating, all - * other parameters provided to `ListMeasurementProtocolSecrets` must match - * the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callListMeasurementProtocolSecrets() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await adminClient.listMeasurementProtocolSecretsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListMeasurementProtocolSecrets(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListMeasurementProtocolSecrets_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/analytics_admin_service.list_properties.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_properties.js deleted file mode 100644 index 9020527..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_properties.js +++ /dev/null @@ -1,94 +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(filter) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListProperties_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. An expression for filtering the results of the request. - * Fields eligible for filtering are: - * `parent:`(The resource name of the parent account/property) or - * `ancestor:`(The resource name of the parent account) or - * `firebase_project:`(The id or number of the linked firebase project). - * Some examples of filters: - * ``` - * | Filter | Description | - * |-----------------------------|-------------------------------------------| - * | parent:accounts/123 | The account with account id: 123. | - * | parent:properties/123 | The property with property id: 123. | - * | ancestor:accounts/123 | The account with account id: 123. | - * | firebase_project:project-id | The firebase project with id: project-id. | - * | firebase_project:123 | The firebase project with number: 123. | - * ``` - */ - // const filter = 'abc123' - /** - * The maximum number of resources to return. The service may return - * fewer than this value, even if there are additional pages. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200; (higher values will be coerced to the maximum) - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListProperties` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListProperties` must - * match the call that provided the page token. - */ - // const pageToken = 'abc123' - /** - * Whether to include soft-deleted (ie: "trashed") Properties in the - * results. Properties can be inspected to determine whether they are deleted - * or not. - */ - // const showDeleted = true - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callListProperties() { - // Construct request - const request = { - filter, - }; - - // Run request - const iterable = await adminClient.listPropertiesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListProperties(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListProperties_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/analytics_admin_service.list_user_links.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_user_links.js deleted file mode 100644 index 0f0975f..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_user_links.js +++ /dev/null @@ -1,74 +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(parent) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListUserLinks_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: accounts/1234 - */ - // const parent = 'abc123' - /** - * The maximum number of user links to return. - * The service may return fewer than this value. - * If unspecified, at most 200 user links will be returned. - * The maximum value is 500; values above 500 will be coerced to 500. - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListUserLinks` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListUserLinks` must - * match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callListUserLinks() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await adminClient.listUserLinksAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListUserLinks(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListUserLinks_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/analytics_admin_service.provision_account_ticket.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.provision_account_ticket.js deleted file mode 100644 index 9c92550..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.provision_account_ticket.js +++ /dev/null @@ -1,62 +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 analyticsadmin_v1alpha_generated_AnalyticsAdminService_ProvisionAccountTicket_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The account to create. - */ - // const account = {} - /** - * Redirect URI where the user will be sent after accepting Terms of Service. - * Must be configured in Developers Console as a Redirect URI - */ - // const redirectUri = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callProvisionAccountTicket() { - // Construct request - const request = { - }; - - // Run request - const response = await adminClient.provisionAccountTicket(request); - console.log(response); - } - - callProvisionAccountTicket(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ProvisionAccountTicket_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/analytics_admin_service.search_change_history_events.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.search_change_history_events.js deleted file mode 100644 index b9f9d57..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.search_change_history_events.js +++ /dev/null @@ -1,101 +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(account) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_SearchChangeHistoryEvents_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The account resource for which to return change history resources. - */ - // const account = 'abc123' - /** - * Optional. Resource name for a child property. If set, only return changes - * made to this property or its child resources. - */ - // const property = 'abc123' - /** - * Optional. If set, only return changes if they are for a resource that matches at - * least one of these types. - */ - // const resourceType = 1234 - /** - * Optional. If set, only return changes that match one or more of these types of - * actions. - */ - // const action = 1234 - /** - * Optional. If set, only return changes if they are made by a user in this list. - */ - // const actorEmail = 'abc123' - /** - * Optional. If set, only return changes made after this time (inclusive). - */ - // const earliestChangeTime = {} - /** - * Optional. If set, only return changes made before this time (inclusive). - */ - // const latestChangeTime = {} - /** - * Optional. The maximum number of ChangeHistoryEvent items to return. - * The service may return fewer than this value, even if there are additional - * pages. If unspecified, at most 50 items will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous `SearchChangeHistoryEvents` call. - * Provide this to retrieve the subsequent page. When paginating, all other - * parameters provided to `SearchChangeHistoryEvents` must match the call that - * provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callSearchChangeHistoryEvents() { - // Construct request - const request = { - account, - }; - - // Run request - const iterable = await adminClient.searchChangeHistoryEventsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callSearchChangeHistoryEvents(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_SearchChangeHistoryEvents_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/analytics_admin_service.update_account.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_account.js deleted file mode 100644 index 4a3829a..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_account.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(account, updateMask) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAccount_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The account to update. - * The account's `name` field is used to identify the account. - */ - // const account = {} - /** - * Required. The list of fields to be updated. Field names must be in snake case - * (e.g., "field_to_update"). Omitted fields will not be updated. To replace - * the entire entity, use one path with the string "*" to match all fields. - */ - // const updateMask = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callUpdateAccount() { - // Construct request - const request = { - account, - updateMask, - }; - - // Run request - const response = await adminClient.updateAccount(request); - console.log(response); - } - - callUpdateAccount(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAccount_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/analytics_admin_service.update_custom_dimension.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_dimension.js deleted file mode 100644 index b6638b1..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_dimension.js +++ /dev/null @@ -1,64 +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(updateMask) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateCustomDimension_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The CustomDimension to update - */ - // const customDimension = {} - /** - * Required. The list of fields to be updated. Omitted fields will not be updated. - * To replace the entire entity, use one path with the string "*" to match - * all fields. - */ - // const updateMask = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callUpdateCustomDimension() { - // Construct request - const request = { - updateMask, - }; - - // Run request - const response = await adminClient.updateCustomDimension(request); - console.log(response); - } - - callUpdateCustomDimension(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateCustomDimension_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/analytics_admin_service.update_custom_metric.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_metric.js deleted file mode 100644 index 50af269..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_metric.js +++ /dev/null @@ -1,64 +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(updateMask) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateCustomMetric_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The CustomMetric to update - */ - // const customMetric = {} - /** - * Required. The list of fields to be updated. Omitted fields will not be updated. - * To replace the entire entity, use one path with the string "*" to match - * all fields. - */ - // const updateMask = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callUpdateCustomMetric() { - // Construct request - const request = { - updateMask, - }; - - // Run request - const response = await adminClient.updateCustomMetric(request); - console.log(response); - } - - callUpdateCustomMetric(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateCustomMetric_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/analytics_admin_service.update_data_retention_settings.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_retention_settings.js deleted file mode 100644 index 13e6dd5..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_retention_settings.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(dataRetentionSettings, updateMask) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDataRetentionSettings_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The settings to update. - * The `name` field is used to identify the settings to be updated. - */ - // const dataRetentionSettings = {} - /** - * Required. The list of fields to be updated. Field names must be in snake case - * (e.g., "field_to_update"). Omitted fields will not be updated. To replace - * the entire entity, use one path with the string "*" to match all fields. - */ - // const updateMask = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callUpdateDataRetentionSettings() { - // Construct request - const request = { - dataRetentionSettings, - updateMask, - }; - - // Run request - const response = await adminClient.updateDataRetentionSettings(request); - console.log(response); - } - - callUpdateDataRetentionSettings(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDataRetentionSettings_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/analytics_admin_service.update_data_stream.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_stream.js deleted file mode 100644 index f3c6fc7..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_stream.js +++ /dev/null @@ -1,64 +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(updateMask) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDataStream_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The DataStream to update - */ - // const dataStream = {} - /** - * Required. The list of fields to be updated. Omitted fields will not be updated. - * To replace the entire entity, use one path with the string "*" to match - * all fields. - */ - // const updateMask = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callUpdateDataStream() { - // Construct request - const request = { - updateMask, - }; - - // Run request - const response = await adminClient.updateDataStream(request); - console.log(response); - } - - callUpdateDataStream(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDataStream_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/analytics_admin_service.update_display_video360_advertiser_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_display_video360_advertiser_link.js deleted file mode 100644 index 1697b7a..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_display_video360_advertiser_link.js +++ /dev/null @@ -1,64 +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(updateMask) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDisplayVideo360AdvertiserLink_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The DisplayVideo360AdvertiserLink to update - */ - // const displayVideo_360AdvertiserLink = {} - /** - * Required. The list of fields to be updated. Omitted fields will not be updated. - * To replace the entire entity, use one path with the string "*" to match - * all fields. - */ - // const updateMask = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callUpdateDisplayVideo360AdvertiserLink() { - // Construct request - const request = { - updateMask, - }; - - // Run request - const response = await adminClient.updateDisplayVideo360AdvertiserLink(request); - console.log(response); - } - - callUpdateDisplayVideo360AdvertiserLink(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDisplayVideo360AdvertiserLink_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/analytics_admin_service.update_google_ads_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_ads_link.js deleted file mode 100644 index ba2fae4..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_ads_link.js +++ /dev/null @@ -1,64 +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(updateMask) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateGoogleAdsLink_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The GoogleAdsLink to update - */ - // const googleAdsLink = {} - /** - * Required. The list of fields to be updated. Field names must be in snake case - * (e.g., "field_to_update"). Omitted fields will not be updated. To replace - * the entire entity, use one path with the string "*" to match all fields. - */ - // const updateMask = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callUpdateGoogleAdsLink() { - // Construct request - const request = { - updateMask, - }; - - // Run request - const response = await adminClient.updateGoogleAdsLink(request); - console.log(response); - } - - callUpdateGoogleAdsLink(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateGoogleAdsLink_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/analytics_admin_service.update_google_signals_settings.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_signals_settings.js deleted file mode 100644 index 85e7f51..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_signals_settings.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(googleSignalsSettings, updateMask) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateGoogleSignalsSettings_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The settings to update. - * The `name` field is used to identify the settings to be updated. - */ - // const googleSignalsSettings = {} - /** - * Required. The list of fields to be updated. Field names must be in snake case - * (e.g., "field_to_update"). Omitted fields will not be updated. To replace - * the entire entity, use one path with the string "*" to match all fields. - */ - // const updateMask = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callUpdateGoogleSignalsSettings() { - // Construct request - const request = { - googleSignalsSettings, - updateMask, - }; - - // Run request - const response = await adminClient.updateGoogleSignalsSettings(request); - console.log(response); - } - - callUpdateGoogleSignalsSettings(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateGoogleSignalsSettings_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/analytics_admin_service.update_measurement_protocol_secret.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_measurement_protocol_secret.js deleted file mode 100644 index 294e127..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_measurement_protocol_secret.js +++ /dev/null @@ -1,62 +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(measurementProtocolSecret) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateMeasurementProtocolSecret_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The measurement protocol secret to update. - */ - // const measurementProtocolSecret = {} - /** - * The list of fields to be updated. Omitted fields will not be updated. - */ - // const updateMask = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callUpdateMeasurementProtocolSecret() { - // Construct request - const request = { - measurementProtocolSecret, - }; - - // Run request - const response = await adminClient.updateMeasurementProtocolSecret(request); - console.log(response); - } - - callUpdateMeasurementProtocolSecret(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateMeasurementProtocolSecret_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/analytics_admin_service.update_property.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_property.js deleted file mode 100644 index c4cbff7..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_property.js +++ /dev/null @@ -1,67 +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(property, updateMask) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateProperty_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The property to update. - * The property's `name` field is used to identify the property to be - * updated. - */ - // const property = {} - /** - * Required. The list of fields to be updated. Field names must be in snake case - * (e.g., "field_to_update"). Omitted fields will not be updated. To replace - * the entire entity, use one path with the string "*" to match all fields. - */ - // const updateMask = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callUpdateProperty() { - // Construct request - const request = { - property, - updateMask, - }; - - // Run request - const response = await adminClient.updateProperty(request); - console.log(response); - } - - callUpdateProperty(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateProperty_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/analytics_admin_service.update_user_link.js b/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_user_link.js deleted file mode 100644 index 3c3a48a..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_user_link.js +++ /dev/null @@ -1,58 +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(userLink) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateUserLink_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The user link to update. - */ - // const userLink = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callUpdateUserLink() { - // Construct request - const request = { - userLink, - }; - - // Run request - const response = await adminClient.updateUserLink(request); - console.log(response); - } - - callUpdateUserLink(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateUserLink_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.admin.v1alpha.json b/owl-bot-staging/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.admin.v1alpha.json deleted file mode 100644 index 0f23bf0..0000000 --- a/owl-bot-staging/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.admin.v1alpha.json +++ /dev/null @@ -1,3111 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-admin", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.analytics.admin.v1alpha", - "version": "v1alpha" - } - ] - }, - "snippets": [ - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAccount_async", - "title": "AnalyticsAdminService getAccount Sample", - "origin": "API_DEFINITION", - "description": " Lookup for a single Account.", - "canonical": true, - "file": "analytics_admin_service.get_account.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetAccount", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetAccount", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.Account", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetAccount", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetAccount", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccounts_async", - "title": "AnalyticsAdminService listAccounts Sample", - "origin": "API_DEFINITION", - "description": " Returns all accounts accessible by the caller. Note that these accounts might not currently have GA4 properties. Soft-deleted (ie: \"trashed\") accounts are excluded by default. Returns an empty list if no relevant accounts are found.", - "canonical": true, - "file": "analytics_admin_service.list_accounts.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAccounts", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListAccounts", - "async": true, - "parameters": [ - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "show_deleted", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ListAccountsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListAccounts", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListAccounts", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteAccount_async", - "title": "AnalyticsAdminService deleteAccount Sample", - "origin": "API_DEFINITION", - "description": " Marks target Account as soft-deleted (ie: \"trashed\") and returns it. This API does not have a method to restore soft-deleted accounts. However, they can be restored using the Trash Can UI. If the accounts are not restored before the expiration time, the account and all child resources (eg: Properties, GoogleAdsLinks, Streams, UserLinks) will be permanently purged. https://support.google.com/analytics/answer/6154772 Returns an error if the target is not found.", - "canonical": true, - "file": "analytics_admin_service.delete_account.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteAccount", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteAccount", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteAccount", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteAccount", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAccount_async", - "title": "AnalyticsAdminService updateAccount Sample", - "origin": "API_DEFINITION", - "description": " Updates an account.", - "canonical": true, - "file": "analytics_admin_service.update_account.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateAccount", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateAccount", - "async": true, - "parameters": [ - { - "name": "account", - "type": ".google.analytics.admin.v1alpha.Account" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1alpha.Account", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateAccount", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateAccount", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ProvisionAccountTicket_async", - "title": "AnalyticsAdminService provisionAccountTicket Sample", - "origin": "API_DEFINITION", - "description": " Requests a ticket for creating an account.", - "canonical": true, - "file": "analytics_admin_service.provision_account_ticket.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ProvisionAccountTicket", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ProvisionAccountTicket", - "async": true, - "parameters": [ - { - "name": "account", - "type": ".google.analytics.admin.v1alpha.Account" - }, - { - "name": "redirect_uri", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ProvisionAccountTicketResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ProvisionAccountTicket", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ProvisionAccountTicket", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccountSummaries_async", - "title": "AnalyticsAdminService listAccountSummaries Sample", - "origin": "API_DEFINITION", - "description": " Returns summaries of all accounts accessible by the caller.", - "canonical": true, - "file": "analytics_admin_service.list_account_summaries.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAccountSummaries", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListAccountSummaries", - "async": true, - "parameters": [ - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ListAccountSummariesResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListAccountSummaries", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListAccountSummaries", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetProperty_async", - "title": "AnalyticsAdminService getProperty Sample", - "origin": "API_DEFINITION", - "description": " Lookup for a single \"GA4\" Property.", - "canonical": true, - "file": "analytics_admin_service.get_property.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetProperty", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetProperty", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.Property", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetProperty", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetProperty", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListProperties_async", - "title": "AnalyticsAdminService listProperties Sample", - "origin": "API_DEFINITION", - "description": " Returns child Properties under the specified parent Account. Only \"GA4\" properties will be returned. Properties will be excluded if the caller does not have access. Soft-deleted (ie: \"trashed\") properties are excluded by default. Returns an empty list if no relevant properties are found.", - "canonical": true, - "file": "analytics_admin_service.list_properties.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 86, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListProperties", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListProperties", - "async": true, - "parameters": [ - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "show_deleted", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ListPropertiesResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListProperties", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListProperties", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateProperty_async", - "title": "AnalyticsAdminService createProperty Sample", - "origin": "API_DEFINITION", - "description": " Creates an \"GA4\" property with the specified location and attributes.", - "canonical": true, - "file": "analytics_admin_service.create_property.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateProperty", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateProperty", - "async": true, - "parameters": [ - { - "name": "property", - "type": ".google.analytics.admin.v1alpha.Property" - } - ], - "resultType": ".google.analytics.admin.v1alpha.Property", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateProperty", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateProperty", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteProperty_async", - "title": "AnalyticsAdminService deleteProperty Sample", - "origin": "API_DEFINITION", - "description": " Marks target Property as soft-deleted (ie: \"trashed\") and returns it. This API does not have a method to restore soft-deleted properties. However, they can be restored using the Trash Can UI. If the properties are not restored before the expiration time, the Property and all child resources (eg: GoogleAdsLinks, Streams, UserLinks) will be permanently purged. https://support.google.com/analytics/answer/6154772 Returns an error if the target is not found, or is not an GA4 Property.", - "canonical": true, - "file": "analytics_admin_service.delete_property.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteProperty", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteProperty", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.Property", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteProperty", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteProperty", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateProperty_async", - "title": "AnalyticsAdminService updateProperty Sample", - "origin": "API_DEFINITION", - "description": " Updates a property.", - "canonical": true, - "file": "analytics_admin_service.update_property.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateProperty", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateProperty", - "async": true, - "parameters": [ - { - "name": "property", - "type": ".google.analytics.admin.v1alpha.Property" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1alpha.Property", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateProperty", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateProperty", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetUserLink_async", - "title": "AnalyticsAdminService getUserLink Sample", - "origin": "API_DEFINITION", - "description": " Gets information about a user's link to an account or property.", - "canonical": true, - "file": "analytics_admin_service.get_user_link.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 50, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetUserLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetUserLink", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.UserLink", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetUserLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetUserLink", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchGetUserLinks_async", - "title": "AnalyticsAdminService batchGetUserLinks Sample", - "origin": "API_DEFINITION", - "description": " Gets information about multiple users' links to an account or property.", - "canonical": true, - "file": "analytics_admin_service.batch_get_user_links.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchGetUserLinks", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchGetUserLinks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "names", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.analytics.admin.v1alpha.BatchGetUserLinksResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "BatchGetUserLinks", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchGetUserLinks", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListUserLinks_async", - "title": "AnalyticsAdminService listUserLinks Sample", - "origin": "API_DEFINITION", - "description": " Lists all user links on an account or property.", - "canonical": true, - "file": "analytics_admin_service.list_user_links.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListUserLinks", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListUserLinks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ListUserLinksResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListUserLinks", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListUserLinks", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_AuditUserLinks_async", - "title": "AnalyticsAdminService auditUserLinks Sample", - "origin": "API_DEFINITION", - "description": " Lists all user links on an account or property, including implicit ones that come from effective permissions granted by groups or organization admin roles. If a returned user link does not have direct permissions, they cannot be removed from the account or property directly with the DeleteUserLink command. They have to be removed from the group/etc that gives them permissions, which is currently only usable/discoverable in the GA or GMP UIs.", - "canonical": true, - "file": "analytics_admin_service.audit_user_links.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "AuditUserLinks", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.AuditUserLinks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.AuditUserLinksResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "AuditUserLinks", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.AuditUserLinks", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateUserLink_async", - "title": "AnalyticsAdminService createUserLink Sample", - "origin": "API_DEFINITION", - "description": " Creates a user link on an account or property. If the user with the specified email already has permissions on the account or property, then the user's existing permissions will be unioned with the permissions specified in the new UserLink.", - "canonical": true, - "file": "analytics_admin_service.create_user_link.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateUserLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateUserLink", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "notify_new_user", - "type": "TYPE_BOOL" - }, - { - "name": "user_link", - "type": ".google.analytics.admin.v1alpha.UserLink" - } - ], - "resultType": ".google.analytics.admin.v1alpha.UserLink", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateUserLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateUserLink", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchCreateUserLinks_async", - "title": "AnalyticsAdminService batchCreateUserLinks Sample", - "origin": "API_DEFINITION", - "description": " Creates information about multiple users' links to an account or property. This method is transactional. If any UserLink cannot be created, none of the UserLinks will be created.", - "canonical": true, - "file": "analytics_admin_service.batch_create_user_links.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchCreateUserLinks", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchCreateUserLinks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "notify_new_users", - "type": "TYPE_BOOL" - }, - { - "name": "requests", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.analytics.admin.v1alpha.BatchCreateUserLinksResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "BatchCreateUserLinks", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchCreateUserLinks", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateUserLink_async", - "title": "AnalyticsAdminService updateUserLink Sample", - "origin": "API_DEFINITION", - "description": " Updates a user link on an account or property.", - "canonical": true, - "file": "analytics_admin_service.update_user_link.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 50, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateUserLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateUserLink", - "async": true, - "parameters": [ - { - "name": "user_link", - "type": ".google.analytics.admin.v1alpha.UserLink" - } - ], - "resultType": ".google.analytics.admin.v1alpha.UserLink", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateUserLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateUserLink", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchUpdateUserLinks_async", - "title": "AnalyticsAdminService batchUpdateUserLinks Sample", - "origin": "API_DEFINITION", - "description": " Updates information about multiple users' links to an account or property.", - "canonical": true, - "file": "analytics_admin_service.batch_update_user_links.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchUpdateUserLinks", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchUpdateUserLinks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "requests", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.analytics.admin.v1alpha.BatchUpdateUserLinksResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "BatchUpdateUserLinks", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchUpdateUserLinks", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteUserLink_async", - "title": "AnalyticsAdminService deleteUserLink Sample", - "origin": "API_DEFINITION", - "description": " Deletes a user link on an account or property.", - "canonical": true, - "file": "analytics_admin_service.delete_user_link.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 50, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteUserLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteUserLink", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteUserLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteUserLink", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchDeleteUserLinks_async", - "title": "AnalyticsAdminService batchDeleteUserLinks Sample", - "origin": "API_DEFINITION", - "description": " Deletes information about multiple users' links to an account or property.", - "canonical": true, - "file": "analytics_admin_service.batch_delete_user_links.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchDeleteUserLinks", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchDeleteUserLinks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "requests", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "BatchDeleteUserLinks", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchDeleteUserLinks", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateFirebaseLink_async", - "title": "AnalyticsAdminService createFirebaseLink Sample", - "origin": "API_DEFINITION", - "description": " Creates a FirebaseLink. Properties can have at most one FirebaseLink.", - "canonical": true, - "file": "analytics_admin_service.create_firebase_link.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateFirebaseLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateFirebaseLink", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "firebase_link", - "type": ".google.analytics.admin.v1alpha.FirebaseLink" - } - ], - "resultType": ".google.analytics.admin.v1alpha.FirebaseLink", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateFirebaseLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateFirebaseLink", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteFirebaseLink_async", - "title": "AnalyticsAdminService deleteFirebaseLink Sample", - "origin": "API_DEFINITION", - "description": " Deletes a FirebaseLink on a property", - "canonical": true, - "file": "analytics_admin_service.delete_firebase_link.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteFirebaseLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteFirebaseLink", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteFirebaseLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteFirebaseLink", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListFirebaseLinks_async", - "title": "AnalyticsAdminService listFirebaseLinks Sample", - "origin": "API_DEFINITION", - "description": " Lists FirebaseLinks on a property. Properties can have at most one FirebaseLink.", - "canonical": true, - "file": "analytics_admin_service.list_firebase_links.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListFirebaseLinks", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListFirebaseLinks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ListFirebaseLinksResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListFirebaseLinks", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListFirebaseLinks", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetGlobalSiteTag_async", - "title": "AnalyticsAdminService getGlobalSiteTag Sample", - "origin": "API_DEFINITION", - "description": " Returns the Site Tag for the specified web stream. Site Tags are immutable singletons.", - "canonical": true, - "file": "analytics_admin_service.get_global_site_tag.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetGlobalSiteTag", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetGlobalSiteTag", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.GlobalSiteTag", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetGlobalSiteTag", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetGlobalSiteTag", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateGoogleAdsLink_async", - "title": "AnalyticsAdminService createGoogleAdsLink Sample", - "origin": "API_DEFINITION", - "description": " Creates a GoogleAdsLink.", - "canonical": true, - "file": "analytics_admin_service.create_google_ads_link.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateGoogleAdsLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateGoogleAdsLink", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "google_ads_link", - "type": ".google.analytics.admin.v1alpha.GoogleAdsLink" - } - ], - "resultType": ".google.analytics.admin.v1alpha.GoogleAdsLink", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateGoogleAdsLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateGoogleAdsLink", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateGoogleAdsLink_async", - "title": "AnalyticsAdminService updateGoogleAdsLink Sample", - "origin": "API_DEFINITION", - "description": " Updates a GoogleAdsLink on a property", - "canonical": true, - "file": "analytics_admin_service.update_google_ads_link.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateGoogleAdsLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateGoogleAdsLink", - "async": true, - "parameters": [ - { - "name": "google_ads_link", - "type": ".google.analytics.admin.v1alpha.GoogleAdsLink" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1alpha.GoogleAdsLink", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateGoogleAdsLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateGoogleAdsLink", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteGoogleAdsLink_async", - "title": "AnalyticsAdminService deleteGoogleAdsLink Sample", - "origin": "API_DEFINITION", - "description": " Deletes a GoogleAdsLink on a property", - "canonical": true, - "file": "analytics_admin_service.delete_google_ads_link.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 50, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteGoogleAdsLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteGoogleAdsLink", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteGoogleAdsLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteGoogleAdsLink", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListGoogleAdsLinks_async", - "title": "AnalyticsAdminService listGoogleAdsLinks Sample", - "origin": "API_DEFINITION", - "description": " Lists GoogleAdsLinks on a property.", - "canonical": true, - "file": "analytics_admin_service.list_google_ads_links.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListGoogleAdsLinks", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListGoogleAdsLinks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ListGoogleAdsLinksResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListGoogleAdsLinks", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListGoogleAdsLinks", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataSharingSettings_async", - "title": "AnalyticsAdminService getDataSharingSettings Sample", - "origin": "API_DEFINITION", - "description": " Get data sharing settings on an account. Data sharing settings are singletons.", - "canonical": true, - "file": "analytics_admin_service.get_data_sharing_settings.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDataSharingSettings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetDataSharingSettings", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.DataSharingSettings", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetDataSharingSettings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetDataSharingSettings", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetMeasurementProtocolSecret_async", - "title": "AnalyticsAdminService getMeasurementProtocolSecret Sample", - "origin": "API_DEFINITION", - "description": " Lookup for a single \"GA4\" MeasurementProtocolSecret.", - "canonical": true, - "file": "analytics_admin_service.get_measurement_protocol_secret.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetMeasurementProtocolSecret", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetMeasurementProtocolSecret", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.MeasurementProtocolSecret", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetMeasurementProtocolSecret", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetMeasurementProtocolSecret", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListMeasurementProtocolSecrets_async", - "title": "AnalyticsAdminService listMeasurementProtocolSecrets Sample", - "origin": "API_DEFINITION", - "description": " Returns child MeasurementProtocolSecrets under the specified parent Property.", - "canonical": true, - "file": "analytics_admin_service.list_measurement_protocol_secrets.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListMeasurementProtocolSecrets", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListMeasurementProtocolSecrets", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListMeasurementProtocolSecrets", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListMeasurementProtocolSecrets", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateMeasurementProtocolSecret_async", - "title": "AnalyticsAdminService createMeasurementProtocolSecret Sample", - "origin": "API_DEFINITION", - "description": " Creates a measurement protocol secret.", - "canonical": true, - "file": "analytics_admin_service.create_measurement_protocol_secret.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateMeasurementProtocolSecret", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateMeasurementProtocolSecret", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "measurement_protocol_secret", - "type": ".google.analytics.admin.v1alpha.MeasurementProtocolSecret" - } - ], - "resultType": ".google.analytics.admin.v1alpha.MeasurementProtocolSecret", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateMeasurementProtocolSecret", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateMeasurementProtocolSecret", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteMeasurementProtocolSecret_async", - "title": "AnalyticsAdminService deleteMeasurementProtocolSecret Sample", - "origin": "API_DEFINITION", - "description": " Deletes target MeasurementProtocolSecret.", - "canonical": true, - "file": "analytics_admin_service.delete_measurement_protocol_secret.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteMeasurementProtocolSecret", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteMeasurementProtocolSecret", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteMeasurementProtocolSecret", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteMeasurementProtocolSecret", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateMeasurementProtocolSecret_async", - "title": "AnalyticsAdminService updateMeasurementProtocolSecret Sample", - "origin": "API_DEFINITION", - "description": " Updates a measurement protocol secret.", - "canonical": true, - "file": "analytics_admin_service.update_measurement_protocol_secret.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateMeasurementProtocolSecret", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateMeasurementProtocolSecret", - "async": true, - "parameters": [ - { - "name": "measurement_protocol_secret", - "type": ".google.analytics.admin.v1alpha.MeasurementProtocolSecret" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1alpha.MeasurementProtocolSecret", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateMeasurementProtocolSecret", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateMeasurementProtocolSecret", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_AcknowledgeUserDataCollection_async", - "title": "AnalyticsAdminService acknowledgeUserDataCollection Sample", - "origin": "API_DEFINITION", - "description": " Acknowledges the terms of user data collection for the specified property. This acknowledgement must be completed (either in the Google Analytics UI or via this API) before MeasurementProtocolSecret resources may be created.", - "canonical": true, - "file": "analytics_admin_service.acknowledge_user_data_collection.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "AcknowledgeUserDataCollection", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.AcknowledgeUserDataCollection", - "async": true, - "parameters": [ - { - "name": "property", - "type": "TYPE_STRING" - }, - { - "name": "acknowledgement", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "AcknowledgeUserDataCollection", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.AcknowledgeUserDataCollection", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_SearchChangeHistoryEvents_async", - "title": "AnalyticsAdminService searchChangeHistoryEvents Sample", - "origin": "API_DEFINITION", - "description": " Searches through all changes to an account or its children given the specified set of filters.", - "canonical": true, - "file": "analytics_admin_service.search_change_history_events.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 93, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SearchChangeHistoryEvents", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.SearchChangeHistoryEvents", - "async": true, - "parameters": [ - { - "name": "account", - "type": "TYPE_STRING" - }, - { - "name": "property", - "type": "TYPE_STRING" - }, - { - "name": "resource_type", - "type": "TYPE_ENUM[]" - }, - { - "name": "action", - "type": "TYPE_ENUM[]" - }, - { - "name": "actor_email", - "type": "TYPE_STRING[]" - }, - { - "name": "earliest_change_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "latest_change_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.SearchChangeHistoryEventsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "SearchChangeHistoryEvents", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.SearchChangeHistoryEvents", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetGoogleSignalsSettings_async", - "title": "AnalyticsAdminService getGoogleSignalsSettings Sample", - "origin": "API_DEFINITION", - "description": " Lookup for Google Signals settings for a property.", - "canonical": true, - "file": "analytics_admin_service.get_google_signals_settings.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetGoogleSignalsSettings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetGoogleSignalsSettings", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.GoogleSignalsSettings", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetGoogleSignalsSettings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetGoogleSignalsSettings", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateGoogleSignalsSettings_async", - "title": "AnalyticsAdminService updateGoogleSignalsSettings Sample", - "origin": "API_DEFINITION", - "description": " Updates Google Signals settings for a property.", - "canonical": true, - "file": "analytics_admin_service.update_google_signals_settings.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateGoogleSignalsSettings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateGoogleSignalsSettings", - "async": true, - "parameters": [ - { - "name": "google_signals_settings", - "type": ".google.analytics.admin.v1alpha.GoogleSignalsSettings" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1alpha.GoogleSignalsSettings", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateGoogleSignalsSettings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateGoogleSignalsSettings", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateConversionEvent_async", - "title": "AnalyticsAdminService createConversionEvent Sample", - "origin": "API_DEFINITION", - "description": " Creates a conversion event with the specified attributes.", - "canonical": true, - "file": "analytics_admin_service.create_conversion_event.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateConversionEvent", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateConversionEvent", - "async": true, - "parameters": [ - { - "name": "conversion_event", - "type": ".google.analytics.admin.v1alpha.ConversionEvent" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ConversionEvent", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateConversionEvent", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateConversionEvent", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetConversionEvent_async", - "title": "AnalyticsAdminService getConversionEvent Sample", - "origin": "API_DEFINITION", - "description": " Retrieve a single conversion event.", - "canonical": true, - "file": "analytics_admin_service.get_conversion_event.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetConversionEvent", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetConversionEvent", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ConversionEvent", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetConversionEvent", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetConversionEvent", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteConversionEvent_async", - "title": "AnalyticsAdminService deleteConversionEvent Sample", - "origin": "API_DEFINITION", - "description": " Deletes a conversion event in a property.", - "canonical": true, - "file": "analytics_admin_service.delete_conversion_event.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteConversionEvent", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteConversionEvent", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteConversionEvent", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteConversionEvent", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListConversionEvents_async", - "title": "AnalyticsAdminService listConversionEvents Sample", - "origin": "API_DEFINITION", - "description": " Returns a list of conversion events in the specified parent property. Returns an empty list if no conversion events are found.", - "canonical": true, - "file": "analytics_admin_service.list_conversion_events.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListConversionEvents", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListConversionEvents", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ListConversionEventsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListConversionEvents", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListConversionEvents", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDisplayVideo360AdvertiserLink_async", - "title": "AnalyticsAdminService getDisplayVideo360AdvertiserLink Sample", - "origin": "API_DEFINITION", - "description": " Look up a single DisplayVideo360AdvertiserLink", - "canonical": true, - "file": "analytics_admin_service.get_display_video360_advertiser_link.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDisplayVideo360AdvertiserLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetDisplayVideo360AdvertiserLink", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetDisplayVideo360AdvertiserLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetDisplayVideo360AdvertiserLink", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDisplayVideo360AdvertiserLinks_async", - "title": "AnalyticsAdminService listDisplayVideo360AdvertiserLinks Sample", - "origin": "API_DEFINITION", - "description": " Lists all DisplayVideo360AdvertiserLinks on a property.", - "canonical": true, - "file": "analytics_admin_service.list_display_video360_advertiser_links.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListDisplayVideo360AdvertiserLinks", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListDisplayVideo360AdvertiserLinks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListDisplayVideo360AdvertiserLinks", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListDisplayVideo360AdvertiserLinks", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDisplayVideo360AdvertiserLink_async", - "title": "AnalyticsAdminService createDisplayVideo360AdvertiserLink Sample", - "origin": "API_DEFINITION", - "description": " Creates a DisplayVideo360AdvertiserLink. This can only be utilized by users who have proper authorization both on the Google Analytics property and on the Display & Video 360 advertiser. Users who do not have access to the Display & Video 360 advertiser should instead seek to create a DisplayVideo360LinkProposal.", - "canonical": true, - "file": "analytics_admin_service.create_display_video360_advertiser_link.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateDisplayVideo360AdvertiserLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateDisplayVideo360AdvertiserLink", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "display_video_360_advertiser_link", - "type": ".google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink" - } - ], - "resultType": ".google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateDisplayVideo360AdvertiserLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateDisplayVideo360AdvertiserLink", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDisplayVideo360AdvertiserLink_async", - "title": "AnalyticsAdminService deleteDisplayVideo360AdvertiserLink Sample", - "origin": "API_DEFINITION", - "description": " Deletes a DisplayVideo360AdvertiserLink on a property.", - "canonical": true, - "file": "analytics_admin_service.delete_display_video360_advertiser_link.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteDisplayVideo360AdvertiserLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteDisplayVideo360AdvertiserLink", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteDisplayVideo360AdvertiserLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteDisplayVideo360AdvertiserLink", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDisplayVideo360AdvertiserLink_async", - "title": "AnalyticsAdminService updateDisplayVideo360AdvertiserLink Sample", - "origin": "API_DEFINITION", - "description": " Updates a DisplayVideo360AdvertiserLink on a property.", - "canonical": true, - "file": "analytics_admin_service.update_display_video360_advertiser_link.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateDisplayVideo360AdvertiserLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateDisplayVideo360AdvertiserLink", - "async": true, - "parameters": [ - { - "name": "display_video_360_advertiser_link", - "type": ".google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateDisplayVideo360AdvertiserLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateDisplayVideo360AdvertiserLink", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDisplayVideo360AdvertiserLinkProposal_async", - "title": "AnalyticsAdminService getDisplayVideo360AdvertiserLinkProposal Sample", - "origin": "API_DEFINITION", - "description": " Lookup for a single DisplayVideo360AdvertiserLinkProposal.", - "canonical": true, - "file": "analytics_admin_service.get_display_video360_advertiser_link_proposal.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDisplayVideo360AdvertiserLinkProposal", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetDisplayVideo360AdvertiserLinkProposal", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetDisplayVideo360AdvertiserLinkProposal", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetDisplayVideo360AdvertiserLinkProposal", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDisplayVideo360AdvertiserLinkProposals_async", - "title": "AnalyticsAdminService listDisplayVideo360AdvertiserLinkProposals Sample", - "origin": "API_DEFINITION", - "description": " Lists DisplayVideo360AdvertiserLinkProposals on a property.", - "canonical": true, - "file": "analytics_admin_service.list_display_video360_advertiser_link_proposals.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListDisplayVideo360AdvertiserLinkProposals", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListDisplayVideo360AdvertiserLinkProposals", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListDisplayVideo360AdvertiserLinkProposals", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListDisplayVideo360AdvertiserLinkProposals", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDisplayVideo360AdvertiserLinkProposal_async", - "title": "AnalyticsAdminService createDisplayVideo360AdvertiserLinkProposal Sample", - "origin": "API_DEFINITION", - "description": " Creates a DisplayVideo360AdvertiserLinkProposal.", - "canonical": true, - "file": "analytics_admin_service.create_display_video360_advertiser_link_proposal.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateDisplayVideo360AdvertiserLinkProposal", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateDisplayVideo360AdvertiserLinkProposal", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "display_video_360_advertiser_link_proposal", - "type": ".google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal" - } - ], - "resultType": ".google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateDisplayVideo360AdvertiserLinkProposal", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateDisplayVideo360AdvertiserLinkProposal", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDisplayVideo360AdvertiserLinkProposal_async", - "title": "AnalyticsAdminService deleteDisplayVideo360AdvertiserLinkProposal Sample", - "origin": "API_DEFINITION", - "description": " Deletes a DisplayVideo360AdvertiserLinkProposal on a property. This can only be used on cancelled proposals.", - "canonical": true, - "file": "analytics_admin_service.delete_display_video360_advertiser_link_proposal.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteDisplayVideo360AdvertiserLinkProposal", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteDisplayVideo360AdvertiserLinkProposal", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteDisplayVideo360AdvertiserLinkProposal", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteDisplayVideo360AdvertiserLinkProposal", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ApproveDisplayVideo360AdvertiserLinkProposal_async", - "title": "AnalyticsAdminService approveDisplayVideo360AdvertiserLinkProposal Sample", - "origin": "API_DEFINITION", - "description": " Approves a DisplayVideo360AdvertiserLinkProposal. The DisplayVideo360AdvertiserLinkProposal will be deleted and a new DisplayVideo360AdvertiserLink will be created.", - "canonical": true, - "file": "analytics_admin_service.approve_display_video360_advertiser_link_proposal.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ApproveDisplayVideo360AdvertiserLinkProposal", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ApproveDisplayVideo360AdvertiserLinkProposal", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ApproveDisplayVideo360AdvertiserLinkProposal", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ApproveDisplayVideo360AdvertiserLinkProposal", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CancelDisplayVideo360AdvertiserLinkProposal_async", - "title": "AnalyticsAdminService cancelDisplayVideo360AdvertiserLinkProposal Sample", - "origin": "API_DEFINITION", - "description": " Cancels a DisplayVideo360AdvertiserLinkProposal. Cancelling can mean either: - Declining a proposal initiated from Display & Video 360 - Withdrawing a proposal initiated from Google Analytics After being cancelled, a proposal will eventually be deleted automatically.", - "canonical": true, - "file": "analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CancelDisplayVideo360AdvertiserLinkProposal", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CancelDisplayVideo360AdvertiserLinkProposal", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CancelDisplayVideo360AdvertiserLinkProposal", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CancelDisplayVideo360AdvertiserLinkProposal", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateCustomDimension_async", - "title": "AnalyticsAdminService createCustomDimension Sample", - "origin": "API_DEFINITION", - "description": " Creates a CustomDimension.", - "canonical": true, - "file": "analytics_admin_service.create_custom_dimension.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCustomDimension", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateCustomDimension", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "custom_dimension", - "type": ".google.analytics.admin.v1alpha.CustomDimension" - } - ], - "resultType": ".google.analytics.admin.v1alpha.CustomDimension", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateCustomDimension", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateCustomDimension", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateCustomDimension_async", - "title": "AnalyticsAdminService updateCustomDimension Sample", - "origin": "API_DEFINITION", - "description": " Updates a CustomDimension on a property.", - "canonical": true, - "file": "analytics_admin_service.update_custom_dimension.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCustomDimension", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateCustomDimension", - "async": true, - "parameters": [ - { - "name": "custom_dimension", - "type": ".google.analytics.admin.v1alpha.CustomDimension" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1alpha.CustomDimension", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateCustomDimension", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateCustomDimension", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListCustomDimensions_async", - "title": "AnalyticsAdminService listCustomDimensions Sample", - "origin": "API_DEFINITION", - "description": " Lists CustomDimensions on a property.", - "canonical": true, - "file": "analytics_admin_service.list_custom_dimensions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListCustomDimensions", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListCustomDimensions", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ListCustomDimensionsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListCustomDimensions", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListCustomDimensions", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveCustomDimension_async", - "title": "AnalyticsAdminService archiveCustomDimension Sample", - "origin": "API_DEFINITION", - "description": " Archives a CustomDimension on a property.", - "canonical": true, - "file": "analytics_admin_service.archive_custom_dimension.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ArchiveCustomDimension", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ArchiveCustomDimension", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ArchiveCustomDimension", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ArchiveCustomDimension", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetCustomDimension_async", - "title": "AnalyticsAdminService getCustomDimension Sample", - "origin": "API_DEFINITION", - "description": " Lookup for a single CustomDimension.", - "canonical": true, - "file": "analytics_admin_service.get_custom_dimension.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCustomDimension", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetCustomDimension", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.CustomDimension", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetCustomDimension", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetCustomDimension", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateCustomMetric_async", - "title": "AnalyticsAdminService createCustomMetric Sample", - "origin": "API_DEFINITION", - "description": " Creates a CustomMetric.", - "canonical": true, - "file": "analytics_admin_service.create_custom_metric.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCustomMetric", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateCustomMetric", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "custom_metric", - "type": ".google.analytics.admin.v1alpha.CustomMetric" - } - ], - "resultType": ".google.analytics.admin.v1alpha.CustomMetric", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateCustomMetric", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateCustomMetric", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateCustomMetric_async", - "title": "AnalyticsAdminService updateCustomMetric Sample", - "origin": "API_DEFINITION", - "description": " Updates a CustomMetric on a property.", - "canonical": true, - "file": "analytics_admin_service.update_custom_metric.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCustomMetric", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateCustomMetric", - "async": true, - "parameters": [ - { - "name": "custom_metric", - "type": ".google.analytics.admin.v1alpha.CustomMetric" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1alpha.CustomMetric", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateCustomMetric", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateCustomMetric", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListCustomMetrics_async", - "title": "AnalyticsAdminService listCustomMetrics Sample", - "origin": "API_DEFINITION", - "description": " Lists CustomMetrics on a property.", - "canonical": true, - "file": "analytics_admin_service.list_custom_metrics.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListCustomMetrics", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListCustomMetrics", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ListCustomMetricsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListCustomMetrics", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListCustomMetrics", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveCustomMetric_async", - "title": "AnalyticsAdminService archiveCustomMetric Sample", - "origin": "API_DEFINITION", - "description": " Archives a CustomMetric on a property.", - "canonical": true, - "file": "analytics_admin_service.archive_custom_metric.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ArchiveCustomMetric", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ArchiveCustomMetric", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ArchiveCustomMetric", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ArchiveCustomMetric", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetCustomMetric_async", - "title": "AnalyticsAdminService getCustomMetric Sample", - "origin": "API_DEFINITION", - "description": " Lookup for a single CustomMetric.", - "canonical": true, - "file": "analytics_admin_service.get_custom_metric.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCustomMetric", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetCustomMetric", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.CustomMetric", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetCustomMetric", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetCustomMetric", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataRetentionSettings_async", - "title": "AnalyticsAdminService getDataRetentionSettings Sample", - "origin": "API_DEFINITION", - "description": " Returns the singleton data retention settings for this property.", - "canonical": true, - "file": "analytics_admin_service.get_data_retention_settings.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDataRetentionSettings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetDataRetentionSettings", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.DataRetentionSettings", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetDataRetentionSettings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetDataRetentionSettings", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDataRetentionSettings_async", - "title": "AnalyticsAdminService updateDataRetentionSettings Sample", - "origin": "API_DEFINITION", - "description": " Updates the singleton data retention settings for this property.", - "canonical": true, - "file": "analytics_admin_service.update_data_retention_settings.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateDataRetentionSettings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateDataRetentionSettings", - "async": true, - "parameters": [ - { - "name": "data_retention_settings", - "type": ".google.analytics.admin.v1alpha.DataRetentionSettings" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1alpha.DataRetentionSettings", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateDataRetentionSettings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateDataRetentionSettings", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDataStream_async", - "title": "AnalyticsAdminService createDataStream Sample", - "origin": "API_DEFINITION", - "description": " Creates a DataStream.", - "canonical": true, - "file": "analytics_admin_service.create_data_stream.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateDataStream", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateDataStream", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "data_stream", - "type": ".google.analytics.admin.v1alpha.DataStream" - } - ], - "resultType": ".google.analytics.admin.v1alpha.DataStream", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateDataStream", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateDataStream", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDataStream_async", - "title": "AnalyticsAdminService deleteDataStream Sample", - "origin": "API_DEFINITION", - "description": " Deletes a DataStream on a property.", - "canonical": true, - "file": "analytics_admin_service.delete_data_stream.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteDataStream", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteDataStream", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteDataStream", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteDataStream", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDataStream_async", - "title": "AnalyticsAdminService updateDataStream Sample", - "origin": "API_DEFINITION", - "description": " Updates a DataStream on a property.", - "canonical": true, - "file": "analytics_admin_service.update_data_stream.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateDataStream", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateDataStream", - "async": true, - "parameters": [ - { - "name": "data_stream", - "type": ".google.analytics.admin.v1alpha.DataStream" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1alpha.DataStream", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateDataStream", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateDataStream", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDataStreams_async", - "title": "AnalyticsAdminService listDataStreams Sample", - "origin": "API_DEFINITION", - "description": " Lists DataStreams on a property.", - "canonical": true, - "file": "analytics_admin_service.list_data_streams.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListDataStreams", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListDataStreams", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ListDataStreamsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListDataStreams", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListDataStreams", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataStream_async", - "title": "AnalyticsAdminService getDataStream Sample", - "origin": "API_DEFINITION", - "description": " Lookup for a single DataStream.", - "canonical": true, - "file": "analytics_admin_service.get_data_stream.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDataStream", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetDataStream", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.DataStream", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetDataStream", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetDataStream", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/v1alpha/src/index.ts b/owl-bot-staging/v1alpha/src/index.ts deleted file mode 100644 index 793e105..0000000 --- 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 AnalyticsAdminServiceClient = v1alpha.AnalyticsAdminServiceClient; -type AnalyticsAdminServiceClient = v1alpha.AnalyticsAdminServiceClient; -export {v1alpha, AnalyticsAdminServiceClient}; -export default {v1alpha, AnalyticsAdminServiceClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_client.ts b/owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_client.ts deleted file mode 100644 index 30f6aea..0000000 --- a/owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_client.ts +++ /dev/null @@ -1,8074 +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, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1alpha/analytics_admin_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './analytics_admin_service_client_config.json'; - -const version = require('../../../package.json').version; - -/** - * Service Interface for the Analytics Admin API (GA4). - * @class - * @memberof v1alpha - */ -export class AnalyticsAdminServiceClient { - 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}; - analyticsAdminServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of AnalyticsAdminServiceClient. - * - * @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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof AnalyticsAdminServiceClient; - 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 = { - accountPathTemplate: new this._gaxModule.PathTemplate( - 'accounts/{account}' - ), - accountSummaryPathTemplate: new this._gaxModule.PathTemplate( - 'accountSummaries/{account_summary}' - ), - accountUserLinkPathTemplate: new this._gaxModule.PathTemplate( - 'accounts/{account}/userLinks/{user_link}' - ), - conversionEventPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/conversionEvents/{conversion_event}' - ), - customDimensionPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/customDimensions/{custom_dimension}' - ), - customMetricPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/customMetrics/{custom_metric}' - ), - dataRetentionSettingsPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/dataRetentionSettings' - ), - dataSharingSettingsPathTemplate: new this._gaxModule.PathTemplate( - 'accounts/{account}/dataSharingSettings' - ), - dataStreamPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/dataStreams/{data_stream}' - ), - displayVideo360AdvertiserLinkPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/displayVideo360AdvertiserLinks/{display_video_360_advertiser_link}' - ), - displayVideo360AdvertiserLinkProposalPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/displayVideo360AdvertiserLinkProposals/{display_video_360_advertiser_link_proposal}' - ), - firebaseLinkPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/firebaseLinks/{firebase_link}' - ), - globalSiteTagPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/dataStreams/{data_stream}/globalSiteTag' - ), - googleAdsLinkPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/googleAdsLinks/{google_ads_link}' - ), - googleSignalsSettingsPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/googleSignalsSettings' - ), - measurementProtocolSecretPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/dataStreams/{data_stream}/measurementProtocolSecrets/{measurement_protocol_secret}' - ), - propertyPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}' - ), - propertyUserLinkPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/userLinks/{user_link}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listAccounts: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'accounts'), - listAccountSummaries: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'accountSummaries'), - listProperties: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'properties'), - listUserLinks: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'userLinks'), - auditUserLinks: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'userLinks'), - listFirebaseLinks: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'firebaseLinks'), - listGoogleAdsLinks: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'googleAdsLinks'), - listMeasurementProtocolSecrets: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'measurementProtocolSecrets'), - searchChangeHistoryEvents: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'changeHistoryEvents'), - listConversionEvents: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'conversionEvents'), - listDisplayVideo360AdvertiserLinks: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'displayVideo_360AdvertiserLinks'), - listDisplayVideo360AdvertiserLinkProposals: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'displayVideo_360AdvertiserLinkProposals'), - listCustomDimensions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'customDimensions'), - listCustomMetrics: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'customMetrics'), - listDataStreams: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dataStreams') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.analytics.admin.v1alpha.AnalyticsAdminService', 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.analyticsAdminServiceStub) { - return this.analyticsAdminServiceStub; - } - - // Put together the "service stub" for - // google.analytics.admin.v1alpha.AnalyticsAdminService. - this.analyticsAdminServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.analytics.admin.v1alpha.AnalyticsAdminService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.analytics.admin.v1alpha.AnalyticsAdminService, - 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 analyticsAdminServiceStubMethods = - ['getAccount', 'listAccounts', 'deleteAccount', 'updateAccount', 'provisionAccountTicket', 'listAccountSummaries', 'getProperty', 'listProperties', 'createProperty', 'deleteProperty', 'updateProperty', 'getUserLink', 'batchGetUserLinks', 'listUserLinks', 'auditUserLinks', 'createUserLink', 'batchCreateUserLinks', 'updateUserLink', 'batchUpdateUserLinks', 'deleteUserLink', 'batchDeleteUserLinks', 'createFirebaseLink', 'deleteFirebaseLink', 'listFirebaseLinks', 'getGlobalSiteTag', 'createGoogleAdsLink', 'updateGoogleAdsLink', 'deleteGoogleAdsLink', 'listGoogleAdsLinks', 'getDataSharingSettings', 'getMeasurementProtocolSecret', 'listMeasurementProtocolSecrets', 'createMeasurementProtocolSecret', 'deleteMeasurementProtocolSecret', 'updateMeasurementProtocolSecret', 'acknowledgeUserDataCollection', 'searchChangeHistoryEvents', 'getGoogleSignalsSettings', 'updateGoogleSignalsSettings', 'createConversionEvent', 'getConversionEvent', 'deleteConversionEvent', 'listConversionEvents', 'getDisplayVideo360AdvertiserLink', 'listDisplayVideo360AdvertiserLinks', 'createDisplayVideo360AdvertiserLink', 'deleteDisplayVideo360AdvertiserLink', 'updateDisplayVideo360AdvertiserLink', 'getDisplayVideo360AdvertiserLinkProposal', 'listDisplayVideo360AdvertiserLinkProposals', 'createDisplayVideo360AdvertiserLinkProposal', 'deleteDisplayVideo360AdvertiserLinkProposal', 'approveDisplayVideo360AdvertiserLinkProposal', 'cancelDisplayVideo360AdvertiserLinkProposal', 'createCustomDimension', 'updateCustomDimension', 'listCustomDimensions', 'archiveCustomDimension', 'getCustomDimension', 'createCustomMetric', 'updateCustomMetric', 'listCustomMetrics', 'archiveCustomMetric', 'getCustomMetric', 'getDataRetentionSettings', 'updateDataRetentionSettings', 'createDataStream', 'deleteDataStream', 'updateDataStream', 'listDataStreams', 'getDataStream']; - for (const methodName of analyticsAdminServiceStubMethods) { - const callPromise = this.analyticsAdminServiceStub.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 = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.analyticsAdminServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'analyticsadmin.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 'analyticsadmin.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.edit', - 'https://www.googleapis.com/auth/analytics.manage.users', - 'https://www.googleapis.com/auth/analytics.manage.users.readonly', - '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 -- - // ------------------- -/** - * Lookup for a single Account. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the account to lookup. - * Format: accounts/{account} - * Example: "accounts/100" - * @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 [Account]{@link google.analytics.admin.v1alpha.Account}. - * 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/analytics_admin_service.get_account.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAccount_async - */ - getAccount( - request?: protos.google.analytics.admin.v1alpha.IGetAccountRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IAccount, - protos.google.analytics.admin.v1alpha.IGetAccountRequest|undefined, {}|undefined - ]>; - getAccount( - request: protos.google.analytics.admin.v1alpha.IGetAccountRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAccount, - protos.google.analytics.admin.v1alpha.IGetAccountRequest|null|undefined, - {}|null|undefined>): void; - getAccount( - request: protos.google.analytics.admin.v1alpha.IGetAccountRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAccount, - protos.google.analytics.admin.v1alpha.IGetAccountRequest|null|undefined, - {}|null|undefined>): void; - getAccount( - request?: protos.google.analytics.admin.v1alpha.IGetAccountRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IAccount, - protos.google.analytics.admin.v1alpha.IGetAccountRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IAccount, - protos.google.analytics.admin.v1alpha.IGetAccountRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IAccount, - protos.google.analytics.admin.v1alpha.IGetAccountRequest|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.getAccount(request, options, callback); - } -/** - * Marks target Account as soft-deleted (ie: "trashed") and returns it. - * - * This API does not have a method to restore soft-deleted accounts. - * However, they can be restored using the Trash Can UI. - * - * If the accounts are not restored before the expiration time, the account - * and all child resources (eg: Properties, GoogleAdsLinks, Streams, - * UserLinks) will be permanently purged. - * https://support.google.com/analytics/answer/6154772 - * - * Returns an error if the target is not found. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Account to soft-delete. - * Format: accounts/{account} - * Example: "accounts/100" - * @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 [Empty]{@link google.protobuf.Empty}. - * 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/analytics_admin_service.delete_account.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteAccount_async - */ - deleteAccount( - request?: protos.google.analytics.admin.v1alpha.IDeleteAccountRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteAccountRequest|undefined, {}|undefined - ]>; - deleteAccount( - request: protos.google.analytics.admin.v1alpha.IDeleteAccountRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteAccountRequest|null|undefined, - {}|null|undefined>): void; - deleteAccount( - request: protos.google.analytics.admin.v1alpha.IDeleteAccountRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteAccountRequest|null|undefined, - {}|null|undefined>): void; - deleteAccount( - request?: protos.google.analytics.admin.v1alpha.IDeleteAccountRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteAccountRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteAccountRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteAccountRequest|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.deleteAccount(request, options, callback); - } -/** - * Updates an account. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.analytics.admin.v1alpha.Account} request.account - * Required. The account to update. - * The account's `name` field is used to identify the account. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to be updated. Field names must be in snake case - * (e.g., "field_to_update"). Omitted fields will not be updated. To replace - * the entire entity, use one path with the string "*" to match all fields. - * @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 [Account]{@link google.analytics.admin.v1alpha.Account}. - * 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/analytics_admin_service.update_account.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAccount_async - */ - updateAccount( - request?: protos.google.analytics.admin.v1alpha.IUpdateAccountRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IAccount, - protos.google.analytics.admin.v1alpha.IUpdateAccountRequest|undefined, {}|undefined - ]>; - updateAccount( - request: protos.google.analytics.admin.v1alpha.IUpdateAccountRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAccount, - protos.google.analytics.admin.v1alpha.IUpdateAccountRequest|null|undefined, - {}|null|undefined>): void; - updateAccount( - request: protos.google.analytics.admin.v1alpha.IUpdateAccountRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAccount, - protos.google.analytics.admin.v1alpha.IUpdateAccountRequest|null|undefined, - {}|null|undefined>): void; - updateAccount( - request?: protos.google.analytics.admin.v1alpha.IUpdateAccountRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IAccount, - protos.google.analytics.admin.v1alpha.IUpdateAccountRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IAccount, - protos.google.analytics.admin.v1alpha.IUpdateAccountRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IAccount, - protos.google.analytics.admin.v1alpha.IUpdateAccountRequest|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({ - 'account.name': request.account!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateAccount(request, options, callback); - } -/** - * Requests a ticket for creating an account. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.analytics.admin.v1alpha.Account} request.account - * The account to create. - * @param {string} request.redirectUri - * Redirect URI where the user will be sent after accepting Terms of Service. - * Must be configured in Developers Console as a Redirect URI - * @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 [ProvisionAccountTicketResponse]{@link google.analytics.admin.v1alpha.ProvisionAccountTicketResponse}. - * 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/analytics_admin_service.provision_account_ticket.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ProvisionAccountTicket_async - */ - provisionAccountTicket( - request?: protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IProvisionAccountTicketResponse, - protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest|undefined, {}|undefined - ]>; - provisionAccountTicket( - request: protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IProvisionAccountTicketResponse, - protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest|null|undefined, - {}|null|undefined>): void; - provisionAccountTicket( - request: protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IProvisionAccountTicketResponse, - protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest|null|undefined, - {}|null|undefined>): void; - provisionAccountTicket( - request?: protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IProvisionAccountTicketResponse, - protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IProvisionAccountTicketResponse, - protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IProvisionAccountTicketResponse, - protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest|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 || {}; - this.initialize(); - return this.innerApiCalls.provisionAccountTicket(request, options, callback); - } -/** - * Lookup for a single "GA4" Property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the property to lookup. - * Format: properties/{property_id} - * Example: "properties/1000" - * @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 [Property]{@link google.analytics.admin.v1alpha.Property}. - * 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/analytics_admin_service.get_property.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetProperty_async - */ - getProperty( - request?: protos.google.analytics.admin.v1alpha.IGetPropertyRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.IGetPropertyRequest|undefined, {}|undefined - ]>; - getProperty( - request: protos.google.analytics.admin.v1alpha.IGetPropertyRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.IGetPropertyRequest|null|undefined, - {}|null|undefined>): void; - getProperty( - request: protos.google.analytics.admin.v1alpha.IGetPropertyRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.IGetPropertyRequest|null|undefined, - {}|null|undefined>): void; - getProperty( - request?: protos.google.analytics.admin.v1alpha.IGetPropertyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.IGetPropertyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.IGetPropertyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.IGetPropertyRequest|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.getProperty(request, options, callback); - } -/** - * Creates an "GA4" property with the specified location and attributes. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.analytics.admin.v1alpha.Property} request.property - * Required. The property to create. - * Note: the supplied property must specify its parent. - * @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 [Property]{@link google.analytics.admin.v1alpha.Property}. - * 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/analytics_admin_service.create_property.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateProperty_async - */ - createProperty( - request?: protos.google.analytics.admin.v1alpha.ICreatePropertyRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.ICreatePropertyRequest|undefined, {}|undefined - ]>; - createProperty( - request: protos.google.analytics.admin.v1alpha.ICreatePropertyRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.ICreatePropertyRequest|null|undefined, - {}|null|undefined>): void; - createProperty( - request: protos.google.analytics.admin.v1alpha.ICreatePropertyRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.ICreatePropertyRequest|null|undefined, - {}|null|undefined>): void; - createProperty( - request?: protos.google.analytics.admin.v1alpha.ICreatePropertyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.ICreatePropertyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.ICreatePropertyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.ICreatePropertyRequest|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 || {}; - this.initialize(); - return this.innerApiCalls.createProperty(request, options, callback); - } -/** - * Marks target Property as soft-deleted (ie: "trashed") and returns it. - * - * This API does not have a method to restore soft-deleted properties. - * However, they can be restored using the Trash Can UI. - * - * If the properties are not restored before the expiration time, the Property - * and all child resources (eg: GoogleAdsLinks, Streams, UserLinks) - * will be permanently purged. - * https://support.google.com/analytics/answer/6154772 - * - * Returns an error if the target is not found, or is not an GA4 Property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Property to soft-delete. - * Format: properties/{property_id} - * Example: "properties/1000" - * @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 [Property]{@link google.analytics.admin.v1alpha.Property}. - * 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/analytics_admin_service.delete_property.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteProperty_async - */ - deleteProperty( - request?: protos.google.analytics.admin.v1alpha.IDeletePropertyRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.IDeletePropertyRequest|undefined, {}|undefined - ]>; - deleteProperty( - request: protos.google.analytics.admin.v1alpha.IDeletePropertyRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.IDeletePropertyRequest|null|undefined, - {}|null|undefined>): void; - deleteProperty( - request: protos.google.analytics.admin.v1alpha.IDeletePropertyRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.IDeletePropertyRequest|null|undefined, - {}|null|undefined>): void; - deleteProperty( - request?: protos.google.analytics.admin.v1alpha.IDeletePropertyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.IDeletePropertyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.IDeletePropertyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.IDeletePropertyRequest|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.deleteProperty(request, options, callback); - } -/** - * Updates a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.analytics.admin.v1alpha.Property} request.property - * Required. The property to update. - * The property's `name` field is used to identify the property to be - * updated. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to be updated. Field names must be in snake case - * (e.g., "field_to_update"). Omitted fields will not be updated. To replace - * the entire entity, use one path with the string "*" to match all fields. - * @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 [Property]{@link google.analytics.admin.v1alpha.Property}. - * 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/analytics_admin_service.update_property.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateProperty_async - */ - updateProperty( - request?: protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest|undefined, {}|undefined - ]>; - updateProperty( - request: protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest|null|undefined, - {}|null|undefined>): void; - updateProperty( - request: protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest|null|undefined, - {}|null|undefined>): void; - updateProperty( - request?: protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IProperty, - protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest|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.name': request.property!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateProperty(request, options, callback); - } -/** - * Gets information about a user's link to an account or property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Example format: accounts/1234/userLinks/5678 - * @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 [UserLink]{@link google.analytics.admin.v1alpha.UserLink}. - * 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/analytics_admin_service.get_user_link.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetUserLink_async - */ - getUserLink( - request?: protos.google.analytics.admin.v1alpha.IGetUserLinkRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IUserLink, - protos.google.analytics.admin.v1alpha.IGetUserLinkRequest|undefined, {}|undefined - ]>; - getUserLink( - request: protos.google.analytics.admin.v1alpha.IGetUserLinkRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IUserLink, - protos.google.analytics.admin.v1alpha.IGetUserLinkRequest|null|undefined, - {}|null|undefined>): void; - getUserLink( - request: protos.google.analytics.admin.v1alpha.IGetUserLinkRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IUserLink, - protos.google.analytics.admin.v1alpha.IGetUserLinkRequest|null|undefined, - {}|null|undefined>): void; - getUserLink( - request?: protos.google.analytics.admin.v1alpha.IGetUserLinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IUserLink, - protos.google.analytics.admin.v1alpha.IGetUserLinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IUserLink, - protos.google.analytics.admin.v1alpha.IGetUserLinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IUserLink, - protos.google.analytics.admin.v1alpha.IGetUserLinkRequest|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.getUserLink(request, options, callback); - } -/** - * Gets information about multiple users' links to an account or property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The account or property that all user links in the request are - * for. The parent of all provided values for the 'names' field must match - * this field. - * Example format: accounts/1234 - * @param {string[]} request.names - * Required. The names of the user links to retrieve. - * A maximum of 1000 user links can be retrieved in a batch. - * Format: accounts/{accountId}/userLinks/{userLinkId} - * @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 [BatchGetUserLinksResponse]{@link google.analytics.admin.v1alpha.BatchGetUserLinksResponse}. - * 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/analytics_admin_service.batch_get_user_links.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchGetUserLinks_async - */ - batchGetUserLinks( - request?: protos.google.analytics.admin.v1alpha.IBatchGetUserLinksRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IBatchGetUserLinksResponse, - protos.google.analytics.admin.v1alpha.IBatchGetUserLinksRequest|undefined, {}|undefined - ]>; - batchGetUserLinks( - request: protos.google.analytics.admin.v1alpha.IBatchGetUserLinksRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IBatchGetUserLinksResponse, - protos.google.analytics.admin.v1alpha.IBatchGetUserLinksRequest|null|undefined, - {}|null|undefined>): void; - batchGetUserLinks( - request: protos.google.analytics.admin.v1alpha.IBatchGetUserLinksRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IBatchGetUserLinksResponse, - protos.google.analytics.admin.v1alpha.IBatchGetUserLinksRequest|null|undefined, - {}|null|undefined>): void; - batchGetUserLinks( - request?: protos.google.analytics.admin.v1alpha.IBatchGetUserLinksRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IBatchGetUserLinksResponse, - protos.google.analytics.admin.v1alpha.IBatchGetUserLinksRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IBatchGetUserLinksResponse, - protos.google.analytics.admin.v1alpha.IBatchGetUserLinksRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IBatchGetUserLinksResponse, - protos.google.analytics.admin.v1alpha.IBatchGetUserLinksRequest|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.batchGetUserLinks(request, options, callback); - } -/** - * Creates a user link on an account or property. - * - * If the user with the specified email already has permissions on the - * account or property, then the user's existing permissions will be unioned - * with the permissions specified in the new UserLink. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: accounts/1234 - * @param {boolean} [request.notifyNewUser] - * Optional. If set, then email the new user notifying them that they've been granted - * permissions to the resource. - * @param {google.analytics.admin.v1alpha.UserLink} request.userLink - * Required. The user link to create. - * @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 [UserLink]{@link google.analytics.admin.v1alpha.UserLink}. - * 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/analytics_admin_service.create_user_link.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateUserLink_async - */ - createUserLink( - request?: protos.google.analytics.admin.v1alpha.ICreateUserLinkRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IUserLink, - protos.google.analytics.admin.v1alpha.ICreateUserLinkRequest|undefined, {}|undefined - ]>; - createUserLink( - request: protos.google.analytics.admin.v1alpha.ICreateUserLinkRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IUserLink, - protos.google.analytics.admin.v1alpha.ICreateUserLinkRequest|null|undefined, - {}|null|undefined>): void; - createUserLink( - request: protos.google.analytics.admin.v1alpha.ICreateUserLinkRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IUserLink, - protos.google.analytics.admin.v1alpha.ICreateUserLinkRequest|null|undefined, - {}|null|undefined>): void; - createUserLink( - request?: protos.google.analytics.admin.v1alpha.ICreateUserLinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IUserLink, - protos.google.analytics.admin.v1alpha.ICreateUserLinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IUserLink, - protos.google.analytics.admin.v1alpha.ICreateUserLinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IUserLink, - protos.google.analytics.admin.v1alpha.ICreateUserLinkRequest|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createUserLink(request, options, callback); - } -/** - * Creates information about multiple users' links to an account or property. - * - * This method is transactional. If any UserLink cannot be created, none of - * the UserLinks will be created. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The account or property that all user links in the request are for. - * This field is required. The parent field in the CreateUserLinkRequest - * messages must either be empty or match this field. - * Example format: accounts/1234 - * @param {boolean} [request.notifyNewUsers] - * Optional. If set, then email the new users notifying them that they've been granted - * permissions to the resource. Regardless of whether this is set or not, - * notify_new_user field inside each individual request is ignored. - * @param {number[]} request.requests - * Required. The requests specifying the user links to create. - * A maximum of 1000 user links can be created in a batch. - * @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 [BatchCreateUserLinksResponse]{@link google.analytics.admin.v1alpha.BatchCreateUserLinksResponse}. - * 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/analytics_admin_service.batch_create_user_links.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchCreateUserLinks_async - */ - batchCreateUserLinks( - request?: protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksResponse, - protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksRequest|undefined, {}|undefined - ]>; - batchCreateUserLinks( - request: protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksResponse, - protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksRequest|null|undefined, - {}|null|undefined>): void; - batchCreateUserLinks( - request: protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksResponse, - protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksRequest|null|undefined, - {}|null|undefined>): void; - batchCreateUserLinks( - request?: protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksResponse, - protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksResponse, - protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksResponse, - protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksRequest|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.batchCreateUserLinks(request, options, callback); - } -/** - * Updates a user link on an account or property. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.analytics.admin.v1alpha.UserLink} request.userLink - * Required. The user link to update. - * @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 [UserLink]{@link google.analytics.admin.v1alpha.UserLink}. - * 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/analytics_admin_service.update_user_link.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateUserLink_async - */ - updateUserLink( - request?: protos.google.analytics.admin.v1alpha.IUpdateUserLinkRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IUserLink, - protos.google.analytics.admin.v1alpha.IUpdateUserLinkRequest|undefined, {}|undefined - ]>; - updateUserLink( - request: protos.google.analytics.admin.v1alpha.IUpdateUserLinkRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IUserLink, - protos.google.analytics.admin.v1alpha.IUpdateUserLinkRequest|null|undefined, - {}|null|undefined>): void; - updateUserLink( - request: protos.google.analytics.admin.v1alpha.IUpdateUserLinkRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IUserLink, - protos.google.analytics.admin.v1alpha.IUpdateUserLinkRequest|null|undefined, - {}|null|undefined>): void; - updateUserLink( - request?: protos.google.analytics.admin.v1alpha.IUpdateUserLinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IUserLink, - protos.google.analytics.admin.v1alpha.IUpdateUserLinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IUserLink, - protos.google.analytics.admin.v1alpha.IUpdateUserLinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IUserLink, - protos.google.analytics.admin.v1alpha.IUpdateUserLinkRequest|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({ - 'user_link.name': request.userLink!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateUserLink(request, options, callback); - } -/** - * Updates information about multiple users' links to an account or property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The account or property that all user links in the request are - * for. The parent field in the UpdateUserLinkRequest messages must either be - * empty or match this field. - * Example format: accounts/1234 - * @param {number[]} request.requests - * Required. The requests specifying the user links to update. - * A maximum of 1000 user links can be updated in a batch. - * @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 [BatchUpdateUserLinksResponse]{@link google.analytics.admin.v1alpha.BatchUpdateUserLinksResponse}. - * 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/analytics_admin_service.batch_update_user_links.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchUpdateUserLinks_async - */ - batchUpdateUserLinks( - request?: protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksResponse, - protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksRequest|undefined, {}|undefined - ]>; - batchUpdateUserLinks( - request: protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksResponse, - protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksRequest|null|undefined, - {}|null|undefined>): void; - batchUpdateUserLinks( - request: protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksResponse, - protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksRequest|null|undefined, - {}|null|undefined>): void; - batchUpdateUserLinks( - request?: protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksResponse, - protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksResponse, - protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksResponse, - protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksRequest|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.batchUpdateUserLinks(request, options, callback); - } -/** - * Deletes a user link on an account or property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Example format: accounts/1234/userLinks/5678 - * @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 [Empty]{@link google.protobuf.Empty}. - * 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/analytics_admin_service.delete_user_link.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteUserLink_async - */ - deleteUserLink( - request?: protos.google.analytics.admin.v1alpha.IDeleteUserLinkRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteUserLinkRequest|undefined, {}|undefined - ]>; - deleteUserLink( - request: protos.google.analytics.admin.v1alpha.IDeleteUserLinkRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteUserLinkRequest|null|undefined, - {}|null|undefined>): void; - deleteUserLink( - request: protos.google.analytics.admin.v1alpha.IDeleteUserLinkRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteUserLinkRequest|null|undefined, - {}|null|undefined>): void; - deleteUserLink( - request?: protos.google.analytics.admin.v1alpha.IDeleteUserLinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteUserLinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteUserLinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteUserLinkRequest|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.deleteUserLink(request, options, callback); - } -/** - * Deletes information about multiple users' links to an account or property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The account or property that all user links in the request are - * for. The parent of all values for user link names to delete must match this - * field. - * Example format: accounts/1234 - * @param {number[]} request.requests - * Required. The requests specifying the user links to update. - * A maximum of 1000 user links can be updated in a batch. - * @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 [Empty]{@link google.protobuf.Empty}. - * 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/analytics_admin_service.batch_delete_user_links.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchDeleteUserLinks_async - */ - batchDeleteUserLinks( - request?: protos.google.analytics.admin.v1alpha.IBatchDeleteUserLinksRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IBatchDeleteUserLinksRequest|undefined, {}|undefined - ]>; - batchDeleteUserLinks( - request: protos.google.analytics.admin.v1alpha.IBatchDeleteUserLinksRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IBatchDeleteUserLinksRequest|null|undefined, - {}|null|undefined>): void; - batchDeleteUserLinks( - request: protos.google.analytics.admin.v1alpha.IBatchDeleteUserLinksRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IBatchDeleteUserLinksRequest|null|undefined, - {}|null|undefined>): void; - batchDeleteUserLinks( - request?: protos.google.analytics.admin.v1alpha.IBatchDeleteUserLinksRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IBatchDeleteUserLinksRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IBatchDeleteUserLinksRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IBatchDeleteUserLinksRequest|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.batchDeleteUserLinks(request, options, callback); - } -/** - * Creates a FirebaseLink. - * - * Properties can have at most one FirebaseLink. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Format: properties/{property_id} - * Example: properties/1234 - * @param {google.analytics.admin.v1alpha.FirebaseLink} request.firebaseLink - * Required. The Firebase link to create. - * @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 [FirebaseLink]{@link google.analytics.admin.v1alpha.FirebaseLink}. - * 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/analytics_admin_service.create_firebase_link.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateFirebaseLink_async - */ - createFirebaseLink( - request?: protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IFirebaseLink, - protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest|undefined, {}|undefined - ]>; - createFirebaseLink( - request: protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IFirebaseLink, - protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest|null|undefined, - {}|null|undefined>): void; - createFirebaseLink( - request: protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IFirebaseLink, - protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest|null|undefined, - {}|null|undefined>): void; - createFirebaseLink( - request?: protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IFirebaseLink, - protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IFirebaseLink, - protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IFirebaseLink, - protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createFirebaseLink(request, options, callback); - } -/** - * Deletes a FirebaseLink on a property - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Format: properties/{property_id}/firebaseLinks/{firebase_link_id} - * Example: properties/1234/firebaseLinks/5678 - * @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 [Empty]{@link google.protobuf.Empty}. - * 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/analytics_admin_service.delete_firebase_link.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteFirebaseLink_async - */ - deleteFirebaseLink( - request?: protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest|undefined, {}|undefined - ]>; - deleteFirebaseLink( - request: protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest|null|undefined, - {}|null|undefined>): void; - deleteFirebaseLink( - request: protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest|null|undefined, - {}|null|undefined>): void; - deleteFirebaseLink( - request?: protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest|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.deleteFirebaseLink(request, options, callback); - } -/** - * Returns the Site Tag for the specified web stream. - * Site Tags are immutable singletons. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the site tag to lookup. - * Note that site tags are singletons and do not have unique IDs. - * Format: properties/{property_id}/dataStreams/{stream_id}/globalSiteTag - * Example: "properties/123/dataStreams/456/globalSiteTag" - * @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 [GlobalSiteTag]{@link google.analytics.admin.v1alpha.GlobalSiteTag}. - * 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/analytics_admin_service.get_global_site_tag.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetGlobalSiteTag_async - */ - getGlobalSiteTag( - request?: protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IGlobalSiteTag, - protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest|undefined, {}|undefined - ]>; - getGlobalSiteTag( - request: protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IGlobalSiteTag, - protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest|null|undefined, - {}|null|undefined>): void; - getGlobalSiteTag( - request: protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IGlobalSiteTag, - protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest|null|undefined, - {}|null|undefined>): void; - getGlobalSiteTag( - request?: protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IGlobalSiteTag, - protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IGlobalSiteTag, - protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IGlobalSiteTag, - protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest|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.getGlobalSiteTag(request, options, callback); - } -/** - * Creates a GoogleAdsLink. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {google.analytics.admin.v1alpha.GoogleAdsLink} request.googleAdsLink - * Required. The GoogleAdsLink to create. - * @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 [GoogleAdsLink]{@link google.analytics.admin.v1alpha.GoogleAdsLink}. - * 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/analytics_admin_service.create_google_ads_link.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateGoogleAdsLink_async - */ - createGoogleAdsLink( - request?: protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IGoogleAdsLink, - protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest|undefined, {}|undefined - ]>; - createGoogleAdsLink( - request: protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IGoogleAdsLink, - protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>): void; - createGoogleAdsLink( - request: protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IGoogleAdsLink, - protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>): void; - createGoogleAdsLink( - request?: protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IGoogleAdsLink, - protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IGoogleAdsLink, - protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IGoogleAdsLink, - protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createGoogleAdsLink(request, options, callback); - } -/** - * Updates a GoogleAdsLink on a property - * - * @param {Object} request - * The request object that will be sent. - * @param {google.analytics.admin.v1alpha.GoogleAdsLink} request.googleAdsLink - * The GoogleAdsLink to update - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to be updated. Field names must be in snake case - * (e.g., "field_to_update"). Omitted fields will not be updated. To replace - * the entire entity, use one path with the string "*" to match all fields. - * @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 [GoogleAdsLink]{@link google.analytics.admin.v1alpha.GoogleAdsLink}. - * 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/analytics_admin_service.update_google_ads_link.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateGoogleAdsLink_async - */ - updateGoogleAdsLink( - request?: protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IGoogleAdsLink, - protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest|undefined, {}|undefined - ]>; - updateGoogleAdsLink( - request: protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IGoogleAdsLink, - protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>): void; - updateGoogleAdsLink( - request: protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IGoogleAdsLink, - protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>): void; - updateGoogleAdsLink( - request?: protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IGoogleAdsLink, - protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IGoogleAdsLink, - protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IGoogleAdsLink, - protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest|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({ - 'google_ads_link.name': request.googleAdsLink!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateGoogleAdsLink(request, options, callback); - } -/** - * Deletes a GoogleAdsLink on a property - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Example format: properties/1234/googleAdsLinks/5678 - * @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 [Empty]{@link google.protobuf.Empty}. - * 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/analytics_admin_service.delete_google_ads_link.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteGoogleAdsLink_async - */ - deleteGoogleAdsLink( - request?: protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest|undefined, {}|undefined - ]>; - deleteGoogleAdsLink( - request: protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>): void; - deleteGoogleAdsLink( - request: protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>): void; - deleteGoogleAdsLink( - request?: protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest|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.deleteGoogleAdsLink(request, options, callback); - } -/** - * Get data sharing settings on an account. - * Data sharing settings are singletons. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the settings to lookup. - * Format: accounts/{account}/dataSharingSettings - * Example: "accounts/1000/dataSharingSettings" - * @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 [DataSharingSettings]{@link google.analytics.admin.v1alpha.DataSharingSettings}. - * 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/analytics_admin_service.get_data_sharing_settings.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataSharingSettings_async - */ - getDataSharingSettings( - request?: protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IDataSharingSettings, - protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest|undefined, {}|undefined - ]>; - getDataSharingSettings( - request: protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDataSharingSettings, - protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest|null|undefined, - {}|null|undefined>): void; - getDataSharingSettings( - request: protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDataSharingSettings, - protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest|null|undefined, - {}|null|undefined>): void; - getDataSharingSettings( - request?: protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IDataSharingSettings, - protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IDataSharingSettings, - protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IDataSharingSettings, - protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest|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.getDataSharingSettings(request, options, callback); - } -/** - * Lookup for a single "GA4" MeasurementProtocolSecret. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the measurement protocol secret to lookup. - * Format: - * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret} - * @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 [MeasurementProtocolSecret]{@link google.analytics.admin.v1alpha.MeasurementProtocolSecret}. - * 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/analytics_admin_service.get_measurement_protocol_secret.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetMeasurementProtocolSecret_async - */ - getMeasurementProtocolSecret( - request?: protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest|undefined, {}|undefined - ]>; - getMeasurementProtocolSecret( - request: protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): void; - getMeasurementProtocolSecret( - request: protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): void; - getMeasurementProtocolSecret( - request?: protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest|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.getMeasurementProtocolSecret(request, options, callback); - } -/** - * Creates a measurement protocol secret. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource where this secret will be created. - * Format: properties/{property}/dataStreams/{dataStream} - * @param {google.analytics.admin.v1alpha.MeasurementProtocolSecret} request.measurementProtocolSecret - * Required. The measurement protocol secret to create. - * @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 [MeasurementProtocolSecret]{@link google.analytics.admin.v1alpha.MeasurementProtocolSecret}. - * 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/analytics_admin_service.create_measurement_protocol_secret.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateMeasurementProtocolSecret_async - */ - createMeasurementProtocolSecret( - request?: protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest|undefined, {}|undefined - ]>; - createMeasurementProtocolSecret( - request: protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): void; - createMeasurementProtocolSecret( - request: protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): void; - createMeasurementProtocolSecret( - request?: protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createMeasurementProtocolSecret(request, options, callback); - } -/** - * Deletes target MeasurementProtocolSecret. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the MeasurementProtocolSecret to delete. - * Format: - * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret} - * @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 [Empty]{@link google.protobuf.Empty}. - * 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/analytics_admin_service.delete_measurement_protocol_secret.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteMeasurementProtocolSecret_async - */ - deleteMeasurementProtocolSecret( - request?: protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest|undefined, {}|undefined - ]>; - deleteMeasurementProtocolSecret( - request: protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): void; - deleteMeasurementProtocolSecret( - request: protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): void; - deleteMeasurementProtocolSecret( - request?: protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest|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.deleteMeasurementProtocolSecret(request, options, callback); - } -/** - * Updates a measurement protocol secret. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.analytics.admin.v1alpha.MeasurementProtocolSecret} request.measurementProtocolSecret - * Required. The measurement protocol secret to update. - * @param {google.protobuf.FieldMask} request.updateMask - * The list of fields to be updated. Omitted fields will not be updated. - * @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 [MeasurementProtocolSecret]{@link google.analytics.admin.v1alpha.MeasurementProtocolSecret}. - * 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/analytics_admin_service.update_measurement_protocol_secret.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateMeasurementProtocolSecret_async - */ - updateMeasurementProtocolSecret( - request?: protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest|undefined, {}|undefined - ]>; - updateMeasurementProtocolSecret( - request: protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): void; - updateMeasurementProtocolSecret( - request: protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): void; - updateMeasurementProtocolSecret( - request?: protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest|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({ - 'measurement_protocol_secret.name': request.measurementProtocolSecret!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateMeasurementProtocolSecret(request, options, callback); - } -/** - * Acknowledges the terms of user data collection for the specified property. - * - * This acknowledgement must be completed (either in the Google Analytics UI - * or via this API) before MeasurementProtocolSecret resources may be created. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.property - * Required. The property for which to acknowledge user data collection. - * @param {string} request.acknowledgement - * Required. An acknowledgement that the caller of this method understands the terms - * of user data collection. - * - * This field must contain the exact value: - * "I acknowledge that I have the necessary privacy disclosures and rights - * from my end users for the collection and processing of their data, - * including the association of such data with the visitation information - * Google Analytics collects from my site and/or app property." - * @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 [AcknowledgeUserDataCollectionResponse]{@link google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionResponse}. - * 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/analytics_admin_service.acknowledge_user_data_collection.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_AcknowledgeUserDataCollection_async - */ - acknowledgeUserDataCollection( - request?: protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionResponse, - protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest|undefined, {}|undefined - ]>; - acknowledgeUserDataCollection( - request: protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionResponse, - protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest|null|undefined, - {}|null|undefined>): void; - acknowledgeUserDataCollection( - request: protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionResponse, - protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest|null|undefined, - {}|null|undefined>): void; - acknowledgeUserDataCollection( - request?: protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionResponse, - protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionResponse, - protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionResponse, - protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest|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.acknowledgeUserDataCollection(request, options, callback); - } -/** - * Lookup for Google Signals settings for a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the google signals settings to retrieve. - * Format: properties/{property}/googleSignalsSettings - * @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 [GoogleSignalsSettings]{@link google.analytics.admin.v1alpha.GoogleSignalsSettings}. - * 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/analytics_admin_service.get_google_signals_settings.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetGoogleSignalsSettings_async - */ - getGoogleSignalsSettings( - request?: protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, - protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest|undefined, {}|undefined - ]>; - getGoogleSignalsSettings( - request: protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, - protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest|null|undefined, - {}|null|undefined>): void; - getGoogleSignalsSettings( - request: protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, - protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest|null|undefined, - {}|null|undefined>): void; - getGoogleSignalsSettings( - request?: protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, - protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, - protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, - protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest|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.getGoogleSignalsSettings(request, options, callback); - } -/** - * Updates Google Signals settings for a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.analytics.admin.v1alpha.GoogleSignalsSettings} request.googleSignalsSettings - * Required. The settings to update. - * The `name` field is used to identify the settings to be updated. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to be updated. Field names must be in snake case - * (e.g., "field_to_update"). Omitted fields will not be updated. To replace - * the entire entity, use one path with the string "*" to match all fields. - * @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 [GoogleSignalsSettings]{@link google.analytics.admin.v1alpha.GoogleSignalsSettings}. - * 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/analytics_admin_service.update_google_signals_settings.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateGoogleSignalsSettings_async - */ - updateGoogleSignalsSettings( - request?: protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, - protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest|undefined, {}|undefined - ]>; - updateGoogleSignalsSettings( - request: protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, - protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest|null|undefined, - {}|null|undefined>): void; - updateGoogleSignalsSettings( - request: protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, - protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest|null|undefined, - {}|null|undefined>): void; - updateGoogleSignalsSettings( - request?: protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, - protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, - protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, - protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest|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({ - 'google_signals_settings.name': request.googleSignalsSettings!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateGoogleSignalsSettings(request, options, callback); - } -/** - * Creates a conversion event with the specified attributes. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.analytics.admin.v1alpha.ConversionEvent} request.conversionEvent - * Required. The conversion event to create. - * @param {string} request.parent - * Required. The resource name of the parent property where this conversion event will - * be created. Format: properties/123 - * @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 [ConversionEvent]{@link google.analytics.admin.v1alpha.ConversionEvent}. - * 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/analytics_admin_service.create_conversion_event.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateConversionEvent_async - */ - createConversionEvent( - request?: protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IConversionEvent, - protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest|undefined, {}|undefined - ]>; - createConversionEvent( - request: protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IConversionEvent, - protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest|null|undefined, - {}|null|undefined>): void; - createConversionEvent( - request: protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IConversionEvent, - protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest|null|undefined, - {}|null|undefined>): void; - createConversionEvent( - request?: protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IConversionEvent, - protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IConversionEvent, - protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IConversionEvent, - protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createConversionEvent(request, options, callback); - } -/** - * Retrieve a single conversion event. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the conversion event to retrieve. - * Format: properties/{property}/conversionEvents/{conversion_event} - * Example: "properties/123/conversionEvents/456" - * @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 [ConversionEvent]{@link google.analytics.admin.v1alpha.ConversionEvent}. - * 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/analytics_admin_service.get_conversion_event.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetConversionEvent_async - */ - getConversionEvent( - request?: protos.google.analytics.admin.v1alpha.IGetConversionEventRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IConversionEvent, - protos.google.analytics.admin.v1alpha.IGetConversionEventRequest|undefined, {}|undefined - ]>; - getConversionEvent( - request: protos.google.analytics.admin.v1alpha.IGetConversionEventRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IConversionEvent, - protos.google.analytics.admin.v1alpha.IGetConversionEventRequest|null|undefined, - {}|null|undefined>): void; - getConversionEvent( - request: protos.google.analytics.admin.v1alpha.IGetConversionEventRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IConversionEvent, - protos.google.analytics.admin.v1alpha.IGetConversionEventRequest|null|undefined, - {}|null|undefined>): void; - getConversionEvent( - request?: protos.google.analytics.admin.v1alpha.IGetConversionEventRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IConversionEvent, - protos.google.analytics.admin.v1alpha.IGetConversionEventRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IConversionEvent, - protos.google.analytics.admin.v1alpha.IGetConversionEventRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IConversionEvent, - protos.google.analytics.admin.v1alpha.IGetConversionEventRequest|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.getConversionEvent(request, options, callback); - } -/** - * Deletes a conversion event in a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the conversion event to delete. - * Format: properties/{property}/conversionEvents/{conversion_event} - * Example: "properties/123/conversionEvents/456" - * @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 [Empty]{@link google.protobuf.Empty}. - * 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/analytics_admin_service.delete_conversion_event.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteConversionEvent_async - */ - deleteConversionEvent( - request?: protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest|undefined, {}|undefined - ]>; - deleteConversionEvent( - request: protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest|null|undefined, - {}|null|undefined>): void; - deleteConversionEvent( - request: protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest|null|undefined, - {}|null|undefined>): void; - deleteConversionEvent( - request?: protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest|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.deleteConversionEvent(request, options, callback); - } -/** - * Look up a single DisplayVideo360AdvertiserLink - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the DisplayVideo360AdvertiserLink to get. - * Example format: properties/1234/displayVideo360AdvertiserLink/5678 - * @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 [DisplayVideo360AdvertiserLink]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink}. - * 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/analytics_admin_service.get_display_video360_advertiser_link.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDisplayVideo360AdvertiserLink_async - */ - getDisplayVideo360AdvertiserLink( - request?: protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, - protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest|undefined, {}|undefined - ]>; - getDisplayVideo360AdvertiserLink( - request: protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, - protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest|null|undefined, - {}|null|undefined>): void; - getDisplayVideo360AdvertiserLink( - request: protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, - protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest|null|undefined, - {}|null|undefined>): void; - getDisplayVideo360AdvertiserLink( - request?: protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, - protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, - protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, - protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest|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.getDisplayVideo360AdvertiserLink(request, options, callback); - } -/** - * Creates a DisplayVideo360AdvertiserLink. - * This can only be utilized by users who have proper authorization both on - * the Google Analytics property and on the Display & Video 360 advertiser. - * Users who do not have access to the Display & Video 360 advertiser should - * instead seek to create a DisplayVideo360LinkProposal. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink} request.displayVideo_360AdvertiserLink - * Required. The DisplayVideo360AdvertiserLink to create. - * @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 [DisplayVideo360AdvertiserLink]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink}. - * 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/analytics_admin_service.create_display_video360_advertiser_link.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDisplayVideo360AdvertiserLink_async - */ - createDisplayVideo360AdvertiserLink( - request?: protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, - protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest|undefined, {}|undefined - ]>; - createDisplayVideo360AdvertiserLink( - request: protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, - protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest|null|undefined, - {}|null|undefined>): void; - createDisplayVideo360AdvertiserLink( - request: protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, - protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest|null|undefined, - {}|null|undefined>): void; - createDisplayVideo360AdvertiserLink( - request?: protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, - protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, - protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, - protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createDisplayVideo360AdvertiserLink(request, options, callback); - } -/** - * Deletes a DisplayVideo360AdvertiserLink on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the DisplayVideo360AdvertiserLink to delete. - * Example format: properties/1234/displayVideo360AdvertiserLinks/5678 - * @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 [Empty]{@link google.protobuf.Empty}. - * 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/analytics_admin_service.delete_display_video360_advertiser_link.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDisplayVideo360AdvertiserLink_async - */ - deleteDisplayVideo360AdvertiserLink( - request?: protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest|undefined, {}|undefined - ]>; - deleteDisplayVideo360AdvertiserLink( - request: protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest|null|undefined, - {}|null|undefined>): void; - deleteDisplayVideo360AdvertiserLink( - request: protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest|null|undefined, - {}|null|undefined>): void; - deleteDisplayVideo360AdvertiserLink( - request?: protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest|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.deleteDisplayVideo360AdvertiserLink(request, options, callback); - } -/** - * Updates a DisplayVideo360AdvertiserLink on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink} request.displayVideo_360AdvertiserLink - * The DisplayVideo360AdvertiserLink to update - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to be updated. Omitted fields will not be updated. - * To replace the entire entity, use one path with the string "*" to match - * all fields. - * @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 [DisplayVideo360AdvertiserLink]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink}. - * 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/analytics_admin_service.update_display_video360_advertiser_link.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDisplayVideo360AdvertiserLink_async - */ - updateDisplayVideo360AdvertiserLink( - request?: protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, - protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest|undefined, {}|undefined - ]>; - updateDisplayVideo360AdvertiserLink( - request: protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, - protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest|null|undefined, - {}|null|undefined>): void; - updateDisplayVideo360AdvertiserLink( - request: protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, - protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest|null|undefined, - {}|null|undefined>): void; - updateDisplayVideo360AdvertiserLink( - request?: protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, - protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, - protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, - protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest|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({ - 'display_video_360_advertiser_link.name': request.displayVideo_360AdvertiserLink!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateDisplayVideo360AdvertiserLink(request, options, callback); - } -/** - * Lookup for a single DisplayVideo360AdvertiserLinkProposal. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the DisplayVideo360AdvertiserLinkProposal to get. - * Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 - * @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 [DisplayVideo360AdvertiserLinkProposal]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal}. - * 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/analytics_admin_service.get_display_video360_advertiser_link_proposal.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDisplayVideo360AdvertiserLinkProposal_async - */ - getDisplayVideo360AdvertiserLinkProposal( - request?: protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, - protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest|undefined, {}|undefined - ]>; - getDisplayVideo360AdvertiserLinkProposal( - request: protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, - protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, - {}|null|undefined>): void; - getDisplayVideo360AdvertiserLinkProposal( - request: protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, - protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, - {}|null|undefined>): void; - getDisplayVideo360AdvertiserLinkProposal( - request?: protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, - protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, - protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, - protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest|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.getDisplayVideo360AdvertiserLinkProposal(request, options, callback); - } -/** - * Creates a DisplayVideo360AdvertiserLinkProposal. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal} request.displayVideo_360AdvertiserLinkProposal - * Required. The DisplayVideo360AdvertiserLinkProposal to create. - * @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 [DisplayVideo360AdvertiserLinkProposal]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal}. - * 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/analytics_admin_service.create_display_video360_advertiser_link_proposal.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDisplayVideo360AdvertiserLinkProposal_async - */ - createDisplayVideo360AdvertiserLinkProposal( - request?: protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, - protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest|undefined, {}|undefined - ]>; - createDisplayVideo360AdvertiserLinkProposal( - request: protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, - protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, - {}|null|undefined>): void; - createDisplayVideo360AdvertiserLinkProposal( - request: protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, - protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, - {}|null|undefined>): void; - createDisplayVideo360AdvertiserLinkProposal( - request?: protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, - protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, - protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, - protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal(request, options, callback); - } -/** - * Deletes a DisplayVideo360AdvertiserLinkProposal on a property. - * This can only be used on cancelled proposals. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the DisplayVideo360AdvertiserLinkProposal to delete. - * Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 - * @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 [Empty]{@link google.protobuf.Empty}. - * 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/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDisplayVideo360AdvertiserLinkProposal_async - */ - deleteDisplayVideo360AdvertiserLinkProposal( - request?: protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest|undefined, {}|undefined - ]>; - deleteDisplayVideo360AdvertiserLinkProposal( - request: protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, - {}|null|undefined>): void; - deleteDisplayVideo360AdvertiserLinkProposal( - request: protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, - {}|null|undefined>): void; - deleteDisplayVideo360AdvertiserLinkProposal( - request?: protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest|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.deleteDisplayVideo360AdvertiserLinkProposal(request, options, callback); - } -/** - * Approves a DisplayVideo360AdvertiserLinkProposal. - * The DisplayVideo360AdvertiserLinkProposal will be deleted and a new - * DisplayVideo360AdvertiserLink will be created. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the DisplayVideo360AdvertiserLinkProposal to approve. - * Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 - * @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 [ApproveDisplayVideo360AdvertiserLinkProposalResponse]{@link google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalResponse}. - * 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/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ApproveDisplayVideo360AdvertiserLinkProposal_async - */ - approveDisplayVideo360AdvertiserLinkProposal( - request?: protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalResponse, - protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest|undefined, {}|undefined - ]>; - approveDisplayVideo360AdvertiserLinkProposal( - request: protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalResponse, - protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, - {}|null|undefined>): void; - approveDisplayVideo360AdvertiserLinkProposal( - request: protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalResponse, - protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, - {}|null|undefined>): void; - approveDisplayVideo360AdvertiserLinkProposal( - request?: protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalResponse, - protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalResponse, - protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalResponse, - protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest|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.approveDisplayVideo360AdvertiserLinkProposal(request, options, callback); - } -/** - * Cancels a DisplayVideo360AdvertiserLinkProposal. - * Cancelling can mean either: - * - Declining a proposal initiated from Display & Video 360 - * - Withdrawing a proposal initiated from Google Analytics - * After being cancelled, a proposal will eventually be deleted automatically. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the DisplayVideo360AdvertiserLinkProposal to cancel. - * Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678 - * @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 [DisplayVideo360AdvertiserLinkProposal]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal}. - * 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/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CancelDisplayVideo360AdvertiserLinkProposal_async - */ - cancelDisplayVideo360AdvertiserLinkProposal( - request?: protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, - protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest|undefined, {}|undefined - ]>; - cancelDisplayVideo360AdvertiserLinkProposal( - request: protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, - protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, - {}|null|undefined>): void; - cancelDisplayVideo360AdvertiserLinkProposal( - request: protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, - protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, - {}|null|undefined>): void; - cancelDisplayVideo360AdvertiserLinkProposal( - request?: protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, - protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, - protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, - protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest|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.cancelDisplayVideo360AdvertiserLinkProposal(request, options, callback); - } -/** - * Creates a CustomDimension. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {google.analytics.admin.v1alpha.CustomDimension} request.customDimension - * Required. The CustomDimension to create. - * @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 [CustomDimension]{@link google.analytics.admin.v1alpha.CustomDimension}. - * 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/analytics_admin_service.create_custom_dimension.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateCustomDimension_async - */ - createCustomDimension( - request?: protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.ICustomDimension, - protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest|undefined, {}|undefined - ]>; - createCustomDimension( - request: protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.ICustomDimension, - protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest|null|undefined, - {}|null|undefined>): void; - createCustomDimension( - request: protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.ICustomDimension, - protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest|null|undefined, - {}|null|undefined>): void; - createCustomDimension( - request?: protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.ICustomDimension, - protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.ICustomDimension, - protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.ICustomDimension, - protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createCustomDimension(request, options, callback); - } -/** - * Updates a CustomDimension on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.analytics.admin.v1alpha.CustomDimension} request.customDimension - * The CustomDimension to update - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to be updated. Omitted fields will not be updated. - * To replace the entire entity, use one path with the string "*" to match - * all fields. - * @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 [CustomDimension]{@link google.analytics.admin.v1alpha.CustomDimension}. - * 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/analytics_admin_service.update_custom_dimension.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateCustomDimension_async - */ - updateCustomDimension( - request?: protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.ICustomDimension, - protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest|undefined, {}|undefined - ]>; - updateCustomDimension( - request: protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.ICustomDimension, - protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest|null|undefined, - {}|null|undefined>): void; - updateCustomDimension( - request: protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.ICustomDimension, - protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest|null|undefined, - {}|null|undefined>): void; - updateCustomDimension( - request?: protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.ICustomDimension, - protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.ICustomDimension, - protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.ICustomDimension, - protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest|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({ - 'custom_dimension.name': request.customDimension!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateCustomDimension(request, options, callback); - } -/** - * Archives a CustomDimension on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the CustomDimension to archive. - * Example format: properties/1234/customDimensions/5678 - * @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 [Empty]{@link google.protobuf.Empty}. - * 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/analytics_admin_service.archive_custom_dimension.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveCustomDimension_async - */ - archiveCustomDimension( - request?: protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest|undefined, {}|undefined - ]>; - archiveCustomDimension( - request: protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest|null|undefined, - {}|null|undefined>): void; - archiveCustomDimension( - request: protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest|null|undefined, - {}|null|undefined>): void; - archiveCustomDimension( - request?: protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest|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.archiveCustomDimension(request, options, callback); - } -/** - * Lookup for a single CustomDimension. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the CustomDimension to get. - * Example format: properties/1234/customDimensions/5678 - * @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 [CustomDimension]{@link google.analytics.admin.v1alpha.CustomDimension}. - * 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/analytics_admin_service.get_custom_dimension.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetCustomDimension_async - */ - getCustomDimension( - request?: protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.ICustomDimension, - protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest|undefined, {}|undefined - ]>; - getCustomDimension( - request: protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.ICustomDimension, - protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest|null|undefined, - {}|null|undefined>): void; - getCustomDimension( - request: protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.ICustomDimension, - protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest|null|undefined, - {}|null|undefined>): void; - getCustomDimension( - request?: protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.ICustomDimension, - protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.ICustomDimension, - protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.ICustomDimension, - protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest|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.getCustomDimension(request, options, callback); - } -/** - * Creates a CustomMetric. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {google.analytics.admin.v1alpha.CustomMetric} request.customMetric - * Required. The CustomMetric to create. - * @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 [CustomMetric]{@link google.analytics.admin.v1alpha.CustomMetric}. - * 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/analytics_admin_service.create_custom_metric.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateCustomMetric_async - */ - createCustomMetric( - request?: protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.ICustomMetric, - protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest|undefined, {}|undefined - ]>; - createCustomMetric( - request: protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.ICustomMetric, - protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest|null|undefined, - {}|null|undefined>): void; - createCustomMetric( - request: protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.ICustomMetric, - protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest|null|undefined, - {}|null|undefined>): void; - createCustomMetric( - request?: protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.ICustomMetric, - protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.ICustomMetric, - protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.ICustomMetric, - protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createCustomMetric(request, options, callback); - } -/** - * Updates a CustomMetric on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.analytics.admin.v1alpha.CustomMetric} request.customMetric - * The CustomMetric to update - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to be updated. Omitted fields will not be updated. - * To replace the entire entity, use one path with the string "*" to match - * all fields. - * @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 [CustomMetric]{@link google.analytics.admin.v1alpha.CustomMetric}. - * 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/analytics_admin_service.update_custom_metric.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateCustomMetric_async - */ - updateCustomMetric( - request?: protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.ICustomMetric, - protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest|undefined, {}|undefined - ]>; - updateCustomMetric( - request: protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.ICustomMetric, - protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest|null|undefined, - {}|null|undefined>): void; - updateCustomMetric( - request: protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.ICustomMetric, - protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest|null|undefined, - {}|null|undefined>): void; - updateCustomMetric( - request?: protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.ICustomMetric, - protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.ICustomMetric, - protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.ICustomMetric, - protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest|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({ - 'custom_metric.name': request.customMetric!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateCustomMetric(request, options, callback); - } -/** - * Archives a CustomMetric on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the CustomMetric to archive. - * Example format: properties/1234/customMetrics/5678 - * @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 [Empty]{@link google.protobuf.Empty}. - * 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/analytics_admin_service.archive_custom_metric.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveCustomMetric_async - */ - archiveCustomMetric( - request?: protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest|undefined, {}|undefined - ]>; - archiveCustomMetric( - request: protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest|null|undefined, - {}|null|undefined>): void; - archiveCustomMetric( - request: protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest|null|undefined, - {}|null|undefined>): void; - archiveCustomMetric( - request?: protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest|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.archiveCustomMetric(request, options, callback); - } -/** - * Lookup for a single CustomMetric. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the CustomMetric to get. - * Example format: properties/1234/customMetrics/5678 - * @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 [CustomMetric]{@link google.analytics.admin.v1alpha.CustomMetric}. - * 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/analytics_admin_service.get_custom_metric.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetCustomMetric_async - */ - getCustomMetric( - request?: protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.ICustomMetric, - protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest|undefined, {}|undefined - ]>; - getCustomMetric( - request: protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.ICustomMetric, - protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest|null|undefined, - {}|null|undefined>): void; - getCustomMetric( - request: protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.ICustomMetric, - protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest|null|undefined, - {}|null|undefined>): void; - getCustomMetric( - request?: protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.ICustomMetric, - protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.ICustomMetric, - protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.ICustomMetric, - protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest|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.getCustomMetric(request, options, callback); - } -/** - * Returns the singleton data retention settings for this property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the settings to lookup. - * Format: - * properties/{property}/dataRetentionSettings - * Example: "properties/1000/dataRetentionSettings" - * @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 [DataRetentionSettings]{@link google.analytics.admin.v1alpha.DataRetentionSettings}. - * 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/analytics_admin_service.get_data_retention_settings.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataRetentionSettings_async - */ - getDataRetentionSettings( - request?: protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IDataRetentionSettings, - protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest|undefined, {}|undefined - ]>; - getDataRetentionSettings( - request: protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDataRetentionSettings, - protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest|null|undefined, - {}|null|undefined>): void; - getDataRetentionSettings( - request: protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDataRetentionSettings, - protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest|null|undefined, - {}|null|undefined>): void; - getDataRetentionSettings( - request?: protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IDataRetentionSettings, - protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IDataRetentionSettings, - protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IDataRetentionSettings, - protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest|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.getDataRetentionSettings(request, options, callback); - } -/** - * Updates the singleton data retention settings for this property. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.analytics.admin.v1alpha.DataRetentionSettings} request.dataRetentionSettings - * Required. The settings to update. - * The `name` field is used to identify the settings to be updated. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to be updated. Field names must be in snake case - * (e.g., "field_to_update"). Omitted fields will not be updated. To replace - * the entire entity, use one path with the string "*" to match all fields. - * @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 [DataRetentionSettings]{@link google.analytics.admin.v1alpha.DataRetentionSettings}. - * 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/analytics_admin_service.update_data_retention_settings.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDataRetentionSettings_async - */ - updateDataRetentionSettings( - request?: protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IDataRetentionSettings, - protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest|undefined, {}|undefined - ]>; - updateDataRetentionSettings( - request: protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDataRetentionSettings, - protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest|null|undefined, - {}|null|undefined>): void; - updateDataRetentionSettings( - request: protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDataRetentionSettings, - protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest|null|undefined, - {}|null|undefined>): void; - updateDataRetentionSettings( - request?: protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IDataRetentionSettings, - protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IDataRetentionSettings, - protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IDataRetentionSettings, - protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest|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({ - 'data_retention_settings.name': request.dataRetentionSettings!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateDataRetentionSettings(request, options, callback); - } -/** - * Creates a DataStream. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {google.analytics.admin.v1alpha.DataStream} request.dataStream - * Required. The DataStream to create. - * @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 [DataStream]{@link google.analytics.admin.v1alpha.DataStream}. - * 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/analytics_admin_service.create_data_stream.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDataStream_async - */ - createDataStream( - request?: protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IDataStream, - protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest|undefined, {}|undefined - ]>; - createDataStream( - request: protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDataStream, - protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest|null|undefined, - {}|null|undefined>): void; - createDataStream( - request: protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDataStream, - protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest|null|undefined, - {}|null|undefined>): void; - createDataStream( - request?: protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IDataStream, - protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IDataStream, - protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IDataStream, - protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createDataStream(request, options, callback); - } -/** - * Deletes a DataStream on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the DataStream to delete. - * Example format: properties/1234/dataStreams/5678 - * @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 [Empty]{@link google.protobuf.Empty}. - * 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/analytics_admin_service.delete_data_stream.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDataStream_async - */ - deleteDataStream( - request?: protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest|undefined, {}|undefined - ]>; - deleteDataStream( - request: protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest|null|undefined, - {}|null|undefined>): void; - deleteDataStream( - request: protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest|null|undefined, - {}|null|undefined>): void; - deleteDataStream( - request?: protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest|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.deleteDataStream(request, options, callback); - } -/** - * Updates a DataStream on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.analytics.admin.v1alpha.DataStream} request.dataStream - * The DataStream to update - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to be updated. Omitted fields will not be updated. - * To replace the entire entity, use one path with the string "*" to match - * all fields. - * @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 [DataStream]{@link google.analytics.admin.v1alpha.DataStream}. - * 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/analytics_admin_service.update_data_stream.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDataStream_async - */ - updateDataStream( - request?: protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IDataStream, - protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest|undefined, {}|undefined - ]>; - updateDataStream( - request: protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDataStream, - protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest|null|undefined, - {}|null|undefined>): void; - updateDataStream( - request: protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDataStream, - protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest|null|undefined, - {}|null|undefined>): void; - updateDataStream( - request?: protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IDataStream, - protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IDataStream, - protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IDataStream, - protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest|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({ - 'data_stream.name': request.dataStream!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateDataStream(request, options, callback); - } -/** - * Lookup for a single DataStream. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the DataStream to get. - * Example format: properties/1234/dataStreams/5678 - * @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 [DataStream]{@link google.analytics.admin.v1alpha.DataStream}. - * 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/analytics_admin_service.get_data_stream.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataStream_async - */ - getDataStream( - request?: protos.google.analytics.admin.v1alpha.IGetDataStreamRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IDataStream, - protos.google.analytics.admin.v1alpha.IGetDataStreamRequest|undefined, {}|undefined - ]>; - getDataStream( - request: protos.google.analytics.admin.v1alpha.IGetDataStreamRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDataStream, - protos.google.analytics.admin.v1alpha.IGetDataStreamRequest|null|undefined, - {}|null|undefined>): void; - getDataStream( - request: protos.google.analytics.admin.v1alpha.IGetDataStreamRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IDataStream, - protos.google.analytics.admin.v1alpha.IGetDataStreamRequest|null|undefined, - {}|null|undefined>): void; - getDataStream( - request?: protos.google.analytics.admin.v1alpha.IGetDataStreamRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IDataStream, - protos.google.analytics.admin.v1alpha.IGetDataStreamRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IDataStream, - protos.google.analytics.admin.v1alpha.IGetDataStreamRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IDataStream, - protos.google.analytics.admin.v1alpha.IGetDataStreamRequest|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.getDataStream(request, options, callback); - } - - /** - * Returns all accounts accessible by the caller. - * - * Note that these accounts might not currently have GA4 properties. - * Soft-deleted (ie: "trashed") accounts are excluded by default. - * Returns an empty list if no relevant accounts are found. - * - * @param {Object} request - * The request object that will be sent. - * @param {number} request.pageSize - * The maximum number of resources to return. The service may return - * fewer than this value, even if there are additional pages. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200; (higher values will be coerced to the maximum) - * @param {string} request.pageToken - * A page token, received from a previous `ListAccounts` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListAccounts` must - * match the call that provided the page token. - * @param {boolean} request.showDeleted - * Whether to include soft-deleted (ie: "trashed") Accounts in the - * results. Accounts can be inspected to determine whether they are deleted or - * not. - * @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 Array of [Account]{@link google.analytics.admin.v1alpha.Account}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listAccountsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listAccounts( - request?: protos.google.analytics.admin.v1alpha.IListAccountsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IAccount[], - protos.google.analytics.admin.v1alpha.IListAccountsRequest|null, - protos.google.analytics.admin.v1alpha.IListAccountsResponse - ]>; - listAccounts( - request: protos.google.analytics.admin.v1alpha.IListAccountsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListAccountsRequest, - protos.google.analytics.admin.v1alpha.IListAccountsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IAccount>): void; - listAccounts( - request: protos.google.analytics.admin.v1alpha.IListAccountsRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListAccountsRequest, - protos.google.analytics.admin.v1alpha.IListAccountsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IAccount>): void; - listAccounts( - request?: protos.google.analytics.admin.v1alpha.IListAccountsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1alpha.IListAccountsRequest, - protos.google.analytics.admin.v1alpha.IListAccountsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IAccount>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListAccountsRequest, - protos.google.analytics.admin.v1alpha.IListAccountsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IAccount>): - Promise<[ - protos.google.analytics.admin.v1alpha.IAccount[], - protos.google.analytics.admin.v1alpha.IListAccountsRequest|null, - protos.google.analytics.admin.v1alpha.IListAccountsResponse - ]>|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 || {}; - this.initialize(); - return this.innerApiCalls.listAccounts(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {number} request.pageSize - * The maximum number of resources to return. The service may return - * fewer than this value, even if there are additional pages. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200; (higher values will be coerced to the maximum) - * @param {string} request.pageToken - * A page token, received from a previous `ListAccounts` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListAccounts` must - * match the call that provided the page token. - * @param {boolean} request.showDeleted - * Whether to include soft-deleted (ie: "trashed") Accounts in the - * results. Accounts can be inspected to determine whether they are deleted or - * not. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Account]{@link google.analytics.admin.v1alpha.Account} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listAccountsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listAccountsStream( - request?: protos.google.analytics.admin.v1alpha.IListAccountsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - const defaultCallSettings = this._defaults['listAccounts']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAccounts.createStream( - this.innerApiCalls.listAccounts as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAccounts`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {number} request.pageSize - * The maximum number of resources to return. The service may return - * fewer than this value, even if there are additional pages. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200; (higher values will be coerced to the maximum) - * @param {string} request.pageToken - * A page token, received from a previous `ListAccounts` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListAccounts` must - * match the call that provided the page token. - * @param {boolean} request.showDeleted - * Whether to include soft-deleted (ie: "trashed") Accounts in the - * results. Accounts can be inspected to determine whether they are deleted or - * not. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Account]{@link google.analytics.admin.v1alpha.Account}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha/analytics_admin_service.list_accounts.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccounts_async - */ - listAccountsAsync( - request?: protos.google.analytics.admin.v1alpha.IListAccountsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - const defaultCallSettings = this._defaults['listAccounts']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAccounts.asyncIterate( - this.innerApiCalls['listAccounts'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Returns summaries of all accounts accessible by the caller. - * - * @param {Object} request - * The request object that will be sent. - * @param {number} request.pageSize - * The maximum number of AccountSummary resources to return. The service may - * return fewer than this value, even if there are additional pages. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200; (higher values will be coerced to the maximum) - * @param {string} request.pageToken - * A page token, received from a previous `ListAccountSummaries` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListAccountSummaries` - * must match the call that provided the page token. - * @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 Array of [AccountSummary]{@link google.analytics.admin.v1alpha.AccountSummary}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listAccountSummariesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listAccountSummaries( - request?: protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IAccountSummary[], - protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest|null, - protos.google.analytics.admin.v1alpha.IListAccountSummariesResponse - ]>; - listAccountSummaries( - request: protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest, - protos.google.analytics.admin.v1alpha.IListAccountSummariesResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IAccountSummary>): void; - listAccountSummaries( - request: protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest, - protos.google.analytics.admin.v1alpha.IListAccountSummariesResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IAccountSummary>): void; - listAccountSummaries( - request?: protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest, - protos.google.analytics.admin.v1alpha.IListAccountSummariesResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IAccountSummary>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest, - protos.google.analytics.admin.v1alpha.IListAccountSummariesResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IAccountSummary>): - Promise<[ - protos.google.analytics.admin.v1alpha.IAccountSummary[], - protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest|null, - protos.google.analytics.admin.v1alpha.IListAccountSummariesResponse - ]>|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 || {}; - this.initialize(); - return this.innerApiCalls.listAccountSummaries(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {number} request.pageSize - * The maximum number of AccountSummary resources to return. The service may - * return fewer than this value, even if there are additional pages. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200; (higher values will be coerced to the maximum) - * @param {string} request.pageToken - * A page token, received from a previous `ListAccountSummaries` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListAccountSummaries` - * must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [AccountSummary]{@link google.analytics.admin.v1alpha.AccountSummary} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listAccountSummariesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listAccountSummariesStream( - request?: protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - const defaultCallSettings = this._defaults['listAccountSummaries']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAccountSummaries.createStream( - this.innerApiCalls.listAccountSummaries as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAccountSummaries`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {number} request.pageSize - * The maximum number of AccountSummary resources to return. The service may - * return fewer than this value, even if there are additional pages. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200; (higher values will be coerced to the maximum) - * @param {string} request.pageToken - * A page token, received from a previous `ListAccountSummaries` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListAccountSummaries` - * must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [AccountSummary]{@link google.analytics.admin.v1alpha.AccountSummary}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha/analytics_admin_service.list_account_summaries.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccountSummaries_async - */ - listAccountSummariesAsync( - request?: protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - const defaultCallSettings = this._defaults['listAccountSummaries']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAccountSummaries.asyncIterate( - this.innerApiCalls['listAccountSummaries'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Returns child Properties under the specified parent Account. - * - * Only "GA4" properties will be returned. - * Properties will be excluded if the caller does not have access. - * Soft-deleted (ie: "trashed") properties are excluded by default. - * Returns an empty list if no relevant properties are found. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.filter - * Required. An expression for filtering the results of the request. - * Fields eligible for filtering are: - * `parent:`(The resource name of the parent account/property) or - * `ancestor:`(The resource name of the parent account) or - * `firebase_project:`(The id or number of the linked firebase project). - * Some examples of filters: - * - * ``` - * | Filter | Description | - * |-----------------------------|-------------------------------------------| - * | parent:accounts/123 | The account with account id: 123. | - * | parent:properties/123 | The property with property id: 123. | - * | ancestor:accounts/123 | The account with account id: 123. | - * | firebase_project:project-id | The firebase project with id: project-id. | - * | firebase_project:123 | The firebase project with number: 123. | - * ``` - * @param {number} request.pageSize - * The maximum number of resources to return. The service may return - * fewer than this value, even if there are additional pages. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200; (higher values will be coerced to the maximum) - * @param {string} request.pageToken - * A page token, received from a previous `ListProperties` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListProperties` must - * match the call that provided the page token. - * @param {boolean} request.showDeleted - * Whether to include soft-deleted (ie: "trashed") Properties in the - * results. Properties can be inspected to determine whether they are deleted - * or not. - * @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 Array of [Property]{@link google.analytics.admin.v1alpha.Property}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listPropertiesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listProperties( - request?: protos.google.analytics.admin.v1alpha.IListPropertiesRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IProperty[], - protos.google.analytics.admin.v1alpha.IListPropertiesRequest|null, - protos.google.analytics.admin.v1alpha.IListPropertiesResponse - ]>; - listProperties( - request: protos.google.analytics.admin.v1alpha.IListPropertiesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListPropertiesRequest, - protos.google.analytics.admin.v1alpha.IListPropertiesResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IProperty>): void; - listProperties( - request: protos.google.analytics.admin.v1alpha.IListPropertiesRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListPropertiesRequest, - protos.google.analytics.admin.v1alpha.IListPropertiesResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IProperty>): void; - listProperties( - request?: protos.google.analytics.admin.v1alpha.IListPropertiesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1alpha.IListPropertiesRequest, - protos.google.analytics.admin.v1alpha.IListPropertiesResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IProperty>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListPropertiesRequest, - protos.google.analytics.admin.v1alpha.IListPropertiesResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IProperty>): - Promise<[ - protos.google.analytics.admin.v1alpha.IProperty[], - protos.google.analytics.admin.v1alpha.IListPropertiesRequest|null, - protos.google.analytics.admin.v1alpha.IListPropertiesResponse - ]>|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 || {}; - this.initialize(); - return this.innerApiCalls.listProperties(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.filter - * Required. An expression for filtering the results of the request. - * Fields eligible for filtering are: - * `parent:`(The resource name of the parent account/property) or - * `ancestor:`(The resource name of the parent account) or - * `firebase_project:`(The id or number of the linked firebase project). - * Some examples of filters: - * - * ``` - * | Filter | Description | - * |-----------------------------|-------------------------------------------| - * | parent:accounts/123 | The account with account id: 123. | - * | parent:properties/123 | The property with property id: 123. | - * | ancestor:accounts/123 | The account with account id: 123. | - * | firebase_project:project-id | The firebase project with id: project-id. | - * | firebase_project:123 | The firebase project with number: 123. | - * ``` - * @param {number} request.pageSize - * The maximum number of resources to return. The service may return - * fewer than this value, even if there are additional pages. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200; (higher values will be coerced to the maximum) - * @param {string} request.pageToken - * A page token, received from a previous `ListProperties` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListProperties` must - * match the call that provided the page token. - * @param {boolean} request.showDeleted - * Whether to include soft-deleted (ie: "trashed") Properties in the - * results. Properties can be inspected to determine whether they are deleted - * or not. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Property]{@link google.analytics.admin.v1alpha.Property} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listPropertiesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listPropertiesStream( - request?: protos.google.analytics.admin.v1alpha.IListPropertiesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - const defaultCallSettings = this._defaults['listProperties']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listProperties.createStream( - this.innerApiCalls.listProperties as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listProperties`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.filter - * Required. An expression for filtering the results of the request. - * Fields eligible for filtering are: - * `parent:`(The resource name of the parent account/property) or - * `ancestor:`(The resource name of the parent account) or - * `firebase_project:`(The id or number of the linked firebase project). - * Some examples of filters: - * - * ``` - * | Filter | Description | - * |-----------------------------|-------------------------------------------| - * | parent:accounts/123 | The account with account id: 123. | - * | parent:properties/123 | The property with property id: 123. | - * | ancestor:accounts/123 | The account with account id: 123. | - * | firebase_project:project-id | The firebase project with id: project-id. | - * | firebase_project:123 | The firebase project with number: 123. | - * ``` - * @param {number} request.pageSize - * The maximum number of resources to return. The service may return - * fewer than this value, even if there are additional pages. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200; (higher values will be coerced to the maximum) - * @param {string} request.pageToken - * A page token, received from a previous `ListProperties` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListProperties` must - * match the call that provided the page token. - * @param {boolean} request.showDeleted - * Whether to include soft-deleted (ie: "trashed") Properties in the - * results. Properties can be inspected to determine whether they are deleted - * or not. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Property]{@link google.analytics.admin.v1alpha.Property}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha/analytics_admin_service.list_properties.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListProperties_async - */ - listPropertiesAsync( - request?: protos.google.analytics.admin.v1alpha.IListPropertiesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - const defaultCallSettings = this._defaults['listProperties']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listProperties.asyncIterate( - this.innerApiCalls['listProperties'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists all user links on an account or property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: accounts/1234 - * @param {number} request.pageSize - * The maximum number of user links to return. - * The service may return fewer than this value. - * If unspecified, at most 200 user links will be returned. - * The maximum value is 500; values above 500 will be coerced to 500. - * @param {string} request.pageToken - * A page token, received from a previous `ListUserLinks` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListUserLinks` must - * match the call that provided the page token. - * @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 Array of [UserLink]{@link google.analytics.admin.v1alpha.UserLink}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listUserLinksAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listUserLinks( - request?: protos.google.analytics.admin.v1alpha.IListUserLinksRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IUserLink[], - protos.google.analytics.admin.v1alpha.IListUserLinksRequest|null, - protos.google.analytics.admin.v1alpha.IListUserLinksResponse - ]>; - listUserLinks( - request: protos.google.analytics.admin.v1alpha.IListUserLinksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListUserLinksRequest, - protos.google.analytics.admin.v1alpha.IListUserLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IUserLink>): void; - listUserLinks( - request: protos.google.analytics.admin.v1alpha.IListUserLinksRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListUserLinksRequest, - protos.google.analytics.admin.v1alpha.IListUserLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IUserLink>): void; - listUserLinks( - request?: protos.google.analytics.admin.v1alpha.IListUserLinksRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1alpha.IListUserLinksRequest, - protos.google.analytics.admin.v1alpha.IListUserLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IUserLink>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListUserLinksRequest, - protos.google.analytics.admin.v1alpha.IListUserLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IUserLink>): - Promise<[ - protos.google.analytics.admin.v1alpha.IUserLink[], - protos.google.analytics.admin.v1alpha.IListUserLinksRequest|null, - protos.google.analytics.admin.v1alpha.IListUserLinksResponse - ]>|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listUserLinks(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: accounts/1234 - * @param {number} request.pageSize - * The maximum number of user links to return. - * The service may return fewer than this value. - * If unspecified, at most 200 user links will be returned. - * The maximum value is 500; values above 500 will be coerced to 500. - * @param {string} request.pageToken - * A page token, received from a previous `ListUserLinks` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListUserLinks` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [UserLink]{@link google.analytics.admin.v1alpha.UserLink} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listUserLinksAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listUserLinksStream( - request?: protos.google.analytics.admin.v1alpha.IListUserLinksRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listUserLinks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listUserLinks.createStream( - this.innerApiCalls.listUserLinks as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listUserLinks`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: accounts/1234 - * @param {number} request.pageSize - * The maximum number of user links to return. - * The service may return fewer than this value. - * If unspecified, at most 200 user links will be returned. - * The maximum value is 500; values above 500 will be coerced to 500. - * @param {string} request.pageToken - * A page token, received from a previous `ListUserLinks` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListUserLinks` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [UserLink]{@link google.analytics.admin.v1alpha.UserLink}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha/analytics_admin_service.list_user_links.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListUserLinks_async - */ - listUserLinksAsync( - request?: protos.google.analytics.admin.v1alpha.IListUserLinksRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listUserLinks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listUserLinks.asyncIterate( - this.innerApiCalls['listUserLinks'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists all user links on an account or property, including implicit ones - * that come from effective permissions granted by groups or organization - * admin roles. - * - * If a returned user link does not have direct permissions, they cannot - * be removed from the account or property directly with the DeleteUserLink - * command. They have to be removed from the group/etc that gives them - * permissions, which is currently only usable/discoverable in the GA or GMP - * UIs. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: accounts/1234 - * @param {number} request.pageSize - * The maximum number of user links to return. - * The service may return fewer than this value. - * If unspecified, at most 1000 user links will be returned. - * The maximum value is 5000; values above 5000 will be coerced to 5000. - * @param {string} request.pageToken - * A page token, received from a previous `AuditUserLinks` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `AuditUserLinks` must - * match the call that provided the page token. - * @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 Array of [AuditUserLink]{@link google.analytics.admin.v1alpha.AuditUserLink}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `auditUserLinksAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - auditUserLinks( - request?: protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IAuditUserLink[], - protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest|null, - protos.google.analytics.admin.v1alpha.IAuditUserLinksResponse - ]>; - auditUserLinks( - request: protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest, - protos.google.analytics.admin.v1alpha.IAuditUserLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IAuditUserLink>): void; - auditUserLinks( - request: protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest, - protos.google.analytics.admin.v1alpha.IAuditUserLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IAuditUserLink>): void; - auditUserLinks( - request?: protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest, - protos.google.analytics.admin.v1alpha.IAuditUserLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IAuditUserLink>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest, - protos.google.analytics.admin.v1alpha.IAuditUserLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IAuditUserLink>): - Promise<[ - protos.google.analytics.admin.v1alpha.IAuditUserLink[], - protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest|null, - protos.google.analytics.admin.v1alpha.IAuditUserLinksResponse - ]>|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.auditUserLinks(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: accounts/1234 - * @param {number} request.pageSize - * The maximum number of user links to return. - * The service may return fewer than this value. - * If unspecified, at most 1000 user links will be returned. - * The maximum value is 5000; values above 5000 will be coerced to 5000. - * @param {string} request.pageToken - * A page token, received from a previous `AuditUserLinks` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `AuditUserLinks` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [AuditUserLink]{@link google.analytics.admin.v1alpha.AuditUserLink} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `auditUserLinksAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - auditUserLinksStream( - request?: protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['auditUserLinks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.auditUserLinks.createStream( - this.innerApiCalls.auditUserLinks as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `auditUserLinks`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: accounts/1234 - * @param {number} request.pageSize - * The maximum number of user links to return. - * The service may return fewer than this value. - * If unspecified, at most 1000 user links will be returned. - * The maximum value is 5000; values above 5000 will be coerced to 5000. - * @param {string} request.pageToken - * A page token, received from a previous `AuditUserLinks` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `AuditUserLinks` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [AuditUserLink]{@link google.analytics.admin.v1alpha.AuditUserLink}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha/analytics_admin_service.audit_user_links.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_AuditUserLinks_async - */ - auditUserLinksAsync( - request?: protos.google.analytics.admin.v1alpha.IAuditUserLinksRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['auditUserLinks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.auditUserLinks.asyncIterate( - this.innerApiCalls['auditUserLinks'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists FirebaseLinks on a property. - * Properties can have at most one FirebaseLink. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Format: properties/{property_id} - * Example: properties/1234 - * @param {number} request.pageSize - * The maximum number of resources to return. The service may return - * fewer than this value, even if there are additional pages. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200; (higher values will be coerced to the maximum) - * @param {string} request.pageToken - * A page token, received from a previous `ListFirebaseLinks` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListProperties` must - * match the call that provided the page token. - * @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 Array of [FirebaseLink]{@link google.analytics.admin.v1alpha.FirebaseLink}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listFirebaseLinksAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listFirebaseLinks( - request?: protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IFirebaseLink[], - protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest|null, - protos.google.analytics.admin.v1alpha.IListFirebaseLinksResponse - ]>; - listFirebaseLinks( - request: protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest, - protos.google.analytics.admin.v1alpha.IListFirebaseLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IFirebaseLink>): void; - listFirebaseLinks( - request: protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest, - protos.google.analytics.admin.v1alpha.IListFirebaseLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IFirebaseLink>): void; - listFirebaseLinks( - request?: protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest, - protos.google.analytics.admin.v1alpha.IListFirebaseLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IFirebaseLink>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest, - protos.google.analytics.admin.v1alpha.IListFirebaseLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IFirebaseLink>): - Promise<[ - protos.google.analytics.admin.v1alpha.IFirebaseLink[], - protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest|null, - protos.google.analytics.admin.v1alpha.IListFirebaseLinksResponse - ]>|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listFirebaseLinks(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Format: properties/{property_id} - * Example: properties/1234 - * @param {number} request.pageSize - * The maximum number of resources to return. The service may return - * fewer than this value, even if there are additional pages. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200; (higher values will be coerced to the maximum) - * @param {string} request.pageToken - * A page token, received from a previous `ListFirebaseLinks` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListProperties` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [FirebaseLink]{@link google.analytics.admin.v1alpha.FirebaseLink} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listFirebaseLinksAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listFirebaseLinksStream( - request?: protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listFirebaseLinks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listFirebaseLinks.createStream( - this.innerApiCalls.listFirebaseLinks as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listFirebaseLinks`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Format: properties/{property_id} - * Example: properties/1234 - * @param {number} request.pageSize - * The maximum number of resources to return. The service may return - * fewer than this value, even if there are additional pages. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200; (higher values will be coerced to the maximum) - * @param {string} request.pageToken - * A page token, received from a previous `ListFirebaseLinks` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListProperties` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [FirebaseLink]{@link google.analytics.admin.v1alpha.FirebaseLink}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha/analytics_admin_service.list_firebase_links.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListFirebaseLinks_async - */ - listFirebaseLinksAsync( - request?: protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listFirebaseLinks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listFirebaseLinks.asyncIterate( - this.innerApiCalls['listFirebaseLinks'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists GoogleAdsLinks on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - * @param {string} request.pageToken - * A page token, received from a previous `ListGoogleAdsLinks` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListGoogleAdsLinks` must - * match the call that provided the page token. - * @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 Array of [GoogleAdsLink]{@link google.analytics.admin.v1alpha.GoogleAdsLink}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listGoogleAdsLinksAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listGoogleAdsLinks( - request?: protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IGoogleAdsLink[], - protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest|null, - protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksResponse - ]>; - listGoogleAdsLinks( - request: protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest, - protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IGoogleAdsLink>): void; - listGoogleAdsLinks( - request: protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest, - protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IGoogleAdsLink>): void; - listGoogleAdsLinks( - request?: protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest, - protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IGoogleAdsLink>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest, - protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IGoogleAdsLink>): - Promise<[ - protos.google.analytics.admin.v1alpha.IGoogleAdsLink[], - protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest|null, - protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksResponse - ]>|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listGoogleAdsLinks(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - * @param {string} request.pageToken - * A page token, received from a previous `ListGoogleAdsLinks` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListGoogleAdsLinks` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [GoogleAdsLink]{@link google.analytics.admin.v1alpha.GoogleAdsLink} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listGoogleAdsLinksAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listGoogleAdsLinksStream( - request?: protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listGoogleAdsLinks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listGoogleAdsLinks.createStream( - this.innerApiCalls.listGoogleAdsLinks as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listGoogleAdsLinks`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - * @param {string} request.pageToken - * A page token, received from a previous `ListGoogleAdsLinks` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListGoogleAdsLinks` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [GoogleAdsLink]{@link google.analytics.admin.v1alpha.GoogleAdsLink}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha/analytics_admin_service.list_google_ads_links.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListGoogleAdsLinks_async - */ - listGoogleAdsLinksAsync( - request?: protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listGoogleAdsLinks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listGoogleAdsLinks.asyncIterate( - this.innerApiCalls['listGoogleAdsLinks'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Returns child MeasurementProtocolSecrets under the specified parent - * Property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the parent stream. - * Format: - * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 10 resources will be returned. - * The maximum value is 10. Higher values will be coerced to the maximum. - * @param {string} request.pageToken - * A page token, received from a previous `ListMeasurementProtocolSecrets` - * call. Provide this to retrieve the subsequent page. When paginating, all - * other parameters provided to `ListMeasurementProtocolSecrets` must match - * the call that provided the page token. - * @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 Array of [MeasurementProtocolSecret]{@link google.analytics.admin.v1alpha.MeasurementProtocolSecret}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listMeasurementProtocolSecretsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listMeasurementProtocolSecrets( - request?: protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret[], - protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest|null, - protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsResponse - ]>; - listMeasurementProtocolSecrets( - request: protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest, - protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret>): void; - listMeasurementProtocolSecrets( - request: protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest, - protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret>): void; - listMeasurementProtocolSecrets( - request?: protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest, - protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest, - protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret>): - Promise<[ - protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret[], - protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest|null, - protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsResponse - ]>|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listMeasurementProtocolSecrets(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the parent stream. - * Format: - * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 10 resources will be returned. - * The maximum value is 10. Higher values will be coerced to the maximum. - * @param {string} request.pageToken - * A page token, received from a previous `ListMeasurementProtocolSecrets` - * call. Provide this to retrieve the subsequent page. When paginating, all - * other parameters provided to `ListMeasurementProtocolSecrets` must match - * the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [MeasurementProtocolSecret]{@link google.analytics.admin.v1alpha.MeasurementProtocolSecret} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listMeasurementProtocolSecretsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listMeasurementProtocolSecretsStream( - request?: protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listMeasurementProtocolSecrets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listMeasurementProtocolSecrets.createStream( - this.innerApiCalls.listMeasurementProtocolSecrets as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listMeasurementProtocolSecrets`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the parent stream. - * Format: - * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 10 resources will be returned. - * The maximum value is 10. Higher values will be coerced to the maximum. - * @param {string} request.pageToken - * A page token, received from a previous `ListMeasurementProtocolSecrets` - * call. Provide this to retrieve the subsequent page. When paginating, all - * other parameters provided to `ListMeasurementProtocolSecrets` must match - * the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [MeasurementProtocolSecret]{@link google.analytics.admin.v1alpha.MeasurementProtocolSecret}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha/analytics_admin_service.list_measurement_protocol_secrets.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListMeasurementProtocolSecrets_async - */ - listMeasurementProtocolSecretsAsync( - request?: protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listMeasurementProtocolSecrets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listMeasurementProtocolSecrets.asyncIterate( - this.innerApiCalls['listMeasurementProtocolSecrets'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Searches through all changes to an account or its children given the - * specified set of filters. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.account - * Required. The account resource for which to return change history resources. - * @param {string} [request.property] - * Optional. Resource name for a child property. If set, only return changes - * made to this property or its child resources. - * @param {number[]} [request.resourceType] - * Optional. If set, only return changes if they are for a resource that matches at - * least one of these types. - * @param {number[]} [request.action] - * Optional. If set, only return changes that match one or more of these types of - * actions. - * @param {string[]} [request.actorEmail] - * Optional. If set, only return changes if they are made by a user in this list. - * @param {google.protobuf.Timestamp} [request.earliestChangeTime] - * Optional. If set, only return changes made after this time (inclusive). - * @param {google.protobuf.Timestamp} [request.latestChangeTime] - * Optional. If set, only return changes made before this time (inclusive). - * @param {number} [request.pageSize] - * Optional. The maximum number of ChangeHistoryEvent items to return. - * The service may return fewer than this value, even if there are additional - * pages. If unspecified, at most 50 items will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `SearchChangeHistoryEvents` call. - * Provide this to retrieve the subsequent page. When paginating, all other - * parameters provided to `SearchChangeHistoryEvents` must match the call that - * provided the page token. - * @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 Array of [ChangeHistoryEvent]{@link google.analytics.admin.v1alpha.ChangeHistoryEvent}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `searchChangeHistoryEventsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - searchChangeHistoryEvents( - request?: protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IChangeHistoryEvent[], - protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest|null, - protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsResponse - ]>; - searchChangeHistoryEvents( - request: protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest, - protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IChangeHistoryEvent>): void; - searchChangeHistoryEvents( - request: protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest, - protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IChangeHistoryEvent>): void; - searchChangeHistoryEvents( - request?: protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest, - protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IChangeHistoryEvent>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest, - protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IChangeHistoryEvent>): - Promise<[ - protos.google.analytics.admin.v1alpha.IChangeHistoryEvent[], - protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest|null, - protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsResponse - ]>|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({ - 'account': request.account || '', - }); - this.initialize(); - return this.innerApiCalls.searchChangeHistoryEvents(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.account - * Required. The account resource for which to return change history resources. - * @param {string} [request.property] - * Optional. Resource name for a child property. If set, only return changes - * made to this property or its child resources. - * @param {number[]} [request.resourceType] - * Optional. If set, only return changes if they are for a resource that matches at - * least one of these types. - * @param {number[]} [request.action] - * Optional. If set, only return changes that match one or more of these types of - * actions. - * @param {string[]} [request.actorEmail] - * Optional. If set, only return changes if they are made by a user in this list. - * @param {google.protobuf.Timestamp} [request.earliestChangeTime] - * Optional. If set, only return changes made after this time (inclusive). - * @param {google.protobuf.Timestamp} [request.latestChangeTime] - * Optional. If set, only return changes made before this time (inclusive). - * @param {number} [request.pageSize] - * Optional. The maximum number of ChangeHistoryEvent items to return. - * The service may return fewer than this value, even if there are additional - * pages. If unspecified, at most 50 items will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `SearchChangeHistoryEvents` call. - * Provide this to retrieve the subsequent page. When paginating, all other - * parameters provided to `SearchChangeHistoryEvents` must match the call that - * provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [ChangeHistoryEvent]{@link google.analytics.admin.v1alpha.ChangeHistoryEvent} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `searchChangeHistoryEventsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - searchChangeHistoryEventsStream( - request?: protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'account': request.account || '', - }); - const defaultCallSettings = this._defaults['searchChangeHistoryEvents']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchChangeHistoryEvents.createStream( - this.innerApiCalls.searchChangeHistoryEvents as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `searchChangeHistoryEvents`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.account - * Required. The account resource for which to return change history resources. - * @param {string} [request.property] - * Optional. Resource name for a child property. If set, only return changes - * made to this property or its child resources. - * @param {number[]} [request.resourceType] - * Optional. If set, only return changes if they are for a resource that matches at - * least one of these types. - * @param {number[]} [request.action] - * Optional. If set, only return changes that match one or more of these types of - * actions. - * @param {string[]} [request.actorEmail] - * Optional. If set, only return changes if they are made by a user in this list. - * @param {google.protobuf.Timestamp} [request.earliestChangeTime] - * Optional. If set, only return changes made after this time (inclusive). - * @param {google.protobuf.Timestamp} [request.latestChangeTime] - * Optional. If set, only return changes made before this time (inclusive). - * @param {number} [request.pageSize] - * Optional. The maximum number of ChangeHistoryEvent items to return. - * The service may return fewer than this value, even if there are additional - * pages. If unspecified, at most 50 items will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `SearchChangeHistoryEvents` call. - * Provide this to retrieve the subsequent page. When paginating, all other - * parameters provided to `SearchChangeHistoryEvents` must match the call that - * provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [ChangeHistoryEvent]{@link google.analytics.admin.v1alpha.ChangeHistoryEvent}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha/analytics_admin_service.search_change_history_events.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_SearchChangeHistoryEvents_async - */ - searchChangeHistoryEventsAsync( - request?: protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'account': request.account || '', - }); - const defaultCallSettings = this._defaults['searchChangeHistoryEvents']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchChangeHistoryEvents.asyncIterate( - this.innerApiCalls['searchChangeHistoryEvents'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Returns a list of conversion events in the specified parent property. - * - * Returns an empty list if no conversion events are found. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the parent property. - * Example: 'properties/123' - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200; (higher values will be coerced to the maximum) - * @param {string} request.pageToken - * A page token, received from a previous `ListConversionEvents` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListConversionEvents` - * must match the call that provided the page token. - * @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 Array of [ConversionEvent]{@link google.analytics.admin.v1alpha.ConversionEvent}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listConversionEventsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listConversionEvents( - request?: protos.google.analytics.admin.v1alpha.IListConversionEventsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IConversionEvent[], - protos.google.analytics.admin.v1alpha.IListConversionEventsRequest|null, - protos.google.analytics.admin.v1alpha.IListConversionEventsResponse - ]>; - listConversionEvents( - request: protos.google.analytics.admin.v1alpha.IListConversionEventsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListConversionEventsRequest, - protos.google.analytics.admin.v1alpha.IListConversionEventsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IConversionEvent>): void; - listConversionEvents( - request: protos.google.analytics.admin.v1alpha.IListConversionEventsRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListConversionEventsRequest, - protos.google.analytics.admin.v1alpha.IListConversionEventsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IConversionEvent>): void; - listConversionEvents( - request?: protos.google.analytics.admin.v1alpha.IListConversionEventsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1alpha.IListConversionEventsRequest, - protos.google.analytics.admin.v1alpha.IListConversionEventsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IConversionEvent>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListConversionEventsRequest, - protos.google.analytics.admin.v1alpha.IListConversionEventsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IConversionEvent>): - Promise<[ - protos.google.analytics.admin.v1alpha.IConversionEvent[], - protos.google.analytics.admin.v1alpha.IListConversionEventsRequest|null, - protos.google.analytics.admin.v1alpha.IListConversionEventsResponse - ]>|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listConversionEvents(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the parent property. - * Example: 'properties/123' - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200; (higher values will be coerced to the maximum) - * @param {string} request.pageToken - * A page token, received from a previous `ListConversionEvents` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListConversionEvents` - * must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [ConversionEvent]{@link google.analytics.admin.v1alpha.ConversionEvent} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listConversionEventsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listConversionEventsStream( - request?: protos.google.analytics.admin.v1alpha.IListConversionEventsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listConversionEvents']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listConversionEvents.createStream( - this.innerApiCalls.listConversionEvents as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listConversionEvents`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the parent property. - * Example: 'properties/123' - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200; (higher values will be coerced to the maximum) - * @param {string} request.pageToken - * A page token, received from a previous `ListConversionEvents` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListConversionEvents` - * must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [ConversionEvent]{@link google.analytics.admin.v1alpha.ConversionEvent}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha/analytics_admin_service.list_conversion_events.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListConversionEvents_async - */ - listConversionEventsAsync( - request?: protos.google.analytics.admin.v1alpha.IListConversionEventsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listConversionEvents']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listConversionEvents.asyncIterate( - this.innerApiCalls['listConversionEvents'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists all DisplayVideo360AdvertiserLinks on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - * @param {string} request.pageToken - * A page token, received from a previous `ListDisplayVideo360AdvertiserLinks` - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListDisplayVideo360AdvertiserLinks` must match the call that provided the - * page token. - * @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 Array of [DisplayVideo360AdvertiserLink]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listDisplayVideo360AdvertiserLinksAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDisplayVideo360AdvertiserLinks( - request?: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink[], - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest|null, - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksResponse - ]>; - listDisplayVideo360AdvertiserLinks( - request: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest, - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink>): void; - listDisplayVideo360AdvertiserLinks( - request: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest, - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink>): void; - listDisplayVideo360AdvertiserLinks( - request?: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest, - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest, - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink>): - Promise<[ - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink[], - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest|null, - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksResponse - ]>|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listDisplayVideo360AdvertiserLinks(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - * @param {string} request.pageToken - * A page token, received from a previous `ListDisplayVideo360AdvertiserLinks` - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListDisplayVideo360AdvertiserLinks` must match the call that provided the - * page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [DisplayVideo360AdvertiserLink]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listDisplayVideo360AdvertiserLinksAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDisplayVideo360AdvertiserLinksStream( - request?: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listDisplayVideo360AdvertiserLinks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDisplayVideo360AdvertiserLinks.createStream( - this.innerApiCalls.listDisplayVideo360AdvertiserLinks as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDisplayVideo360AdvertiserLinks`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - * @param {string} request.pageToken - * A page token, received from a previous `ListDisplayVideo360AdvertiserLinks` - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListDisplayVideo360AdvertiserLinks` must match the call that provided the - * page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [DisplayVideo360AdvertiserLink]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_links.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDisplayVideo360AdvertiserLinks_async - */ - listDisplayVideo360AdvertiserLinksAsync( - request?: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listDisplayVideo360AdvertiserLinks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDisplayVideo360AdvertiserLinks.asyncIterate( - this.innerApiCalls['listDisplayVideo360AdvertiserLinks'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists DisplayVideo360AdvertiserLinkProposals on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - * @param {string} request.pageToken - * A page token, received from a previous - * `ListDisplayVideo360AdvertiserLinkProposals` call. Provide this to retrieve - * the subsequent page. - * - * When paginating, all other parameters provided to - * `ListDisplayVideo360AdvertiserLinkProposals` must match the call that - * provided the page token. - * @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 Array of [DisplayVideo360AdvertiserLinkProposal]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listDisplayVideo360AdvertiserLinkProposalsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDisplayVideo360AdvertiserLinkProposals( - request?: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal[], - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest|null, - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsResponse - ]>; - listDisplayVideo360AdvertiserLinkProposals( - request: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest, - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal>): void; - listDisplayVideo360AdvertiserLinkProposals( - request: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest, - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal>): void; - listDisplayVideo360AdvertiserLinkProposals( - request?: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest, - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest, - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal>): - Promise<[ - protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal[], - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest|null, - protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsResponse - ]>|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - * @param {string} request.pageToken - * A page token, received from a previous - * `ListDisplayVideo360AdvertiserLinkProposals` call. Provide this to retrieve - * the subsequent page. - * - * When paginating, all other parameters provided to - * `ListDisplayVideo360AdvertiserLinkProposals` must match the call that - * provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [DisplayVideo360AdvertiserLinkProposal]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listDisplayVideo360AdvertiserLinkProposalsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDisplayVideo360AdvertiserLinkProposalsStream( - request?: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listDisplayVideo360AdvertiserLinkProposals']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.createStream( - this.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDisplayVideo360AdvertiserLinkProposals`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - * @param {string} request.pageToken - * A page token, received from a previous - * `ListDisplayVideo360AdvertiserLinkProposals` call. Provide this to retrieve - * the subsequent page. - * - * When paginating, all other parameters provided to - * `ListDisplayVideo360AdvertiserLinkProposals` must match the call that - * provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [DisplayVideo360AdvertiserLinkProposal]{@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_link_proposals.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDisplayVideo360AdvertiserLinkProposals_async - */ - listDisplayVideo360AdvertiserLinkProposalsAsync( - request?: protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listDisplayVideo360AdvertiserLinkProposals']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.asyncIterate( - this.innerApiCalls['listDisplayVideo360AdvertiserLinkProposals'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists CustomDimensions on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - * @param {string} request.pageToken - * A page token, received from a previous `ListCustomDimensions` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListCustomDimensions` - * must match the call that provided the page token. - * @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 Array of [CustomDimension]{@link google.analytics.admin.v1alpha.CustomDimension}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listCustomDimensionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listCustomDimensions( - request?: protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.ICustomDimension[], - protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest|null, - protos.google.analytics.admin.v1alpha.IListCustomDimensionsResponse - ]>; - listCustomDimensions( - request: protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest, - protos.google.analytics.admin.v1alpha.IListCustomDimensionsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.ICustomDimension>): void; - listCustomDimensions( - request: protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest, - protos.google.analytics.admin.v1alpha.IListCustomDimensionsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.ICustomDimension>): void; - listCustomDimensions( - request?: protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest, - protos.google.analytics.admin.v1alpha.IListCustomDimensionsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.ICustomDimension>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest, - protos.google.analytics.admin.v1alpha.IListCustomDimensionsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.ICustomDimension>): - Promise<[ - protos.google.analytics.admin.v1alpha.ICustomDimension[], - protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest|null, - protos.google.analytics.admin.v1alpha.IListCustomDimensionsResponse - ]>|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listCustomDimensions(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - * @param {string} request.pageToken - * A page token, received from a previous `ListCustomDimensions` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListCustomDimensions` - * must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [CustomDimension]{@link google.analytics.admin.v1alpha.CustomDimension} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listCustomDimensionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listCustomDimensionsStream( - request?: protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listCustomDimensions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listCustomDimensions.createStream( - this.innerApiCalls.listCustomDimensions as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listCustomDimensions`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - * @param {string} request.pageToken - * A page token, received from a previous `ListCustomDimensions` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListCustomDimensions` - * must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [CustomDimension]{@link google.analytics.admin.v1alpha.CustomDimension}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha/analytics_admin_service.list_custom_dimensions.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListCustomDimensions_async - */ - listCustomDimensionsAsync( - request?: protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listCustomDimensions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listCustomDimensions.asyncIterate( - this.innerApiCalls['listCustomDimensions'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists CustomMetrics on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - * @param {string} request.pageToken - * A page token, received from a previous `ListCustomMetrics` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListCustomMetrics` must - * match the call that provided the page token. - * @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 Array of [CustomMetric]{@link google.analytics.admin.v1alpha.CustomMetric}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listCustomMetricsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listCustomMetrics( - request?: protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.ICustomMetric[], - protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest|null, - protos.google.analytics.admin.v1alpha.IListCustomMetricsResponse - ]>; - listCustomMetrics( - request: protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest, - protos.google.analytics.admin.v1alpha.IListCustomMetricsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.ICustomMetric>): void; - listCustomMetrics( - request: protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest, - protos.google.analytics.admin.v1alpha.IListCustomMetricsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.ICustomMetric>): void; - listCustomMetrics( - request?: protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest, - protos.google.analytics.admin.v1alpha.IListCustomMetricsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.ICustomMetric>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest, - protos.google.analytics.admin.v1alpha.IListCustomMetricsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.ICustomMetric>): - Promise<[ - protos.google.analytics.admin.v1alpha.ICustomMetric[], - protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest|null, - protos.google.analytics.admin.v1alpha.IListCustomMetricsResponse - ]>|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listCustomMetrics(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - * @param {string} request.pageToken - * A page token, received from a previous `ListCustomMetrics` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListCustomMetrics` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [CustomMetric]{@link google.analytics.admin.v1alpha.CustomMetric} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listCustomMetricsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listCustomMetricsStream( - request?: protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listCustomMetrics']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listCustomMetrics.createStream( - this.innerApiCalls.listCustomMetrics as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listCustomMetrics`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - * @param {string} request.pageToken - * A page token, received from a previous `ListCustomMetrics` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListCustomMetrics` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [CustomMetric]{@link google.analytics.admin.v1alpha.CustomMetric}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha/analytics_admin_service.list_custom_metrics.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListCustomMetrics_async - */ - listCustomMetricsAsync( - request?: protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listCustomMetrics']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listCustomMetrics.asyncIterate( - this.innerApiCalls['listCustomMetrics'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists DataStreams on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - * @param {string} request.pageToken - * A page token, received from a previous `ListDataStreams` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListDataStreams` must - * match the call that provided the page token. - * @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 Array of [DataStream]{@link google.analytics.admin.v1alpha.DataStream}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listDataStreamsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDataStreams( - request?: protos.google.analytics.admin.v1alpha.IListDataStreamsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IDataStream[], - protos.google.analytics.admin.v1alpha.IListDataStreamsRequest|null, - protos.google.analytics.admin.v1alpha.IListDataStreamsResponse - ]>; - listDataStreams( - request: protos.google.analytics.admin.v1alpha.IListDataStreamsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListDataStreamsRequest, - protos.google.analytics.admin.v1alpha.IListDataStreamsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IDataStream>): void; - listDataStreams( - request: protos.google.analytics.admin.v1alpha.IListDataStreamsRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListDataStreamsRequest, - protos.google.analytics.admin.v1alpha.IListDataStreamsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IDataStream>): void; - listDataStreams( - request?: protos.google.analytics.admin.v1alpha.IListDataStreamsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1alpha.IListDataStreamsRequest, - protos.google.analytics.admin.v1alpha.IListDataStreamsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IDataStream>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListDataStreamsRequest, - protos.google.analytics.admin.v1alpha.IListDataStreamsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IDataStream>): - Promise<[ - protos.google.analytics.admin.v1alpha.IDataStream[], - protos.google.analytics.admin.v1alpha.IListDataStreamsRequest|null, - protos.google.analytics.admin.v1alpha.IListDataStreamsResponse - ]>|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({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listDataStreams(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - * @param {string} request.pageToken - * A page token, received from a previous `ListDataStreams` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListDataStreams` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [DataStream]{@link google.analytics.admin.v1alpha.DataStream} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listDataStreamsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDataStreamsStream( - request?: protos.google.analytics.admin.v1alpha.IListDataStreamsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listDataStreams']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDataStreams.createStream( - this.innerApiCalls.listDataStreams as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDataStreams`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {number} request.pageSize - * The maximum number of resources to return. - * If unspecified, at most 50 resources will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). - * @param {string} request.pageToken - * A page token, received from a previous `ListDataStreams` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListDataStreams` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [DataStream]{@link google.analytics.admin.v1alpha.DataStream}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha/analytics_admin_service.list_data_streams.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDataStreams_async - */ - listDataStreamsAsync( - request?: protos.google.analytics.admin.v1alpha.IListDataStreamsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listDataStreams']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDataStreams.asyncIterate( - this.innerApiCalls['listDataStreams'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified account resource name string. - * - * @param {string} account - * @returns {string} Resource name string. - */ - accountPath(account:string) { - return this.pathTemplates.accountPathTemplate.render({ - account: account, - }); - } - - /** - * Parse the account from Account resource. - * - * @param {string} accountName - * A fully-qualified path representing Account resource. - * @returns {string} A string representing the account. - */ - matchAccountFromAccountName(accountName: string) { - return this.pathTemplates.accountPathTemplate.match(accountName).account; - } - - /** - * Return a fully-qualified accountSummary resource name string. - * - * @param {string} account_summary - * @returns {string} Resource name string. - */ - accountSummaryPath(accountSummary:string) { - return this.pathTemplates.accountSummaryPathTemplate.render({ - account_summary: accountSummary, - }); - } - - /** - * Parse the account_summary from AccountSummary resource. - * - * @param {string} accountSummaryName - * A fully-qualified path representing AccountSummary resource. - * @returns {string} A string representing the account_summary. - */ - matchAccountSummaryFromAccountSummaryName(accountSummaryName: string) { - return this.pathTemplates.accountSummaryPathTemplate.match(accountSummaryName).account_summary; - } - - /** - * Return a fully-qualified accountUserLink resource name string. - * - * @param {string} account - * @param {string} user_link - * @returns {string} Resource name string. - */ - accountUserLinkPath(account:string,userLink:string) { - return this.pathTemplates.accountUserLinkPathTemplate.render({ - account: account, - user_link: userLink, - }); - } - - /** - * Parse the account from AccountUserLink resource. - * - * @param {string} accountUserLinkName - * A fully-qualified path representing account_user_link resource. - * @returns {string} A string representing the account. - */ - matchAccountFromAccountUserLinkName(accountUserLinkName: string) { - return this.pathTemplates.accountUserLinkPathTemplate.match(accountUserLinkName).account; - } - - /** - * Parse the user_link from AccountUserLink resource. - * - * @param {string} accountUserLinkName - * A fully-qualified path representing account_user_link resource. - * @returns {string} A string representing the user_link. - */ - matchUserLinkFromAccountUserLinkName(accountUserLinkName: string) { - return this.pathTemplates.accountUserLinkPathTemplate.match(accountUserLinkName).user_link; - } - - /** - * Return a fully-qualified conversionEvent resource name string. - * - * @param {string} property - * @param {string} conversion_event - * @returns {string} Resource name string. - */ - conversionEventPath(property:string,conversionEvent:string) { - return this.pathTemplates.conversionEventPathTemplate.render({ - property: property, - conversion_event: conversionEvent, - }); - } - - /** - * Parse the property from ConversionEvent resource. - * - * @param {string} conversionEventName - * A fully-qualified path representing ConversionEvent resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromConversionEventName(conversionEventName: string) { - return this.pathTemplates.conversionEventPathTemplate.match(conversionEventName).property; - } - - /** - * Parse the conversion_event from ConversionEvent resource. - * - * @param {string} conversionEventName - * A fully-qualified path representing ConversionEvent resource. - * @returns {string} A string representing the conversion_event. - */ - matchConversionEventFromConversionEventName(conversionEventName: string) { - return this.pathTemplates.conversionEventPathTemplate.match(conversionEventName).conversion_event; - } - - /** - * Return a fully-qualified customDimension resource name string. - * - * @param {string} property - * @param {string} custom_dimension - * @returns {string} Resource name string. - */ - customDimensionPath(property:string,customDimension:string) { - return this.pathTemplates.customDimensionPathTemplate.render({ - property: property, - custom_dimension: customDimension, - }); - } - - /** - * Parse the property from CustomDimension resource. - * - * @param {string} customDimensionName - * A fully-qualified path representing CustomDimension resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromCustomDimensionName(customDimensionName: string) { - return this.pathTemplates.customDimensionPathTemplate.match(customDimensionName).property; - } - - /** - * Parse the custom_dimension from CustomDimension resource. - * - * @param {string} customDimensionName - * A fully-qualified path representing CustomDimension resource. - * @returns {string} A string representing the custom_dimension. - */ - matchCustomDimensionFromCustomDimensionName(customDimensionName: string) { - return this.pathTemplates.customDimensionPathTemplate.match(customDimensionName).custom_dimension; - } - - /** - * Return a fully-qualified customMetric resource name string. - * - * @param {string} property - * @param {string} custom_metric - * @returns {string} Resource name string. - */ - customMetricPath(property:string,customMetric:string) { - return this.pathTemplates.customMetricPathTemplate.render({ - property: property, - custom_metric: customMetric, - }); - } - - /** - * Parse the property from CustomMetric resource. - * - * @param {string} customMetricName - * A fully-qualified path representing CustomMetric resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromCustomMetricName(customMetricName: string) { - return this.pathTemplates.customMetricPathTemplate.match(customMetricName).property; - } - - /** - * Parse the custom_metric from CustomMetric resource. - * - * @param {string} customMetricName - * A fully-qualified path representing CustomMetric resource. - * @returns {string} A string representing the custom_metric. - */ - matchCustomMetricFromCustomMetricName(customMetricName: string) { - return this.pathTemplates.customMetricPathTemplate.match(customMetricName).custom_metric; - } - - /** - * Return a fully-qualified dataRetentionSettings resource name string. - * - * @param {string} property - * @returns {string} Resource name string. - */ - dataRetentionSettingsPath(property:string) { - return this.pathTemplates.dataRetentionSettingsPathTemplate.render({ - property: property, - }); - } - - /** - * Parse the property from DataRetentionSettings resource. - * - * @param {string} dataRetentionSettingsName - * A fully-qualified path representing DataRetentionSettings resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromDataRetentionSettingsName(dataRetentionSettingsName: string) { - return this.pathTemplates.dataRetentionSettingsPathTemplate.match(dataRetentionSettingsName).property; - } - - /** - * Return a fully-qualified dataSharingSettings resource name string. - * - * @param {string} account - * @returns {string} Resource name string. - */ - dataSharingSettingsPath(account:string) { - return this.pathTemplates.dataSharingSettingsPathTemplate.render({ - account: account, - }); - } - - /** - * Parse the account from DataSharingSettings resource. - * - * @param {string} dataSharingSettingsName - * A fully-qualified path representing DataSharingSettings resource. - * @returns {string} A string representing the account. - */ - matchAccountFromDataSharingSettingsName(dataSharingSettingsName: string) { - return this.pathTemplates.dataSharingSettingsPathTemplate.match(dataSharingSettingsName).account; - } - - /** - * Return a fully-qualified dataStream resource name string. - * - * @param {string} property - * @param {string} data_stream - * @returns {string} Resource name string. - */ - dataStreamPath(property:string,dataStream:string) { - return this.pathTemplates.dataStreamPathTemplate.render({ - property: property, - data_stream: dataStream, - }); - } - - /** - * Parse the property from DataStream resource. - * - * @param {string} dataStreamName - * A fully-qualified path representing DataStream resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromDataStreamName(dataStreamName: string) { - return this.pathTemplates.dataStreamPathTemplate.match(dataStreamName).property; - } - - /** - * Parse the data_stream from DataStream resource. - * - * @param {string} dataStreamName - * A fully-qualified path representing DataStream resource. - * @returns {string} A string representing the data_stream. - */ - matchDataStreamFromDataStreamName(dataStreamName: string) { - return this.pathTemplates.dataStreamPathTemplate.match(dataStreamName).data_stream; - } - - /** - * Return a fully-qualified displayVideo360AdvertiserLink resource name string. - * - * @param {string} property - * @returns {string} Resource name string. - */ - displayVideo360AdvertiserLinkPath(property:string) { - return this.pathTemplates.displayVideo360AdvertiserLinkPathTemplate.render({ - property: property, - }); - } - - /** - * Parse the property from DisplayVideo360AdvertiserLink resource. - * - * @param {string} displayVideo360AdvertiserLinkName - * A fully-qualified path representing DisplayVideo360AdvertiserLink resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromDisplayVideo360AdvertiserLinkName(displayVideo360AdvertiserLinkName: string) { - return this.pathTemplates.displayVideo360AdvertiserLinkPathTemplate.match(displayVideo360AdvertiserLinkName).property; - } - - /** - * Return a fully-qualified displayVideo360AdvertiserLinkProposal resource name string. - * - * @param {string} property - * @returns {string} Resource name string. - */ - displayVideo360AdvertiserLinkProposalPath(property:string) { - return this.pathTemplates.displayVideo360AdvertiserLinkProposalPathTemplate.render({ - property: property, - }); - } - - /** - * Parse the property from DisplayVideo360AdvertiserLinkProposal resource. - * - * @param {string} displayVideo360AdvertiserLinkProposalName - * A fully-qualified path representing DisplayVideo360AdvertiserLinkProposal resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromDisplayVideo360AdvertiserLinkProposalName(displayVideo360AdvertiserLinkProposalName: string) { - return this.pathTemplates.displayVideo360AdvertiserLinkProposalPathTemplate.match(displayVideo360AdvertiserLinkProposalName).property; - } - - /** - * Return a fully-qualified firebaseLink resource name string. - * - * @param {string} property - * @param {string} firebase_link - * @returns {string} Resource name string. - */ - firebaseLinkPath(property:string,firebaseLink:string) { - return this.pathTemplates.firebaseLinkPathTemplate.render({ - property: property, - firebase_link: firebaseLink, - }); - } - - /** - * Parse the property from FirebaseLink resource. - * - * @param {string} firebaseLinkName - * A fully-qualified path representing FirebaseLink resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromFirebaseLinkName(firebaseLinkName: string) { - return this.pathTemplates.firebaseLinkPathTemplate.match(firebaseLinkName).property; - } - - /** - * Parse the firebase_link from FirebaseLink resource. - * - * @param {string} firebaseLinkName - * A fully-qualified path representing FirebaseLink resource. - * @returns {string} A string representing the firebase_link. - */ - matchFirebaseLinkFromFirebaseLinkName(firebaseLinkName: string) { - return this.pathTemplates.firebaseLinkPathTemplate.match(firebaseLinkName).firebase_link; - } - - /** - * Return a fully-qualified globalSiteTag resource name string. - * - * @param {string} property - * @param {string} data_stream - * @returns {string} Resource name string. - */ - globalSiteTagPath(property:string,dataStream:string) { - return this.pathTemplates.globalSiteTagPathTemplate.render({ - property: property, - data_stream: dataStream, - }); - } - - /** - * Parse the property from GlobalSiteTag resource. - * - * @param {string} globalSiteTagName - * A fully-qualified path representing GlobalSiteTag resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromGlobalSiteTagName(globalSiteTagName: string) { - return this.pathTemplates.globalSiteTagPathTemplate.match(globalSiteTagName).property; - } - - /** - * Parse the data_stream from GlobalSiteTag resource. - * - * @param {string} globalSiteTagName - * A fully-qualified path representing GlobalSiteTag resource. - * @returns {string} A string representing the data_stream. - */ - matchDataStreamFromGlobalSiteTagName(globalSiteTagName: string) { - return this.pathTemplates.globalSiteTagPathTemplate.match(globalSiteTagName).data_stream; - } - - /** - * Return a fully-qualified googleAdsLink resource name string. - * - * @param {string} property - * @param {string} google_ads_link - * @returns {string} Resource name string. - */ - googleAdsLinkPath(property:string,googleAdsLink:string) { - return this.pathTemplates.googleAdsLinkPathTemplate.render({ - property: property, - google_ads_link: googleAdsLink, - }); - } - - /** - * Parse the property from GoogleAdsLink resource. - * - * @param {string} googleAdsLinkName - * A fully-qualified path representing GoogleAdsLink resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromGoogleAdsLinkName(googleAdsLinkName: string) { - return this.pathTemplates.googleAdsLinkPathTemplate.match(googleAdsLinkName).property; - } - - /** - * Parse the google_ads_link from GoogleAdsLink resource. - * - * @param {string} googleAdsLinkName - * A fully-qualified path representing GoogleAdsLink resource. - * @returns {string} A string representing the google_ads_link. - */ - matchGoogleAdsLinkFromGoogleAdsLinkName(googleAdsLinkName: string) { - return this.pathTemplates.googleAdsLinkPathTemplate.match(googleAdsLinkName).google_ads_link; - } - - /** - * Return a fully-qualified googleSignalsSettings resource name string. - * - * @param {string} property - * @returns {string} Resource name string. - */ - googleSignalsSettingsPath(property:string) { - return this.pathTemplates.googleSignalsSettingsPathTemplate.render({ - property: property, - }); - } - - /** - * Parse the property from GoogleSignalsSettings resource. - * - * @param {string} googleSignalsSettingsName - * A fully-qualified path representing GoogleSignalsSettings resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromGoogleSignalsSettingsName(googleSignalsSettingsName: string) { - return this.pathTemplates.googleSignalsSettingsPathTemplate.match(googleSignalsSettingsName).property; - } - - /** - * Return a fully-qualified measurementProtocolSecret resource name string. - * - * @param {string} property - * @param {string} data_stream - * @param {string} measurement_protocol_secret - * @returns {string} Resource name string. - */ - measurementProtocolSecretPath(property:string,dataStream:string,measurementProtocolSecret:string) { - return this.pathTemplates.measurementProtocolSecretPathTemplate.render({ - property: property, - data_stream: dataStream, - measurement_protocol_secret: measurementProtocolSecret, - }); - } - - /** - * Parse the property from MeasurementProtocolSecret resource. - * - * @param {string} measurementProtocolSecretName - * A fully-qualified path representing MeasurementProtocolSecret resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromMeasurementProtocolSecretName(measurementProtocolSecretName: string) { - return this.pathTemplates.measurementProtocolSecretPathTemplate.match(measurementProtocolSecretName).property; - } - - /** - * Parse the data_stream from MeasurementProtocolSecret resource. - * - * @param {string} measurementProtocolSecretName - * A fully-qualified path representing MeasurementProtocolSecret resource. - * @returns {string} A string representing the data_stream. - */ - matchDataStreamFromMeasurementProtocolSecretName(measurementProtocolSecretName: string) { - return this.pathTemplates.measurementProtocolSecretPathTemplate.match(measurementProtocolSecretName).data_stream; - } - - /** - * Parse the measurement_protocol_secret from MeasurementProtocolSecret resource. - * - * @param {string} measurementProtocolSecretName - * A fully-qualified path representing MeasurementProtocolSecret resource. - * @returns {string} A string representing the measurement_protocol_secret. - */ - matchMeasurementProtocolSecretFromMeasurementProtocolSecretName(measurementProtocolSecretName: string) { - return this.pathTemplates.measurementProtocolSecretPathTemplate.match(measurementProtocolSecretName).measurement_protocol_secret; - } - - /** - * Return a fully-qualified property resource name string. - * - * @param {string} property - * @returns {string} Resource name string. - */ - propertyPath(property:string) { - return this.pathTemplates.propertyPathTemplate.render({ - property: property, - }); - } - - /** - * Parse the property from Property resource. - * - * @param {string} propertyName - * A fully-qualified path representing Property resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromPropertyName(propertyName: string) { - return this.pathTemplates.propertyPathTemplate.match(propertyName).property; - } - - /** - * Return a fully-qualified propertyUserLink resource name string. - * - * @param {string} property - * @param {string} user_link - * @returns {string} Resource name string. - */ - propertyUserLinkPath(property:string,userLink:string) { - return this.pathTemplates.propertyUserLinkPathTemplate.render({ - property: property, - user_link: userLink, - }); - } - - /** - * Parse the property from PropertyUserLink resource. - * - * @param {string} propertyUserLinkName - * A fully-qualified path representing property_user_link resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromPropertyUserLinkName(propertyUserLinkName: string) { - return this.pathTemplates.propertyUserLinkPathTemplate.match(propertyUserLinkName).property; - } - - /** - * Parse the user_link from PropertyUserLink resource. - * - * @param {string} propertyUserLinkName - * A fully-qualified path representing property_user_link resource. - * @returns {string} A string representing the user_link. - */ - matchUserLinkFromPropertyUserLinkName(propertyUserLinkName: string) { - return this.pathTemplates.propertyUserLinkPathTemplate.match(propertyUserLinkName).user_link; - } - - /** - * 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.analyticsAdminServiceStub && !this._terminated) { - return this.analyticsAdminServiceStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_client_config.json b/owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_client_config.json deleted file mode 100644 index 24e060d..0000000 --- a/owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_client_config.json +++ /dev/null @@ -1,394 +0,0 @@ -{ - "interfaces": { - "google.analytics.admin.v1alpha.AnalyticsAdminService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unknown_unavailable": [ - "UNKNOWN", - "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 - }, - "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": { - "GetAccount": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListAccounts": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "DeleteAccount": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "UpdateAccount": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ProvisionAccountTicket": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListAccountSummaries": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetProperty": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListProperties": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateProperty": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "DeleteProperty": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "UpdateProperty": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetUserLink": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "BatchGetUserLinks": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListUserLinks": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "AuditUserLinks": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateUserLink": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "BatchCreateUserLinks": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "UpdateUserLink": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "BatchUpdateUserLinks": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "DeleteUserLink": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "BatchDeleteUserLinks": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateFirebaseLink": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "DeleteFirebaseLink": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListFirebaseLinks": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetGlobalSiteTag": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateGoogleAdsLink": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "UpdateGoogleAdsLink": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "DeleteGoogleAdsLink": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListGoogleAdsLinks": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetDataSharingSettings": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetMeasurementProtocolSecret": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListMeasurementProtocolSecrets": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateMeasurementProtocolSecret": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "DeleteMeasurementProtocolSecret": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "UpdateMeasurementProtocolSecret": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "AcknowledgeUserDataCollection": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "SearchChangeHistoryEvents": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetGoogleSignalsSettings": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "UpdateGoogleSignalsSettings": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateConversionEvent": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetConversionEvent": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "DeleteConversionEvent": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListConversionEvents": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetDisplayVideo360AdvertiserLink": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListDisplayVideo360AdvertiserLinks": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateDisplayVideo360AdvertiserLink": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "DeleteDisplayVideo360AdvertiserLink": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "UpdateDisplayVideo360AdvertiserLink": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetDisplayVideo360AdvertiserLinkProposal": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListDisplayVideo360AdvertiserLinkProposals": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateDisplayVideo360AdvertiserLinkProposal": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "DeleteDisplayVideo360AdvertiserLinkProposal": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ApproveDisplayVideo360AdvertiserLinkProposal": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CancelDisplayVideo360AdvertiserLinkProposal": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateCustomDimension": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "UpdateCustomDimension": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListCustomDimensions": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ArchiveCustomDimension": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetCustomDimension": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateCustomMetric": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "UpdateCustomMetric": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListCustomMetrics": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ArchiveCustomMetric": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetCustomMetric": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetDataRetentionSettings": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "UpdateDataRetentionSettings": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateDataStream": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "DeleteDataStream": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "UpdateDataStream": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListDataStreams": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetDataStream": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - } - } - } - } -} diff --git a/owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_proto_list.json b/owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_proto_list.json deleted file mode 100644 index 731e0f1..0000000 --- a/owl-bot-staging/v1alpha/src/v1alpha/analytics_admin_service_proto_list.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "../../protos/google/analytics/admin/v1alpha/analytics_admin.proto", - "../../protos/google/analytics/admin/v1alpha/resources.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 11e2655..0000000 --- a/owl-bot-staging/v1alpha/src/v1alpha/gapic_metadata.json +++ /dev/null @@ -1,793 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.analytics.admin.v1alpha", - "libraryPackage": "@google-analytics/admin", - "services": { - "AnalyticsAdminService": { - "clients": { - "grpc": { - "libraryClient": "AnalyticsAdminServiceClient", - "rpcs": { - "GetAccount": { - "methods": [ - "getAccount" - ] - }, - "DeleteAccount": { - "methods": [ - "deleteAccount" - ] - }, - "UpdateAccount": { - "methods": [ - "updateAccount" - ] - }, - "ProvisionAccountTicket": { - "methods": [ - "provisionAccountTicket" - ] - }, - "GetProperty": { - "methods": [ - "getProperty" - ] - }, - "CreateProperty": { - "methods": [ - "createProperty" - ] - }, - "DeleteProperty": { - "methods": [ - "deleteProperty" - ] - }, - "UpdateProperty": { - "methods": [ - "updateProperty" - ] - }, - "GetUserLink": { - "methods": [ - "getUserLink" - ] - }, - "BatchGetUserLinks": { - "methods": [ - "batchGetUserLinks" - ] - }, - "CreateUserLink": { - "methods": [ - "createUserLink" - ] - }, - "BatchCreateUserLinks": { - "methods": [ - "batchCreateUserLinks" - ] - }, - "UpdateUserLink": { - "methods": [ - "updateUserLink" - ] - }, - "BatchUpdateUserLinks": { - "methods": [ - "batchUpdateUserLinks" - ] - }, - "DeleteUserLink": { - "methods": [ - "deleteUserLink" - ] - }, - "BatchDeleteUserLinks": { - "methods": [ - "batchDeleteUserLinks" - ] - }, - "CreateFirebaseLink": { - "methods": [ - "createFirebaseLink" - ] - }, - "DeleteFirebaseLink": { - "methods": [ - "deleteFirebaseLink" - ] - }, - "GetGlobalSiteTag": { - "methods": [ - "getGlobalSiteTag" - ] - }, - "CreateGoogleAdsLink": { - "methods": [ - "createGoogleAdsLink" - ] - }, - "UpdateGoogleAdsLink": { - "methods": [ - "updateGoogleAdsLink" - ] - }, - "DeleteGoogleAdsLink": { - "methods": [ - "deleteGoogleAdsLink" - ] - }, - "GetDataSharingSettings": { - "methods": [ - "getDataSharingSettings" - ] - }, - "GetMeasurementProtocolSecret": { - "methods": [ - "getMeasurementProtocolSecret" - ] - }, - "CreateMeasurementProtocolSecret": { - "methods": [ - "createMeasurementProtocolSecret" - ] - }, - "DeleteMeasurementProtocolSecret": { - "methods": [ - "deleteMeasurementProtocolSecret" - ] - }, - "UpdateMeasurementProtocolSecret": { - "methods": [ - "updateMeasurementProtocolSecret" - ] - }, - "AcknowledgeUserDataCollection": { - "methods": [ - "acknowledgeUserDataCollection" - ] - }, - "GetGoogleSignalsSettings": { - "methods": [ - "getGoogleSignalsSettings" - ] - }, - "UpdateGoogleSignalsSettings": { - "methods": [ - "updateGoogleSignalsSettings" - ] - }, - "CreateConversionEvent": { - "methods": [ - "createConversionEvent" - ] - }, - "GetConversionEvent": { - "methods": [ - "getConversionEvent" - ] - }, - "DeleteConversionEvent": { - "methods": [ - "deleteConversionEvent" - ] - }, - "GetDisplayVideo360AdvertiserLink": { - "methods": [ - "getDisplayVideo360AdvertiserLink" - ] - }, - "CreateDisplayVideo360AdvertiserLink": { - "methods": [ - "createDisplayVideo360AdvertiserLink" - ] - }, - "DeleteDisplayVideo360AdvertiserLink": { - "methods": [ - "deleteDisplayVideo360AdvertiserLink" - ] - }, - "UpdateDisplayVideo360AdvertiserLink": { - "methods": [ - "updateDisplayVideo360AdvertiserLink" - ] - }, - "GetDisplayVideo360AdvertiserLinkProposal": { - "methods": [ - "getDisplayVideo360AdvertiserLinkProposal" - ] - }, - "CreateDisplayVideo360AdvertiserLinkProposal": { - "methods": [ - "createDisplayVideo360AdvertiserLinkProposal" - ] - }, - "DeleteDisplayVideo360AdvertiserLinkProposal": { - "methods": [ - "deleteDisplayVideo360AdvertiserLinkProposal" - ] - }, - "ApproveDisplayVideo360AdvertiserLinkProposal": { - "methods": [ - "approveDisplayVideo360AdvertiserLinkProposal" - ] - }, - "CancelDisplayVideo360AdvertiserLinkProposal": { - "methods": [ - "cancelDisplayVideo360AdvertiserLinkProposal" - ] - }, - "CreateCustomDimension": { - "methods": [ - "createCustomDimension" - ] - }, - "UpdateCustomDimension": { - "methods": [ - "updateCustomDimension" - ] - }, - "ArchiveCustomDimension": { - "methods": [ - "archiveCustomDimension" - ] - }, - "GetCustomDimension": { - "methods": [ - "getCustomDimension" - ] - }, - "CreateCustomMetric": { - "methods": [ - "createCustomMetric" - ] - }, - "UpdateCustomMetric": { - "methods": [ - "updateCustomMetric" - ] - }, - "ArchiveCustomMetric": { - "methods": [ - "archiveCustomMetric" - ] - }, - "GetCustomMetric": { - "methods": [ - "getCustomMetric" - ] - }, - "GetDataRetentionSettings": { - "methods": [ - "getDataRetentionSettings" - ] - }, - "UpdateDataRetentionSettings": { - "methods": [ - "updateDataRetentionSettings" - ] - }, - "CreateDataStream": { - "methods": [ - "createDataStream" - ] - }, - "DeleteDataStream": { - "methods": [ - "deleteDataStream" - ] - }, - "UpdateDataStream": { - "methods": [ - "updateDataStream" - ] - }, - "GetDataStream": { - "methods": [ - "getDataStream" - ] - }, - "ListAccounts": { - "methods": [ - "listAccounts", - "listAccountsStream", - "listAccountsAsync" - ] - }, - "ListAccountSummaries": { - "methods": [ - "listAccountSummaries", - "listAccountSummariesStream", - "listAccountSummariesAsync" - ] - }, - "ListProperties": { - "methods": [ - "listProperties", - "listPropertiesStream", - "listPropertiesAsync" - ] - }, - "ListUserLinks": { - "methods": [ - "listUserLinks", - "listUserLinksStream", - "listUserLinksAsync" - ] - }, - "AuditUserLinks": { - "methods": [ - "auditUserLinks", - "auditUserLinksStream", - "auditUserLinksAsync" - ] - }, - "ListFirebaseLinks": { - "methods": [ - "listFirebaseLinks", - "listFirebaseLinksStream", - "listFirebaseLinksAsync" - ] - }, - "ListGoogleAdsLinks": { - "methods": [ - "listGoogleAdsLinks", - "listGoogleAdsLinksStream", - "listGoogleAdsLinksAsync" - ] - }, - "ListMeasurementProtocolSecrets": { - "methods": [ - "listMeasurementProtocolSecrets", - "listMeasurementProtocolSecretsStream", - "listMeasurementProtocolSecretsAsync" - ] - }, - "SearchChangeHistoryEvents": { - "methods": [ - "searchChangeHistoryEvents", - "searchChangeHistoryEventsStream", - "searchChangeHistoryEventsAsync" - ] - }, - "ListConversionEvents": { - "methods": [ - "listConversionEvents", - "listConversionEventsStream", - "listConversionEventsAsync" - ] - }, - "ListDisplayVideo360AdvertiserLinks": { - "methods": [ - "listDisplayVideo360AdvertiserLinks", - "listDisplayVideo360AdvertiserLinksStream", - "listDisplayVideo360AdvertiserLinksAsync" - ] - }, - "ListDisplayVideo360AdvertiserLinkProposals": { - "methods": [ - "listDisplayVideo360AdvertiserLinkProposals", - "listDisplayVideo360AdvertiserLinkProposalsStream", - "listDisplayVideo360AdvertiserLinkProposalsAsync" - ] - }, - "ListCustomDimensions": { - "methods": [ - "listCustomDimensions", - "listCustomDimensionsStream", - "listCustomDimensionsAsync" - ] - }, - "ListCustomMetrics": { - "methods": [ - "listCustomMetrics", - "listCustomMetricsStream", - "listCustomMetricsAsync" - ] - }, - "ListDataStreams": { - "methods": [ - "listDataStreams", - "listDataStreamsStream", - "listDataStreamsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "AnalyticsAdminServiceClient", - "rpcs": { - "GetAccount": { - "methods": [ - "getAccount" - ] - }, - "DeleteAccount": { - "methods": [ - "deleteAccount" - ] - }, - "UpdateAccount": { - "methods": [ - "updateAccount" - ] - }, - "ProvisionAccountTicket": { - "methods": [ - "provisionAccountTicket" - ] - }, - "GetProperty": { - "methods": [ - "getProperty" - ] - }, - "CreateProperty": { - "methods": [ - "createProperty" - ] - }, - "DeleteProperty": { - "methods": [ - "deleteProperty" - ] - }, - "UpdateProperty": { - "methods": [ - "updateProperty" - ] - }, - "GetUserLink": { - "methods": [ - "getUserLink" - ] - }, - "BatchGetUserLinks": { - "methods": [ - "batchGetUserLinks" - ] - }, - "CreateUserLink": { - "methods": [ - "createUserLink" - ] - }, - "BatchCreateUserLinks": { - "methods": [ - "batchCreateUserLinks" - ] - }, - "UpdateUserLink": { - "methods": [ - "updateUserLink" - ] - }, - "BatchUpdateUserLinks": { - "methods": [ - "batchUpdateUserLinks" - ] - }, - "DeleteUserLink": { - "methods": [ - "deleteUserLink" - ] - }, - "BatchDeleteUserLinks": { - "methods": [ - "batchDeleteUserLinks" - ] - }, - "CreateFirebaseLink": { - "methods": [ - "createFirebaseLink" - ] - }, - "DeleteFirebaseLink": { - "methods": [ - "deleteFirebaseLink" - ] - }, - "GetGlobalSiteTag": { - "methods": [ - "getGlobalSiteTag" - ] - }, - "CreateGoogleAdsLink": { - "methods": [ - "createGoogleAdsLink" - ] - }, - "UpdateGoogleAdsLink": { - "methods": [ - "updateGoogleAdsLink" - ] - }, - "DeleteGoogleAdsLink": { - "methods": [ - "deleteGoogleAdsLink" - ] - }, - "GetDataSharingSettings": { - "methods": [ - "getDataSharingSettings" - ] - }, - "GetMeasurementProtocolSecret": { - "methods": [ - "getMeasurementProtocolSecret" - ] - }, - "CreateMeasurementProtocolSecret": { - "methods": [ - "createMeasurementProtocolSecret" - ] - }, - "DeleteMeasurementProtocolSecret": { - "methods": [ - "deleteMeasurementProtocolSecret" - ] - }, - "UpdateMeasurementProtocolSecret": { - "methods": [ - "updateMeasurementProtocolSecret" - ] - }, - "AcknowledgeUserDataCollection": { - "methods": [ - "acknowledgeUserDataCollection" - ] - }, - "GetGoogleSignalsSettings": { - "methods": [ - "getGoogleSignalsSettings" - ] - }, - "UpdateGoogleSignalsSettings": { - "methods": [ - "updateGoogleSignalsSettings" - ] - }, - "CreateConversionEvent": { - "methods": [ - "createConversionEvent" - ] - }, - "GetConversionEvent": { - "methods": [ - "getConversionEvent" - ] - }, - "DeleteConversionEvent": { - "methods": [ - "deleteConversionEvent" - ] - }, - "GetDisplayVideo360AdvertiserLink": { - "methods": [ - "getDisplayVideo360AdvertiserLink" - ] - }, - "CreateDisplayVideo360AdvertiserLink": { - "methods": [ - "createDisplayVideo360AdvertiserLink" - ] - }, - "DeleteDisplayVideo360AdvertiserLink": { - "methods": [ - "deleteDisplayVideo360AdvertiserLink" - ] - }, - "UpdateDisplayVideo360AdvertiserLink": { - "methods": [ - "updateDisplayVideo360AdvertiserLink" - ] - }, - "GetDisplayVideo360AdvertiserLinkProposal": { - "methods": [ - "getDisplayVideo360AdvertiserLinkProposal" - ] - }, - "CreateDisplayVideo360AdvertiserLinkProposal": { - "methods": [ - "createDisplayVideo360AdvertiserLinkProposal" - ] - }, - "DeleteDisplayVideo360AdvertiserLinkProposal": { - "methods": [ - "deleteDisplayVideo360AdvertiserLinkProposal" - ] - }, - "ApproveDisplayVideo360AdvertiserLinkProposal": { - "methods": [ - "approveDisplayVideo360AdvertiserLinkProposal" - ] - }, - "CancelDisplayVideo360AdvertiserLinkProposal": { - "methods": [ - "cancelDisplayVideo360AdvertiserLinkProposal" - ] - }, - "CreateCustomDimension": { - "methods": [ - "createCustomDimension" - ] - }, - "UpdateCustomDimension": { - "methods": [ - "updateCustomDimension" - ] - }, - "ArchiveCustomDimension": { - "methods": [ - "archiveCustomDimension" - ] - }, - "GetCustomDimension": { - "methods": [ - "getCustomDimension" - ] - }, - "CreateCustomMetric": { - "methods": [ - "createCustomMetric" - ] - }, - "UpdateCustomMetric": { - "methods": [ - "updateCustomMetric" - ] - }, - "ArchiveCustomMetric": { - "methods": [ - "archiveCustomMetric" - ] - }, - "GetCustomMetric": { - "methods": [ - "getCustomMetric" - ] - }, - "GetDataRetentionSettings": { - "methods": [ - "getDataRetentionSettings" - ] - }, - "UpdateDataRetentionSettings": { - "methods": [ - "updateDataRetentionSettings" - ] - }, - "CreateDataStream": { - "methods": [ - "createDataStream" - ] - }, - "DeleteDataStream": { - "methods": [ - "deleteDataStream" - ] - }, - "UpdateDataStream": { - "methods": [ - "updateDataStream" - ] - }, - "GetDataStream": { - "methods": [ - "getDataStream" - ] - }, - "ListAccounts": { - "methods": [ - "listAccounts", - "listAccountsStream", - "listAccountsAsync" - ] - }, - "ListAccountSummaries": { - "methods": [ - "listAccountSummaries", - "listAccountSummariesStream", - "listAccountSummariesAsync" - ] - }, - "ListProperties": { - "methods": [ - "listProperties", - "listPropertiesStream", - "listPropertiesAsync" - ] - }, - "ListUserLinks": { - "methods": [ - "listUserLinks", - "listUserLinksStream", - "listUserLinksAsync" - ] - }, - "AuditUserLinks": { - "methods": [ - "auditUserLinks", - "auditUserLinksStream", - "auditUserLinksAsync" - ] - }, - "ListFirebaseLinks": { - "methods": [ - "listFirebaseLinks", - "listFirebaseLinksStream", - "listFirebaseLinksAsync" - ] - }, - "ListGoogleAdsLinks": { - "methods": [ - "listGoogleAdsLinks", - "listGoogleAdsLinksStream", - "listGoogleAdsLinksAsync" - ] - }, - "ListMeasurementProtocolSecrets": { - "methods": [ - "listMeasurementProtocolSecrets", - "listMeasurementProtocolSecretsStream", - "listMeasurementProtocolSecretsAsync" - ] - }, - "SearchChangeHistoryEvents": { - "methods": [ - "searchChangeHistoryEvents", - "searchChangeHistoryEventsStream", - "searchChangeHistoryEventsAsync" - ] - }, - "ListConversionEvents": { - "methods": [ - "listConversionEvents", - "listConversionEventsStream", - "listConversionEventsAsync" - ] - }, - "ListDisplayVideo360AdvertiserLinks": { - "methods": [ - "listDisplayVideo360AdvertiserLinks", - "listDisplayVideo360AdvertiserLinksStream", - "listDisplayVideo360AdvertiserLinksAsync" - ] - }, - "ListDisplayVideo360AdvertiserLinkProposals": { - "methods": [ - "listDisplayVideo360AdvertiserLinkProposals", - "listDisplayVideo360AdvertiserLinkProposalsStream", - "listDisplayVideo360AdvertiserLinkProposalsAsync" - ] - }, - "ListCustomDimensions": { - "methods": [ - "listCustomDimensions", - "listCustomDimensionsStream", - "listCustomDimensionsAsync" - ] - }, - "ListCustomMetrics": { - "methods": [ - "listCustomMetrics", - "listCustomMetricsStream", - "listCustomMetricsAsync" - ] - }, - "ListDataStreams": { - "methods": [ - "listDataStreams", - "listDataStreamsStream", - "listDataStreamsAsync" - ] - } - } - } - } - } - } -} 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 6836b1c..0000000 --- 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 {AnalyticsAdminServiceClient} from './analytics_admin_service_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 763ea5c..0000000 --- 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 admin = require('@google-analytics/admin'); - -function main() { - const analyticsAdminServiceClient = new admin.AnalyticsAdminServiceClient(); -} - -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 6815309..0000000 --- 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 {AnalyticsAdminServiceClient} from '@google-analytics/admin'; - -// check that the client class type name can be used -function doStuffWithAnalyticsAdminServiceClient(client: AnalyticsAdminServiceClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const analyticsAdminServiceClient = new AnalyticsAdminServiceClient(); - doStuffWithAnalyticsAdminServiceClient(analyticsAdminServiceClient); -} - -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 8ec4522..0000000 --- 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_analytics_admin_service_v1alpha.ts b/owl-bot-staging/v1alpha/test/gapic_analytics_admin_service_v1alpha.ts deleted file mode 100644 index bdfc71f..0000000 --- a/owl-bot-staging/v1alpha/test/gapic_analytics_admin_service_v1alpha.ts +++ /dev/null @@ -1,9428 +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 analyticsadminserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -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); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1alpha.AnalyticsAdminServiceClient', () => { - it('has servicePath', () => { - const servicePath = analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.analyticsAdminServiceStub, undefined); - await client.initialize(); - assert(client.analyticsAdminServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.analyticsAdminServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.analyticsAdminServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - 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 analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - 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('getAccount', () => { - it('invokes getAccount without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetAccountRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()); - client.innerApiCalls.getAccount = stubSimpleCall(expectedResponse); - const [response] = await client.getAccount(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getAccount as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getAccount without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetAccountRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()); - client.innerApiCalls.getAccount = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getAccount( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAccount|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getAccount as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getAccount with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetAccountRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getAccount = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAccount(request), expectedError); - assert((client.innerApiCalls.getAccount as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getAccount with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetAccountRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getAccount(request), expectedError); - }); - }); - - describe('deleteAccount', () => { - it('invokes deleteAccount without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteAccountRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteAccount = stubSimpleCall(expectedResponse); - const [response] = await client.deleteAccount(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteAccount as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteAccount without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteAccountRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteAccount = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteAccount( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteAccount as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteAccount with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteAccountRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteAccount = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteAccount(request), expectedError); - assert((client.innerApiCalls.deleteAccount as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteAccount with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteAccountRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteAccount(request), expectedError); - }); - }); - - describe('updateAccount', () => { - it('invokes updateAccount without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateAccountRequest()); - request.account = {}; - request.account.name = ''; - const expectedHeaderRequestParams = "account.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()); - client.innerApiCalls.updateAccount = stubSimpleCall(expectedResponse); - const [response] = await client.updateAccount(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateAccount as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateAccount without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateAccountRequest()); - request.account = {}; - request.account.name = ''; - const expectedHeaderRequestParams = "account.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()); - client.innerApiCalls.updateAccount = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateAccount( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAccount|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateAccount as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateAccount with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateAccountRequest()); - request.account = {}; - request.account.name = ''; - const expectedHeaderRequestParams = "account.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateAccount = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateAccount(request), expectedError); - assert((client.innerApiCalls.updateAccount as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateAccount with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateAccountRequest()); - request.account = {}; - request.account.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateAccount(request), expectedError); - }); - }); - - describe('provisionAccountTicket', () => { - it('invokes provisionAccountTicket without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ProvisionAccountTicketRequest()); - const expectedOptions = {otherArgs: {headers: {}}};; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ProvisionAccountTicketResponse()); - client.innerApiCalls.provisionAccountTicket = stubSimpleCall(expectedResponse); - const [response] = await client.provisionAccountTicket(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.provisionAccountTicket as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes provisionAccountTicket without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ProvisionAccountTicketRequest()); - const expectedOptions = {otherArgs: {headers: {}}};; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ProvisionAccountTicketResponse()); - client.innerApiCalls.provisionAccountTicket = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.provisionAccountTicket( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IProvisionAccountTicketResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.provisionAccountTicket as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes provisionAccountTicket with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ProvisionAccountTicketRequest()); - const expectedOptions = {otherArgs: {headers: {}}};; - const expectedError = new Error('expected'); - client.innerApiCalls.provisionAccountTicket = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.provisionAccountTicket(request), expectedError); - assert((client.innerApiCalls.provisionAccountTicket as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes provisionAccountTicket with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ProvisionAccountTicketRequest()); - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.provisionAccountTicket(request), expectedError); - }); - }); - - describe('getProperty', () => { - it('invokes getProperty without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetPropertyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()); - client.innerApiCalls.getProperty = stubSimpleCall(expectedResponse); - const [response] = await client.getProperty(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getProperty as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getProperty without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetPropertyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()); - client.innerApiCalls.getProperty = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getProperty( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IProperty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getProperty as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getProperty with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetPropertyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getProperty = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getProperty(request), expectedError); - assert((client.innerApiCalls.getProperty as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getProperty with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetPropertyRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getProperty(request), expectedError); - }); - }); - - describe('createProperty', () => { - it('invokes createProperty without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreatePropertyRequest()); - const expectedOptions = {otherArgs: {headers: {}}};; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()); - client.innerApiCalls.createProperty = stubSimpleCall(expectedResponse); - const [response] = await client.createProperty(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createProperty as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createProperty without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreatePropertyRequest()); - const expectedOptions = {otherArgs: {headers: {}}};; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()); - client.innerApiCalls.createProperty = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createProperty( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IProperty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createProperty as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createProperty with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreatePropertyRequest()); - const expectedOptions = {otherArgs: {headers: {}}};; - const expectedError = new Error('expected'); - client.innerApiCalls.createProperty = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createProperty(request), expectedError); - assert((client.innerApiCalls.createProperty as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createProperty with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreatePropertyRequest()); - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createProperty(request), expectedError); - }); - }); - - describe('deleteProperty', () => { - it('invokes deleteProperty without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeletePropertyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()); - client.innerApiCalls.deleteProperty = stubSimpleCall(expectedResponse); - const [response] = await client.deleteProperty(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteProperty as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteProperty without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeletePropertyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()); - client.innerApiCalls.deleteProperty = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteProperty( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IProperty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteProperty as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteProperty with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeletePropertyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteProperty = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteProperty(request), expectedError); - assert((client.innerApiCalls.deleteProperty as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteProperty with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeletePropertyRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteProperty(request), expectedError); - }); - }); - - describe('updateProperty', () => { - it('invokes updateProperty without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdatePropertyRequest()); - request.property = {}; - request.property.name = ''; - const expectedHeaderRequestParams = "property.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()); - client.innerApiCalls.updateProperty = stubSimpleCall(expectedResponse); - const [response] = await client.updateProperty(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateProperty as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateProperty without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdatePropertyRequest()); - request.property = {}; - request.property.name = ''; - const expectedHeaderRequestParams = "property.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()); - client.innerApiCalls.updateProperty = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateProperty( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IProperty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateProperty as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateProperty with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdatePropertyRequest()); - request.property = {}; - request.property.name = ''; - const expectedHeaderRequestParams = "property.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateProperty = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateProperty(request), expectedError); - assert((client.innerApiCalls.updateProperty as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateProperty with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdatePropertyRequest()); - request.property = {}; - request.property.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateProperty(request), expectedError); - }); - }); - - describe('getUserLink', () => { - it('invokes getUserLink without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetUserLinkRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()); - client.innerApiCalls.getUserLink = stubSimpleCall(expectedResponse); - const [response] = await client.getUserLink(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getUserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getUserLink without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetUserLinkRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()); - client.innerApiCalls.getUserLink = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getUserLink( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IUserLink|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getUserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getUserLink with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetUserLinkRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getUserLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getUserLink(request), expectedError); - assert((client.innerApiCalls.getUserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getUserLink with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetUserLinkRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getUserLink(request), expectedError); - }); - }); - - describe('batchGetUserLinks', () => { - it('invokes batchGetUserLinks without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchGetUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchGetUserLinksResponse()); - client.innerApiCalls.batchGetUserLinks = stubSimpleCall(expectedResponse); - const [response] = await client.batchGetUserLinks(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchGetUserLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchGetUserLinks without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchGetUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchGetUserLinksResponse()); - client.innerApiCalls.batchGetUserLinks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchGetUserLinks( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IBatchGetUserLinksResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchGetUserLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes batchGetUserLinks with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchGetUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchGetUserLinks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchGetUserLinks(request), expectedError); - assert((client.innerApiCalls.batchGetUserLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchGetUserLinks with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchGetUserLinksRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchGetUserLinks(request), expectedError); - }); - }); - - describe('createUserLink', () => { - it('invokes createUserLink without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateUserLinkRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()); - client.innerApiCalls.createUserLink = stubSimpleCall(expectedResponse); - const [response] = await client.createUserLink(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createUserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createUserLink without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateUserLinkRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()); - client.innerApiCalls.createUserLink = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createUserLink( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IUserLink|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createUserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createUserLink with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateUserLinkRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createUserLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createUserLink(request), expectedError); - assert((client.innerApiCalls.createUserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createUserLink with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateUserLinkRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createUserLink(request), expectedError); - }); - }); - - describe('batchCreateUserLinks', () => { - it('invokes batchCreateUserLinks without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchCreateUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchCreateUserLinksResponse()); - client.innerApiCalls.batchCreateUserLinks = stubSimpleCall(expectedResponse); - const [response] = await client.batchCreateUserLinks(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchCreateUserLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchCreateUserLinks without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchCreateUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchCreateUserLinksResponse()); - client.innerApiCalls.batchCreateUserLinks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchCreateUserLinks( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IBatchCreateUserLinksResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchCreateUserLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes batchCreateUserLinks with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchCreateUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateUserLinks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchCreateUserLinks(request), expectedError); - assert((client.innerApiCalls.batchCreateUserLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchCreateUserLinks with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchCreateUserLinksRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchCreateUserLinks(request), expectedError); - }); - }); - - describe('updateUserLink', () => { - it('invokes updateUserLink without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateUserLinkRequest()); - request.userLink = {}; - request.userLink.name = ''; - const expectedHeaderRequestParams = "user_link.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()); - client.innerApiCalls.updateUserLink = stubSimpleCall(expectedResponse); - const [response] = await client.updateUserLink(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateUserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateUserLink without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateUserLinkRequest()); - request.userLink = {}; - request.userLink.name = ''; - const expectedHeaderRequestParams = "user_link.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()); - client.innerApiCalls.updateUserLink = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateUserLink( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IUserLink|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateUserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateUserLink with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateUserLinkRequest()); - request.userLink = {}; - request.userLink.name = ''; - const expectedHeaderRequestParams = "user_link.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateUserLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateUserLink(request), expectedError); - assert((client.innerApiCalls.updateUserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateUserLink with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateUserLinkRequest()); - request.userLink = {}; - request.userLink.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateUserLink(request), expectedError); - }); - }); - - describe('batchUpdateUserLinks', () => { - it('invokes batchUpdateUserLinks without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchUpdateUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchUpdateUserLinksResponse()); - client.innerApiCalls.batchUpdateUserLinks = stubSimpleCall(expectedResponse); - const [response] = await client.batchUpdateUserLinks(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchUpdateUserLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchUpdateUserLinks without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchUpdateUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchUpdateUserLinksResponse()); - client.innerApiCalls.batchUpdateUserLinks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchUpdateUserLinks( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IBatchUpdateUserLinksResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchUpdateUserLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes batchUpdateUserLinks with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchUpdateUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchUpdateUserLinks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchUpdateUserLinks(request), expectedError); - assert((client.innerApiCalls.batchUpdateUserLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchUpdateUserLinks with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchUpdateUserLinksRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchUpdateUserLinks(request), expectedError); - }); - }); - - describe('deleteUserLink', () => { - it('invokes deleteUserLink without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteUserLinkRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteUserLink = stubSimpleCall(expectedResponse); - const [response] = await client.deleteUserLink(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteUserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteUserLink without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteUserLinkRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteUserLink = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteUserLink( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteUserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteUserLink with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteUserLinkRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteUserLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteUserLink(request), expectedError); - assert((client.innerApiCalls.deleteUserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteUserLink with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteUserLinkRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteUserLink(request), expectedError); - }); - }); - - describe('batchDeleteUserLinks', () => { - it('invokes batchDeleteUserLinks without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchDeleteUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.batchDeleteUserLinks = stubSimpleCall(expectedResponse); - const [response] = await client.batchDeleteUserLinks(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchDeleteUserLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchDeleteUserLinks without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchDeleteUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.batchDeleteUserLinks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchDeleteUserLinks( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchDeleteUserLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes batchDeleteUserLinks with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchDeleteUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchDeleteUserLinks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchDeleteUserLinks(request), expectedError); - assert((client.innerApiCalls.batchDeleteUserLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchDeleteUserLinks with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.BatchDeleteUserLinksRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchDeleteUserLinks(request), expectedError); - }); - }); - - describe('createFirebaseLink', () => { - it('invokes createFirebaseLink without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateFirebaseLinkRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()); - client.innerApiCalls.createFirebaseLink = stubSimpleCall(expectedResponse); - const [response] = await client.createFirebaseLink(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createFirebaseLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createFirebaseLink without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateFirebaseLinkRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()); - client.innerApiCalls.createFirebaseLink = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createFirebaseLink( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IFirebaseLink|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createFirebaseLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createFirebaseLink with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateFirebaseLinkRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createFirebaseLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createFirebaseLink(request), expectedError); - assert((client.innerApiCalls.createFirebaseLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createFirebaseLink with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateFirebaseLinkRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createFirebaseLink(request), expectedError); - }); - }); - - describe('deleteFirebaseLink', () => { - it('invokes deleteFirebaseLink without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteFirebaseLinkRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteFirebaseLink = stubSimpleCall(expectedResponse); - const [response] = await client.deleteFirebaseLink(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteFirebaseLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteFirebaseLink without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteFirebaseLinkRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteFirebaseLink = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteFirebaseLink( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteFirebaseLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteFirebaseLink with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteFirebaseLinkRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFirebaseLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteFirebaseLink(request), expectedError); - assert((client.innerApiCalls.deleteFirebaseLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteFirebaseLink with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteFirebaseLinkRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteFirebaseLink(request), expectedError); - }); - }); - - describe('getGlobalSiteTag', () => { - it('invokes getGlobalSiteTag without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetGlobalSiteTagRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GlobalSiteTag()); - client.innerApiCalls.getGlobalSiteTag = stubSimpleCall(expectedResponse); - const [response] = await client.getGlobalSiteTag(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getGlobalSiteTag as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getGlobalSiteTag without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetGlobalSiteTagRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GlobalSiteTag()); - client.innerApiCalls.getGlobalSiteTag = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getGlobalSiteTag( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IGlobalSiteTag|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getGlobalSiteTag as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getGlobalSiteTag with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetGlobalSiteTagRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getGlobalSiteTag = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getGlobalSiteTag(request), expectedError); - assert((client.innerApiCalls.getGlobalSiteTag as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getGlobalSiteTag with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetGlobalSiteTagRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getGlobalSiteTag(request), expectedError); - }); - }); - - describe('createGoogleAdsLink', () => { - it('invokes createGoogleAdsLink without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateGoogleAdsLinkRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()); - client.innerApiCalls.createGoogleAdsLink = stubSimpleCall(expectedResponse); - const [response] = await client.createGoogleAdsLink(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createGoogleAdsLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createGoogleAdsLink without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateGoogleAdsLinkRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()); - client.innerApiCalls.createGoogleAdsLink = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createGoogleAdsLink( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IGoogleAdsLink|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createGoogleAdsLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createGoogleAdsLink with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateGoogleAdsLinkRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createGoogleAdsLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createGoogleAdsLink(request), expectedError); - assert((client.innerApiCalls.createGoogleAdsLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createGoogleAdsLink with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateGoogleAdsLinkRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createGoogleAdsLink(request), expectedError); - }); - }); - - describe('updateGoogleAdsLink', () => { - it('invokes updateGoogleAdsLink without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateGoogleAdsLinkRequest()); - request.googleAdsLink = {}; - request.googleAdsLink.name = ''; - const expectedHeaderRequestParams = "google_ads_link.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()); - client.innerApiCalls.updateGoogleAdsLink = stubSimpleCall(expectedResponse); - const [response] = await client.updateGoogleAdsLink(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateGoogleAdsLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateGoogleAdsLink without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateGoogleAdsLinkRequest()); - request.googleAdsLink = {}; - request.googleAdsLink.name = ''; - const expectedHeaderRequestParams = "google_ads_link.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()); - client.innerApiCalls.updateGoogleAdsLink = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateGoogleAdsLink( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IGoogleAdsLink|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateGoogleAdsLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateGoogleAdsLink with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateGoogleAdsLinkRequest()); - request.googleAdsLink = {}; - request.googleAdsLink.name = ''; - const expectedHeaderRequestParams = "google_ads_link.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateGoogleAdsLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateGoogleAdsLink(request), expectedError); - assert((client.innerApiCalls.updateGoogleAdsLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateGoogleAdsLink with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateGoogleAdsLinkRequest()); - request.googleAdsLink = {}; - request.googleAdsLink.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateGoogleAdsLink(request), expectedError); - }); - }); - - describe('deleteGoogleAdsLink', () => { - it('invokes deleteGoogleAdsLink without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteGoogleAdsLinkRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteGoogleAdsLink = stubSimpleCall(expectedResponse); - const [response] = await client.deleteGoogleAdsLink(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteGoogleAdsLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteGoogleAdsLink without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteGoogleAdsLinkRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteGoogleAdsLink = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteGoogleAdsLink( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteGoogleAdsLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteGoogleAdsLink with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteGoogleAdsLinkRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteGoogleAdsLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteGoogleAdsLink(request), expectedError); - assert((client.innerApiCalls.deleteGoogleAdsLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteGoogleAdsLink with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteGoogleAdsLinkRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteGoogleAdsLink(request), expectedError); - }); - }); - - describe('getDataSharingSettings', () => { - it('invokes getDataSharingSettings without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataSharingSettingsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataSharingSettings()); - client.innerApiCalls.getDataSharingSettings = stubSimpleCall(expectedResponse); - const [response] = await client.getDataSharingSettings(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDataSharingSettings as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDataSharingSettings without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataSharingSettingsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataSharingSettings()); - client.innerApiCalls.getDataSharingSettings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDataSharingSettings( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDataSharingSettings|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDataSharingSettings as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getDataSharingSettings with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataSharingSettingsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getDataSharingSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDataSharingSettings(request), expectedError); - assert((client.innerApiCalls.getDataSharingSettings as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDataSharingSettings with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataSharingSettingsRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getDataSharingSettings(request), expectedError); - }); - }); - - describe('getMeasurementProtocolSecret', () => { - it('invokes getMeasurementProtocolSecret without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetMeasurementProtocolSecretRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()); - client.innerApiCalls.getMeasurementProtocolSecret = stubSimpleCall(expectedResponse); - const [response] = await client.getMeasurementProtocolSecret(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getMeasurementProtocolSecret without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetMeasurementProtocolSecretRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()); - client.innerApiCalls.getMeasurementProtocolSecret = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getMeasurementProtocolSecret( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getMeasurementProtocolSecret with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetMeasurementProtocolSecretRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getMeasurementProtocolSecret(request), expectedError); - assert((client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getMeasurementProtocolSecret with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetMeasurementProtocolSecretRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getMeasurementProtocolSecret(request), expectedError); - }); - }); - - describe('createMeasurementProtocolSecret', () => { - it('invokes createMeasurementProtocolSecret without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateMeasurementProtocolSecretRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()); - client.innerApiCalls.createMeasurementProtocolSecret = stubSimpleCall(expectedResponse); - const [response] = await client.createMeasurementProtocolSecret(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createMeasurementProtocolSecret without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateMeasurementProtocolSecretRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()); - client.innerApiCalls.createMeasurementProtocolSecret = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createMeasurementProtocolSecret( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createMeasurementProtocolSecret with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateMeasurementProtocolSecretRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createMeasurementProtocolSecret(request), expectedError); - assert((client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createMeasurementProtocolSecret with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateMeasurementProtocolSecretRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createMeasurementProtocolSecret(request), expectedError); - }); - }); - - describe('deleteMeasurementProtocolSecret', () => { - it('invokes deleteMeasurementProtocolSecret without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteMeasurementProtocolSecretRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteMeasurementProtocolSecret = stubSimpleCall(expectedResponse); - const [response] = await client.deleteMeasurementProtocolSecret(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteMeasurementProtocolSecret without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteMeasurementProtocolSecretRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteMeasurementProtocolSecret = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteMeasurementProtocolSecret( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteMeasurementProtocolSecret with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteMeasurementProtocolSecretRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteMeasurementProtocolSecret(request), expectedError); - assert((client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteMeasurementProtocolSecret with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteMeasurementProtocolSecretRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteMeasurementProtocolSecret(request), expectedError); - }); - }); - - describe('updateMeasurementProtocolSecret', () => { - it('invokes updateMeasurementProtocolSecret without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateMeasurementProtocolSecretRequest()); - request.measurementProtocolSecret = {}; - request.measurementProtocolSecret.name = ''; - const expectedHeaderRequestParams = "measurement_protocol_secret.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()); - client.innerApiCalls.updateMeasurementProtocolSecret = stubSimpleCall(expectedResponse); - const [response] = await client.updateMeasurementProtocolSecret(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateMeasurementProtocolSecret without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateMeasurementProtocolSecretRequest()); - request.measurementProtocolSecret = {}; - request.measurementProtocolSecret.name = ''; - const expectedHeaderRequestParams = "measurement_protocol_secret.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()); - client.innerApiCalls.updateMeasurementProtocolSecret = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateMeasurementProtocolSecret( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateMeasurementProtocolSecret with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateMeasurementProtocolSecretRequest()); - request.measurementProtocolSecret = {}; - request.measurementProtocolSecret.name = ''; - const expectedHeaderRequestParams = "measurement_protocol_secret.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateMeasurementProtocolSecret(request), expectedError); - assert((client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateMeasurementProtocolSecret with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateMeasurementProtocolSecretRequest()); - request.measurementProtocolSecret = {}; - request.measurementProtocolSecret.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateMeasurementProtocolSecret(request), expectedError); - }); - }); - - describe('acknowledgeUserDataCollection', () => { - it('invokes acknowledgeUserDataCollection without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionResponse()); - client.innerApiCalls.acknowledgeUserDataCollection = stubSimpleCall(expectedResponse); - const [response] = await client.acknowledgeUserDataCollection(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes acknowledgeUserDataCollection without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionResponse()); - client.innerApiCalls.acknowledgeUserDataCollection = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.acknowledgeUserDataCollection( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes acknowledgeUserDataCollection with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionRequest()); - request.property = ''; - const expectedHeaderRequestParams = "property="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.acknowledgeUserDataCollection = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.acknowledgeUserDataCollection(request), expectedError); - assert((client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes acknowledgeUserDataCollection with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionRequest()); - request.property = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.acknowledgeUserDataCollection(request), expectedError); - }); - }); - - describe('getGoogleSignalsSettings', () => { - it('invokes getGoogleSignalsSettings without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetGoogleSignalsSettingsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleSignalsSettings()); - client.innerApiCalls.getGoogleSignalsSettings = stubSimpleCall(expectedResponse); - const [response] = await client.getGoogleSignalsSettings(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getGoogleSignalsSettings as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getGoogleSignalsSettings without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetGoogleSignalsSettingsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleSignalsSettings()); - client.innerApiCalls.getGoogleSignalsSettings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getGoogleSignalsSettings( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getGoogleSignalsSettings as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getGoogleSignalsSettings with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetGoogleSignalsSettingsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getGoogleSignalsSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getGoogleSignalsSettings(request), expectedError); - assert((client.innerApiCalls.getGoogleSignalsSettings as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getGoogleSignalsSettings with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetGoogleSignalsSettingsRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getGoogleSignalsSettings(request), expectedError); - }); - }); - - describe('updateGoogleSignalsSettings', () => { - it('invokes updateGoogleSignalsSettings without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateGoogleSignalsSettingsRequest()); - request.googleSignalsSettings = {}; - request.googleSignalsSettings.name = ''; - const expectedHeaderRequestParams = "google_signals_settings.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleSignalsSettings()); - client.innerApiCalls.updateGoogleSignalsSettings = stubSimpleCall(expectedResponse); - const [response] = await client.updateGoogleSignalsSettings(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateGoogleSignalsSettings as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateGoogleSignalsSettings without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateGoogleSignalsSettingsRequest()); - request.googleSignalsSettings = {}; - request.googleSignalsSettings.name = ''; - const expectedHeaderRequestParams = "google_signals_settings.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleSignalsSettings()); - client.innerApiCalls.updateGoogleSignalsSettings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateGoogleSignalsSettings( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateGoogleSignalsSettings as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateGoogleSignalsSettings with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateGoogleSignalsSettingsRequest()); - request.googleSignalsSettings = {}; - request.googleSignalsSettings.name = ''; - const expectedHeaderRequestParams = "google_signals_settings.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateGoogleSignalsSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateGoogleSignalsSettings(request), expectedError); - assert((client.innerApiCalls.updateGoogleSignalsSettings as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateGoogleSignalsSettings with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateGoogleSignalsSettingsRequest()); - request.googleSignalsSettings = {}; - request.googleSignalsSettings.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateGoogleSignalsSettings(request), expectedError); - }); - }); - - describe('createConversionEvent', () => { - it('invokes createConversionEvent without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateConversionEventRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()); - client.innerApiCalls.createConversionEvent = stubSimpleCall(expectedResponse); - const [response] = await client.createConversionEvent(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createConversionEvent as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createConversionEvent without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateConversionEventRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()); - client.innerApiCalls.createConversionEvent = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createConversionEvent( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IConversionEvent|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createConversionEvent as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createConversionEvent with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateConversionEventRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createConversionEvent = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createConversionEvent(request), expectedError); - assert((client.innerApiCalls.createConversionEvent as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createConversionEvent with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateConversionEventRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createConversionEvent(request), expectedError); - }); - }); - - describe('getConversionEvent', () => { - it('invokes getConversionEvent without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetConversionEventRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()); - client.innerApiCalls.getConversionEvent = stubSimpleCall(expectedResponse); - const [response] = await client.getConversionEvent(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getConversionEvent as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getConversionEvent without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetConversionEventRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()); - client.innerApiCalls.getConversionEvent = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getConversionEvent( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IConversionEvent|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getConversionEvent as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getConversionEvent with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetConversionEventRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getConversionEvent = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getConversionEvent(request), expectedError); - assert((client.innerApiCalls.getConversionEvent as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getConversionEvent with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetConversionEventRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getConversionEvent(request), expectedError); - }); - }); - - describe('deleteConversionEvent', () => { - it('invokes deleteConversionEvent without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteConversionEventRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteConversionEvent = stubSimpleCall(expectedResponse); - const [response] = await client.deleteConversionEvent(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteConversionEvent as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteConversionEvent without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteConversionEventRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteConversionEvent = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteConversionEvent( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteConversionEvent as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteConversionEvent with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteConversionEventRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteConversionEvent = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteConversionEvent(request), expectedError); - assert((client.innerApiCalls.deleteConversionEvent as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteConversionEvent with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteConversionEventRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteConversionEvent(request), expectedError); - }); - }); - - describe('getDisplayVideo360AdvertiserLink', () => { - it('invokes getDisplayVideo360AdvertiserLink without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()); - client.innerApiCalls.getDisplayVideo360AdvertiserLink = stubSimpleCall(expectedResponse); - const [response] = await client.getDisplayVideo360AdvertiserLink(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDisplayVideo360AdvertiserLink without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()); - client.innerApiCalls.getDisplayVideo360AdvertiserLink = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDisplayVideo360AdvertiserLink( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getDisplayVideo360AdvertiserLink with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getDisplayVideo360AdvertiserLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDisplayVideo360AdvertiserLink(request), expectedError); - assert((client.innerApiCalls.getDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDisplayVideo360AdvertiserLink with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getDisplayVideo360AdvertiserLink(request), expectedError); - }); - }); - - describe('createDisplayVideo360AdvertiserLink', () => { - it('invokes createDisplayVideo360AdvertiserLink without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()); - client.innerApiCalls.createDisplayVideo360AdvertiserLink = stubSimpleCall(expectedResponse); - const [response] = await client.createDisplayVideo360AdvertiserLink(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createDisplayVideo360AdvertiserLink without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()); - client.innerApiCalls.createDisplayVideo360AdvertiserLink = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDisplayVideo360AdvertiserLink( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createDisplayVideo360AdvertiserLink with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createDisplayVideo360AdvertiserLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDisplayVideo360AdvertiserLink(request), expectedError); - assert((client.innerApiCalls.createDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createDisplayVideo360AdvertiserLink with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createDisplayVideo360AdvertiserLink(request), expectedError); - }); - }); - - describe('deleteDisplayVideo360AdvertiserLink', () => { - it('invokes deleteDisplayVideo360AdvertiserLink without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteDisplayVideo360AdvertiserLink = stubSimpleCall(expectedResponse); - const [response] = await client.deleteDisplayVideo360AdvertiserLink(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteDisplayVideo360AdvertiserLink without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteDisplayVideo360AdvertiserLink = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteDisplayVideo360AdvertiserLink( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteDisplayVideo360AdvertiserLink with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDisplayVideo360AdvertiserLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteDisplayVideo360AdvertiserLink(request), expectedError); - assert((client.innerApiCalls.deleteDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteDisplayVideo360AdvertiserLink with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteDisplayVideo360AdvertiserLink(request), expectedError); - }); - }); - - describe('updateDisplayVideo360AdvertiserLink', () => { - it('invokes updateDisplayVideo360AdvertiserLink without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDisplayVideo360AdvertiserLinkRequest()); - request.displayVideo_360AdvertiserLink = {}; - request.displayVideo_360AdvertiserLink.name = ''; - const expectedHeaderRequestParams = "display_video_360_advertiser_link.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()); - client.innerApiCalls.updateDisplayVideo360AdvertiserLink = stubSimpleCall(expectedResponse); - const [response] = await client.updateDisplayVideo360AdvertiserLink(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateDisplayVideo360AdvertiserLink without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDisplayVideo360AdvertiserLinkRequest()); - request.displayVideo_360AdvertiserLink = {}; - request.displayVideo_360AdvertiserLink.name = ''; - const expectedHeaderRequestParams = "display_video_360_advertiser_link.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()); - client.innerApiCalls.updateDisplayVideo360AdvertiserLink = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateDisplayVideo360AdvertiserLink( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateDisplayVideo360AdvertiserLink with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDisplayVideo360AdvertiserLinkRequest()); - request.displayVideo_360AdvertiserLink = {}; - request.displayVideo_360AdvertiserLink.name = ''; - const expectedHeaderRequestParams = "display_video_360_advertiser_link.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDisplayVideo360AdvertiserLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateDisplayVideo360AdvertiserLink(request), expectedError); - assert((client.innerApiCalls.updateDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateDisplayVideo360AdvertiserLink with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDisplayVideo360AdvertiserLinkRequest()); - request.displayVideo_360AdvertiserLink = {}; - request.displayVideo_360AdvertiserLink.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateDisplayVideo360AdvertiserLink(request), expectedError); - }); - }); - - describe('getDisplayVideo360AdvertiserLinkProposal', () => { - it('invokes getDisplayVideo360AdvertiserLinkProposal without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkProposalRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()); - client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(expectedResponse); - const [response] = await client.getDisplayVideo360AdvertiserLinkProposal(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDisplayVideo360AdvertiserLinkProposal without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkProposalRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()); - client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDisplayVideo360AdvertiserLinkProposal( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getDisplayVideo360AdvertiserLinkProposal with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkProposalRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDisplayVideo360AdvertiserLinkProposal(request), expectedError); - assert((client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDisplayVideo360AdvertiserLinkProposal with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkProposalRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getDisplayVideo360AdvertiserLinkProposal(request), expectedError); - }); - }); - - describe('createDisplayVideo360AdvertiserLinkProposal', () => { - it('invokes createDisplayVideo360AdvertiserLinkProposal without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkProposalRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()); - client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(expectedResponse); - const [response] = await client.createDisplayVideo360AdvertiserLinkProposal(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createDisplayVideo360AdvertiserLinkProposal without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkProposalRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()); - client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDisplayVideo360AdvertiserLinkProposal( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createDisplayVideo360AdvertiserLinkProposal with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkProposalRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDisplayVideo360AdvertiserLinkProposal(request), expectedError); - assert((client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createDisplayVideo360AdvertiserLinkProposal with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkProposalRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createDisplayVideo360AdvertiserLinkProposal(request), expectedError); - }); - }); - - describe('deleteDisplayVideo360AdvertiserLinkProposal', () => { - it('invokes deleteDisplayVideo360AdvertiserLinkProposal without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkProposalRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(expectedResponse); - const [response] = await client.deleteDisplayVideo360AdvertiserLinkProposal(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteDisplayVideo360AdvertiserLinkProposal without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkProposalRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteDisplayVideo360AdvertiserLinkProposal( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteDisplayVideo360AdvertiserLinkProposal with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkProposalRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteDisplayVideo360AdvertiserLinkProposal(request), expectedError); - assert((client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteDisplayVideo360AdvertiserLinkProposal with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkProposalRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteDisplayVideo360AdvertiserLinkProposal(request), expectedError); - }); - }); - - describe('approveDisplayVideo360AdvertiserLinkProposal', () => { - it('invokes approveDisplayVideo360AdvertiserLinkProposal without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalResponse()); - client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(expectedResponse); - const [response] = await client.approveDisplayVideo360AdvertiserLinkProposal(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes approveDisplayVideo360AdvertiserLinkProposal without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalResponse()); - client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.approveDisplayVideo360AdvertiserLinkProposal( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes approveDisplayVideo360AdvertiserLinkProposal with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.approveDisplayVideo360AdvertiserLinkProposal(request), expectedError); - assert((client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes approveDisplayVideo360AdvertiserLinkProposal with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.approveDisplayVideo360AdvertiserLinkProposal(request), expectedError); - }); - }); - - describe('cancelDisplayVideo360AdvertiserLinkProposal', () => { - it('invokes cancelDisplayVideo360AdvertiserLinkProposal without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CancelDisplayVideo360AdvertiserLinkProposalRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()); - client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(expectedResponse); - const [response] = await client.cancelDisplayVideo360AdvertiserLinkProposal(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelDisplayVideo360AdvertiserLinkProposal without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CancelDisplayVideo360AdvertiserLinkProposalRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()); - client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelDisplayVideo360AdvertiserLinkProposal( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes cancelDisplayVideo360AdvertiserLinkProposal with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CancelDisplayVideo360AdvertiserLinkProposalRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelDisplayVideo360AdvertiserLinkProposal(request), expectedError); - assert((client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelDisplayVideo360AdvertiserLinkProposal with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CancelDisplayVideo360AdvertiserLinkProposalRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelDisplayVideo360AdvertiserLinkProposal(request), expectedError); - }); - }); - - describe('createCustomDimension', () => { - it('invokes createCustomDimension without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateCustomDimensionRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()); - client.innerApiCalls.createCustomDimension = stubSimpleCall(expectedResponse); - const [response] = await client.createCustomDimension(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createCustomDimension as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createCustomDimension without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateCustomDimensionRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()); - client.innerApiCalls.createCustomDimension = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCustomDimension( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ICustomDimension|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createCustomDimension as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createCustomDimension with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateCustomDimensionRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createCustomDimension = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createCustomDimension(request), expectedError); - assert((client.innerApiCalls.createCustomDimension as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createCustomDimension with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateCustomDimensionRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createCustomDimension(request), expectedError); - }); - }); - - describe('updateCustomDimension', () => { - it('invokes updateCustomDimension without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateCustomDimensionRequest()); - request.customDimension = {}; - request.customDimension.name = ''; - const expectedHeaderRequestParams = "custom_dimension.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()); - client.innerApiCalls.updateCustomDimension = stubSimpleCall(expectedResponse); - const [response] = await client.updateCustomDimension(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateCustomDimension as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateCustomDimension without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateCustomDimensionRequest()); - request.customDimension = {}; - request.customDimension.name = ''; - const expectedHeaderRequestParams = "custom_dimension.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()); - client.innerApiCalls.updateCustomDimension = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCustomDimension( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ICustomDimension|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateCustomDimension as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateCustomDimension with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateCustomDimensionRequest()); - request.customDimension = {}; - request.customDimension.name = ''; - const expectedHeaderRequestParams = "custom_dimension.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCustomDimension = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateCustomDimension(request), expectedError); - assert((client.innerApiCalls.updateCustomDimension as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateCustomDimension with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateCustomDimensionRequest()); - request.customDimension = {}; - request.customDimension.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateCustomDimension(request), expectedError); - }); - }); - - describe('archiveCustomDimension', () => { - it('invokes archiveCustomDimension without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ArchiveCustomDimensionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.archiveCustomDimension = stubSimpleCall(expectedResponse); - const [response] = await client.archiveCustomDimension(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.archiveCustomDimension as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes archiveCustomDimension without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ArchiveCustomDimensionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.archiveCustomDimension = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.archiveCustomDimension( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.archiveCustomDimension as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes archiveCustomDimension with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ArchiveCustomDimensionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.archiveCustomDimension = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.archiveCustomDimension(request), expectedError); - assert((client.innerApiCalls.archiveCustomDimension as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes archiveCustomDimension with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ArchiveCustomDimensionRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.archiveCustomDimension(request), expectedError); - }); - }); - - describe('getCustomDimension', () => { - it('invokes getCustomDimension without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetCustomDimensionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()); - client.innerApiCalls.getCustomDimension = stubSimpleCall(expectedResponse); - const [response] = await client.getCustomDimension(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getCustomDimension as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getCustomDimension without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetCustomDimensionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()); - client.innerApiCalls.getCustomDimension = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCustomDimension( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ICustomDimension|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getCustomDimension as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getCustomDimension with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetCustomDimensionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getCustomDimension = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCustomDimension(request), expectedError); - assert((client.innerApiCalls.getCustomDimension as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getCustomDimension with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetCustomDimensionRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getCustomDimension(request), expectedError); - }); - }); - - describe('createCustomMetric', () => { - it('invokes createCustomMetric without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateCustomMetricRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()); - client.innerApiCalls.createCustomMetric = stubSimpleCall(expectedResponse); - const [response] = await client.createCustomMetric(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createCustomMetric as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createCustomMetric without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateCustomMetricRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()); - client.innerApiCalls.createCustomMetric = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCustomMetric( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ICustomMetric|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createCustomMetric as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createCustomMetric with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateCustomMetricRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createCustomMetric = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createCustomMetric(request), expectedError); - assert((client.innerApiCalls.createCustomMetric as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createCustomMetric with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateCustomMetricRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createCustomMetric(request), expectedError); - }); - }); - - describe('updateCustomMetric', () => { - it('invokes updateCustomMetric without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateCustomMetricRequest()); - request.customMetric = {}; - request.customMetric.name = ''; - const expectedHeaderRequestParams = "custom_metric.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()); - client.innerApiCalls.updateCustomMetric = stubSimpleCall(expectedResponse); - const [response] = await client.updateCustomMetric(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateCustomMetric as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateCustomMetric without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateCustomMetricRequest()); - request.customMetric = {}; - request.customMetric.name = ''; - const expectedHeaderRequestParams = "custom_metric.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()); - client.innerApiCalls.updateCustomMetric = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCustomMetric( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ICustomMetric|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateCustomMetric as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateCustomMetric with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateCustomMetricRequest()); - request.customMetric = {}; - request.customMetric.name = ''; - const expectedHeaderRequestParams = "custom_metric.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCustomMetric = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateCustomMetric(request), expectedError); - assert((client.innerApiCalls.updateCustomMetric as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateCustomMetric with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateCustomMetricRequest()); - request.customMetric = {}; - request.customMetric.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateCustomMetric(request), expectedError); - }); - }); - - describe('archiveCustomMetric', () => { - it('invokes archiveCustomMetric without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ArchiveCustomMetricRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.archiveCustomMetric = stubSimpleCall(expectedResponse); - const [response] = await client.archiveCustomMetric(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.archiveCustomMetric as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes archiveCustomMetric without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ArchiveCustomMetricRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.archiveCustomMetric = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.archiveCustomMetric( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.archiveCustomMetric as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes archiveCustomMetric with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ArchiveCustomMetricRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.archiveCustomMetric = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.archiveCustomMetric(request), expectedError); - assert((client.innerApiCalls.archiveCustomMetric as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes archiveCustomMetric with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ArchiveCustomMetricRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.archiveCustomMetric(request), expectedError); - }); - }); - - describe('getCustomMetric', () => { - it('invokes getCustomMetric without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetCustomMetricRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()); - client.innerApiCalls.getCustomMetric = stubSimpleCall(expectedResponse); - const [response] = await client.getCustomMetric(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getCustomMetric as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getCustomMetric without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetCustomMetricRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()); - client.innerApiCalls.getCustomMetric = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCustomMetric( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ICustomMetric|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getCustomMetric as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getCustomMetric with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetCustomMetricRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getCustomMetric = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCustomMetric(request), expectedError); - assert((client.innerApiCalls.getCustomMetric as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getCustomMetric with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetCustomMetricRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getCustomMetric(request), expectedError); - }); - }); - - describe('getDataRetentionSettings', () => { - it('invokes getDataRetentionSettings without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataRetentionSettingsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataRetentionSettings()); - client.innerApiCalls.getDataRetentionSettings = stubSimpleCall(expectedResponse); - const [response] = await client.getDataRetentionSettings(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDataRetentionSettings as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDataRetentionSettings without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataRetentionSettingsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataRetentionSettings()); - client.innerApiCalls.getDataRetentionSettings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDataRetentionSettings( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDataRetentionSettings|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDataRetentionSettings as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getDataRetentionSettings with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataRetentionSettingsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getDataRetentionSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDataRetentionSettings(request), expectedError); - assert((client.innerApiCalls.getDataRetentionSettings as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDataRetentionSettings with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataRetentionSettingsRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getDataRetentionSettings(request), expectedError); - }); - }); - - describe('updateDataRetentionSettings', () => { - it('invokes updateDataRetentionSettings without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDataRetentionSettingsRequest()); - request.dataRetentionSettings = {}; - request.dataRetentionSettings.name = ''; - const expectedHeaderRequestParams = "data_retention_settings.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataRetentionSettings()); - client.innerApiCalls.updateDataRetentionSettings = stubSimpleCall(expectedResponse); - const [response] = await client.updateDataRetentionSettings(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateDataRetentionSettings as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateDataRetentionSettings without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDataRetentionSettingsRequest()); - request.dataRetentionSettings = {}; - request.dataRetentionSettings.name = ''; - const expectedHeaderRequestParams = "data_retention_settings.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataRetentionSettings()); - client.innerApiCalls.updateDataRetentionSettings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateDataRetentionSettings( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDataRetentionSettings|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateDataRetentionSettings as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateDataRetentionSettings with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDataRetentionSettingsRequest()); - request.dataRetentionSettings = {}; - request.dataRetentionSettings.name = ''; - const expectedHeaderRequestParams = "data_retention_settings.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDataRetentionSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateDataRetentionSettings(request), expectedError); - assert((client.innerApiCalls.updateDataRetentionSettings as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateDataRetentionSettings with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDataRetentionSettingsRequest()); - request.dataRetentionSettings = {}; - request.dataRetentionSettings.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateDataRetentionSettings(request), expectedError); - }); - }); - - describe('createDataStream', () => { - it('invokes createDataStream without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDataStreamRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()); - client.innerApiCalls.createDataStream = stubSimpleCall(expectedResponse); - const [response] = await client.createDataStream(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createDataStream as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createDataStream without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDataStreamRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()); - client.innerApiCalls.createDataStream = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDataStream( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDataStream|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createDataStream as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createDataStream with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDataStreamRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createDataStream = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDataStream(request), expectedError); - assert((client.innerApiCalls.createDataStream as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createDataStream with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.CreateDataStreamRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createDataStream(request), expectedError); - }); - }); - - describe('deleteDataStream', () => { - it('invokes deleteDataStream without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDataStreamRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteDataStream = stubSimpleCall(expectedResponse); - const [response] = await client.deleteDataStream(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteDataStream as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteDataStream without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDataStreamRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteDataStream = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteDataStream( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteDataStream as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteDataStream with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDataStreamRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDataStream = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteDataStream(request), expectedError); - assert((client.innerApiCalls.deleteDataStream as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteDataStream with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DeleteDataStreamRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteDataStream(request), expectedError); - }); - }); - - describe('updateDataStream', () => { - it('invokes updateDataStream without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDataStreamRequest()); - request.dataStream = {}; - request.dataStream.name = ''; - const expectedHeaderRequestParams = "data_stream.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()); - client.innerApiCalls.updateDataStream = stubSimpleCall(expectedResponse); - const [response] = await client.updateDataStream(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateDataStream as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateDataStream without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDataStreamRequest()); - request.dataStream = {}; - request.dataStream.name = ''; - const expectedHeaderRequestParams = "data_stream.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()); - client.innerApiCalls.updateDataStream = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateDataStream( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDataStream|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateDataStream as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateDataStream with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDataStreamRequest()); - request.dataStream = {}; - request.dataStream.name = ''; - const expectedHeaderRequestParams = "data_stream.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDataStream = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateDataStream(request), expectedError); - assert((client.innerApiCalls.updateDataStream as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateDataStream with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.UpdateDataStreamRequest()); - request.dataStream = {}; - request.dataStream.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateDataStream(request), expectedError); - }); - }); - - describe('getDataStream', () => { - it('invokes getDataStream without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataStreamRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()); - client.innerApiCalls.getDataStream = stubSimpleCall(expectedResponse); - const [response] = await client.getDataStream(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDataStream as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDataStream without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataStreamRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()); - client.innerApiCalls.getDataStream = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDataStream( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDataStream|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDataStream as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getDataStream with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataStreamRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getDataStream = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDataStream(request), expectedError); - assert((client.innerApiCalls.getDataStream as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDataStream with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.GetDataStreamRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getDataStream(request), expectedError); - }); - }); - - describe('listAccounts', () => { - it('invokes listAccounts without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountsRequest()); - const expectedOptions = {otherArgs: {headers: {}}};; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), - ]; - client.innerApiCalls.listAccounts = stubSimpleCall(expectedResponse); - const [response] = await client.listAccounts(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listAccounts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listAccounts without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountsRequest()); - const expectedOptions = {otherArgs: {headers: {}}};; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), - ]; - client.innerApiCalls.listAccounts = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAccounts( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAccount[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listAccounts as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listAccounts with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountsRequest()); - const expectedOptions = {otherArgs: {headers: {}}};; - const expectedError = new Error('expected'); - client.innerApiCalls.listAccounts = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAccounts(request), expectedError); - assert((client.innerApiCalls.listAccounts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listAccountsStream without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountsRequest()); - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), - ]; - client.descriptors.page.listAccounts.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAccountsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.Account[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.Account) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listAccounts.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAccounts, request)); - }); - - it('invokes listAccountsStream with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountsRequest()); - const expectedError = new Error('expected'); - client.descriptors.page.listAccounts.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAccountsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.Account[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.Account) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAccounts.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAccounts, request)); - }); - - it('uses async iteration with listAccounts without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountsRequest()); - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Account()), - ]; - client.descriptors.page.listAccounts.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1alpha.IAccount[] = []; - const iterable = client.listAccountsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAccounts.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - - it('uses async iteration with listAccounts with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountsRequest());const expectedError = new Error('expected'); - client.descriptors.page.listAccounts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAccountsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.analytics.admin.v1alpha.IAccount[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAccounts.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('listAccountSummaries', () => { - it('invokes listAccountSummaries without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountSummariesRequest()); - const expectedOptions = {otherArgs: {headers: {}}};; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), - ]; - client.innerApiCalls.listAccountSummaries = stubSimpleCall(expectedResponse); - const [response] = await client.listAccountSummaries(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listAccountSummaries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listAccountSummaries without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountSummariesRequest()); - const expectedOptions = {otherArgs: {headers: {}}};; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), - ]; - client.innerApiCalls.listAccountSummaries = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAccountSummaries( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAccountSummary[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listAccountSummaries as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listAccountSummaries with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountSummariesRequest()); - const expectedOptions = {otherArgs: {headers: {}}};; - const expectedError = new Error('expected'); - client.innerApiCalls.listAccountSummaries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAccountSummaries(request), expectedError); - assert((client.innerApiCalls.listAccountSummaries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listAccountSummariesStream without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountSummariesRequest()); - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), - ]; - client.descriptors.page.listAccountSummaries.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAccountSummariesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.AccountSummary[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.AccountSummary) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listAccountSummaries.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAccountSummaries, request)); - }); - - it('invokes listAccountSummariesStream with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountSummariesRequest()); - const expectedError = new Error('expected'); - client.descriptors.page.listAccountSummaries.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAccountSummariesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.AccountSummary[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.AccountSummary) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAccountSummaries.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAccountSummaries, request)); - }); - - it('uses async iteration with listAccountSummaries without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountSummariesRequest()); - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccountSummary()), - ]; - client.descriptors.page.listAccountSummaries.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1alpha.IAccountSummary[] = []; - const iterable = client.listAccountSummariesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAccountSummaries.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - - it('uses async iteration with listAccountSummaries with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListAccountSummariesRequest());const expectedError = new Error('expected'); - client.descriptors.page.listAccountSummaries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAccountSummariesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.analytics.admin.v1alpha.IAccountSummary[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAccountSummaries.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('listProperties', () => { - it('invokes listProperties without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListPropertiesRequest()); - const expectedOptions = {otherArgs: {headers: {}}};; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), - ]; - client.innerApiCalls.listProperties = stubSimpleCall(expectedResponse); - const [response] = await client.listProperties(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listProperties as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listProperties without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListPropertiesRequest()); - const expectedOptions = {otherArgs: {headers: {}}};; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), - ]; - client.innerApiCalls.listProperties = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listProperties( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IProperty[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listProperties as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listProperties with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListPropertiesRequest()); - const expectedOptions = {otherArgs: {headers: {}}};; - const expectedError = new Error('expected'); - client.innerApiCalls.listProperties = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listProperties(request), expectedError); - assert((client.innerApiCalls.listProperties as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listPropertiesStream without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListPropertiesRequest()); - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), - ]; - client.descriptors.page.listProperties.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listPropertiesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.Property[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.Property) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listProperties.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listProperties, request)); - }); - - it('invokes listPropertiesStream with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListPropertiesRequest()); - const expectedError = new Error('expected'); - client.descriptors.page.listProperties.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listPropertiesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.Property[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.Property) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listProperties.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listProperties, request)); - }); - - it('uses async iteration with listProperties without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListPropertiesRequest()); - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Property()), - ]; - client.descriptors.page.listProperties.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1alpha.IProperty[] = []; - const iterable = client.listPropertiesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listProperties.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - - it('uses async iteration with listProperties with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListPropertiesRequest());const expectedError = new Error('expected'); - client.descriptors.page.listProperties.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listPropertiesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.analytics.admin.v1alpha.IProperty[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listProperties.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('listUserLinks', () => { - it('invokes listUserLinks without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), - ]; - client.innerApiCalls.listUserLinks = stubSimpleCall(expectedResponse); - const [response] = await client.listUserLinks(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listUserLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listUserLinks without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), - ]; - client.innerApiCalls.listUserLinks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listUserLinks( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IUserLink[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listUserLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listUserLinks with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listUserLinks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listUserLinks(request), expectedError); - assert((client.innerApiCalls.listUserLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listUserLinksStream without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), - ]; - client.descriptors.page.listUserLinks.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listUserLinksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.UserLink[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.UserLink) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listUserLinks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listUserLinks, request)); - assert.strictEqual( - (client.descriptors.page.listUserLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listUserLinksStream with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listUserLinks.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listUserLinksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.UserLink[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.UserLink) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listUserLinks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listUserLinks, request)); - assert.strictEqual( - (client.descriptors.page.listUserLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listUserLinks without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.UserLink()), - ]; - client.descriptors.page.listUserLinks.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1alpha.IUserLink[] = []; - const iterable = client.listUserLinksAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listUserLinks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listUserLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listUserLinks with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listUserLinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listUserLinksAsync(request); - await assert.rejects(async () => { - const responses: protos.google.analytics.admin.v1alpha.IUserLink[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listUserLinks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listUserLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('auditUserLinks', () => { - it('invokes auditUserLinks without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), - ]; - client.innerApiCalls.auditUserLinks = stubSimpleCall(expectedResponse); - const [response] = await client.auditUserLinks(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.auditUserLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes auditUserLinks without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), - ]; - client.innerApiCalls.auditUserLinks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.auditUserLinks( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAuditUserLink[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.auditUserLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes auditUserLinks with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.auditUserLinks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.auditUserLinks(request), expectedError); - assert((client.innerApiCalls.auditUserLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes auditUserLinksStream without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), - ]; - client.descriptors.page.auditUserLinks.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.auditUserLinksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.AuditUserLink[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.AuditUserLink) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.auditUserLinks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.auditUserLinks, request)); - assert.strictEqual( - (client.descriptors.page.auditUserLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes auditUserLinksStream with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.auditUserLinks.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.auditUserLinksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.AuditUserLink[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.AuditUserLink) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.auditUserLinks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.auditUserLinks, request)); - assert.strictEqual( - (client.descriptors.page.auditUserLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with auditUserLinks without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLink()), - ]; - client.descriptors.page.auditUserLinks.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1alpha.IAuditUserLink[] = []; - const iterable = client.auditUserLinksAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.auditUserLinks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.auditUserLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with auditUserLinks with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.AuditUserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.auditUserLinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.auditUserLinksAsync(request); - await assert.rejects(async () => { - const responses: protos.google.analytics.admin.v1alpha.IAuditUserLink[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.auditUserLinks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.auditUserLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listFirebaseLinks', () => { - it('invokes listFirebaseLinks without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListFirebaseLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), - ]; - client.innerApiCalls.listFirebaseLinks = stubSimpleCall(expectedResponse); - const [response] = await client.listFirebaseLinks(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listFirebaseLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listFirebaseLinks without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListFirebaseLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), - ]; - client.innerApiCalls.listFirebaseLinks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listFirebaseLinks( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IFirebaseLink[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listFirebaseLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listFirebaseLinks with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListFirebaseLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listFirebaseLinks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listFirebaseLinks(request), expectedError); - assert((client.innerApiCalls.listFirebaseLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listFirebaseLinksStream without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListFirebaseLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), - ]; - client.descriptors.page.listFirebaseLinks.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listFirebaseLinksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.FirebaseLink[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.FirebaseLink) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listFirebaseLinks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listFirebaseLinks, request)); - assert.strictEqual( - (client.descriptors.page.listFirebaseLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listFirebaseLinksStream with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListFirebaseLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listFirebaseLinks.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listFirebaseLinksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.FirebaseLink[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.FirebaseLink) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listFirebaseLinks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listFirebaseLinks, request)); - assert.strictEqual( - (client.descriptors.page.listFirebaseLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listFirebaseLinks without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListFirebaseLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.FirebaseLink()), - ]; - client.descriptors.page.listFirebaseLinks.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1alpha.IFirebaseLink[] = []; - const iterable = client.listFirebaseLinksAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listFirebaseLinks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listFirebaseLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listFirebaseLinks with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListFirebaseLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listFirebaseLinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listFirebaseLinksAsync(request); - await assert.rejects(async () => { - const responses: protos.google.analytics.admin.v1alpha.IFirebaseLink[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listFirebaseLinks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listFirebaseLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listGoogleAdsLinks', () => { - it('invokes listGoogleAdsLinks without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), - ]; - client.innerApiCalls.listGoogleAdsLinks = stubSimpleCall(expectedResponse); - const [response] = await client.listGoogleAdsLinks(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listGoogleAdsLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listGoogleAdsLinks without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), - ]; - client.innerApiCalls.listGoogleAdsLinks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listGoogleAdsLinks( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IGoogleAdsLink[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listGoogleAdsLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listGoogleAdsLinks with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listGoogleAdsLinks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listGoogleAdsLinks(request), expectedError); - assert((client.innerApiCalls.listGoogleAdsLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listGoogleAdsLinksStream without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), - ]; - client.descriptors.page.listGoogleAdsLinks.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listGoogleAdsLinksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.GoogleAdsLink[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.GoogleAdsLink) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listGoogleAdsLinks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listGoogleAdsLinks, request)); - assert.strictEqual( - (client.descriptors.page.listGoogleAdsLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listGoogleAdsLinksStream with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listGoogleAdsLinks.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listGoogleAdsLinksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.GoogleAdsLink[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.GoogleAdsLink) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listGoogleAdsLinks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listGoogleAdsLinks, request)); - assert.strictEqual( - (client.descriptors.page.listGoogleAdsLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listGoogleAdsLinks without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.GoogleAdsLink()), - ]; - client.descriptors.page.listGoogleAdsLinks.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1alpha.IGoogleAdsLink[] = []; - const iterable = client.listGoogleAdsLinksAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listGoogleAdsLinks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listGoogleAdsLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listGoogleAdsLinks with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listGoogleAdsLinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listGoogleAdsLinksAsync(request); - await assert.rejects(async () => { - const responses: protos.google.analytics.admin.v1alpha.IGoogleAdsLink[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listGoogleAdsLinks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listGoogleAdsLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listMeasurementProtocolSecrets', () => { - it('invokes listMeasurementProtocolSecrets without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), - ]; - client.innerApiCalls.listMeasurementProtocolSecrets = stubSimpleCall(expectedResponse); - const [response] = await client.listMeasurementProtocolSecrets(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listMeasurementProtocolSecrets without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), - ]; - client.innerApiCalls.listMeasurementProtocolSecrets = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listMeasurementProtocolSecrets( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listMeasurementProtocolSecrets with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listMeasurementProtocolSecrets = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listMeasurementProtocolSecrets(request), expectedError); - assert((client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listMeasurementProtocolSecretsStream without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), - ]; - client.descriptors.page.listMeasurementProtocolSecrets.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listMeasurementProtocolSecretsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listMeasurementProtocolSecrets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listMeasurementProtocolSecrets, request)); - assert.strictEqual( - (client.descriptors.page.listMeasurementProtocolSecrets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listMeasurementProtocolSecretsStream with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listMeasurementProtocolSecrets.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listMeasurementProtocolSecretsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listMeasurementProtocolSecrets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listMeasurementProtocolSecrets, request)); - assert.strictEqual( - (client.descriptors.page.listMeasurementProtocolSecrets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listMeasurementProtocolSecrets without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret()), - ]; - client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret[] = []; - const iterable = client.listMeasurementProtocolSecretsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listMeasurementProtocolSecrets with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listMeasurementProtocolSecretsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('searchChangeHistoryEvents', () => { - it('invokes searchChangeHistoryEvents without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest()); - request.account = ''; - const expectedHeaderRequestParams = "account="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), - ]; - client.innerApiCalls.searchChangeHistoryEvents = stubSimpleCall(expectedResponse); - const [response] = await client.searchChangeHistoryEvents(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.searchChangeHistoryEvents as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes searchChangeHistoryEvents without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest()); - request.account = ''; - const expectedHeaderRequestParams = "account="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), - ]; - client.innerApiCalls.searchChangeHistoryEvents = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.searchChangeHistoryEvents( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IChangeHistoryEvent[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.searchChangeHistoryEvents as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes searchChangeHistoryEvents with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest()); - request.account = ''; - const expectedHeaderRequestParams = "account="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.searchChangeHistoryEvents = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchChangeHistoryEvents(request), expectedError); - assert((client.innerApiCalls.searchChangeHistoryEvents as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes searchChangeHistoryEventsStream without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest()); - request.account = ''; - const expectedHeaderRequestParams = "account="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), - ]; - client.descriptors.page.searchChangeHistoryEvents.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.searchChangeHistoryEventsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.ChangeHistoryEvent[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.ChangeHistoryEvent) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.searchChangeHistoryEvents.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchChangeHistoryEvents, request)); - assert.strictEqual( - (client.descriptors.page.searchChangeHistoryEvents.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes searchChangeHistoryEventsStream with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest()); - request.account = ''; - const expectedHeaderRequestParams = "account="; - const expectedError = new Error('expected'); - client.descriptors.page.searchChangeHistoryEvents.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.searchChangeHistoryEventsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.ChangeHistoryEvent[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.ChangeHistoryEvent) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.searchChangeHistoryEvents.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchChangeHistoryEvents, request)); - assert.strictEqual( - (client.descriptors.page.searchChangeHistoryEvents.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with searchChangeHistoryEvents without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest()); - request.account = ''; - const expectedHeaderRequestParams = "account="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent()), - ]; - client.descriptors.page.searchChangeHistoryEvents.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1alpha.IChangeHistoryEvent[] = []; - const iterable = client.searchChangeHistoryEventsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.searchChangeHistoryEvents.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.searchChangeHistoryEvents.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with searchChangeHistoryEvents with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest()); - request.account = ''; - const expectedHeaderRequestParams = "account=";const expectedError = new Error('expected'); - client.descriptors.page.searchChangeHistoryEvents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.searchChangeHistoryEventsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.analytics.admin.v1alpha.IChangeHistoryEvent[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.searchChangeHistoryEvents.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.searchChangeHistoryEvents.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listConversionEvents', () => { - it('invokes listConversionEvents without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListConversionEventsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), - ]; - client.innerApiCalls.listConversionEvents = stubSimpleCall(expectedResponse); - const [response] = await client.listConversionEvents(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listConversionEvents as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listConversionEvents without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListConversionEventsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), - ]; - client.innerApiCalls.listConversionEvents = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listConversionEvents( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IConversionEvent[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listConversionEvents as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listConversionEvents with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListConversionEventsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listConversionEvents = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listConversionEvents(request), expectedError); - assert((client.innerApiCalls.listConversionEvents as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listConversionEventsStream without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListConversionEventsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), - ]; - client.descriptors.page.listConversionEvents.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listConversionEventsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.ConversionEvent[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.ConversionEvent) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listConversionEvents.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listConversionEvents, request)); - assert.strictEqual( - (client.descriptors.page.listConversionEvents.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listConversionEventsStream with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListConversionEventsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listConversionEvents.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listConversionEventsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.ConversionEvent[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.ConversionEvent) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listConversionEvents.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listConversionEvents, request)); - assert.strictEqual( - (client.descriptors.page.listConversionEvents.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listConversionEvents without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListConversionEventsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ConversionEvent()), - ]; - client.descriptors.page.listConversionEvents.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1alpha.IConversionEvent[] = []; - const iterable = client.listConversionEventsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listConversionEvents.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listConversionEvents.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listConversionEvents with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListConversionEventsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listConversionEvents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listConversionEventsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.analytics.admin.v1alpha.IConversionEvent[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listConversionEvents.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listConversionEvents.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listDisplayVideo360AdvertiserLinks', () => { - it('invokes listDisplayVideo360AdvertiserLinks without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), - ]; - client.innerApiCalls.listDisplayVideo360AdvertiserLinks = stubSimpleCall(expectedResponse); - const [response] = await client.listDisplayVideo360AdvertiserLinks(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDisplayVideo360AdvertiserLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDisplayVideo360AdvertiserLinks without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), - ]; - client.innerApiCalls.listDisplayVideo360AdvertiserLinks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDisplayVideo360AdvertiserLinks( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDisplayVideo360AdvertiserLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listDisplayVideo360AdvertiserLinks with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listDisplayVideo360AdvertiserLinks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDisplayVideo360AdvertiserLinks(request), expectedError); - assert((client.innerApiCalls.listDisplayVideo360AdvertiserLinks as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDisplayVideo360AdvertiserLinksStream without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), - ]; - client.descriptors.page.listDisplayVideo360AdvertiserLinks.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDisplayVideo360AdvertiserLinksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listDisplayVideo360AdvertiserLinks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDisplayVideo360AdvertiserLinks, request)); - assert.strictEqual( - (client.descriptors.page.listDisplayVideo360AdvertiserLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listDisplayVideo360AdvertiserLinksStream with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listDisplayVideo360AdvertiserLinks.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDisplayVideo360AdvertiserLinksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDisplayVideo360AdvertiserLinks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDisplayVideo360AdvertiserLinks, request)); - assert.strictEqual( - (client.descriptors.page.listDisplayVideo360AdvertiserLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDisplayVideo360AdvertiserLinks without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink()), - ]; - client.descriptors.page.listDisplayVideo360AdvertiserLinks.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink[] = []; - const iterable = client.listDisplayVideo360AdvertiserLinksAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDisplayVideo360AdvertiserLinks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDisplayVideo360AdvertiserLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDisplayVideo360AdvertiserLinks with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listDisplayVideo360AdvertiserLinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDisplayVideo360AdvertiserLinksAsync(request); - await assert.rejects(async () => { - const responses: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDisplayVideo360AdvertiserLinks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDisplayVideo360AdvertiserLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listDisplayVideo360AdvertiserLinkProposals', () => { - it('invokes listDisplayVideo360AdvertiserLinkProposals without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), - ]; - client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals = stubSimpleCall(expectedResponse); - const [response] = await client.listDisplayVideo360AdvertiserLinkProposals(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDisplayVideo360AdvertiserLinkProposals without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), - ]; - client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDisplayVideo360AdvertiserLinkProposals( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listDisplayVideo360AdvertiserLinkProposals with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDisplayVideo360AdvertiserLinkProposals(request), expectedError); - assert((client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDisplayVideo360AdvertiserLinkProposalsStream without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), - ]; - client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDisplayVideo360AdvertiserLinkProposalsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals, request)); - assert.strictEqual( - (client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listDisplayVideo360AdvertiserLinkProposalsStream with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDisplayVideo360AdvertiserLinkProposalsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals, request)); - assert.strictEqual( - (client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDisplayVideo360AdvertiserLinkProposals without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal()), - ]; - client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal[] = []; - const iterable = client.listDisplayVideo360AdvertiserLinkProposalsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDisplayVideo360AdvertiserLinkProposals with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDisplayVideo360AdvertiserLinkProposalsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listCustomDimensions', () => { - it('invokes listCustomDimensions without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomDimensionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), - ]; - client.innerApiCalls.listCustomDimensions = stubSimpleCall(expectedResponse); - const [response] = await client.listCustomDimensions(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listCustomDimensions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listCustomDimensions without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomDimensionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), - ]; - client.innerApiCalls.listCustomDimensions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listCustomDimensions( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ICustomDimension[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listCustomDimensions as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listCustomDimensions with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomDimensionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listCustomDimensions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listCustomDimensions(request), expectedError); - assert((client.innerApiCalls.listCustomDimensions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listCustomDimensionsStream without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomDimensionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), - ]; - client.descriptors.page.listCustomDimensions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listCustomDimensionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.CustomDimension[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.CustomDimension) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listCustomDimensions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listCustomDimensions, request)); - assert.strictEqual( - (client.descriptors.page.listCustomDimensions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listCustomDimensionsStream with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomDimensionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listCustomDimensions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listCustomDimensionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.CustomDimension[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.CustomDimension) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listCustomDimensions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listCustomDimensions, request)); - assert.strictEqual( - (client.descriptors.page.listCustomDimensions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listCustomDimensions without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomDimensionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomDimension()), - ]; - client.descriptors.page.listCustomDimensions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1alpha.ICustomDimension[] = []; - const iterable = client.listCustomDimensionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listCustomDimensions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listCustomDimensions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listCustomDimensions with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomDimensionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listCustomDimensions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listCustomDimensionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.analytics.admin.v1alpha.ICustomDimension[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listCustomDimensions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listCustomDimensions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listCustomMetrics', () => { - it('invokes listCustomMetrics without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomMetricsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), - ]; - client.innerApiCalls.listCustomMetrics = stubSimpleCall(expectedResponse); - const [response] = await client.listCustomMetrics(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listCustomMetrics as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listCustomMetrics without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomMetricsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), - ]; - client.innerApiCalls.listCustomMetrics = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listCustomMetrics( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ICustomMetric[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listCustomMetrics as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listCustomMetrics with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomMetricsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listCustomMetrics = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listCustomMetrics(request), expectedError); - assert((client.innerApiCalls.listCustomMetrics as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listCustomMetricsStream without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomMetricsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), - ]; - client.descriptors.page.listCustomMetrics.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listCustomMetricsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.CustomMetric[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.CustomMetric) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listCustomMetrics.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listCustomMetrics, request)); - assert.strictEqual( - (client.descriptors.page.listCustomMetrics.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listCustomMetricsStream with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomMetricsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listCustomMetrics.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listCustomMetricsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.CustomMetric[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.CustomMetric) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listCustomMetrics.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listCustomMetrics, request)); - assert.strictEqual( - (client.descriptors.page.listCustomMetrics.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listCustomMetrics without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomMetricsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.CustomMetric()), - ]; - client.descriptors.page.listCustomMetrics.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1alpha.ICustomMetric[] = []; - const iterable = client.listCustomMetricsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listCustomMetrics.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listCustomMetrics.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listCustomMetrics with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListCustomMetricsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listCustomMetrics.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listCustomMetricsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.analytics.admin.v1alpha.ICustomMetric[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listCustomMetrics.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listCustomMetrics.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listDataStreams', () => { - it('invokes listDataStreams without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDataStreamsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), - ]; - client.innerApiCalls.listDataStreams = stubSimpleCall(expectedResponse); - const [response] = await client.listDataStreams(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDataStreams as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDataStreams without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDataStreamsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), - ]; - client.innerApiCalls.listDataStreams = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDataStreams( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IDataStream[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDataStreams as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listDataStreams with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDataStreamsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listDataStreams = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDataStreams(request), expectedError); - assert((client.innerApiCalls.listDataStreams as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDataStreamsStream without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDataStreamsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), - ]; - client.descriptors.page.listDataStreams.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDataStreamsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.DataStream[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.DataStream) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listDataStreams.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDataStreams, request)); - assert.strictEqual( - (client.descriptors.page.listDataStreams.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listDataStreamsStream with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDataStreamsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listDataStreams.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDataStreamsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.DataStream[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.DataStream) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDataStreams.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDataStreams, request)); - assert.strictEqual( - (client.descriptors.page.listDataStreams.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDataStreams without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDataStreamsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.DataStream()), - ]; - client.descriptors.page.listDataStreams.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1alpha.IDataStream[] = []; - const iterable = client.listDataStreamsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDataStreams.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDataStreams.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDataStreams with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.analytics.admin.v1alpha.ListDataStreamsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listDataStreams.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDataStreamsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.analytics.admin.v1alpha.IDataStream[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDataStreams.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDataStreams.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('account', () => { - const fakePath = "/rendered/path/account"; - const expectedParameters = { - account: "accountValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.accountPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.accountPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('accountPath', () => { - const result = client.accountPath("accountValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.accountPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchAccountFromAccountName', () => { - const result = client.matchAccountFromAccountName(fakePath); - assert.strictEqual(result, "accountValue"); - assert((client.pathTemplates.accountPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('accountSummary', () => { - const fakePath = "/rendered/path/accountSummary"; - const expectedParameters = { - account_summary: "accountSummaryValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.accountSummaryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.accountSummaryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('accountSummaryPath', () => { - const result = client.accountSummaryPath("accountSummaryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.accountSummaryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchAccountSummaryFromAccountSummaryName', () => { - const result = client.matchAccountSummaryFromAccountSummaryName(fakePath); - assert.strictEqual(result, "accountSummaryValue"); - assert((client.pathTemplates.accountSummaryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('accountUserLink', () => { - const fakePath = "/rendered/path/accountUserLink"; - const expectedParameters = { - account: "accountValue", - user_link: "userLinkValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.accountUserLinkPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.accountUserLinkPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('accountUserLinkPath', () => { - const result = client.accountUserLinkPath("accountValue", "userLinkValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.accountUserLinkPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchAccountFromAccountUserLinkName', () => { - const result = client.matchAccountFromAccountUserLinkName(fakePath); - assert.strictEqual(result, "accountValue"); - assert((client.pathTemplates.accountUserLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchUserLinkFromAccountUserLinkName', () => { - const result = client.matchUserLinkFromAccountUserLinkName(fakePath); - assert.strictEqual(result, "userLinkValue"); - assert((client.pathTemplates.accountUserLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('conversionEvent', () => { - const fakePath = "/rendered/path/conversionEvent"; - const expectedParameters = { - property: "propertyValue", - conversion_event: "conversionEventValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.conversionEventPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.conversionEventPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('conversionEventPath', () => { - const result = client.conversionEventPath("propertyValue", "conversionEventValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.conversionEventPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromConversionEventName', () => { - const result = client.matchPropertyFromConversionEventName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.conversionEventPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchConversionEventFromConversionEventName', () => { - const result = client.matchConversionEventFromConversionEventName(fakePath); - assert.strictEqual(result, "conversionEventValue"); - assert((client.pathTemplates.conversionEventPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customDimension', () => { - const fakePath = "/rendered/path/customDimension"; - const expectedParameters = { - property: "propertyValue", - custom_dimension: "customDimensionValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customDimensionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customDimensionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customDimensionPath', () => { - const result = client.customDimensionPath("propertyValue", "customDimensionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customDimensionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromCustomDimensionName', () => { - const result = client.matchPropertyFromCustomDimensionName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.customDimensionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomDimensionFromCustomDimensionName', () => { - const result = client.matchCustomDimensionFromCustomDimensionName(fakePath); - assert.strictEqual(result, "customDimensionValue"); - assert((client.pathTemplates.customDimensionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customMetric', () => { - const fakePath = "/rendered/path/customMetric"; - const expectedParameters = { - property: "propertyValue", - custom_metric: "customMetricValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customMetricPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customMetricPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customMetricPath', () => { - const result = client.customMetricPath("propertyValue", "customMetricValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customMetricPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromCustomMetricName', () => { - const result = client.matchPropertyFromCustomMetricName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.customMetricPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomMetricFromCustomMetricName', () => { - const result = client.matchCustomMetricFromCustomMetricName(fakePath); - assert.strictEqual(result, "customMetricValue"); - assert((client.pathTemplates.customMetricPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataRetentionSettings', () => { - const fakePath = "/rendered/path/dataRetentionSettings"; - const expectedParameters = { - property: "propertyValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataRetentionSettingsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataRetentionSettingsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataRetentionSettingsPath', () => { - const result = client.dataRetentionSettingsPath("propertyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataRetentionSettingsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromDataRetentionSettingsName', () => { - const result = client.matchPropertyFromDataRetentionSettingsName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.dataRetentionSettingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataSharingSettings', () => { - const fakePath = "/rendered/path/dataSharingSettings"; - const expectedParameters = { - account: "accountValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataSharingSettingsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataSharingSettingsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataSharingSettingsPath', () => { - const result = client.dataSharingSettingsPath("accountValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataSharingSettingsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchAccountFromDataSharingSettingsName', () => { - const result = client.matchAccountFromDataSharingSettingsName(fakePath); - assert.strictEqual(result, "accountValue"); - assert((client.pathTemplates.dataSharingSettingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataStream', () => { - const fakePath = "/rendered/path/dataStream"; - const expectedParameters = { - property: "propertyValue", - data_stream: "dataStreamValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataStreamPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataStreamPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataStreamPath', () => { - const result = client.dataStreamPath("propertyValue", "dataStreamValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataStreamPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromDataStreamName', () => { - const result = client.matchPropertyFromDataStreamName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.dataStreamPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataStreamFromDataStreamName', () => { - const result = client.matchDataStreamFromDataStreamName(fakePath); - assert.strictEqual(result, "dataStreamValue"); - assert((client.pathTemplates.dataStreamPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('displayVideo360AdvertiserLink', () => { - const fakePath = "/rendered/path/displayVideo360AdvertiserLink"; - const expectedParameters = { - property: "propertyValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.displayVideo360AdvertiserLinkPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.displayVideo360AdvertiserLinkPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('displayVideo360AdvertiserLinkPath', () => { - const result = client.displayVideo360AdvertiserLinkPath("propertyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.displayVideo360AdvertiserLinkPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromDisplayVideo360AdvertiserLinkName', () => { - const result = client.matchPropertyFromDisplayVideo360AdvertiserLinkName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.displayVideo360AdvertiserLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('displayVideo360AdvertiserLinkProposal', () => { - const fakePath = "/rendered/path/displayVideo360AdvertiserLinkProposal"; - const expectedParameters = { - property: "propertyValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.displayVideo360AdvertiserLinkProposalPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.displayVideo360AdvertiserLinkProposalPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('displayVideo360AdvertiserLinkProposalPath', () => { - const result = client.displayVideo360AdvertiserLinkProposalPath("propertyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.displayVideo360AdvertiserLinkProposalPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromDisplayVideo360AdvertiserLinkProposalName', () => { - const result = client.matchPropertyFromDisplayVideo360AdvertiserLinkProposalName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.displayVideo360AdvertiserLinkProposalPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('firebaseLink', () => { - const fakePath = "/rendered/path/firebaseLink"; - const expectedParameters = { - property: "propertyValue", - firebase_link: "firebaseLinkValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.firebaseLinkPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.firebaseLinkPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('firebaseLinkPath', () => { - const result = client.firebaseLinkPath("propertyValue", "firebaseLinkValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.firebaseLinkPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromFirebaseLinkName', () => { - const result = client.matchPropertyFromFirebaseLinkName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.firebaseLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFirebaseLinkFromFirebaseLinkName', () => { - const result = client.matchFirebaseLinkFromFirebaseLinkName(fakePath); - assert.strictEqual(result, "firebaseLinkValue"); - assert((client.pathTemplates.firebaseLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('globalSiteTag', () => { - const fakePath = "/rendered/path/globalSiteTag"; - const expectedParameters = { - property: "propertyValue", - data_stream: "dataStreamValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.globalSiteTagPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.globalSiteTagPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('globalSiteTagPath', () => { - const result = client.globalSiteTagPath("propertyValue", "dataStreamValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.globalSiteTagPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromGlobalSiteTagName', () => { - const result = client.matchPropertyFromGlobalSiteTagName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.globalSiteTagPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataStreamFromGlobalSiteTagName', () => { - const result = client.matchDataStreamFromGlobalSiteTagName(fakePath); - assert.strictEqual(result, "dataStreamValue"); - assert((client.pathTemplates.globalSiteTagPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('googleAdsLink', () => { - const fakePath = "/rendered/path/googleAdsLink"; - const expectedParameters = { - property: "propertyValue", - google_ads_link: "googleAdsLinkValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.googleAdsLinkPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.googleAdsLinkPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('googleAdsLinkPath', () => { - const result = client.googleAdsLinkPath("propertyValue", "googleAdsLinkValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.googleAdsLinkPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromGoogleAdsLinkName', () => { - const result = client.matchPropertyFromGoogleAdsLinkName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.googleAdsLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchGoogleAdsLinkFromGoogleAdsLinkName', () => { - const result = client.matchGoogleAdsLinkFromGoogleAdsLinkName(fakePath); - assert.strictEqual(result, "googleAdsLinkValue"); - assert((client.pathTemplates.googleAdsLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('googleSignalsSettings', () => { - const fakePath = "/rendered/path/googleSignalsSettings"; - const expectedParameters = { - property: "propertyValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.googleSignalsSettingsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.googleSignalsSettingsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('googleSignalsSettingsPath', () => { - const result = client.googleSignalsSettingsPath("propertyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.googleSignalsSettingsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromGoogleSignalsSettingsName', () => { - const result = client.matchPropertyFromGoogleSignalsSettingsName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.googleSignalsSettingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('measurementProtocolSecret', () => { - const fakePath = "/rendered/path/measurementProtocolSecret"; - const expectedParameters = { - property: "propertyValue", - data_stream: "dataStreamValue", - measurement_protocol_secret: "measurementProtocolSecretValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.measurementProtocolSecretPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.measurementProtocolSecretPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('measurementProtocolSecretPath', () => { - const result = client.measurementProtocolSecretPath("propertyValue", "dataStreamValue", "measurementProtocolSecretValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.measurementProtocolSecretPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromMeasurementProtocolSecretName', () => { - const result = client.matchPropertyFromMeasurementProtocolSecretName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.measurementProtocolSecretPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataStreamFromMeasurementProtocolSecretName', () => { - const result = client.matchDataStreamFromMeasurementProtocolSecretName(fakePath); - assert.strictEqual(result, "dataStreamValue"); - assert((client.pathTemplates.measurementProtocolSecretPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMeasurementProtocolSecretFromMeasurementProtocolSecretName', () => { - const result = client.matchMeasurementProtocolSecretFromMeasurementProtocolSecretName(fakePath); - assert.strictEqual(result, "measurementProtocolSecretValue"); - assert((client.pathTemplates.measurementProtocolSecretPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('property', () => { - const fakePath = "/rendered/path/property"; - const expectedParameters = { - property: "propertyValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.propertyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.propertyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('propertyPath', () => { - const result = client.propertyPath("propertyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.propertyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromPropertyName', () => { - const result = client.matchPropertyFromPropertyName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.propertyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('propertyUserLink', () => { - const fakePath = "/rendered/path/propertyUserLink"; - const expectedParameters = { - property: "propertyValue", - user_link: "userLinkValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.propertyUserLinkPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.propertyUserLinkPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('propertyUserLinkPath', () => { - const result = client.propertyUserLinkPath("propertyValue", "userLinkValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.propertyUserLinkPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromPropertyUserLinkName', () => { - const result = client.matchPropertyFromPropertyUserLinkName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.propertyUserLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchUserLinkFromPropertyUserLinkName', () => { - const result = client.matchUserLinkFromPropertyUserLinkName(fakePath); - assert.strictEqual(result, "userLinkValue"); - assert((client.pathTemplates.propertyUserLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1alpha/tsconfig.json b/owl-bot-staging/v1alpha/tsconfig.json deleted file mode 100644 index c78f1c8..0000000 --- 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 0e336a8..0000000 --- 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: 'AnalyticsAdminService', - filename: './analytics-admin-service.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/src/v1alpha/analytics_admin_service_client.ts b/src/v1alpha/analytics_admin_service_client.ts index b3147f5..a136a04 100644 --- a/src/v1alpha/analytics_admin_service_client.ts +++ b/src/v1alpha/analytics_admin_service_client.ts @@ -70,7 +70,7 @@ export class AnalyticsAdminServiceClient { * * @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). + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] @@ -93,11 +93,10 @@ export class AnalyticsAdminServiceClient { * 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. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields.